gaoluyang
4 天以前 d66628e95a691fae99ca0e9ed9a47309a6486e84
src/views/collaborativeApproval/approvalProcess/index.vue
@@ -25,7 +25,7 @@
      </div>
      <div>
        <el-button type="primary" @click="openForm('add')">新增</el-button>
<!--        <el-button @click="handleOut">导出</el-button>-->
        <el-button @click="handleOut">导出</el-button>
        <el-button type="danger" plain @click="handleDelete">删除</el-button>
      </div>
    </div>
@@ -222,6 +222,29 @@
    tableLoading.value = false;
  })
};
// 导出
const handleOut = () => {
  const type = Number(props.approveType || 0)
  const urlMap = {
    0: "/approveProcess/exportZero",
    1: "/approveProcess/exportOne",
    2: "/approveProcess/exportTwo",
    3: "/approveProcess/exportThree",
    4: "/approveProcess/exportFour",
    5: "/approveProcess/exportFive",
  }
  const url = urlMap[type] || urlMap[0]
  const nameMap = {
    0: "协同审批管理表",
    1: "公出管理审批表",
    2: "请假管理审批表",
    3: "出差管理审批表",
    4: "报销管理审批表",
    5: "采购申请审批表",
  }
  const fileName = nameMap[type] || nameMap[0]
  proxy.download(url, {}, `${fileName}.xlsx`)
}
// 表格选择数据
const handleSelectionChange = (selection) => {
  selectedRows.value = selection;