BPM:完善 task 转派的实现
This commit is contained in:
parent
60ddc45b9b
commit
a40866e27f
@ -12,10 +12,6 @@ export const getDoneTaskPage = async (params) => {
|
|||||||
return await request.get({ url: '/bpm/task/done-page', params })
|
return await request.get({ url: '/bpm/task/done-page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const completeTask = async (data) => {
|
|
||||||
return await request.put({ url: '/bpm/task/complete', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const approveTask = async (data) => {
|
export const approveTask = async (data) => {
|
||||||
return await request.put({ url: '/bpm/task/approve', data })
|
return await request.put({ url: '/bpm/task/approve', data })
|
||||||
}
|
}
|
||||||
@ -23,13 +19,6 @@ export const approveTask = async (data) => {
|
|||||||
export const rejectTask = async (data) => {
|
export const rejectTask = async (data) => {
|
||||||
return await request.put({ url: '/bpm/task/reject', data })
|
return await request.put({ url: '/bpm/task/reject', data })
|
||||||
}
|
}
|
||||||
export const backTask = async (data) => {
|
|
||||||
return await request.put({ url: '/bpm/task/back', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const updateTaskAssignee = async (data) => {
|
|
||||||
return await request.put({ url: '/bpm/task/update-assignee', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getTaskListByProcessInstanceId = async (processInstanceId) => {
|
export const getTaskListByProcessInstanceId = async (processInstanceId) => {
|
||||||
return await request.get({
|
return await request.get({
|
||||||
@ -37,11 +26,6 @@ export const getTaskListByProcessInstanceId = async (processInstanceId) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出任务
|
|
||||||
export const exportTask = async (params) => {
|
|
||||||
return await request.download({ url: '/bpm/task/export', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取所有可回退的节点
|
// 获取所有可回退的节点
|
||||||
export const getTaskListByReturn = async (id: string) => {
|
export const getTaskListByReturn = async (id: string) => {
|
||||||
return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
|
return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
|
||||||
@ -52,13 +36,16 @@ export const returnTask = async (data: any) => {
|
|||||||
return await request.put({ url: '/bpm/task/return', data })
|
return await request.put({ url: '/bpm/task/return', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// 委派
|
||||||
* 委派
|
export const delegateTask = async (data: any) => {
|
||||||
*/
|
|
||||||
export const delegateTask = async (data) => {
|
|
||||||
return await request.put({ url: '/bpm/task/delegate', data })
|
return await request.put({ url: '/bpm/task/delegate', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转派
|
||||||
|
export const transferTask = async (data: any) => {
|
||||||
|
return await request.put({ url: '/bpm/task/transfer', data })
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加签
|
* 加签
|
||||||
*/
|
*/
|
||||||
|
@ -44,9 +44,7 @@
|
|||||||
<label v-if="item.durationInMillis" style="font-weight: normal; color: #8a909c">
|
<label v-if="item.durationInMillis" style="font-weight: normal; color: #8a909c">
|
||||||
{{ formatPast2(item?.durationInMillis) }}
|
{{ formatPast2(item?.durationInMillis) }}
|
||||||
</label>
|
</label>
|
||||||
<p v-if="item.reason">
|
<p v-if="item.reason"> 审批建议:{{ item.reason }} </p>
|
||||||
<el-tag :type="getTimelineItemType(item)">{{ item.reason }}</el-tag>
|
|
||||||
</p>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-timeline-item>
|
</el-timeline-item>
|
||||||
</el-timeline>
|
</el-timeline>
|
||||||
|
@ -37,10 +37,12 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: '',
|
id: '',
|
||||||
delegateUserId: undefined
|
delegateUserId: undefined,
|
||||||
|
reason: ''
|
||||||
})
|
})
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
delegateUserId: [{ required: true, message: '接收人不能为空', trigger: 'change' }]
|
delegateUserId: [{ required: true, message: '接收人不能为空', trigger: 'change' }],
|
||||||
|
reason: [{ required: true, message: '委派理由不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
@ -79,7 +81,8 @@ const submitForm = async () => {
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
id: '',
|
id: '',
|
||||||
delegateUserId: undefined
|
delegateUserId: undefined,
|
||||||
|
reason: ''
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog v-model="dialogVisible" title="回退" width="500">
|
<Dialog v-model="dialogVisible" title="回退任务" width="500">
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog v-model="dialogVisible" title="转派审批人" width="500">
|
<Dialog v-model="dialogVisible" title="转派任务" width="500">
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
||||||
@ -17,6 +17,9 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="转派理由" prop="reason">
|
||||||
|
<el-input v-model="formData.reason" clearable placeholder="请输入转派理由" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
@ -28,16 +31,18 @@
|
|||||||
import * as TaskApi from '@/api/bpm/task'
|
import * as TaskApi from '@/api/bpm/task'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
|
|
||||||
defineOptions({ name: 'BpmTaskUpdateAssigneeForm' })
|
defineOptions({ name: 'TaskTransferForm' })
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: '',
|
id: '',
|
||||||
assigneeUserId: undefined
|
assigneeUserId: undefined,
|
||||||
|
reason: ''
|
||||||
})
|
})
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }]
|
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }],
|
||||||
|
reason: [{ required: true, message: '转派理由不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
@ -63,7 +68,7 @@ const submitForm = async () => {
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
await TaskApi.updateTaskAssignee(formData.value)
|
await TaskApi.transferTask(formData.value)
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
emit('success')
|
emit('success')
|
||||||
@ -76,7 +81,8 @@ const submitForm = async () => {
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
id: '',
|
id: '',
|
||||||
assigneeUserId: undefined
|
assigneeUserId: undefined,
|
||||||
|
reason: ''
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
@ -104,12 +104,12 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 弹窗:转派审批人 -->
|
<!-- 弹窗:转派审批人 -->
|
||||||
<TaskUpdateAssigneeForm ref="taskUpdateAssigneeFormRef" @success="getDetail" />
|
<TaskTransferForm ref="taskTransferFormRef" @success="getDetail" />
|
||||||
<!-- 弹窗,回退节点 -->
|
<!-- 弹窗:回退节点 -->
|
||||||
<TaskReturnDialog ref="taskReturnDialogRef" @success="getDetail" />
|
<TaskReturnForm ref="taskReturnFormRef" @success="getDetail" />
|
||||||
<!-- 委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中-->
|
<!-- 弹窗:委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中-->
|
||||||
<TaskDelegateForm ref="taskDelegateForm" @success="getDetail" />
|
<TaskDelegateForm ref="taskDelegateForm" @success="getDetail" />
|
||||||
<!-- 加签,当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
<!-- 弹窗:加签,当前任务审批人为A,向前加签选了一个C,则需要C先审批,然后再是A审批,向后加签B,A审批完,需要B再审批完,才算完成这个任务节点 -->
|
||||||
<TaskAddSignDialogForm ref="taskAddSignDialogForm" @success="getDetail" />
|
<TaskAddSignDialogForm ref="taskAddSignDialogForm" @success="getDetail" />
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
@ -120,11 +120,11 @@ import type { ApiAttrs } from '@form-create/element-ui/types/config'
|
|||||||
import * as DefinitionApi from '@/api/bpm/definition'
|
import * as DefinitionApi from '@/api/bpm/definition'
|
||||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||||
import * as TaskApi from '@/api/bpm/task'
|
import * as TaskApi from '@/api/bpm/task'
|
||||||
import TaskUpdateAssigneeForm from './TaskUpdateAssigneeForm.vue'
|
|
||||||
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
|
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
|
||||||
import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue'
|
import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue'
|
||||||
import TaskReturnDialog from './TaskReturnDialogForm.vue'
|
import TaskReturnForm from './dialog/TaskReturnForm.vue'
|
||||||
import TaskDelegateForm from './TaskDelegateForm.vue'
|
import TaskDelegateForm from './dialog/TaskDelegateForm.vue'
|
||||||
|
import TaskTransferForm from './dialog/TaskTransferForm.vue'
|
||||||
import TaskAddSignDialogForm from './TaskAddSignDialogForm.vue'
|
import TaskAddSignDialogForm from './TaskAddSignDialogForm.vue'
|
||||||
import { registerComponent } from '@/utils/routerHelper'
|
import { registerComponent } from '@/utils/routerHelper'
|
||||||
import { isEmpty } from '@/utils/is'
|
import { isEmpty } from '@/utils/is'
|
||||||
@ -187,9 +187,9 @@ const handleAudit = async (task, pass) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 转派审批人 */
|
/** 转派审批人 */
|
||||||
const taskUpdateAssigneeFormRef = ref()
|
const taskTransferFormRef = ref()
|
||||||
const openTaskUpdateAssigneeForm = (id: string) => {
|
const openTaskUpdateAssigneeForm = (id: string) => {
|
||||||
taskUpdateAssigneeFormRef.value.open(id)
|
taskTransferFormRef.value.open(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理审批退回的操作 */
|
/** 处理审批退回的操作 */
|
||||||
@ -199,9 +199,9 @@ const handleDelegate = async (task) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 处理审批退回的操作 */
|
/** 处理审批退回的操作 */
|
||||||
const taskReturnDialogRef = ref()
|
const taskReturnFormRef = ref()
|
||||||
const handleBack = async (task) => {
|
const handleBack = async (task: any) => {
|
||||||
taskReturnDialogRef.value.open(task.id)
|
taskReturnFormRef.value.open(task.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 处理审批加签的操作 */
|
/** 处理审批加签的操作 */
|
||||||
|
Loading…
Reference in New Issue
Block a user