feat(erp): 采购订单审批进协同办公——移除页面审批按钮,已办任务增加反审批

- 采购订单页移除审批/反审批按钮,订单创建后自动进协同办公审批
- 协同办公已办任务对采购订单审批任务显示反审批按钮(撤回已审核订单重新进入待办),隐藏无效的撤回按钮
- 已办任务操作列加宽,避免按钮文字截断

Co-Authored-By: Claude <noreply@anthropic.com>
已修改4个文件
80 ■■■■■ 文件已修改
src/api/erp/purchase/order/index.ts 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bpm/task/done/data.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bpm/task/done/index.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/erp/purchase/order/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/erp/purchase/order/index.ts
@@ -103,6 +103,13 @@
  return requestClient.get<any[]>('/erp/purchase-order/approve-process-list');
}
/** 反审批(协同办公已办任务中撤回已审核订单,回退为未审核) */
export function reverseApprove(processInstanceId: string) {
  return requestClient.post('/erp/purchase-order/reverse-approve', null, {
    params: { processInstanceId },
  });
}
/** 获取采购审核流程列表响应 */
export interface ProcessDefinition {
  id: string; // 流程定义ID
src/views/bpm/task/done/data.ts
@@ -146,7 +146,7 @@
    },
    {
      title: '操作',
      width: 120,
      width: 180,
      fixed: 'right',
      slots: { default: 'actions' },
    },
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),
src/views/erp/purchase/order/index.vue
@@ -16,7 +16,6 @@
  deletePurchaseOrder,
  exportPurchaseOrder,
  getPurchaseOrderPage,
  updatePurchaseOrderStatus,
} from '#/api/erp/purchase/order';
import { $t } from '#/locales';
@@ -63,24 +62,6 @@
  try {
    await deletePurchaseOrder(ids);
    message.success($t('ui.actionMessage.deleteSuccess'));
    handleRefresh();
  } finally {
    hideLoading();
  }
}
/** 审批/反审批操作 */
async function handleUpdateStatus(
  row: ErpPurchaseOrderApi.PurchaseOrder,
  status: number,
) {
  const hideLoading = message.loading({
    content: `确定${status === 20 ? '审批' : '反审批'}该订单吗?`,
    duration: 0,
  });
  try {
    await updatePurchaseOrderStatus(row.id!, status);
    message.success(`${status === 20 ? '审批' : '反审批'}成功`);
    handleRefresh();
  } finally {
    hideLoading();
@@ -159,7 +140,8 @@
</script>
<template>
  <Page auto-content-height><FormModal @success="handleRefresh" />
  <Page auto-content-height>
    <FormModal @success="handleRefresh" />
    <Grid table-title="采购订单列表">
      <template #toolbar-tools>
        <TableAction
@@ -215,20 +197,6 @@
              auth: ['erp:purchase-order:update'],
              ifShow: () => row.status !== 20,
              onClick: handleEdit.bind(null, row),
            },
            {
              label: row.status === 10 ? '审批' : '反审批',
              type: 'link',
              icon: ACTION_ICON.AUDIT,
              auth: ['erp:purchase-order:update-status'],
              popConfirm: {
                title: `确认${row.status === 10 ? '审批' : '反审批'}${row.no}吗?`,
                confirm: handleUpdateStatus.bind(
                  null,
                  row,
                  row.status === 10 ? 20 : 10,
                ),
              },
            },
            {
              label: '确认收货',