fix: 工作包括编辑内容不正确的问题

This commit is contained in:
kuaifan 2022-04-07 22:51:43 +08:00
parent e55a1d8713
commit 1323bba420
4 changed files with 23 additions and 23 deletions

View File

@ -282,7 +282,7 @@ class ReportController extends AbstractController
}
// 生成唯一标识
$sign = Report::generateSign($type, 0, Carbon::instance($start_time));
$one = Report::query()->whereSign($sign)->whereType($type)->first();
$one = Report::whereSign($sign)->whereType($type)->first();
// 如果已经提交了相关汇报
if ($one && $id > 0) {
return Base::retSuccess('success', [
@ -292,7 +292,6 @@ class ReportController extends AbstractController
]);
}
// 已完成的任务
$completeContent = "";
$complete_task = ProjectTask::query()

View File

@ -111,7 +111,6 @@ export default {
},
onEditReport(id) {
this.reportId = id;
if (this.$Electron) {
let config = {
title: this.$L(id > 0 ? '修改报告' : '新增报告'),
@ -126,6 +125,7 @@ export default {
config
});
} else {
this.reportId = id;
this.showEditDrawer = true;
}
},

View File

@ -74,35 +74,33 @@ export default {
id: 0,
offset: 0 // -1
},
prevCycleText: "",
nextCycleText: "",
prevCycleText: this.$L("上一周"),
nextCycleText: this.$L("下一周"),
};
},
watch: {
id(val) {
if (this.id > 0) {
this.getDetail(val);
} else {
this.reportData.offset = 0;
this.reportData.type = "weekly";
this.reportData.receive = [];
this.getTemplate();
}
id: {
handler(val) {
if (val > 0) {
this.getDetail(val);
} else {
this.reportData.offset = 0;
this.reportData.type = "weekly";
this.reportData.receive = [];
this.getTemplate();
}
},
immediate: true
},
},
computed: {
...mapState(["userId"])
},
mounted() {
this.getTemplate();
//
},
methods: {
initLanguage() {
this.prevCycleText = this.$L("上一周");
this.nextCycleText = this.$L("下一周");
},
handleSubmit: function () {
handleSubmit() {
if (this.reportData.receive.length === 0) {
$A.messageError(this.$L("请选择接收人"));
return false;

View File

@ -142,8 +142,11 @@ export default {
},
on: {
action: (name) => {
if (name === 'edit') this.$emit("on-edit", row.id);
if (name === 'view') this.$emit("on-view", row);
if (name === 'edit') {
this.$emit("on-edit", row.id);
} else if (name === 'view') {
this.$emit("on-view", row);
}
}
}
});