From 2fcde4358f400cf7ea9b4f5d4ba9b1634e9c1bc4 Mon Sep 17 00:00:00 2001 From: Dragon <> Date: Sat, 30 Mar 2024 12:59:11 +0800 Subject: [PATCH] bug --- src/views/final/content/Content.vue | 120 ++++++++++++++++------------ src/views/task/aside/ListItem.vue | 5 +- src/views/task/aside/TaskList.vue | 112 +++++++++++++------------- src/views/task/content/Content.vue | 16 ++-- 4 files changed, 140 insertions(+), 113 deletions(-) diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 6da9fac..126413c 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -248,6 +248,19 @@ async function formatColumns() { } } + index = columnsRef.value.findIndex(v => v.title == '所属项目') + if (index > -1) { + columnsRef.value[index] = { + title: '所属项目', + key: columnsRef.value[index].key, // "fromtaskname" + fixed: columnsRef.value[index].fixed || undefined, + width: 200, + ellipsis: { + tooltip: true, + }, + } + } + index = columnsRef.value.findIndex(v => v.title == '任务名称') if (index > -1) { columnsRef.value[index] = { @@ -575,10 +588,10 @@ function actionHandler(action: any, row: any) { resetHandler() break case 'approval': - approvalHandler(row) + singleApproval(row) break case 'reject': - rejectHandler(row) + rejectHandler([row]) break default: break @@ -630,26 +643,24 @@ function getSelectItems() { return tableData.value.filter(item => selectionIds.value.includes(item.id)) } -function approvalHandler(row) { - // const items = getSelectItems() - const items = [row] - const msg = validate(items) - - if (msg !== null) { - message.error(msg) - return +// 单个审批通过 +function singleApproval(row) { + const param = { + result: true, + comment: '', + disposeType: '', + disposeTypeId: '', + failCauseId: '', + failCauseName: '', + flowTaskInfoList: [ + { + formId: row.id, + taskId: row.taskId, + taskName: row.fromTaskName, + }, + ], } - - dialog.info({ - title: '确认提示', - content: '确认给该任务审批为【通过】吗?', - positiveText: '确定', - negativeText: '取消', - onPositiveClick: () => { - approval(items) - }, - onNegativeClick: () => {}, - }) + doAudit(param) } function batchApproval() { @@ -673,26 +684,25 @@ function batchApproval() { }) } -function approval(items) { - const formIds: string[] = items.map(item => item.id) - const taskIds: string[] = items.map(item => item.taskId) - const tasknames: string[] = items.map(item => item.taskname) +// function approval(items) { +// const formIds: string[] = items.map(item => item.id) +// const taskIds: string[] = items.map(item => item.taskId) +// const tasknames: string[] = items.map(item => item.taskname) - const param: ApprovalParam = { - formid: formIds, - taskId: taskIds, - approvd: true, - taskComment: 'approval', - taskname: tasknames, - } +// const param: ApprovalParam = { +// formid: formIds, +// taskId: taskIds, +// approvd: true, +// taskComment: 'approval', +// taskname: tasknames, +// } - doAudit(param) -} +// doAudit(param) +// } -function rejectHandler(row) { - // const items = getSelectItems() - const items = [row] - const msg = validate(items) +// 审核不通过 +function rejectHandler(list) { + const msg = validate(list) if (msg !== null) { message.error(msg) @@ -700,7 +710,7 @@ function rejectHandler(row) { } const modal = unref(notPassModalRef)! as any - modal.showModal() + modal.showModal(list) } function reject(idOrDesc: string, backId: string, isOther: boolean) { @@ -720,15 +730,6 @@ function reject(idOrDesc: string, backId: string, isOther: boolean) { doAudit(param) } -function doAudit(param: any) { - audit(param).then((res) => { - const { code } = res - if (code === 'OK') - reload() - else message.error(res.message) - }) -} - function reload() { const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps query(page!, pageSize!) @@ -751,6 +752,27 @@ async function refreshHandler(searchId?: any) { reset() query(pagination.page, pagination.pageSize, searchId) } + +// 审核通过 +function doAudit(param: any) { + dialog.info({ + title: '确认提示', + content: '确认给该任务审批为【通过】吗?', + positiveText: '确定', + negativeText: '取消', + onPositiveClick: () => { + audit(param).then((res) => { + const { code } = res + if (code === 'OK') { + message.success('审核成功') + reload() + } + else { message.error(res.message) } + }) + }, + onNegativeClick: () => {}, + }) +}