|
|
@@ -1,19 +1,16 @@
|
|
|
<template>
|
|
|
<div class="safety-platform-container">
|
|
|
<header class="safety-platform-container__header">
|
|
|
- <div class="breadcrumb-title"> 教育培训计划管理</div>
|
|
|
+ <div class="breadcrumb-title">教育培训计划管理</div>
|
|
|
</header>
|
|
|
<main class="safety-platform-container__main">
|
|
|
<div class="search-table-container">
|
|
|
<header>
|
|
|
<div style="position: relative">
|
|
|
<el-button type="primary" class="search-table-container--button" @click="handleCreate"> 添加 </el-button>
|
|
|
- <!-- <el-button plain class="search-table-container--button" @click="handleImport">
|
|
|
- 导入
|
|
|
- </el-button>
|
|
|
- <el-button plain class="search-table-container--button" @click="handleDownload">
|
|
|
- 导出
|
|
|
- </el-button> -->
|
|
|
+ <el-button plain class="search-table-container--button" @click="handleImport">
|
|
|
+ 导入
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<div class="act-search">
|
|
|
<section class="select-box">
|
|
|
@@ -63,6 +60,9 @@
|
|
|
<section class="search-btn">
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
<el-button @click="handleReset">重置</el-button>
|
|
|
+ <el-button plain class="search-table-container--button" @click="handleDownload">
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
</section>
|
|
|
</div>
|
|
|
</header>
|
|
|
@@ -155,6 +155,7 @@
|
|
|
issueEducationAndTrainingProgram,
|
|
|
cancelEducationAndTrainingProgram,
|
|
|
deleteEducationAndTrainingProgram,
|
|
|
+ exportTableData
|
|
|
} from '@/api/production-education-training-plan';
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
|
@@ -250,7 +251,7 @@
|
|
|
// 批量导入
|
|
|
const batchImportVisible = ref(false);
|
|
|
const { urlPrefix } = useGlobSetting();
|
|
|
- const importApiUrl = ref(urlJoin(urlPrefix, '/inventory/importInventory'));
|
|
|
+ const importApiUrl = ref(urlJoin(urlPrefix, '/educationTrainingPlan/importProductionEducationTrainingPlan'));
|
|
|
const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-inventory-template.xlsx');
|
|
|
|
|
|
const handleImport = () => {
|
|
|
@@ -264,19 +265,14 @@
|
|
|
|
|
|
const handleDownload = async () => {
|
|
|
try {
|
|
|
- const exportParams = {
|
|
|
- stuffName: tableQuery.queryParam.stuffName || undefined,
|
|
|
- status: tableQuery.queryParam.status,
|
|
|
- ids: tableQuery.queryParam.ids.length > 0 ? tableQuery.queryParam.ids : undefined,
|
|
|
- };
|
|
|
- // const response = await exportInventory(exportParams);
|
|
|
- // if (response) {
|
|
|
- // const fileName = `物品库存管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
- // downloadByData(response, fileName);
|
|
|
- // ElMessage.success('导出成功');
|
|
|
- // }
|
|
|
+ const response = await exportTableData(tableQuery.queryParam);
|
|
|
+ if (response) {
|
|
|
+ const fileName = `教育培训计划管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
+ downloadByData(response, fileName);
|
|
|
+ ElMessage.success('导出成功');
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
- console.error('导出物品库存失败:', e);
|
|
|
+ console.error('导出教育培训计划管理失败:', e);
|
|
|
ElMessage.error('导出失败,请重试');
|
|
|
}
|
|
|
};
|