仿钉钉流程设计器- 简化审批拒绝逻辑

This commit is contained in:
jason
2024-06-18 00:06:52 +08:00
parent d5a7ae1865
commit 5ee0a7b946
6 changed files with 11 additions and 49 deletions

View File

@ -82,7 +82,7 @@ const saveSimpleFlowModel = async () => {
return;
}
const data = {
modelId: props.modelId,
id: props.modelId,
simpleModel: processNodeTree.value
}

View File

@ -70,15 +70,7 @@ export enum RejectHandlerType {
/**
* 驳回到指定节点
*/
RETURN_PRE_USER_TASK = 2,
/**
* 按拒绝人数比例终止流程
*/
FINISH_PROCESS_BY_REJECT_RATIO = 3,
/**
* 结束任务
*/
FINISH_TASK = 4
RETURN_USER_TASK = 2
}
@ -233,8 +225,7 @@ export const TIMEOUT_HANDLER_ACTION_TYPES: DictDataVO [] = [
]
export const REJECT_HANDLER_TYPES: DictDataVO [] = [
{ label: '终止流程', value: RejectHandlerType.FINISH_PROCESS },
{ label: '驳回到指定节点', value: RejectHandlerType.RETURN_PRE_USER_TASK },
{ label: '按拒绝人数终止流程(用于会签)', value: RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO }
{ label: '驳回到指定节点', value: RejectHandlerType.RETURN_USER_TASK }
// { label: '结束任务', value: RejectHandlerType.FINISH_TASK }
]

View File

@ -181,7 +181,6 @@
:key="item.value"
:value="item.value"
:label="item.label"
:disabled="rejectHandlerOptionDisabled(item.value)"
/>
</div>
@ -191,7 +190,7 @@
<el-form-item
v-if="
currentNode.attributes.rejectHandler.type == RejectHandlerType.RETURN_PRE_USER_TASK
currentNode.attributes.rejectHandler.type == RejectHandlerType.RETURN_USER_TASK
"
label="驳回节点"
prop="rejectHandlerNode"
@ -540,35 +539,12 @@ const blurEvent = () => {
currentNode.value.name || (NODE_DEFAULT_NAME.get(NodeType.USER_TASK_NODE) as string)
}
const approveMethodChanged = () => {
currentNode.value.attributes.rejectHandler.type = RejectHandlerType.FINISH_PROCESS
const approveMethod = currentNode.value.attributes?.approveMethod
if ( approveMethod === ApproveMethodType.APPROVE_BY_RATIO) {
currentNode.value.attributes.rejectHandler.type =
RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO
} else {
currentNode.value.attributes.rejectHandler.type = RejectHandlerType.FINISH_PROCESS
}
if (approveMethod === ApproveMethodType.APPROVE_BY_RATIO) {
currentNode.value.attributes.approveRatio = 100;
}
}
const rejectHandlerOptionDisabled = computed(() => {
return (val: number) => {
const approveMethod = currentNode.value.attributes?.approveMethod
if (
val === RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO &&
approveMethod !== ApproveMethodType.APPROVE_BY_RATIO
) {
return true
}
if ( approveMethod === ApproveMethodType.APPROVE_BY_RATIO
&& val !== RejectHandlerType.FINISH_PROCESS_BY_REJECT_RATIO) {
return true
}
return false
}
})
// 默认 6小时
const timeDuration = ref(6)
const timeUnit = ref(TimeUnitType.HOUR)