yxk-20260611-通用办理模块
选择驳回时,自动写入:不同意,请退回修改
This commit is contained in:
+34
-9
@@ -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([]);
|
||||
|
||||
Reference in New Issue
Block a user