From 01914add571007a725e5c1c5a732b8eeecc4efee Mon Sep 17 00:00:00 2001 From: Yangk Date: Tue, 13 Jan 2026 17:45:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(oa):=20=E4=BC=98=E5=8C=96=E5=87=BA?= =?UTF-8?q?=E5=B7=AE=E7=94=B3=E8=AF=B7=E8=A1=A8=E5=8D=95=E5=92=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在编辑模式下实现抄送人员的自动设置功能,默认添加部门负责人和分管副总 - 将申请人姓名和部门查询字段改为选择器组件,支持下拉选择 - 添加业务方向的选择器组件替换输入框 - 集成用户和部门列表数据用于查询条件筛选 - 实现页面初始化时异步加载用户和部门数据 --- src/views/oa/crm/businessTripApply/edit.vue | 27 ++++++++++++++++- src/views/oa/crm/businessTripApply/index.vue | 31 ++++++++++++++++---- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/views/oa/crm/businessTripApply/edit.vue b/src/views/oa/crm/businessTripApply/edit.vue index a48a465..b116506 100644 --- a/src/views/oa/crm/businessTripApply/edit.vue +++ b/src/views/oa/crm/businessTripApply/edit.vue @@ -91,7 +91,7 @@ - + @@ -390,6 +390,31 @@ onMounted(async () => { if (form.value.copyUserIds && typeof form.value.copyUserIds === 'string') { form.value.copyUserIds = (form.value.copyUserIds as string).split(',').filter((id) => id); } + + // 编辑模式下,如果抄送人员为空,重新设置默认抄送人员 + if (routeParams.value.type === 'update' && (!form.value.copyUserIds || form.value.copyUserIds.length === 0)) { + // 根据部门ID获取部门负责人和分管副总 + const deptInfo = deptInfoList.value.find((d: any) => d.deptId === form.value.deptId); + if (deptInfo) { + const deptLeaderId = deptInfo.leader; + const vicePresidentId = deptInfo.vicePresident; + // 将部门负责人和分管副总加入默认抄送人员 + const deptCopyIds: string[] = []; + if (deptLeaderId) deptCopyIds.push(String(deptLeaderId)); + if (vicePresidentId) deptCopyIds.push(String(vicePresidentId)); + + // 根据昵称匹配默认抄送人员 + const defaultCopyIds = userList.value.filter((u: any) => defaultCopyUserNames.includes(u.nickName)).map((u: any) => String(u.userId)); + + // 合并默认抄送人员和部门负责人/分管副总(去重) + form.value.copyUserIds = [...new Set([...defaultCopyIds, ...deptCopyIds])]; + } + } + + // 确保 variables 对象存在 + if (!form.value.variables) { + form.value.variables = {}; + } } }); }); diff --git a/src/views/oa/crm/businessTripApply/index.vue b/src/views/oa/crm/businessTripApply/index.vue index 04931cb..414ddc7 100644 --- a/src/views/oa/crm/businessTripApply/index.vue +++ b/src/views/oa/crm/businessTripApply/index.vue @@ -12,11 +12,15 @@ - - + + + + - - + + + + @@ -28,7 +32,9 @@ - + + + @@ -192,6 +198,10 @@