buhuazhen
2026-05-29 fd20b340153df3282b87dc631b7f72437ee06c07
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -10,7 +10,7 @@
      <el-tab-pane label="报价审批" name="6"></el-tab-pane>
      <el-tab-pane label="发货审批" name="7"></el-tab-pane>
    </el-tabs>
    <div class="search_form">
      <div>
        <span class="search_title">流程编号:</span>
@@ -38,14 +38,14 @@
        <el-button
          type="primary"
          @click="openForm('add')"
          v-if="currentApproveType !== 6 && currentApproveType !== 7"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
        >新增</el-button>
        <el-button @click="handleOut">导出</el-button>
        <el-button
          type="danger"
          plain
          @click="handleDelete"
          v-if="currentApproveType !== 7"
          v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7"
        >删除</el-button>
      </div>
    </div>
@@ -113,7 +113,8 @@
  const isLeaveType = currentApproveType.value === 2; // 请假管理
  const isReimburseType = currentApproveType.value === 4; // 报销管理
  const isQuotationType = currentApproveType.value === 6; // 报价审批
  const isPurchaseType = currentApproveType.value === 5; // 采购审批
  // 基础列配置
  const baseColumns = [
    {
@@ -159,9 +160,8 @@
      width: 220
    },
    {
      label: isQuotationType ? "报价单号" : "审批事由",
      label: isQuotationType ? "报价单号" : isPurchaseType ? "采购单号" : "审批事由",
      prop: "approveReason",
      width: 200
    },
    {
      label: "申请人",
@@ -169,7 +169,7 @@
      width: 120
    }
  ];
  // 金额列(仅报销管理显示)
  if (isReimburseType) {
    baseColumns.push({
@@ -178,7 +178,7 @@
      width: 120
    });
  }
  // 日期列(根据类型动态配置)
  baseColumns.push(
    {
@@ -192,60 +192,72 @@
      width: 120
    }
  );
  // 当前审批人列
  baseColumns.push({
    label: "当前审批人",
    prop: "approveUserCurrentName",
    width: 120
  });
  // 操作列
  const actionOperations = [
    {
      name: "编辑",
      type: "text",
      clickFun: (row) => {
        openForm("edit", row);
      },
      disabled: (row) =>
        currentApproveType.value === 5 ||
        currentApproveType.value === 6 ||
        currentApproveType.value === 7 ||
        row.approveStatus == 2 ||
        row.approveStatus == 1 ||
        row.approveStatus == 4
    },
    {
      name: "审核",
      type: "text",
      clickFun: (row) => {
        openApprovalDia("approval", row);
      },
      disabled: (row) =>
        row.approveUserCurrentId == null ||
        row.approveStatus == 2 ||
        row.approveStatus == 3 ||
        row.approveStatus == 4 ||
        row.approveUserCurrentId !== userStore.id
    },
    {
      name: "详情",
      type: "text",
      clickFun: (row) => {
        openApprovalDia("view", row);
      },
    },
  ];
  // 报价审批(类型 6)不展示“附件”操作
  if (!isQuotationType) {
    actionOperations.push({
      name: "附件",
      type: "text",
      clickFun: (row) => {
        downLoadFile(row);
      },
    });
  }
  baseColumns.push({
    dataType: "action",
    label: "操作",
    align: "center",
    fixed: "right",
    width: 230,
    operation: [
      {
        name: "编辑",
        type: "text",
        clickFun: (row) => {
          openForm("edit", row);
        },
        disabled: (row) =>
          currentApproveType.value === 6 ||
          currentApproveType.value === 7 ||
          row.approveStatus == 2 ||
          row.approveStatus == 1 ||
          row.approveStatus == 4
      },
      {
        name: "审核",
        type: "text",
        clickFun: (row) => {
          openApprovalDia("approval", row);
        },
        disabled: (row) => row.approveUserCurrentId == null || row.approveStatus == 2 || row.approveStatus == 3 || row.approveStatus == 4 || row.approveUserCurrentId !== userStore.id
      },
      {
        name: "详情",
        type: "text",
        clickFun: (row) => {
          openApprovalDia('view', row);
        },
      },
      {
        name: "附件",
        type: "text",
        clickFun: (row) => {
          downLoadFile(row);
        },
      },
    ],
    operation: actionOperations,
  });
  return baseColumns;
});
const tableData = ref([]);
@@ -359,17 +371,17 @@
  // 根据URL参数设置标签页和查询条件
  const approveType = route.query.approveType;
  const approveId = route.query.approveId;
  if (approveType) {
    // 设置标签页(approveType 对应 activeTab 的 name)
    activeTab.value = String(approveType);
  }
  if (approveId) {
    // 设置流程编号查询条件
    searchForm.value.approveId = String(approveId);
  }
  // 查询列表
  getList();
});