From 172a177cc52f7a476b35457a5e4cb44e07ed2899 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Fri, 19 Sep 2025 18:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E4=BA=A4=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../filesTransfer/apply/prop/applyForm.vue | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/views/filesTransfer/apply/prop/applyForm.vue b/src/views/filesTransfer/apply/prop/applyForm.vue index a3a4084..96450de 100644 --- a/src/views/filesTransfer/apply/prop/applyForm.vue +++ b/src/views/filesTransfer/apply/prop/applyForm.vue @@ -133,21 +133,7 @@ export default { await getProSelectApi().then(res => { this.proList = res.data; }); - const res = await getTransferApplyFilesByApplyIdApi({ id: this.rowData.id }); - if (Array.isArray(res.data) && res.data.length > 0) { - res.data.map(item => { - const newFile = { - proFilesContentsId: item.id, - parParentName: item.parParentName, - parentName: item.parentName, - fileName: item.fileName, - proId: item.proId, - fileSourceId: item.fileId, - filePath: item.filePath - }; - this.checkTreeData.push(newFile); - }) - } + if (this.isAdd === 'edit' && this.rowData) { // 编辑模式:填充表单数据 @@ -156,6 +142,21 @@ export default { proId: this.rowData.proId || undefined, deptId: this.rowData.deptId || undefined, }; + const res = await getTransferApplyFilesByApplyIdApi({ id: this.rowData.id }); + if (Array.isArray(res.data) && res.data.length > 0) { + res.data.map(item => { + const newFile = { + proFilesContentsId: item.id, + parParentName: item.parParentName, + parentName: item.parentName, + fileName: item.fileName, + proId: item.proId, + fileSourceId: item.fileId, + filePath: item.filePath + }; + this.checkTreeData.push(newFile); + }) + } } else { // 新增模式:重置表单 this.form = { @@ -208,6 +209,7 @@ export default { deptId: undefined }; this.resetForm("ruleForm"); + this.checkTreeData = []; }, handleReuslt(res) { this.$modal.msgSuccess(res.msg);