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

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

@ -8,8 +8,8 @@ export const updateBpmSimpleModel = async (data) => {
})
}
export const getBpmSimpleModel = async (modelId) => {
export const getBpmSimpleModel = async (id) => {
return await request.get({
url: '/bpm/model/simple/get?modelId=' + modelId
url: '/bpm/model/simple/get?id=' + id
})
}

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 = () => {
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
}
const approveMethod = currentNode.value.attributes?.approveMethod
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)

View File

@ -56,5 +56,4 @@ onMounted( async () => {
})
</script>
<style lang='scss' scoped>
</style>

View File

@ -53,18 +53,14 @@ const test = async () => {
message.error('缺少模型 modelId 编号')
return
}
const test = nodeConfig.value
console.log('test is ', test)
console.log('nodeConfig.value ', nodeConfig.value)
const data1 = {
modelId: modelId,
simpleModelBody: toRaw(nodeConfig.value)
}
const data = {
modelId: modelId,
id: modelId,
simpleModelBody: nodeConfig.value
}
console.log('request json data1 is ', data1)
const result = await updateBpmSimpleModel(data)
console.log('save the result is ', result)
if (result) {