|
@@ -6,6 +6,9 @@
|
|
|
<main class="safety-platform-container__main">
|
|
<main class="safety-platform-container__main">
|
|
|
<div style="margin-bottom:20px">
|
|
<div style="margin-bottom:20px">
|
|
|
<el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
|
|
<el-button type="primary" @click="$router.push({ name: 'constructionSafetyManageAdd' })">添加 </el-button>
|
|
|
|
|
+ <!-- <el-button plain class="search-table-container--button" @click="handleImport">
|
|
|
|
|
+ 导入
|
|
|
|
|
+ </el-button> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div class="search-form">
|
|
<div class="search-form">
|
|
|
<el-form :inline="true">
|
|
<el-form :inline="true">
|
|
@@ -43,9 +46,11 @@
|
|
|
</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>
|
|
|
|
|
|
|
@@ -107,6 +112,16 @@
|
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <BatchImport
|
|
|
|
|
+ v-if="batchImportVisible"
|
|
|
|
|
+ :visible="batchImportVisible"
|
|
|
|
|
+ :import-api-url="importApiUrl"
|
|
|
|
|
+ :template-url="templateUrl"
|
|
|
|
|
+ template-name="下载模板"
|
|
|
|
|
+ :show-template="false"
|
|
|
|
|
+ @close="batchImportVisible = false"
|
|
|
|
|
+ @update="handleUpdate"
|
|
|
|
|
+ />
|
|
|
</main>
|
|
</main>
|
|
|
</div>
|
|
</div>
|
|
|
<BasicDialog
|
|
<BasicDialog
|
|
@@ -177,6 +192,7 @@
|
|
|
constructionSafetyQueryPageConstruction,
|
|
constructionSafetyQueryPageConstruction,
|
|
|
constructionSafetyDeleteConstructionById,
|
|
constructionSafetyDeleteConstructionById,
|
|
|
constructionSafetyUpdateApply,
|
|
constructionSafetyUpdateApply,
|
|
|
|
|
+ exportConstructionSafetyList,
|
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
|
import BasicDialog from '@/components/BasicDialog.vue';
|
|
import BasicDialog from '@/components/BasicDialog.vue';
|
|
|
import { getApprovalNodeInstanceList } from '@/api/approval/approval';
|
|
import { getApprovalNodeInstanceList } from '@/api/approval/approval';
|
|
@@ -188,7 +204,10 @@
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
import { APPROVAL_TYPE_MAP, APPROVER_TYPE } from '@/views/emergency/emergency-plan/src/constant';
|
|
import { APPROVAL_TYPE_MAP, APPROVER_TYPE } from '@/views/emergency/emergency-plan/src/constant';
|
|
|
import { useEmergencySuppliesHook } from '@/views/emergency/emergency-supplies/src/hook';
|
|
import { useEmergencySuppliesHook } from '@/views/emergency/emergency-supplies/src/hook';
|
|
|
-
|
|
|
|
|
|
|
+ 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 router = useRouter();
|
|
const router = useRouter();
|
|
|
const { id } = useUserInfoHook();
|
|
const { id } = useUserInfoHook();
|
|
|
const firstLevelDepts = ref<any[]>([]);
|
|
const firstLevelDepts = ref<any[]>([]);
|
|
@@ -339,6 +358,36 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 批量导入
|
|
|
|
|
+ const batchImportVisible = ref(false);
|
|
|
|
|
+ const { urlPrefix } = useGlobSetting();
|
|
|
|
|
+ // /productionSafety/academyFile/import
|
|
|
|
|
+ const importApiUrl = ref(urlJoin(urlPrefix, '/safetyRisk/list/importRiskList'));
|
|
|
|
|
+ const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-academy-file-template.xlsx');
|
|
|
|
|
+
|
|
|
|
|
+ const handleImport = () => {
|
|
|
|
|
+ batchImportVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleUpdate = () => {
|
|
|
|
|
+ batchImportVisible.value = false;
|
|
|
|
|
+ // getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleDownload = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const response = await exportConstructionSafetyList();
|
|
|
|
|
+ if (response) {
|
|
|
|
|
+ const fileName = `施工作业安全管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
+ downloadByData(response, fileName);
|
|
|
|
|
+ ElMessage.success('导出成功');
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('导出院级文件失败:', e);
|
|
|
|
|
+ ElMessage.error('导出失败,请重试');
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await getDeptData();
|
|
await getDeptData();
|
|
|
queryTableList();
|
|
queryTableList();
|
|
@@ -362,7 +411,10 @@
|
|
|
:deep(.breadcrumb .title) {
|
|
:deep(.breadcrumb .title) {
|
|
|
margin-left: 0;
|
|
margin-left: 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ :deep(main) {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ }
|
|
|
.search-form {
|
|
.search-form {
|
|
|
min-width: 800px;
|
|
min-width: 800px;
|
|
|
display: flex;
|
|
display: flex;
|