From ccb5915a8572a3080cf5019e40ccd78e359ae472 Mon Sep 17 00:00:00 2001 From: KaaNoo Date: Sun, 13 Jul 2025 16:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=8A=B6=E6=80=81=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E5=8F=91=E9=80=81mail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/model/BookingDataModel.cpp | 7 +++++++ view/bookingService/apply.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/module/model/BookingDataModel.cpp b/module/model/BookingDataModel.cpp index df1fb4c..feb7512 100644 --- a/module/model/BookingDataModel.cpp +++ b/module/model/BookingDataModel.cpp @@ -6,6 +6,7 @@ #include "BookingDataModel.h" #include "EquipmentDataModel.h" +#include "module/data/data_mail.h" namespace dataModel { @@ -78,6 +79,8 @@ namespace dataModel { if (newStatus == "同意") { success = data::Booking::processApprovalTransaction(rec.id,rec.equipmentId,rec.userId,approvalId); rec.approvalStatus = newStatus; + QString content = tr("%1%2了你的申请").arg(rec.approverName).arg(newStatus); + data::mail::send_mail(approvalId,rec.id,"回复",content,""); emit approvalStatusChanged(); emit dataChanged(index, index); } @@ -91,6 +94,10 @@ namespace dataModel { rec.approvalDate = QDateTime::currentDateTime(); emit approvalStatusChanged(); emit dataChanged(index, index.siblingAtColumn(Col_ApproverName)); + if (newStatus == "拒绝") { + QString content = tr("%1%2了你的申请").arg(rec.approverName).arg(newStatus); + data::mail::send_mail(approvalId,rec.id,"回复",content,""); + } } } return success; diff --git a/view/bookingService/apply.cpp b/view/bookingService/apply.cpp index d1292af..cab02ee 100644 --- a/view/bookingService/apply.cpp +++ b/view/bookingService/apply.cpp @@ -97,6 +97,7 @@ void Apply::on_btnRush_clicked() { } QString content = tr("%1向%2申请%3设备").arg(senderName).arg(receiverName).arg(""); data::mail::send_mail(data::UserControl::currentUserId,receiverId.toInt(),subject,content,""); + QMessageBox::information(this,"提醒","发送成功",QMessageBox::Ok); } else { QMessageBox::warning(this,"警告","请选择一个申请",QMessageBox::Ok);