Skip to content

Commit

Permalink
fix: 工作包括编辑内容不正确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Apr 7, 2022
1 parent e55a1d8 commit 1323bba
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
3 changes: 1 addition & 2 deletions app/Http/Controllers/Api/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function template(): array
}
// 生成唯一标识
$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', [
Expand All @@ -292,7 +292,6 @@ public function template(): array
]);
}


// 已完成的任务
$completeContent = "";
$complete_task = ProjectTask::query()
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/pages/manage/components/Report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export default {
},
onEditReport(id) {
this.reportId = id;
if (this.$Electron) {
let config = {
title: this.$L(id > 0 ? '修改报告' : '新增报告'),
Expand All @@ -126,6 +125,7 @@ export default {
config
});
} else {
this.reportId = id;
this.showEditDrawer = true;
}
},
Expand Down
34 changes: 16 additions & 18 deletions resources/assets/js/pages/manage/components/ReportEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions resources/assets/js/pages/manage/components/ReportMy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
});
Expand Down

0 comments on commit 1323bba

Please sign in to comment.