diff --git a/ruoyi-ui/src/views/oa/project/report/index.vue b/ruoyi-ui/src/views/oa/project/report/index.vue index 38ef852..0e753f8 100644 --- a/ruoyi-ui/src/views/oa/project/report/index.vue +++ b/ruoyi-ui/src/views/oa/project/report/index.vue @@ -292,6 +292,7 @@ import { addProjectReport, delProjectReport, + getLastReport, getProjectReport, getTodayProjectReport, listProjectReport, @@ -557,6 +558,10 @@ export default { this.suppVisible = false; this.title = "添加项目报工"; this.checkTodayReport().finally(() => { + // 如果今天还没报过工,尝试加载上次报工记录回填 + if (!this.hasTodayReport) { + this.loadLastReport(); + } this.open = true; this.$nextTick(() => { if (!this.form.reportId) { @@ -565,6 +570,16 @@ export default { }); }); }, + /** 加载上次报工记录,回填项目选择(记忆功能) */ + loadLastReport() { + getLastReport().then(response => { + if (response.data && response.data.projectId) { + this.form.projectId = response.data.projectId; + } + }).catch(() => { + // 加载失败不影响正常使用 + }); + }, /** 修改按钮操作 */ handleUpdate(row) { this.suppVisible = false;