Merge branch 'gaoang-2024-8' into 'dev'
feat: 撤回逻辑修改 See merge request itc-framework/ma/2024/front!12
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<BasicTable @register="registerTable" @row-dbClick="onRowDblClick" @selection-change="selectionChange">
|
||||
<template #toolbar>
|
||||
<div class="button-box">
|
||||
<a-button @click="drawBack">{{ t('撤回') }}</a-button>
|
||||
<a-button @click="drawBack" v-if="activityId">{{ t('撤回') }}</a-button>
|
||||
<!-- <RejectProcess
|
||||
:taskId="taskId"
|
||||
:processId="processId"
|
||||
@ -85,8 +85,9 @@
|
||||
width: 120,
|
||||
},
|
||||
];
|
||||
const activityId = ref('')
|
||||
|
||||
const { formConfig, processId, taskId, schemaId, selectionChange } = userTaskTable();
|
||||
const { formConfig, processId, taskId, schemaId, data } = userTaskTable();
|
||||
const [registerTable, { reload, clearSelectedRowKeys }] = useTable({
|
||||
title: t('已办任务列表'),
|
||||
api: getSchemaTask,
|
||||
@ -125,38 +126,48 @@
|
||||
okType: 'danger',
|
||||
cancelText: t('取消'),
|
||||
onOk() {
|
||||
getDrawNode(processId.value).then(r=> {
|
||||
if (r.length) {
|
||||
withdraw(processId.value, r[0].activityId).then(res => {
|
||||
if (res) {
|
||||
notification.open({
|
||||
type: 'success',
|
||||
message: t('撤回'),
|
||||
description: t('撤回成功'),
|
||||
});
|
||||
reload()
|
||||
clearSelectedRowKeys()
|
||||
} else {
|
||||
notification.open({
|
||||
type: 'error',
|
||||
message: t('撤回'),
|
||||
description: t('撤回失败'),
|
||||
});
|
||||
}
|
||||
})
|
||||
withdraw(processId.value, activityId.value).then(res => {
|
||||
if (res) {
|
||||
notification.open({
|
||||
type: 'success',
|
||||
message: t('撤回'),
|
||||
description: t('撤回成功'),
|
||||
});
|
||||
reload()
|
||||
clearSelectedRowKeys()
|
||||
} else {
|
||||
notification.open({
|
||||
type: 'error',
|
||||
message: t('撤回'),
|
||||
description: t('撤回失败, 无可撤回节点'),
|
||||
description: t('撤回失败'),
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
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 { processId, taskId, schemaId } = record;
|
||||
router.push({
|
||||
|
||||
Reference in New Issue
Block a user