From b6d4dcdde8849bb134e48d28428c8be60884ff46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E6=98=8A?= Date: Wed, 8 Jul 2026 16:10:35 +0800 Subject: [PATCH] feat(oa/project/report): add last report memory function when add report MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当新增项目报工的时候,如果今日还未报工,自动回填上次报工的项目信息,提升用户填报体验 --- ruoyi-ui/src/views/oa/project/report/index.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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;