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

This commit is contained in:
youkehai 2023-10-10 10:40:30 +08:00
parent 683e319c72
commit 62a953815d
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) => {
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 })
}
/**

View File

@ -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>

View File

@ -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