From 0251fb6f8979a5943f58478686265ce776103ab4 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 25 八月 2026 09:08:17 +0800
Subject: [PATCH] feat(erp): 采购订单审批进协同办公——移除页面审批按钮,已办任务增加反审批
---
src/views/bpm/task/done/index.vue | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/src/views/bpm/task/done/index.vue b/src/views/bpm/task/done/index.vue
index 753eda8..4bf1c3a 100644
--- a/src/views/bpm/task/done/index.vue
+++ b/src/views/bpm/task/done/index.vue
@@ -7,6 +7,7 @@
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { reverseApprove } from '#/api/erp/purchase/order';
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
import { router } from '#/router';
@@ -34,6 +35,28 @@
try {
await withdrawTask(row.id);
message.success('鎾ゅ洖鎴愬姛');
+ await gridApi.query();
+ } finally {
+ hideLoading();
+ }
+}
+
+/** 鏄惁閲囪喘璁㈠崟瀹℃壒浠诲姟锛堢敤浜庢樉绀�"鍙嶅鎵�"銆侀殣钘忛�氱敤"鎾ゅ洖"锛� */
+function isPurchaseOrderApprove(row: BpmTaskApi.Task) {
+ return (row.processInstance?.processDefinitionId || '').startsWith(
+ 'purchase_order_approve',
+ );
+}
+
+/** 鍙嶅鎵归噰璐鍗曪紙宸插鏍� -> 鏈鏍革紝鍦ㄥ崗鍚屽姙鍏凡鍔炰换鍔′腑鎿嶄綔锛� */
+async function handleReverseApprove(row: BpmTaskApi.Task) {
+ const hideLoading = message.loading({
+ content: '鍙嶅鎵逛腑...',
+ duration: 0,
+ });
+ try {
+ await reverseApprove(row.processInstance.id);
+ message.success('鍙嶅鎵规垚鍔燂紝璁㈠崟宸查噸鏂拌繘鍏ュ緟鍔炲鎵�');
await gridApi.query();
} finally {
hideLoading();
@@ -77,10 +100,22 @@
<TableAction
:actions="[
{
+ label: '鍙嶅鎵�',
+ type: 'link',
+ danger: true,
+ icon: ACTION_ICON.AUDIT,
+ ifShow: () => isPurchaseOrderApprove(row),
+ popConfirm: {
+ title: '纭畾瑕佸弽瀹℃壒璇ラ噰璐鍗曞悧锛熻鍗曞皢閲嶆柊杩涘叆寰呭姙瀹℃壒',
+ confirm: handleReverseApprove.bind(null, row),
+ },
+ },
+ {
label: '鎾ゅ洖',
type: 'link',
danger: true,
icon: ACTION_ICON.DELETE,
+ ifShow: () => !isPurchaseOrderApprove(row),
popConfirm: {
title: '纭畾瑕佹挙鍥炶浠诲姟鍚楋紵',
confirm: handleWithdraw.bind(null, row),
--
Gitblit v1.9.3