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);