|
@@ -5,12 +5,15 @@
|
|
|
</header>
|
|
</header>
|
|
|
<main class="safety-platform-container__main">
|
|
<main class="safety-platform-container__main">
|
|
|
<div style="margin-bottom:20px">
|
|
<div style="margin-bottom:20px">
|
|
|
- <el-button
|
|
|
|
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="$router.push({ name: 'laborProductsRequisitionManageAdd' })"
|
|
@click="$router.push({ name: 'laborProductsRequisitionManageAdd' })"
|
|
|
>
|
|
>
|
|
|
添加
|
|
添加
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button plain @click="handleImport">
|
|
|
|
|
+ 导入
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="search-form">
|
|
<div class="search-form">
|
|
|
<el-form :inline="true">
|
|
<el-form :inline="true">
|
|
@@ -35,9 +38,11 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div>
|
|
<div>
|
|
|
-
|
|
|
|
|
<el-button type="primary" @click="queryTableList">查询</el-button>
|
|
<el-button type="primary" @click="queryTableList">查询</el-button>
|
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
|
|
|
+ <el-button plain @click="handleDownload">
|
|
|
|
|
+ 导出
|
|
|
|
|
+ </el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -97,6 +102,16 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</main>
|
|
</main>
|
|
|
|
|
+ <BatchImport
|
|
|
|
|
+ v-if="batchImportVisible"
|
|
|
|
|
+ :visible="batchImportVisible"
|
|
|
|
|
+ :import-api-url="importApiUrl"
|
|
|
|
|
+ :template-url="templateUrl"
|
|
|
|
|
+ template-name="下载模板"
|
|
|
|
|
+ :show-template="false"
|
|
|
|
|
+ @close="batchImportVisible = false"
|
|
|
|
|
+ @update="handleUpdate"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -106,10 +121,15 @@
|
|
|
import {
|
|
import {
|
|
|
queryPersonalProtectiveEquipmentReceiveList,
|
|
queryPersonalProtectiveEquipmentReceiveList,
|
|
|
deletePersonalProtectiveEquipmentReceive,
|
|
deletePersonalProtectiveEquipmentReceive,
|
|
|
|
|
+ exportPersonalProtectiveEquipmentReceiveList,
|
|
|
type QueryPersonalProtectiveEquipmentReceivePageReq,
|
|
type QueryPersonalProtectiveEquipmentReceivePageReq,
|
|
|
type PersonalProtectiveEquipmentReceive,
|
|
type PersonalProtectiveEquipmentReceive,
|
|
|
} from '@/api/production-safety/personal-protective-equipment-receive';
|
|
} from '@/api/production-safety/personal-protective-equipment-receive';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
|
|
+ import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
|
|
|
+ import { useGlobSetting } from '@/hooks/setting';
|
|
|
|
|
+ import urlJoin from 'url-join';
|
|
|
|
|
+ import { downloadByData } from '@/utils/file/download';
|
|
|
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
const queryParams = reactive<
|
|
const queryParams = reactive<
|
|
@@ -169,6 +189,36 @@
|
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 批量导入
|
|
|
|
|
+ const batchImportVisible = ref(false);
|
|
|
|
|
+ const { urlPrefix } = useGlobSetting();
|
|
|
|
|
+ // /productionSafety/academyFile/import
|
|
|
|
|
+ const importApiUrl = ref(urlJoin(urlPrefix, '/personalProtectiveEquipmentReceive/importProtectiveEquipmentReceive'));
|
|
|
|
|
+ const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-academy-file-template.xlsx');
|
|
|
|
|
+
|
|
|
|
|
+ const handleImport = () => {
|
|
|
|
|
+ batchImportVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleUpdate = () => {
|
|
|
|
|
+ batchImportVisible.value = false;
|
|
|
|
|
+ queryTableList();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleDownload = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const response = await exportPersonalProtectiveEquipmentReceiveList(queryParams.queryParam);
|
|
|
|
|
+ if (response) {
|
|
|
|
|
+ const fileName = `劳防用品领用管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
+ downloadByData(response, fileName);
|
|
|
|
|
+ ElMessage.success('导出成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('导出劳防用品领用管理失败:', e);
|
|
|
|
|
+ ElMessage.error('导出失败,请重试');
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const handleRestParams = () => {
|
|
const handleRestParams = () => {
|
|
|
queryParams.pageNumber = 1;
|
|
queryParams.pageNumber = 1;
|
|
|
queryParams.pageSize = 10;
|
|
queryParams.pageSize = 10;
|