|
@@ -6,20 +6,24 @@
|
|
|
<main class="safety-platform-container__main flex">
|
|
<main class="safety-platform-container__main flex">
|
|
|
<div class="nav">
|
|
<div class="nav">
|
|
|
<el-button type="primary" :icon="Plus" @click="addTeam('parent')"> 添加组织 </el-button>
|
|
<el-button type="primary" :icon="Plus" @click="addTeam('parent')"> 添加组织 </el-button>
|
|
|
|
|
+
|
|
|
<div class="collapse-wrapper">
|
|
<div class="collapse-wrapper">
|
|
|
|
|
+ <!-- expand-icon-position="left" 版本小了,不支持 -->
|
|
|
<el-collapse accordion v-model="activeName" v-if="fetchSafetyOrganizationList.length > 0">
|
|
<el-collapse accordion v-model="activeName" v-if="fetchSafetyOrganizationList.length > 0">
|
|
|
<el-collapse-item :name="item.orgId" v-for="item in fetchSafetyOrganizationList">
|
|
<el-collapse-item :name="item.orgId" v-for="item in fetchSafetyOrganizationList">
|
|
|
<template #title="{ isActive }">
|
|
<template #title="{ isActive }">
|
|
|
<div :class="['title-wrapper', { 'is-active': isActive }]">
|
|
<div :class="['title-wrapper', { 'is-active': isActive }]">
|
|
|
- <span @click.stop="querySafetyTeamData('parent', item)">{{ item.orgName }}</span>
|
|
|
|
|
|
|
+ <span @click.stop="querySafetyTeamData('parent', item)">
|
|
|
|
|
+ {{ item.orgName }}
|
|
|
|
|
+ </span>
|
|
|
<div class="handler">
|
|
<div class="handler">
|
|
|
- <el-button link size="small" type="primary" @click.stop="handleCreateSafetySystem('children', item)"
|
|
|
|
|
- >新增子组织</el-button
|
|
|
|
|
|
|
+ <el-button :icon="Plus" size="small" type="default" dashed @click.stop="handleCreateSafetySystem('children', item)"
|
|
|
|
|
+ ></el-button
|
|
|
>
|
|
>
|
|
|
- <el-button link size="small" type="primary" @click.stop="handleEditSafetySystem('parent', item, '')"
|
|
|
|
|
|
|
+ <el-button size="small" type="primary" link @click.stop="handleEditSafetySystem('parent', item, '')"
|
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button link size="small" type="danger" @click.stop="handleDelSafetySystem('parent', item)"
|
|
|
|
|
|
|
+ <el-button size="small" type="danger" link @click.stop="handleDelSafetySystem('parent', item)"
|
|
|
>删除</el-button
|
|
>删除</el-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
@@ -67,7 +71,11 @@
|
|
|
@confirmAddSafetySystem="confirmAddSafetySystemCallback"
|
|
@confirmAddSafetySystem="confirmAddSafetySystemCallback"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="search-table-container">
|
|
|
|
|
|
|
+ <div class="search-table-container table-content">
|
|
|
|
|
+ <div style="margin-bottom:20px">
|
|
|
|
|
+ <el-button type="primary" @click="handleCreate"> 添加 </el-button>
|
|
|
|
|
+ <el-button plain @click="handleImport">导入</el-button>
|
|
|
|
|
+ </div>
|
|
|
<header>
|
|
<header>
|
|
|
<div class="act-search">
|
|
<div class="act-search">
|
|
|
<section class="select-box">
|
|
<section class="select-box">
|
|
@@ -82,8 +90,8 @@
|
|
|
<div class="select-box--item">
|
|
<div class="select-box--item">
|
|
|
<span>状态:</span>
|
|
<span>状态:</span>
|
|
|
<el-select v-model="tableQuery.queryParam.status" placeholder="请选择状态" clearable>
|
|
<el-select v-model="tableQuery.queryParam.status" placeholder="请选择状态" clearable>
|
|
|
- <el-option label="启用" value="1" />
|
|
|
|
|
- <el-option label="禁用" value="2" />
|
|
|
|
|
|
|
+ <el-option label="启用" :value="1" />
|
|
|
|
|
+ <el-option label="禁用" :value="2" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="select-box--item">
|
|
<div class="select-box--item">
|
|
@@ -103,20 +111,12 @@
|
|
|
<section class="search-btn">
|
|
<section class="search-btn">
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
<el-button @click="handleReset">重置</el-button>
|
|
<el-button @click="handleReset">重置</el-button>
|
|
|
|
|
+ <el-button plain @click="handleDownload">导出</el-button>
|
|
|
</section>
|
|
</section>
|
|
|
</div>
|
|
</div>
|
|
|
</header>
|
|
</header>
|
|
|
|
|
|
|
|
<div class="batch-table">
|
|
<div class="batch-table">
|
|
|
- <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> -->
|
|
|
|
|
- </div>
|
|
|
|
|
<BasicTable
|
|
<BasicTable
|
|
|
ref="basicTableRef"
|
|
ref="basicTableRef"
|
|
|
:tableData="tableData"
|
|
:tableData="tableData"
|
|
@@ -151,7 +151,7 @@
|
|
|
:visible="batchImportVisible"
|
|
:visible="batchImportVisible"
|
|
|
:import-api-url="importApiUrl"
|
|
:import-api-url="importApiUrl"
|
|
|
:template-url="templateUrl"
|
|
:template-url="templateUrl"
|
|
|
- template-name="下载模板"
|
|
|
|
|
|
|
+ template-name="安全组织体系"
|
|
|
:show-template="false"
|
|
:show-template="false"
|
|
|
@close="batchImportVisible = false"
|
|
@close="batchImportVisible = false"
|
|
|
@update="handleUpdate"
|
|
@update="handleUpdate"
|
|
@@ -162,14 +162,12 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
- import { Plus } from '@element-plus/icons-vue';
|
|
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
- import { TABLE_OPTIONS, INVENTORY_TABLE_COLUMNS } from './configs/tables';
|
|
|
|
|
|
|
+ import { TABLE_OPTIONS, TABLE_COLUMNS } from './configs/tables';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
- import { queryInventoryManage, deleteInventory, exportInventory } from '@/api/inventory';
|
|
|
|
|
import {
|
|
import {
|
|
|
getSafetySystemList,
|
|
getSafetySystemList,
|
|
|
addSafetySystem,
|
|
addSafetySystem,
|
|
@@ -177,21 +175,26 @@
|
|
|
deleteSafetySystem,
|
|
deleteSafetySystem,
|
|
|
fetchTableList,
|
|
fetchTableList,
|
|
|
delEmployee,
|
|
delEmployee,
|
|
|
|
|
+ exportSafetyOrganizationSystemManagement
|
|
|
} from '@/api/safety-organization-management';
|
|
} from '@/api/safety-organization-management';
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
|
import urlJoin from 'url-join';
|
|
import urlJoin from 'url-join';
|
|
|
- import { OptionsProps } from '@/types/log/constants';
|
|
|
|
|
- import { calculateTreeData } from '@/utils';
|
|
|
|
|
- import { getAllDepartments } from '@/api/auth/dept';
|
|
|
|
|
import AddSafetySystem from './components/addSafetySystem.vue';
|
|
import AddSafetySystem from './components/addSafetySystem.vue';
|
|
|
|
|
+ import {
|
|
|
|
|
+ Delete,
|
|
|
|
|
+ Edit,
|
|
|
|
|
+ Plus,
|
|
|
|
|
+} from '@element-plus/icons-vue'
|
|
|
|
|
+
|
|
|
|
|
+const position = ref('left')
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
// 表格
|
|
// 表格
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
|
|
|
- const { tableConfig, pagination } = useTableConfig(INVENTORY_TABLE_COLUMNS, TABLE_OPTIONS);
|
|
|
|
|
|
|
+ const { tableConfig, pagination } = useTableConfig(TABLE_COLUMNS, TABLE_OPTIONS);
|
|
|
|
|
|
|
|
const tableData = ref<any[]>([]);
|
|
const tableData = ref<any[]>([]);
|
|
|
|
|
|
|
@@ -230,21 +233,11 @@
|
|
|
try {
|
|
try {
|
|
|
const res = await fetchTableList(tableQuery);
|
|
const res = await fetchTableList(tableQuery);
|
|
|
if (res) {
|
|
if (res) {
|
|
|
- // 映射返回数据字段到表格字段
|
|
|
|
|
- tableData.value = res.records.map((item) => ({
|
|
|
|
|
- id: item.id,
|
|
|
|
|
- itemName: item.stuffName, // 物品名称
|
|
|
|
|
- warehouseDate: item.inStoreTime, // 入库日期
|
|
|
|
|
- itemQuantity: item.stuffQty, // 物品数量
|
|
|
|
|
- handler: item.createdUserName, // 经办人
|
|
|
|
|
- remarks: item.remark, // 备注
|
|
|
|
|
- status: item.status, // 状态:1-启用,2-禁用
|
|
|
|
|
- statusName: item.statusName, // 状态名称
|
|
|
|
|
- }));
|
|
|
|
|
|
|
+ tableData.value = res.records
|
|
|
pagination.total = res.totalRow;
|
|
pagination.total = res.totalRow;
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('获取物品库存列表失败:', e);
|
|
|
|
|
|
|
+ console.error('获取列表失败:', e);
|
|
|
tableData.value = [];
|
|
tableData.value = [];
|
|
|
pagination.total = 0;
|
|
pagination.total = 0;
|
|
|
} finally {
|
|
} finally {
|
|
@@ -402,7 +395,7 @@
|
|
|
// 批量导入
|
|
// 批量导入
|
|
|
const batchImportVisible = ref(false);
|
|
const batchImportVisible = ref(false);
|
|
|
const { urlPrefix } = useGlobSetting();
|
|
const { urlPrefix } = useGlobSetting();
|
|
|
- const importApiUrl = ref(urlJoin(urlPrefix, '/inventory/importInventory'));
|
|
|
|
|
|
|
+ const importApiUrl = ref(urlJoin(urlPrefix, '/safetyorguser/importSafetyOrgUser'));
|
|
|
const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-inventory-template.xlsx');
|
|
const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-inventory-template.xlsx');
|
|
|
|
|
|
|
|
const handleImport = () => {
|
|
const handleImport = () => {
|
|
@@ -416,19 +409,14 @@
|
|
|
|
|
|
|
|
const handleDownload = async () => {
|
|
const handleDownload = async () => {
|
|
|
try {
|
|
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);
|
|
|
|
|
|
|
+ const response = await exportSafetyOrganizationSystemManagement(tableQuery.queryParam);
|
|
|
if (response) {
|
|
if (response) {
|
|
|
- const fileName = `物品库存管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
|
|
|
|
+ const fileName = `安全组织体系管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
downloadByData(response, fileName);
|
|
downloadByData(response, fileName);
|
|
|
ElMessage.success('导出成功');
|
|
ElMessage.success('导出成功');
|
|
|
}
|
|
}
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
- console.error('导出物品库存失败:', e);
|
|
|
|
|
|
|
+ console.error('导出安全组织体系管理失败:', e);
|
|
|
ElMessage.error('导出失败,请重试');
|
|
ElMessage.error('导出失败,请重试');
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -484,13 +472,21 @@
|
|
|
@use '@/styles/page-main-layout.scss' as *;
|
|
@use '@/styles/page-main-layout.scss' as *;
|
|
|
@use '@/styles/basic-table-action.scss' as *;
|
|
@use '@/styles/basic-table-action.scss' as *;
|
|
|
@use '@/views/traffic/violation/style/act-search-table.scss' as *;
|
|
@use '@/views/traffic/violation/style/act-search-table.scss' as *;
|
|
|
-
|
|
|
|
|
|
|
+ .table-content {
|
|
|
|
|
+ }
|
|
|
.nav {
|
|
.nav {
|
|
|
- width: 500px;
|
|
|
|
|
|
|
+ flex: 0 0 300px;
|
|
|
margin-right: 15px;
|
|
margin-right: 15px;
|
|
|
padding-right: 15px;
|
|
padding-right: 15px;
|
|
|
border-right: 1px solid #eee;
|
|
border-right: 1px solid #eee;
|
|
|
-
|
|
|
|
|
|
|
+ :deep(.collapse-title) {
|
|
|
|
|
+ flex: 1 0 90%;
|
|
|
|
|
+ order: 1;
|
|
|
|
|
+ .el-collapse-item__header {
|
|
|
|
|
+ flex: 1 0 auto;
|
|
|
|
|
+ order: -1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.collapse-wrapper {
|
|
.collapse-wrapper {
|
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
|
|
|
|