gongchunyi
2 天以前 492802e4fc1b371ba21a2a490c8dcd67d7c8b29c
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -18,6 +18,8 @@
                   name="6"></el-tab-pane>
      <el-tab-pane label="发货审批"
                   name="7"></el-tab-pane>
      <el-tab-pane label="入库审批"
                   name="9"></el-tab-pane>
    </el-tabs>
    <div class="search_form">
      <div>
@@ -52,12 +54,12 @@
        <el-button @click="handleOut">审批人维护</el-button>
        <el-button type="primary"
                   @click="openForm('add')"
                   v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7">新增</el-button>
                   v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9">新增</el-button>
        <el-button @click="handleExport">导出</el-button>
        <el-button type="danger"
                   plain
                   @click="handleDelete"
                   v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7">删除</el-button>
                   v-if="currentApproveType !== 5 && currentApproveType !== 6 && currentApproveType !== 7 && currentApproveType !== 9">删除</el-button>
      </div>
    </div>
    <div class="table_list">
@@ -184,9 +186,12 @@
  // 动态表格列配置,根据审批类型生成列
  const tableColumnCopy = computed(() => {
    const isLeaveType = currentApproveType.value === 2; // 请假管理
    const isBusinessTripType = currentApproveType.value === 3; // 出差管理
    const showDateRange = isLeaveType || isBusinessTripType; // 是否显示时间段
    const isReimburseType = currentApproveType.value === 4; // 报销管理
    const isQuotationType = currentApproveType.value === 6; // 报价审批
    const isPurchaseType = currentApproveType.value === 5; // 采购审批
    const isInboundType = currentApproveType.value === 9; // 入库审批
    // 基础列配置
    const baseColumns = [
@@ -237,6 +242,8 @@
          ? "报价单号"
          : isPurchaseType
          ? "采购合同号"
          : isInboundType
          ? "入库单号"
          : "审批事由",
        prop: "approveReason",
      },
@@ -256,19 +263,35 @@
      });
    }
    // 日期列(根据类型动态配置)
    // 基础日期列
    baseColumns.push(
      {
        label: isLeaveType ? "开始日期" : "申请日期",
        prop: isLeaveType ? "startDate" : "approveTime",
        width: 200,
        label: "申请日期",
        prop: "approveTime",
        width: 160,
      },
      {
        label: "结束日期",
        prop: isLeaveType ? "endDate" : "approveOverTime",
        width: 120,
        label: "审批日期",
        prop: "approveOverTime",
        width: 160,
      }
    );
    // 开始和结束日期列
    if (showDateRange) {
      baseColumns.push(
        {
          label: "开始日期",
          prop: "startDate",
          width: 120,
        },
        {
          label: "结束日期",
          prop: "endDate",
          width: 120,
        }
      );
    }
    // 当前审批人列
    baseColumns.push({
@@ -289,6 +312,7 @@
          currentApproveType.value === 5 ||
          currentApproveType.value === 6 ||
          currentApproveType.value === 7 ||
          currentApproveType.value === 9 ||
          row.approveStatus == 2 ||
          row.approveStatus == 1 ||
          row.approveStatus == 4,
@@ -402,6 +426,7 @@
      5: "/approveProcess/exportFive",
      6: "/approveProcess/exportSix",
      7: "/approveProcess/exportSeven",
      9: "/approveProcess/exportNine",
    };
    const url = urlMap[type] || urlMap[0];
    const nameMap = {
@@ -413,6 +438,7 @@
      5: "采购申请审批表",
      6: "报价审批表",
      7: "发货审批表",
      9: "入库审批表",
    };
    const fileName = nameMap[type] || nameMap[0];
    proxy.download(url, {}, `${fileName}.xlsx`);