From 496f9714d0db6ff19984c8f47bfcad5d88b3944e Mon Sep 17 00:00:00 2001 From: ye1023 <12588209+ye1023@user.noreply.gitee.com> Date: Wed, 13 May 2026 14:14:47 +0800 Subject: [PATCH] =?UTF-8?q?yxk-20260509-=E5=85=9A=E5=A7=94=E4=BC=9A?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E6=94=B9=E9=80=A0=201=E3=80=81=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E8=B4=9F=E8=B4=A3=E4=BA=BA=E5=88=86=E9=85=8D=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=8A=82=E7=82=B9=EF=BC=9A=E9=A2=86=E5=AF=BC=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9B=B4=E6=8E=A5=E5=8F=8D=E9=A6=88=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E5=B9=B6=E5=8A=9E=E7=BB=93=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BgPartymatterBPMForm.vue | 74 +++++++++++++------ 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue b/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue index 33f7b92..7082d82 100644 --- a/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue +++ b/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue @@ -125,22 +125,28 @@ - + + + + 否(分配部门经办人) + 是(办结) + + + + - + - - - - - - - 保存经办人 - + + + + + + 保存 @@ -190,6 +196,7 @@ const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } }; const wideLabelCol = { xs: { span: 24 }, sm: { span: 3 } }; const wideWrapperCol = { xs: { span: 24 }, sm: { span: 21 } }; + const wideActionWrapperCol = { xs: { span: 24 }, sm: { span: 21, offset: 3 } }; const feedbackModalRef = ref(); const loading = ref(false); @@ -198,6 +205,7 @@ const showBaseInfoDetail = ref(false); const feedbackList = ref([]); const subApproveUser = ref(''); + const isEnd = ref(0); const mainForm = reactive>({ id: '', @@ -242,6 +250,7 @@ const showProcessHandle = computed(() => props.formBpm && !!props.formData?.taskId); const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1'); const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1'); + const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1'); const processInfo = computed(() => ({ taskId: props.formData?.taskId, @@ -267,6 +276,14 @@ () => initFormData() ); + watch( + () => props.formData?.vars?.isEnd, + (value) => { + isEnd.value = String(value ?? '0') === '1' ? 1 : 0; + }, + { immediate: true } + ); + async function initFormData() { const dataId = props.formData?.dataId; if (!dataId) { @@ -335,35 +352,48 @@ async function saveSubApproveUserVariable() { const processInstanceId = processInfo.value.processInstanceId; + const isEndValue = String(isEnd.value); const usernameValue = normalizeUsernameList(subApproveUser.value); if (!processInstanceId) { createMessage.warning('流程实例ID不能为空'); return; } - if (!usernameValue) { + if (isEndValue !== '1' && !usernameValue) { createMessage.warning('请选择部门经办人'); return; } savingSubApproveUser.value = true; try { - const res = await setProcessVariable({ - processInstanceId, - taskId: processInfo.value.taskId, - local: true, - varField: 'subApproveUser', - varVal: usernameValue, - }); - if (res.success) { - createMessage.success(res.message || '保存成功'); - } else { - createMessage.warning(res.message || '保存失败'); + const isEndResult = await saveProcessVariable('isEnd', isEndValue); + if (!isEndResult?.success) { + createMessage.warning(isEndResult.message || '保存失败'); + return; } + + if (isEndValue !== '1') { + const subApproveUserResult = await saveProcessVariable('subApproveUser', usernameValue); + if (!subApproveUserResult?.success) { + createMessage.warning(subApproveUserResult.message || '保存失败'); + return; + } + } + createMessage.success('保存成功'); } finally { savingSubApproveUser.value = false; } } + function saveProcessVariable(varField: string, varVal: any) { + return setProcessVariable({ + processInstanceId: processInfo.value.processInstanceId, + taskId: processInfo.value.taskId, + local: true, + varField, + varVal, + }); + } + function normalizeUsernameList(value: string) { return String(value || '') .split(',')