From ace3bc4c19d78f4f1a6fee66707c8ba1473cffba Mon Sep 17 00:00:00 2001 From: ye1023 <12588209+ye1023@user.noreply.gitee.com> Date: Thu, 11 Jun 2026 15:35:37 +0800 Subject: [PATCH] =?UTF-8?q?yxk-20260611-=E9=80=9A=E7=94=A8=E5=8A=9E?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=20=E9=80=89=E6=8B=A9=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E6=97=B6=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=86=99=E5=85=A5?= =?UTF-8?q?=EF=BC=9A=E4=B8=8D=E5=90=8C=E6=84=8F=EF=BC=8C=E8=AF=B7=E9=80=80?= =?UTF-8?q?=E5=9B=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../myHandleTask/content/MyHandleContent.vue | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/views/super/bpm/process/personalOffice/myHandleTask/content/MyHandleContent.vue b/src/views/super/bpm/process/personalOffice/myHandleTask/content/MyHandleContent.vue index 929184f..102dd8d 100644 --- a/src/views/super/bpm/process/personalOffice/myHandleTask/content/MyHandleContent.vue +++ b/src/views/super/bpm/process/personalOffice/myHandleTask/content/MyHandleContent.vue @@ -122,6 +122,13 @@ import { useUserStore } from '/@/store/modules/user'; import { isString } from '/@/utils/is'; + const REJECT_DEFAULT_REASON = '不同意,请退回修改。'; + const REJECT_PROCESS_MODEL = '3'; + + function isRejectProcessModel(value) { + return String(value) === REJECT_PROCESS_MODEL; + } + export default { name: 'MyHandleContent', components: { @@ -229,24 +236,42 @@ watchEffect(() => { props.turnbackTaskId && (model.rejectModelNode = props.turnbackTaskId); }); + function applyAutoReason(value, extraAutoReasons = []) { + const nextReason = value || ''; + const autoReasons = [lastAutoReason.value, ...extraAutoReasons].filter(Boolean); + const canApplyReason = !model.reason || autoReasons.includes(model.reason); + if (nextReason && canApplyReason) { + model.reason = nextReason; + lastAutoReason.value = nextReason; + return true; + } + if (!nextReason && model.reason === lastAutoReason.value) { + model.reason = ''; + } + lastAutoReason.value = nextReason; + return false; + } + // 默认处理意见只在空值或仍为上一条自动意见时刷新,避免覆盖用户手动输入。 watch( () => props.defaultReason, (value) => { - const nextReason = value || ''; - const canApplyDefaultReason = !model.reason || model.reason === lastAutoReason.value; - if (nextReason && canApplyDefaultReason) { - model.reason = nextReason; - lastAutoReason.value = nextReason; + if (isRejectProcessModel(model.processModel)) { return; } - if (!nextReason && model.reason === lastAutoReason.value) { - model.reason = ''; - } - lastAutoReason.value = nextReason; + applyAutoReason(value); }, { immediate: true } ); + watch( + () => model.processModel, + (value) => { + const isReject = isRejectProcessModel(value); + applyAutoReason(isReject ? REJECT_DEFAULT_REASON : props.defaultReason, [ + isReject ? props.defaultReason : REJECT_DEFAULT_REASON, + ]); + } + ); // 选择下一步操作人 const checkedNext = ref(false); const nextPersonList = ref([]);