fix: 减签按钮显示和api地址修改

(cherry picked from commit 62a953815d)
This commit is contained in:
youkehai 2023-10-10 10:40:30 +08:00 committed by shizhong
parent c4e6163437
commit dbcefcca9b
3 changed files with 18 additions and 5 deletions

View File

@ -69,8 +69,8 @@ export const taskAddSign = async (data) => {
/** /**
* *
*/ */
export const getSubSignTaskList = async (id: string) => { export const getChildrenTaskList = async (id: string) => {
return await request.get({ url: '/bpm/task/get-sub-sign?taskId=' + id }) return await request.get({ url: '/bpm/task/get-children-task-list?taskId=' + id })
} }
/** /**

View File

@ -2,7 +2,7 @@
<el-drawer v-model="drawerVisible" title="子任务" size="70%"> <el-drawer v-model="drawerVisible" title="子任务" size="70%">
<template #header> <template #header>
<h4>{{ baseTask.name }} 审批人{{ baseTask.assigneeUser?.nickname }}</h4> <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" /> <Icon icon="ep:remove" />
减签 减签
</el-button> </el-button>
@ -32,7 +32,7 @@
<el-table-column label="操作" prop="operation"> <el-table-column label="操作" prop="operation">
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-if="!isEmpty(scope.row.children)" v-if="showSubSignButton(scope.row)"
type="danger" type="danger"
plain plain
@click="handleSubSign(scope.row)" @click="handleSubSign(scope.row)"
@ -83,4 +83,17 @@ const taskSubSignDialogForm = ref()
const handleSubSign = (item) => { const handleSubSign = (item) => {
taskSubSignDialogForm.value.open(item.id) 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> </script>

View File

@ -44,7 +44,7 @@ const formRef = ref() // 表单 Ref
const subTaskList = ref([]) const subTaskList = ref([])
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (id: string) => { const open = async (id: string) => {
subTaskList.value = await TaskApi.getSubSignTaskList(id) subTaskList.value = await TaskApi.getChildrenTaskList(id)
if (isEmpty(subTaskList.value)) { if (isEmpty(subTaskList.value)) {
message.warning('当前没有可减签的任务') message.warning('当前没有可减签的任务')
return false return false