Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions module/model/BookingDataModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "BookingDataModel.h"

#include "EquipmentDataModel.h"
#include "module/data/data_mail.h"

namespace dataModel {

Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions view/bookingService/apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading