yxk-20260611-通用办理模块
选择驳回时,自动写入:不同意,请退回修改
This commit is contained in:
+34
-9
@@ -122,6 +122,13 @@
|
|||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import { isString } from '/@/utils/is';
|
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 {
|
export default {
|
||||||
name: 'MyHandleContent',
|
name: 'MyHandleContent',
|
||||||
components: {
|
components: {
|
||||||
@@ -229,24 +236,42 @@
|
|||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
props.turnbackTaskId && (model.rejectModelNode = props.turnbackTaskId);
|
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(
|
watch(
|
||||||
() => props.defaultReason,
|
() => props.defaultReason,
|
||||||
(value) => {
|
(value) => {
|
||||||
const nextReason = value || '';
|
if (isRejectProcessModel(model.processModel)) {
|
||||||
const canApplyDefaultReason = !model.reason || model.reason === lastAutoReason.value;
|
|
||||||
if (nextReason && canApplyDefaultReason) {
|
|
||||||
model.reason = nextReason;
|
|
||||||
lastAutoReason.value = nextReason;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!nextReason && model.reason === lastAutoReason.value) {
|
applyAutoReason(value);
|
||||||
model.reason = '';
|
|
||||||
}
|
|
||||||
lastAutoReason.value = nextReason;
|
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ 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 checkedNext = ref(false);
|
||||||
const nextPersonList = ref([]);
|
const nextPersonList = ref([]);
|
||||||
|
|||||||
Reference in New Issue
Block a user