fix: 减签按钮显示和api地址修改
This commit is contained in:
parent
683e319c72
commit
62a953815d
@ -69,8 +69,8 @@ export const taskAddSign = async (data) => {
|
||||
/**
|
||||
* 获取减签任务列表
|
||||
*/
|
||||
export const getSubSignTaskList = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/get-sub-sign?taskId=' + id })
|
||||
export const getChildrenTaskList = async (id: string) => {
|
||||
return await request.get({ url: '/bpm/task/get-children-task-list?taskId=' + id })
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-drawer v-model="drawerVisible" title="子任务" size="70%">
|
||||
<template #header>
|
||||
<h4>【{{ baseTask.name }} 】审批人:{{ baseTask.assigneeUser?.nickname }}</h4>
|
||||
<el-button style="margin-left: 5px" type="danger" plain @click="handleSubSign(baseTask)">
|
||||
<el-button style="margin-left: 5px" v-if="showSubSignButton(baseTask)" type="danger" plain @click="handleSubSign(baseTask)">
|
||||
<Icon icon="ep:remove" />
|
||||
减签
|
||||
</el-button>
|
||||
@ -32,7 +32,7 @@
|
||||
<el-table-column label="操作" prop="operation">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="!isEmpty(scope.row.children)"
|
||||
v-if="showSubSignButton(scope.row)"
|
||||
type="danger"
|
||||
plain
|
||||
@click="handleSubSign(scope.row)"
|
||||
@ -83,4 +83,17 @@ const taskSubSignDialogForm = ref()
|
||||
const handleSubSign = (item) => {
|
||||
taskSubSignDialogForm.value.open(item.id)
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示减签按钮
|
||||
* @param task
|
||||
*/
|
||||
const showSubSignButton = (task:any) => {
|
||||
if(!isEmpty(task.children)){
|
||||
//有子任务,且子任务有任意一个是 待处理 和 待前置任务完成 则显示减签按钮
|
||||
const subTask = task.children.find((item) => item.result === 1 || item.result === 9)
|
||||
return !isEmpty(subTask)
|
||||
}
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
|
@ -44,7 +44,7 @@ const formRef = ref() // 表单 Ref
|
||||
const subTaskList = ref([])
|
||||
/** 打开弹窗 */
|
||||
const open = async (id: string) => {
|
||||
subTaskList.value = await TaskApi.getSubSignTaskList(id)
|
||||
subTaskList.value = await TaskApi.getChildrenTaskList(id)
|
||||
if (isEmpty(subTaskList.value)) {
|
||||
message.warning('当前没有可减签的任务')
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user