审批抽屉修改
This commit is contained in:
1 parent
e028a656d3
commit
20acfe34b4
8 files changed
+443
-41
No files matched your search
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<!--右侧抽屉-->
|
||||
<!--审批抽屉-->
|
||||
<el-drawer v-model="taskDrawerVisible" direction="rtl" size="400px">
|
||||
<template #header>
|
||||
<h3>{{ currentData?.processName }}</h3>
|
||||
<h3>{{ curAssignTask?.processName }}</h3>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="w-full h-full" v-loading="loading">
|
||||
@@ -17,9 +17,9 @@
|
||||
<flow-node-format
|
||||
:disableSelect="true"
|
||||
:formData="formValue"
|
||||
:task-id="processId"
|
||||
:processInstanceId="processInstanceId"
|
||||
:flow-id="currentData.flowId"
|
||||
:task-id="curAssignTask.taskId"
|
||||
:processInstanceId="curAssignTask.processInstanceId"
|
||||
:flow-id="curAssignTask.flowId"
|
||||
ref="flowNodeFormatRef"
|
||||
class="mt-4"
|
||||
/>
|
||||
@@ -59,7 +59,6 @@ const taskDrawerVisible = defineModel<boolean>()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
processId: string
|
||||
currentData: any
|
||||
}>(),
|
||||
{
|
||||
processId: "",
|
||||
@@ -72,7 +71,7 @@ const agreeHandler = ref()
|
||||
const refuseHandler = ref()
|
||||
const transferHandler = ref()
|
||||
const currentOpenFlowForm = ref<FlowFormItem[]>([])
|
||||
const processInstanceId = ref("")
|
||||
const curAssignTask = ref<any>({})
|
||||
const loading = ref(false)
|
||||
|
||||
watch(
|
||||
@@ -81,23 +80,22 @@ watch(
|
||||
if (val) {
|
||||
loading.value = true
|
||||
try {
|
||||
const ress = await queryAssignTaskOne({ processInstanceId: props.processId })
|
||||
console.log("xxx", ress)
|
||||
const assignTask = await queryAssignTaskOne({ processInstanceId: props.processId })
|
||||
if (assignTask.code === 0) {
|
||||
curAssignTask.value = assignTask.data
|
||||
}
|
||||
|
||||
const res = await queryTask(props.processId, false).finally(() => (loading.value = false))
|
||||
const res = await queryTask(curAssignTask.value.taskId, false).finally(() => (loading.value = false))
|
||||
if (res.code === 0) {
|
||||
currentOpenFlowForm.value = res.data.formItems
|
||||
processInstanceId.value = res.data.processInstanceId
|
||||
}
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
currentOpenFlowForm.value = []
|
||||
curAssignTask.value = {}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
},
|
||||
)
|
||||
|
||||
const addLayoutOneItem = (id: number | string) => {
|
||||
@@ -122,15 +120,15 @@ const deleteLayoutOneItem = (id: any, index: any) => {
|
||||
|
||||
// 提交任务
|
||||
const submitTask = () => {
|
||||
agreeHandler.value.handle({ ...props.currentData, taskId: props.processId }, currentOpenFlowForm.value)
|
||||
agreeHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
|
||||
}
|
||||
// 拒绝任务
|
||||
const refuseTask = () => {
|
||||
refuseHandler.value.handle({ ...props.currentData, taskId: props.processId }, currentOpenFlowForm.value)
|
||||
refuseHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
|
||||
}
|
||||
// 转办任务
|
||||
const transferTask = () => {
|
||||
transferHandler.value.handle({ ...props.currentData, taskId: props.processId }, currentOpenFlowForm.value)
|
||||
transferHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
|
||||
}
|
||||
|
||||
// 流程提交
|
||||
|
||||
Reference in new issue
Block a user