Files
HIS-GUI/gui/dialogs/payment_dialog.h
2026-04-07 17:18:33 +08:00

69 lines
1.5 KiB
C++

#ifndef PAYMENT_DIALOG_H
#define PAYMENT_DIALOG_H
#include <QDialog>
#include <QString>
#include <memory>
// Forward declarations
class QLineEdit;
class QComboBox;
class QDoubleSpinBox;
class QTextEdit;
class QPushButton;
class QLabel;
namespace core {
class HisCore;
}
/**
* 支付对话框
* 供用户在进行挂号、检查、用药等付费操作时完成支付
*/
class PaymentDialog : public QDialog {
Q_OBJECT
public:
explicit PaymentDialog(core::HisCore& core, QWidget* parent = nullptr);
// 设置支付信息
void setPaymentInfo(const QString& patientID,
const QString& patientName,
const QString& operationType,
double amount);
// 获取支付是否成功
bool isPaymentSuccessful() const { return paymentSuccessful_; }
// 获取生成的支付ID
QString getPaymentID() const { return paymentID_; }
private slots:
void onPaymentMethodChanged(int index);
void onConfirmPayment();
void onCancel();
private:
void setupUI();
bool validateInput();
std::string paymentMethodToString(int index);
core::HisCore& core_;
bool paymentSuccessful_;
QString paymentID_;
// UI Components
QLineEdit* patientIDEdit_;
QLineEdit* patientNameEdit_;
QLineEdit* operationTypeEdit_;
QDoubleSpinBox* amountSpinBox_;
QComboBox* paymentMethodCombo_;
QTextEdit* descriptionEdit_;
QLabel* balanceLabel_;
QPushButton* confirmButton_;
QPushButton* cancelButton_;
};
#endif