feat: 撤回逻辑修改
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
<BasicTable @register="registerTable" @row-dbClick="onRowDblClick" @selection-change="selectionChange">
|
<BasicTable @register="registerTable" @row-dbClick="onRowDblClick" @selection-change="selectionChange">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<div class="button-box">
|
<div class="button-box">
|
||||||
<a-button @click="drawBack">{{ t('撤回') }}</a-button>
|
<a-button @click="drawBack" v-if="activityId">{{ t('撤回') }}</a-button>
|
||||||
<!-- <RejectProcess
|
<!-- <RejectProcess
|
||||||
:taskId="taskId"
|
:taskId="taskId"
|
||||||
:processId="processId"
|
:processId="processId"
|
||||||
@ -85,8 +85,9 @@
|
|||||||
width: 120,
|
width: 120,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
const activityId = ref('')
|
||||||
|
|
||||||
const { formConfig, processId, taskId, schemaId, selectionChange } = userTaskTable();
|
const { formConfig, processId, taskId, schemaId, data } = userTaskTable();
|
||||||
const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
|
const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
|
||||||
title: t('已办任务列表'),
|
title: t('已办任务列表'),
|
||||||
api: getSchemaTask,
|
api: getSchemaTask,
|
||||||
@ -125,9 +126,7 @@
|
|||||||
okType: 'danger',
|
okType: 'danger',
|
||||||
cancelText: t('取消'),
|
cancelText: t('取消'),
|
||||||
onOk() {
|
onOk() {
|
||||||
getDrawNode(processId.value).then(r=> {
|
withdraw(processId.value, activityId.value).then(res => {
|
||||||
if (r.length) {
|
|
||||||
withdraw(processId.value, r[0].activityId).then(res => {
|
|
||||||
if (res) {
|
if (res) {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@ -144,19 +143,31 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
notification.open({
|
|
||||||
type: 'error',
|
|
||||||
message: t('撤回'),
|
|
||||||
description: t('撤回失败, 无可撤回节点'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
onCancel() {},
|
onCancel() {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function selectionChange({ keys, rows }) {
|
||||||
|
data.selectedRows = rows;
|
||||||
|
if (keys?.length > 0) {
|
||||||
|
processId.value = rows[0].processId;
|
||||||
|
taskId.value = rows[0].taskId;
|
||||||
|
schemaId.value = rows[0].schemaId;
|
||||||
|
getDrawNode(processId.value).then(res => {
|
||||||
|
if(res.length) {
|
||||||
|
activityId.value = res[0].activityId
|
||||||
|
} else {
|
||||||
|
activityId.value = ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
processId.value = '';
|
||||||
|
taskId.value = '';
|
||||||
|
schemaId.value = '';
|
||||||
|
activityId.value = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
const onRowDblClick = (record, index) => {
|
const onRowDblClick = (record, index) => {
|
||||||
const { processId, taskId, schemaId } = record;
|
const { processId, taskId, schemaId } = record;
|
||||||
router.push({
|
router.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user