|
|
@@ -3,7 +3,7 @@
|
|
|
<header class="safety-platform-container__header">
|
|
|
<div class="breadcrumb-title"> 安全组织体系架构 </div>
|
|
|
</header>
|
|
|
- <main class="safety-platform-container__main flex">
|
|
|
+ <main class="safety-platform-container__main flex platform-main">
|
|
|
<div class="nav">
|
|
|
<el-button type="primary" :icon="Plus" @click="addTeam('parent')"> 添加组织 </el-button>
|
|
|
|
|
|
@@ -34,7 +34,22 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="search-table-container table-content">
|
|
|
- <div style="margin-bottom:20px">
|
|
|
+ <div>
|
|
|
+ <p class="label-title">组织信息</p>
|
|
|
+ <el-form :model="safetyOrgUser" ref="formRef" :rules="safetyOrgUserRules">
|
|
|
+ <el-form-item label="组织人数" prop="userNum">
|
|
|
+ <el-input placeholder="请输入组织人数" type="number" v-model="safetyOrgUser.userNum" style="width:450px" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="组织职责" prop="depResp">
|
|
|
+ <el-input placeholder="请填写组织职责" v-model="safetyOrgUser.depResp" :autosize="{ minRows: 2, maxRows: 6 }" :maxlength="300" show-word-limit type="textarea" style="width:450px" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="handleSave"> 保存 </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <p class="label-title">人员信息</p>
|
|
|
<el-button type="primary" :icon="Plus" @click="handleCreate"> 添加 </el-button>
|
|
|
<el-button plain @click="handleImport">导入</el-button>
|
|
|
</div>
|
|
|
@@ -137,6 +152,8 @@
|
|
|
deleteSafetySystem,
|
|
|
fetchTableList,
|
|
|
delEmployee,
|
|
|
+ safetyOrgUserSave,
|
|
|
+ safetyOrgUserDetail,
|
|
|
exportSafetyOrganizationSystemManagement
|
|
|
} from '@/api/safety-organization-management';
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
@@ -144,6 +161,7 @@
|
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
|
import urlJoin from 'url-join';
|
|
|
import AddSafetySystem from './components/addSafetySystem.vue';
|
|
|
+ import {SafetyOrgUserRules} from "./configs/form"
|
|
|
import {
|
|
|
Delete,
|
|
|
Edit,
|
|
|
@@ -177,7 +195,41 @@ const position = ref('left')
|
|
|
endTime: '',
|
|
|
},
|
|
|
});
|
|
|
-
|
|
|
+ const safetyOrgUser = reactive({
|
|
|
+ userNum: '',
|
|
|
+ depResp: ''
|
|
|
+ })
|
|
|
+ const formRef = ref()
|
|
|
+ const safetyOrgUserRules = ref(SafetyOrgUserRules)
|
|
|
+ // 校验员工数量和职责
|
|
|
+ const handleValidate = async () => {
|
|
|
+ if (!formRef.value) return;
|
|
|
+ const res = await formRef.value.validateField();
|
|
|
+ return res;
|
|
|
+ };
|
|
|
+ // 保存员工数量和职责
|
|
|
+ const handleSave = async ()=>{
|
|
|
+ const res = await handleValidate()
|
|
|
+ if (!res) return;
|
|
|
+ try {
|
|
|
+ await safetyOrgUserSave(safetyOrgUser)
|
|
|
+ ElMessage.success('保存成功');
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('保存失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 查询组织详情
|
|
|
+ const safetyOrgDetail = async (id)=>{
|
|
|
+ try {
|
|
|
+ const res = await safetyOrgUserDetail(id)
|
|
|
+ Object.assign(safetyOrgUser, {
|
|
|
+ userNum: res.userNum,
|
|
|
+ depResp: res.depResp
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('获取详情失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
const handleSizeChange = (value: number) => {
|
|
|
pagination.pageSize = value;
|
|
|
tableQuery.pageSize = value;
|
|
|
@@ -330,8 +382,11 @@ const position = ref('left')
|
|
|
const querySafetyTeamData = (value) => {
|
|
|
// console.log('查询', value);
|
|
|
tableQuery.queryParam.classifyName = value.orgId;
|
|
|
+ safetyOrgDetail(value.orgId)
|
|
|
getTableData();
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
// 时间查询
|
|
|
const onchangeDateRange = () => {
|
|
|
if (dateRange.value && Array.isArray(dateRange.value) && dateRange.value.length === 2) {
|
|
|
@@ -436,6 +491,9 @@ const position = ref('left')
|
|
|
const orgId = route.query.id as string;
|
|
|
tableQuery.queryParam.classifyName = orgId || undefined
|
|
|
getTableData();
|
|
|
+ if(orgId){
|
|
|
+ safetyOrgDetail(orgId)
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
@@ -444,13 +502,20 @@ const position = ref('left')
|
|
|
@use '@/styles/page-main-layout.scss' as *;
|
|
|
@use '@/styles/basic-table-action.scss' as *;
|
|
|
@use '@/views/traffic/violation/style/act-search-table.scss' as *;
|
|
|
+ .platform-main {
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
.table-content {
|
|
|
+ flex:1;
|
|
|
+ width: 0;
|
|
|
+ min-width: 0;
|
|
|
}
|
|
|
.nav {
|
|
|
flex: 0 0 300px;
|
|
|
margin-right: 15px;
|
|
|
padding-right: 15px;
|
|
|
border-right: 1px solid #eee;
|
|
|
+ overflow-y: auto;
|
|
|
:deep(.collapse-title) {
|
|
|
flex: 1 0 90%;
|
|
|
order: 1;
|
|
|
@@ -497,4 +562,7 @@ const position = ref('left')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .label-title{
|
|
|
+ margin-bottom:16px;
|
|
|
+ }
|
|
|
</style>
|