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)); $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) { if ($one && $id > 0) {
return Base::retSuccess('success', [ return Base::retSuccess('success', [
@ -292,7 +292,6 @@ class ReportController extends AbstractController
]); ]);
} }
// 已完成的任务 // 已完成的任务
$completeContent = ""; $completeContent = "";
$complete_task = ProjectTask::query() $complete_task = ProjectTask::query()

View File

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

View File

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

View File

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