流程任务驳回可驳回到任意节点
parent
41533b2cb2
commit
c14afe185a
|
|
@ -106,7 +106,7 @@
|
|||
:color="btn.type"
|
||||
:type="btn.type ? btn.type : 'primary'"
|
||||
@click="handleBtnClick(btn)"
|
||||
>{{ btn.name }}</a-button
|
||||
>{{ btn.name }} {{ btn.code }}</a-button
|
||||
>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
|
@ -141,6 +141,31 @@
|
|||
</a-timeline>
|
||||
</a-drawer>
|
||||
</div>
|
||||
<a-modal
|
||||
v-model:open="rejectOpen"
|
||||
width="50%"
|
||||
title="驳回节点选择"
|
||||
@ok="rejectHandleOk"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<div class="l-from-body">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
labelAlign="left"
|
||||
:label-col="rejectLabelCol"
|
||||
:wrapper-col="rejectWrapperCol"
|
||||
>
|
||||
<a-form-item label="驳回到">
|
||||
<a-select
|
||||
v-model:value="NextId"
|
||||
placeholder="驳回节点选择"
|
||||
:field-names="{ label: 'name', value: 'id' }"
|
||||
:options="rejectRelations"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</a-modal>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
|
|
@ -170,7 +195,8 @@
|
|||
const formBoxRef = ref<any>();
|
||||
const emit = defineEmits(['closeModel']);
|
||||
const keyValue = ref('');
|
||||
|
||||
const rejectLabelCol = { span: 5 };
|
||||
const rejectWrapperCol = { span: 17 };
|
||||
const flowWfDataStore = flowStore();
|
||||
const prefixCls = 'preview-box';
|
||||
const flowContent = ref('');
|
||||
|
|
@ -184,6 +210,8 @@
|
|||
const processVisble = ref(false);
|
||||
const AsyncComponent = ref();
|
||||
const pcForm = ref();
|
||||
const NextId = ref('');
|
||||
const rejectRelations = ref([]);
|
||||
const props = defineProps({
|
||||
processId: String,
|
||||
taskId: String,
|
||||
|
|
@ -250,6 +278,7 @@
|
|||
const auditName = ref('audit');
|
||||
const auditTitleVal = ref('审批栏');
|
||||
const auditNameVal = ref('审批意见');
|
||||
const rejectOpen = ref(false);
|
||||
function changeActive(activeKey) {
|
||||
if (activeKey == 'flow') {
|
||||
processVisble.value = true;
|
||||
|
|
@ -265,6 +294,7 @@
|
|||
}
|
||||
|
||||
async function getTaskInfo() {
|
||||
rejectRelations.value = [];
|
||||
let query: any = {
|
||||
id: props.taskId,
|
||||
};
|
||||
|
|
@ -276,6 +306,14 @@
|
|||
let content = JSON.parse(data.scheme.content);
|
||||
let wfData = content.wfData;
|
||||
console.log(wfData);
|
||||
const finishedTaskSet = Array.from(new Set(data.flowViewer.finishedTaskSet));
|
||||
finishedTaskSet.forEach((item) => {
|
||||
wfData.forEach((element) => {
|
||||
if (item == element.id && element.id != data.task.unitId) {
|
||||
rejectRelations.value.push(element);
|
||||
}
|
||||
});
|
||||
});
|
||||
const auditNode = wfData.find((t) => t.id == data.task.unitId);
|
||||
console.log(auditNode);
|
||||
if (auditNode.auditTitle) {
|
||||
|
|
@ -482,6 +520,7 @@
|
|||
const currentNode: currentNodeObject =
|
||||
wfData.find((t) => t.id == designerData.task.unitId) || {};
|
||||
designerData.currentNode = currentNode;
|
||||
console.log('currentNode', currentNode);
|
||||
// 设置审核按钮
|
||||
const btns: taskBtnsType[] = [];
|
||||
if (currentNode.type == 'bpmn:StartEvent') {
|
||||
|
|
@ -561,7 +600,7 @@
|
|||
const funName = btn.code;
|
||||
const res = await pcForm.value[funName]();
|
||||
console.log(res);
|
||||
handleCreateFlow(processId);
|
||||
handleSubmit(btn);
|
||||
} else {
|
||||
handleSubmit(btn);
|
||||
}
|
||||
|
|
@ -594,8 +633,11 @@
|
|||
des: formData.value.des,
|
||||
});
|
||||
} else {
|
||||
console.log(designerData.currentNode.rejectType);
|
||||
console.log(btn.code);
|
||||
if (designerData.currentNode.rejectType == '2' && btn.code == 'disagree') {
|
||||
designerData.selectRejectNodeVisible = true;
|
||||
rejectOpen.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -608,7 +650,7 @@
|
|||
// return;
|
||||
// }
|
||||
}
|
||||
res = await auditFun();
|
||||
// res = await auditFun();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -683,6 +725,21 @@
|
|||
return createMessage.error('失败');
|
||||
}
|
||||
}
|
||||
// 驳回到指定节点
|
||||
async function rejectHandleOk() {
|
||||
const data = await audit(props.taskId, {
|
||||
code: designerData.currentBtn.code,
|
||||
name: designerData.currentBtn.name,
|
||||
des: formData.value.des,
|
||||
NextId: NextId.value,
|
||||
});
|
||||
if (data) {
|
||||
closePage();
|
||||
return createMessage.success('成功');
|
||||
} else {
|
||||
return createMessage.error('失败');
|
||||
}
|
||||
}
|
||||
onBeforeMount(() => {
|
||||
getTaskInfo();
|
||||
});
|
||||
|
|
@ -766,4 +823,7 @@
|
|||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
.l-from-body {
|
||||
padding: 10px 30px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue