#ifndef PAYMENT_DIALOG_H #define PAYMENT_DIALOG_H #include #include #include // 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