From ede67dc74f5ec5e491b102b1835d9cb5315dc6d5 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期一, 01 八月 2022 10:48:15 +0800 Subject: [PATCH] 双重预防 --- src/views/doublePrevent/checkTaskManage/record/index.vue | 260 ++ src/views/doublePrevent/riskLevel/check/components/checkUnitDialog.vue | 227 ++ src/api/user/index.ts | 2 src/api/doublePreventSystem/rectify/index.ts | 45 src/views/doublePrevent/checkTaskManage/work/components/workDialog.vue | 309 ++ src/views/intellectInspect/inspectBasic/discriminate/index.vue | 4 src/views/doublePrevent/hiddenInvestigate/record/index.vue | 2 src/api/doublePreventSystem/work/index.ts | 38 src/api/doublePreventSystem/checkUnit/index.ts | 44 src/router/route.ts | 3 src/views/doublePrevent/hiddenInvestigate/checkTaskManage/record/index.vue | 2 src/api/doublePreventSystem/riskControlMeasure/index.ts | 6 src/views/doublePrevent/hiddenInvestigate/work/index.vue | 0 src/views/doublePrevent/checkTaskManage/record/components/recordDialog.vue | 308 ++ src/utils/request.ts | 15 src/views/doublePrevent/hiddenInvestigate/checkTaskManage/work/index.vue | 0 src/views/doublePrevent/hiddenManage/hiddenCheck/index.vue | 247 ++ src/views/doublePrevent/hiddenInvestigate/checkTaskManage/work/components/inspectionTaskDialog.vue | 0 src/views/doublePrevent/riskLevel/checkUnit/index.vue | 195 + src/views/doublePrevent/riskLevel/map/components/rectifyDialog.vue | 397 +++ .env.development | 5 src/assets/methods/index.ts | 15 src/assets/style/index.scss | 4 src/views/home/index.vue | 329 +- src/api/doublePreventSystem/check/index.ts | 45 src/views/doublePrevent/checkTaskManage/work/index.vue | 254 ++ src/views/doublePrevent/hiddenInvestigate/work/components/inspectionTaskDialog.vue | 0 src/api/doublePreventSystem/record/index.ts | 32 src/views/doublePrevent/hiddenManage/hiddenCheck/components/checkDialog.vue | 2 src/views/IntelligentXjSys/basicDataManagement/facilityArea/index.vue | 718 +++--- src/views/doublePrevent/riskLevel/map/index.vue | 272 ++ src/views/doublePrevent/riskLevel/checkUnit/components/checkUnitDialog.vue | 227 ++ src/views/doublePrevent/riskLevel/check/components/selectMeasureControlDialog.vue | 219 ++ src/views/doublePrevent/riskLevel/checkUnit/components/selectMeasureControlDialog.vue | 219 ++ src/views/doublePrevent/hiddenManage/hiddenReport/components/reportDialog.vue | 469 ++++ src/views/intellectInspect/inspectBasic/inspectPoint/index.vue | 4 src/views/doublePrevent/riskLevel/action/index.vue | 43 src/views/doublePrevent/hiddenManage/hiddenReport/index.vue | 337 +++ src/views/doublePrevent/hiddenManage/hiddenRectify/index.vue | 260 ++ src/views/doublePrevent/riskLevel/check/index.vue | 195 + /dev/null | 269 -- src/views/doublePrevent/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue | 33 src/views/intellectInspect/inspectBasic/facility/index.vue | 4 src/views/doublePrevent/hiddenManage/hiddenRectify/components/rectifyDialog.vue | 232 ++ src/views/doublePrevent/riskLevel/device/index.vue | 4 src/views/homeMenu/homeMenu.vue | 7 src/App.vue | 29 src/api/doublePreventSystem/report/index.ts | 38 .prettierrc.js | 3 49 files changed, 5,523 insertions(+), 849 deletions(-) diff --git a/.env.development b/.env.development index 31d9c01..b1428e8 100644 --- a/.env.development +++ b/.env.development @@ -3,6 +3,5 @@ # 本地环境接口地址 #VITE_API_URL = 'http://192.168.0.35:8008' -VITE_API_URL = 'http://192.168.0.29:8008' - -#VITE_API_URL = 'http://192.168.0.69:8008' +#VITE_API_URL = 'http://192.168.0.29:8008' +VITE_API_URL = 'http://192.168.0.69:8008' diff --git a/.prettierrc.js b/.prettierrc.js index 4223d15..5a12c4d 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,6 +1,6 @@ module.exports = { // 一行最多多少个字符 - printWidth: 150, + printWidth: 1500, // 指定每个缩进级别的空格数 tabWidth: 4, // 使用制表符而不是空格缩进行 @@ -15,6 +15,7 @@ // jsxSingleQuote: false, // // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none trailingComma: 'none', + bracketSpacing: true, // 在对象文字中的括号之间打印空格 // bracketSpacing: true, // // jsx 标签的反尖括号需要换行 diff --git a/src/App.vue b/src/App.vue index e2f3598..5e39821 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,23 @@ <template> - <el-config-provider :size="getGlobalComponentSize" :locale="i18nLocale"> - <router-view v-show="themeConfig.lockScreenTime > 1" /> - <LockScreen v-if="themeConfig.isLockScreen" /> - <Setings ref="setingsRef" v-show="themeConfig.lockScreenTime > 1" /> - <CloseFull v-if="!themeConfig.isLockScreen" /> - </el-config-provider> + <!-- <transition name="fade" mode="out-in">--> + <!-- <keep-alive :exclude="excludeList">--> + <!-- <router-view v-if="!$route.meta.iskeepAlive" :key="$route.id"></router-view>--> + <!-- </keep-alive>--> + <!-- </transition>--> + <router-view v-if="!$route.meta.iskeepAlive" v-slot="{ Component }"> + <transition name="fade" mode="in-out"> + <keep-alive :exclude="excludeList" :include="includeList"> + <component :is="Component" :key="$route.id"></component> + </keep-alive> + </transition> + </router-view> + <!-- <el-config-provider :size="getGlobalComponentSize" :locale="i18nLocale">--> + <!-- <router-view v-show="themeConfig.lockScreenTime > 1" />--> + <!-- <router-view v-show="themeConfig.lockScreenTime > 1" />--> + <!-- <LockScreen v-if="themeConfig.isLockScreen" />--> + <!-- <Setings ref="setingsRef" v-show="themeConfig.lockScreenTime > 1" />--> + <!-- <CloseFull v-if="!themeConfig.isLockScreen" />--> + <!-- </el-config-provider>--> </template> <script lang="ts"> @@ -32,7 +45,9 @@ const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const state = reactive({ - i18nLocale: null + i18nLocale: null, + excludeList: ['a-e'], + includeList: [] }); // 获取全局组件大小 diff --git a/src/api/doublePreventSystem/check/index.ts b/src/api/doublePreventSystem/check/index.ts new file mode 100644 index 0000000..550ec9e --- /dev/null +++ b/src/api/doublePreventSystem/check/index.ts @@ -0,0 +1,45 @@ +import request from '/@/utils/request'; + +export function hiddenCheckApi() { + return { + // v1 + getHiddenCheckList: (data: object) => { + return request({ + url: `/prevent/dangerRectify/select/getDangerRectifyPage`, + method: 'post', + data: data + }); + }, + // v1 + addHiddenCheck: (data: object) => { + return request({ + url: `/prevent/dangerManage/select/saveDangerManage`, + method: 'post', + data: data + }); + }, + // v1 + modHiddenCheck: (data: object) => { + return request({ + url: `/prevent/dangerRectify/update/updateDangerRectify`, + method: 'post', + data: data + }); + }, + // v1 + deleteHiddenCheck: (data: object) => { + return request({ + url: `/prevent/dangerRectify/delete/deleteDangerRectify`, + method: 'post', + data: data + }); + }, + // v1 + getAllHiddenCheckList: () => { + return request({ + url: `/prevent/device/select/listDevices`, + method: 'post' + }); + } + }; +} diff --git a/src/api/doublePreventSystem/checkUnit/index.ts b/src/api/doublePreventSystem/checkUnit/index.ts new file mode 100644 index 0000000..8085f50 --- /dev/null +++ b/src/api/doublePreventSystem/checkUnit/index.ts @@ -0,0 +1,44 @@ +import request from '/@/utils/request'; + +export function checkUnitApi() { + return { + // v1 + getCheckUnitList: (data: object) => { + return request({ + url: `/prevent/taskUnit/select/getTaskUnitPage`, + method: 'post', + data: data + }); + }, + // v1 + addCheckUnit: (data: object) => { + return request({ + url: `/prevent/taskUnit/insert/saveTaskUnit`, + method: 'post', + data: data + }); + }, + // v1 + modCheckUnit: (data: object) => { + return request({ + url: `/prevent/taskUnit/update/updateTaskUnit`, + method: 'post', + data: data + }); + }, + // v1 + deleteCheckUnit: (data: object) => { + return request({ + url: `/prevent/taskUnit/delete/deleteTaskUnit`, + method: 'post', + data: data + }); + }, + getAllCheckUnitList: () => { + return request({ + url: `/prevent/taskUnit/select/listTaskUnit`, + method: 'post' + }); + } + }; +} diff --git a/src/api/doublePreventSystem/record/index.ts b/src/api/doublePreventSystem/record/index.ts new file mode 100644 index 0000000..551ffce --- /dev/null +++ b/src/api/doublePreventSystem/record/index.ts @@ -0,0 +1,32 @@ +import request from '/@/utils/request'; + +export function recordApi() { + return { + // v1 + getRecordList: (data: object) => { + return request({ + url: `/prevent/checkTask/select/getTaskPage`, + method: 'post', + data: data + }); + }, + + // v1 + submitRecord: (data: object) => { + return request({ + url: `/prevent/checkTask/update/updateTask`, + method: 'post', + data: data + }); + }, + + // v1 + deleteRecord: (data: object) => { + return request({ + url: `/prevent/checkWork/delete/deleteCheckWork`, + method: 'post', + data: data + }); + } + }; +} diff --git a/src/api/doublePreventSystem/rectify/index.ts b/src/api/doublePreventSystem/rectify/index.ts new file mode 100644 index 0000000..d9e054e --- /dev/null +++ b/src/api/doublePreventSystem/rectify/index.ts @@ -0,0 +1,45 @@ +import request from '/@/utils/request'; + +export function hiddenRectifyApi() { + return { + // v1 + getHiddenRectifyList: (data: object) => { + return request({ + url: `/prevent/dangerRectify/select/getDangerRectifyPage`, + method: 'post', + data: data + }); + }, + // v1 + submitHiddenRectify: (data: object) => { + return request({ + url: `/prevent/dangerRectify/update/applyReport`, + method: 'post', + data: data + }); + }, + // v1 + delayHiddenRectifyTime: (data: object) => { + return request({ + url: `/prevent/dangerRectify/update/timeOutRectify`, + method: 'post', + data: data + }); + }, + // v1 + deleteHiddenRectify: (data: object) => { + return request({ + url: `/prevent/dangerRectify/delete/deleteDangerRectify`, + method: 'post', + data: data + }); + }, + // v1 + getAllHiddenRectifyList: () => { + return request({ + url: `/prevent/device/select/listDevices`, + method: 'post' + }); + } + }; +} diff --git a/src/api/doublePreventSystem/report/index.ts b/src/api/doublePreventSystem/report/index.ts new file mode 100644 index 0000000..9d2f64f --- /dev/null +++ b/src/api/doublePreventSystem/report/index.ts @@ -0,0 +1,38 @@ +import request from '/@/utils/request'; + +export function hiddenReportApi() { + return { + // v1 + getHiddenReportList: (data: object) => { + return request({ + url: `/prevent/dangerManage/select/getDangerManagePage`, + method: 'post', + data: data + }); + }, + // v1 + addHiddenReport: (data: object) => { + return request({ + url: `/prevent/dangerManage/insert/saveDangerManage`, + method: 'post', + data: data + }); + }, + // v1 + modHiddenReport: (data: object) => { + return request({ + url: `/prevent/dangerManage/update/updateDangerManage`, + method: 'post', + data: data + }); + }, + // v1 + deleteHiddenReport: (data: object) => { + return request({ + url: `/prevent/dangerManage/delete/deleteDangerManage`, + method: 'post', + data: data + }); + } + }; +} diff --git a/src/api/doublePreventSystem/riskControlMeasure/index.ts b/src/api/doublePreventSystem/riskControlMeasure/index.ts index 01d190d..28f2311 100644 --- a/src/api/doublePreventSystem/riskControlMeasure/index.ts +++ b/src/api/doublePreventSystem/riskControlMeasure/index.ts @@ -34,6 +34,12 @@ data: data }); }, + getAllRiskControlMeasureList: () => { + return request({ + url: `/prevent/riskControlMeasure/select/listControlMeasure`, + method: 'post' + }); + }, getClassifyData: () => { return request({ url: `/prevent/riskControlMeasure/select/listMeasures`, diff --git a/src/api/doublePreventSystem/work/index.ts b/src/api/doublePreventSystem/work/index.ts new file mode 100644 index 0000000..73968ce --- /dev/null +++ b/src/api/doublePreventSystem/work/index.ts @@ -0,0 +1,38 @@ +import request from '/@/utils/request'; + +export function workApi() { + return { + // v1 + getWorkList: (data: object) => { + return request({ + url: `/prevent/checkWork/select/getCheckWorkPage`, + method: 'post', + data: data + }); + }, + // v1 + addWork: (data: object) => { + return request({ + url: `/prevent/checkWork/insert/saveCheckWork`, + method: 'post', + data: data + }); + }, + // v1 + modWork: (data: object) => { + return request({ + url: `/prevent/checkTask/update/updateCheckWork`, + method: 'post', + data: data + }); + }, + // v1 + deleteWork: (data: object) => { + return request({ + url: `/prevent/checkWork/delete/deleteCheckWork`, + method: 'post', + data: data + }); + } + }; +} diff --git a/src/api/user/index.ts b/src/api/user/index.ts index 8959ea7..1f8f991 100644 --- a/src/api/user/index.ts +++ b/src/api/user/index.ts @@ -29,7 +29,7 @@ // v1 getUserLByDepartment: (depId: number | null) => { return request({ - url: `/account/dep/list?depId=${depId}`, + url: `/account/dep/list?depId=${depId == null ? '' : depId}`, method: 'get' }); } diff --git a/src/assets/methods/index.ts b/src/assets/methods/index.ts new file mode 100644 index 0000000..42a8045 --- /dev/null +++ b/src/assets/methods/index.ts @@ -0,0 +1,15 @@ +import { userApi } from '/@/api/user'; +import { ElMessage } from 'element-plus'; + +export async function getUserByDepartment(value: number | null) { + let res = await userApi().getUserLByDepartment(value); + if (res.data.code === '200') { + return res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + return []; + } +} diff --git a/src/assets/style/index.scss b/src/assets/style/index.scss index f47c66b..22aad3b 100644 --- a/src/assets/style/index.scss +++ b/src/assets/style/index.scss @@ -1,6 +1,10 @@ .input-box{ width: 200px !important; padding-right: 10px; + padding-bottom: 10px; +} +.input-add{ + width: 90% !important; } .basic-line{ display: inline-block; diff --git a/src/router/route.ts b/src/router/route.ts index 9773b21..699646d 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -76,7 +76,8 @@ name: 'homeMenu', component: () => import('/@/views/homeMenu/homeMenu.vue'), meta: { - title: '登录' + title: '首页', + isKeepAlive: false } } ]; diff --git a/src/utils/request.ts b/src/utils/request.ts index f8844cb..cde3406 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import { ElMessage } from 'element-plus'; +import { ElMessage, ElMessageBox } from 'element-plus'; import { Session } from '/@/utils/storage'; import JSONbig from 'json-bigint'; @@ -14,6 +14,11 @@ service.interceptors.request.use( (config) => { // 在发送请求之前做些什么 token + // for (let key in config.data) { + // if (config.data[key] == null || config.data[key] === undefined) { + // delete config.data[key]; + // } + // } if (Session.get('token')) { (<any>config.headers).common['Authorization'] = `${Session.get('token')}`; (<any>config.headers).common['uid'] = `${Session.get('uid')}`; @@ -52,8 +57,10 @@ }, 2000); } else if (response.data.code && response.data.code === 'A0215') { ElMessage.error('token失效'); - Session.clear(); - window.location.href = '/'; + setTimeout(() => { + Session.clear(); + window.location.href = '/'; + }, 2000); } // if(response.data.code && response.data.code !== '200'){ return Promise.resolve(response); @@ -84,7 +91,7 @@ } else if (error.message == 'Network Error') { ElMessage.error('网络连接错误'); } else { - if (error.response.data) ElMessage.error(error.response.statusText); + if (error.response.data) ElMessage.error(error.response.data.error); else ElMessage.error('接口路径找不到'); } return Promise.reject(error); diff --git a/src/views/IntelligentXjSys/basicDataManagement/facilityArea/index.vue b/src/views/IntelligentXjSys/basicDataManagement/facilityArea/index.vue index 5c490e7..e8629be 100644 --- a/src/views/IntelligentXjSys/basicDataManagement/facilityArea/index.vue +++ b/src/views/IntelligentXjSys/basicDataManagement/facilityArea/index.vue @@ -1,375 +1,367 @@ <template> - <div class="home-container"> - <el-scrollbar height="100%"> - <el-row class="homeCard"> - <el-col :span="12"> - <div class="grid-content topInfo"> - <el-input v-model="searchName" placeholder="设施区域名称"></el-input> - <el-select v-model="searchPlace" placeholder="设施区域类型"> - <el-option label="设备" value="设备" /> - <el-option label="区域" value="区域" /> - </el-select> - <el-button type="primary">查询</el-button> - <el-button plain>重置</el-button> - </div> - </el-col> - </el-row> - <div class="homeCard"> - <div class="main-card"> - <el-row class="cardTop"> - <el-col :span="12" class="mainCardBtn"> - <el-button type="primary" :icon="Plus" size="default" @click="dialogAddRecord=true">新建</el-button> -<!-- <el-button type="warning" :icon="Edit" size="default" plain>修改</el-button>--> - <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button> - </el-col> - <el-button type="primary" :icon="Refresh" size="default"/> - </el-row> - <el-table - ref="multipleTableRef" - :data="tableData" - style="width: 100%" - :header-cell-style="{background: '#fafafa'}" - @selection-change="handleSelectionChange" - > - <el-table-column type="selection" width="55" /> - <el-table-column type="index" width="80" label="序号"/> - <el-table-column property="name" label="设施区域名称"/> - <el-table-column property="type" label="设施区域类型"/> - <el-table-column property="rfid" label="关联RFID"/> - <el-table-column property="creater" label="创建人"/> - <el-table-column property="createTime" label="创建时间" sortable/> - <el-table-column property="updater" label="更新人"/> - <el-table-column property="updateTime" label="更新时间" sortable/> - <el-table-column fixed="right" label="操作" align="center" width="250"> - <template #default="scope"> - <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> - <el-button link type="primary" size="small" :icon="Edit" @click="editRecord(scope.$index ,scope.row)">修改</el-button> - <el-button link type="danger" size="small" :icon="Delete" @click="deleteRecord(scope.$index)">删除</el-button> - </template> - </el-table-column> - </el-table> - </div> - <div class="pageBtn"> - <el-pagination - v-model:currentPage="currentPage" - v-model:page-size="pageSize" - :page-sizes="[10, 15]" - small=false - background - layout="total, sizes, prev, pager, next, jumper" - :total="100" - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - /> - </div> - </div> - </el-scrollbar> - <el-dialog v-model="dialogDetails" title="设施区域"> - <el-form :model="details" label-width="120px"> - <el-form-item label="设施区域名称"> - <el-input v-model="details.name" readonly/> - </el-form-item> - <el-form-item label="设施区域类型"> - <el-input v-model="details.type" readonly/> - </el-form-item> - <el-form-item label="关联RFID"> - <el-input v-model="details.rfid" type="textarea" readonly/> - </el-form-item> - <el-form-item label="创建人"> - <el-input v-model="details.creater" readonly/> - </el-form-item> - <el-form-item label="创建时间"> - <el-input v-model="details.createTime" readonly/> - </el-form-item> - <el-form-item label="更新人"> - <el-input v-model="details.updater" readonly/> - </el-form-item> - <el-form-item label="更新时间"> - <el-input v-model="details.updateTime" readonly/> - </el-form-item> - <el-form-item> - <el-button type="primary" @click="dialogDetails = false" size="default" v-throttle>确认</el-button> - </el-form-item> - </el-form> - </el-dialog> - <el-dialog v-model="dialogAddRecord" title="设施区域编辑" @close="closeAdd"> - <el-form :model="addRecord" label-width="120px" ref="addRef" :rules="addRules"> - <el-form-item label="设施区域名称" prop="name"> - <el-input - v-model="addRecord.name" - > - </el-input> - </el-form-item> - <el-form-item label="设施区域类型" prop="type"> - <el-select v-model="addRecord.type"> - <el-option label="设备" value="设备" /> - <el-option label="区域" value="区域" /> - </el-select> - </el-form-item> - <el-form-item label="关联RFID" prop="rfid"> - <el-select v-model="addRecord.rfid" multiple> - <el-option label="风机系统1标签" value="风机系统1标签" /> - <el-option label="风机系统2标签" value="风机系统2标签"/> - <el-option label="风机系统3标签" value="风机系统3标签"/> - <el-option label="A场所1标签" value="A场所1标签"/> - </el-select> - </el-form-item> - <el-form-item> - <el-button type="warning" @click="dialogAddRecord = false" size="default" plain>取消</el-button> - <el-button type="primary" @click="confirmAddRecord(addRef)" size="default" v-throttle>确认</el-button> - </el-form-item> - </el-form> - </el-dialog> - <el-dialog v-model="deleteDialog" title="提示" width="30%" center @close="indexClear"> - <span>您确定要删除该条记录吗?</span> - <template #footer> - <span class="dialog-footer"> - <el-button @click="deleteDialog = false" size="default">取消</el-button> - <el-button type="primary" @click="conFirmDelete" size="default" v-throttle>确认</el-button> - </span> - </template> - </el-dialog> - </div> + <div class="home-container"> + <el-scrollbar height="100%"> + <el-row class="homeCard"> + <el-col :span="12"> + <div class="grid-content topInfo"> + <el-input v-model="searchName" placeholder="设施区域名称"></el-input> + <el-select v-model="searchPlace" placeholder="设施区域类型"> + <el-option label="设备" value="设备" /> + <el-option label="区域" value="区域" /> + </el-select> + <el-button type="primary">查询</el-button> + <el-button plain>重置</el-button> + </div> + </el-col> + </el-row> + <div class="homeCard"> + <div class="main-card"> + <el-row class="cardTop"> + <el-col :span="12" class="mainCardBtn"> + <el-button type="primary" :icon="Plus" size="default" @click="dialogAddRecord = true">新建</el-button> + <!-- <el-button type="warning" :icon="Edit" size="default" plain>修改</el-button>--> + <el-button type="danger" :icon="Delete" size="default" plain>删除</el-button> + </el-col> + <el-button type="primary" :icon="Refresh" size="default" /> + </el-row> + <el-table + ref="multipleTableRef" + :data="tableData" + style="width: 100%" + :header-cell-style="{ background: '#fafafa' }" + @selection-change="handleSelectionChange" + > + <el-table-column type="selection" width="55" /> + <el-table-column type="index" width="80" label="序号" /> + <el-table-column property="name" label="设施区域名称" /> + <el-table-column property="type" label="设施区域类型" /> + <el-table-column property="rfid" label="关联RFID" /> + <el-table-column property="creater" label="创建人" /> + <el-table-column property="createTime" label="创建时间" sortable /> + <el-table-column property="updater" label="更新人" /> + <el-table-column property="updateTime" label="更新时间" sortable /> + <el-table-column fixed="right" label="操作" align="center" width="250"> + <template #default="scope"> + <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> + <el-button link type="primary" size="small" :icon="Edit" @click="editRecord(scope.$index, scope.row)">修改</el-button> + <el-button link type="danger" size="small" :icon="Delete" @click="deleteRecord(scope.$index)">删除</el-button> + </template> + </el-table-column> + </el-table> + </div> + <div class="pageBtn"> + <el-pagination + v-model:currentPage="currentPage" + v-model:page-size="pageSize" + :page-sizes="[10, 15]" + small="false" + background + layout="total, sizes, prev, pager, next, jumper" + :total="100" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + /> + </div> + </div> + </el-scrollbar> + <el-dialog v-model="dialogDetails" title="设施区域"> + <el-form :model="details" label-width="120px"> + <el-form-item label="设施区域名称"> + <el-input v-model="details.name" readonly /> + </el-form-item> + <el-form-item label="设施区域类型"> + <el-input v-model="details.type" readonly /> + </el-form-item> + <el-form-item label="关联RFID"> + <el-input v-model="details.rfid" type="textarea" readonly /> + </el-form-item> + <el-form-item label="创建人"> + <el-input v-model="details.creater" readonly /> + </el-form-item> + <el-form-item label="创建时间"> + <el-input v-model="details.createTime" readonly /> + </el-form-item> + <el-form-item label="更新人"> + <el-input v-model="details.updater" readonly /> + </el-form-item> + <el-form-item label="更新时间"> + <el-input v-model="details.updateTime" readonly /> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="dialogDetails = false" size="default" v-throttle>确认</el-button> + </el-form-item> + </el-form> + </el-dialog> + <el-dialog v-model="dialogAddRecord" title="设施区域编辑" @close="closeAdd"> + <el-form :model="addRecord" label-width="120px" ref="addRef" :rules="addRules"> + <el-form-item label="设施区域名称" prop="name"> + <el-input v-model="addRecord.name"> </el-input> + </el-form-item> + <el-form-item label="设施区域类型" prop="type"> + <el-select v-model="addRecord.type"> + <el-option label="设备" value="设备" /> + <el-option label="区域" value="区域" /> + </el-select> + </el-form-item> + <el-form-item label="关联RFID" prop="rfid"> + <el-select v-model="addRecord.rfid" multiple> + <el-option label="风机系统1标签" value="风机系统1标签" /> + <el-option label="风机系统2标签" value="风机系统2标签" /> + <el-option label="风机系统3标签" value="风机系统3标签" /> + <el-option label="A场所1标签" value="A场所1标签" /> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="warning" @click="dialogAddRecord = false" size="default" plain>取消</el-button> + <el-button type="primary" @click="confirmAddRecord(addRef)" size="default" v-throttle>确认</el-button> + </el-form-item> + </el-form> + </el-dialog> + <el-dialog v-model="deleteDialog" title="提示" width="30%" center @close="indexClear"> + <span>您确定要删除该条记录吗?</span> + <template #footer> + <span class="dialog-footer"> + <el-button @click="deleteDialog = false" size="default">取消</el-button> + <el-button type="primary" @click="conFirmDelete" size="default" v-throttle>确认</el-button> + </span> + </template> + </el-dialog> + </div> </template> <script lang="ts" setup> - import { toRefs, reactive, ref } from 'vue'; - import { storeToRefs } from 'pinia'; - import { initBackEndControlRoutes } from '/@/router/backEnd'; - import {useUserInfo} from "/@/stores/userInfo"; - import { Session } from '/@/utils/storage'; - import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue' - import { ElTable } from 'element-plus' - import { FormInstance, FormRules } from 'element-plus' - let global: any = { - homeChartOne: null, - homeChartTwo: null, - homeCharThree: null, - dispose: [null, '', undefined], - }; +import { toRefs, reactive, ref } from 'vue'; +import { storeToRefs } from 'pinia'; +import { initBackEndControlRoutes } from '/@/router/backEnd'; +import { useUserInfo } from '/@/stores/userInfo'; +import { Session } from '/@/utils/storage'; +import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue'; +import { ElTable } from 'element-plus'; +import { FormInstance, FormRules } from 'element-plus'; +let global: any = { + homeChartOne: null, + homeChartTwo: null, + homeCharThree: null, + dispose: [null, '', undefined] +}; - interface stateType { - homeOne: Array <type> - } - interface type { - - } - // export default defineComponent({ - // name: 'workCheckinRecord', - // setup() { - const userInfo = useUserInfo() - const { userInfos } = storeToRefs(userInfo); - const searchName = ref('') - const searchPlace = ref('') - const currentPage = ref(1) - const pageSize = ref(10) - const chosenIndex = ref(-1) - const casProps = { - expandTrigger: 'hover', - multiple: true, - emitPath: false, - checkStrictly: false - } - const handleSizeChange = (val: number) => { - console.log(`${val} items per page`) - } - const handleCurrentChange = (val: number) => { - console.log(`current page: ${val}`) - } - // 时间格式化 - const timeForm = { - hour12: false, - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - second: '2-digit' - } - const tableData = reactive( - [ - { - name: '风机系统', - type: '设备', - rfid: ['风机系统1标签','风机系统2标签'], - creater: '张三', - createTime: '2022-07-14 12:23:03', - updater: '李四', - updateTime: '2022-07-16 14:23:03' - }, - { - name: 'A场所', - type: '区域', - rfid: ['A场所1标签'], - creater: '李四', - createTime: '2022-07-16 12:23:03', - updater: '张三', - updateTime: '2022-07-18 14:23:03' - } - ] - ) - const addRef = ref<FormInstance>() - const addRules = reactive<FormRules>({ - name:[{required: true, message: '该内容不能为空',trigger:'blur'}], - type:[{required: true, message: '该内容不能为空',trigger:'blur'}], - rfid:[{required: true, message: '该内容不能为空',trigger:'blur'}] - }) - const dialogDetails = ref(false) - const dialogAddRecord = ref(false) - const deleteDialog = ref(false) - const addRecord = ref({}) - const details = ref({}) - const viewRecord = (row) =>{ - details.value = JSON.parse(JSON.stringify(row)) - dialogDetails.value = true - } - const deleteRecord = (index) =>{ - chosenIndex.value = index - deleteDialog.value = true - } - const conFirmDelete = ()=> { - tableData.splice(chosenIndex.value,1) - deleteDialog.value = false - } - const confirmAddRecord = async (formEl: FormInstance | undefined) =>{ - if (!formEl) return - await formEl.validate((valid, fields) => { - if (valid) { - if(chosenIndex.value == -1){ - addRecord.value.createTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-') - addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-') - tableData.unshift(addRecord.value) - }else{ - addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-') - tableData[chosenIndex.value] = addRecord.value - } - dialogAddRecord.value =false - } else { - console.log('error submit!', fields) - } - }) - - } - const closeAdd =()=>{ - addRecord.value={} - chosenIndex.value = -1 - } - const indexClear = ()=>{ - chosenIndex.value = -1 - } - const editRecord =(index, row)=>{ - dialogAddRecord.value = true - chosenIndex.value = index - addRecord.value = JSON.parse(JSON.stringify(row)) - } - // 折线图 - const renderMenu = async (value: string) => { - Session.set('projectId',value) - userInfos.value.projectId = value - await initBackEndControlRoutes(); - }; - // return { - // renderMenu, - // multipleTableRef, - // tableData, - // currentPage, - // pageSize, - // dialogDetails, - // details, - // deleteDialog, - // dialogAddRecord, - // viewRecord, - // deleteRecord, - // handleSizeChange, - // handleCurrentChange, - // Plus, - // Edit, - // Delete, - // Search, - // Download, - // handleSelectionChange, - // Refresh, - // ...toRefs(state), - // }; - // }, - // }); +interface stateType { + homeOne: Array<type>; +} +interface type {} +// export default defineComponent({ +// name: 'workCheckinRecord', +// setup() { +const userInfo = useUserInfo(); +const { userInfos } = storeToRefs(userInfo); +const searchName = ref(''); +const searchPlace = ref(''); +const currentPage = ref(1); +const pageSize = ref(10); +const chosenIndex = ref(-1); +const casProps = { + expandTrigger: 'hover', + multiple: true, + emitPath: false, + checkStrictly: false +}; +const handleSizeChange = (val: number) => { + console.log(`${val} items per page`); +}; +const handleCurrentChange = (val: number) => { + console.log(`current page: ${val}`); +}; +// 时间格式化 +const timeForm = { + hour12: false, + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit' +}; +const tableData = reactive([ + { + name: '风机系统', + type: '设备', + rfid: ['风机系统1标签', '风机系统2标签'], + creater: '张三', + createTime: '2022-07-14 12:23:03', + updater: '李四', + updateTime: '2022-07-16 14:23:03' + }, + { + name: 'A场所', + type: '区域', + rfid: ['A场所1标签'], + creater: '李四', + createTime: '2022-07-16 12:23:03', + updater: '张三', + updateTime: '2022-07-18 14:23:03' + } +]); +const addRef = ref<FormInstance>(); +const addRules = reactive<FormRules>({ + name: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], + type: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], + rfid: [{ required: true, message: '该内容不能为空', trigger: 'blur' }] +}); +const dialogDetails = ref(false); +const dialogAddRecord = ref(false); +const deleteDialog = ref(false); +const addRecord = ref({}); +const details = ref({}); +const viewRecord = (row) => { + details.value = JSON.parse(JSON.stringify(row)); + dialogDetails.value = true; +}; +const deleteRecord = (index) => { + chosenIndex.value = index; + deleteDialog.value = true; +}; +const conFirmDelete = () => { + tableData.splice(chosenIndex.value, 1); + deleteDialog.value = false; +}; +const confirmAddRecord = async (formEl: FormInstance | undefined) => { + if (!formEl) return; + await formEl.validate((valid, fields) => { + if (valid) { + if (chosenIndex.value == -1) { + addRecord.value.createTime = new Date().toLocaleString('zh', timeForm).replace(/\//g, '-'); + addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g, '-'); + tableData.unshift(addRecord.value); + } else { + addRecord.value.updateTime = new Date().toLocaleString('zh', timeForm).replace(/\//g, '-'); + tableData[chosenIndex.value] = addRecord.value; + } + dialogAddRecord.value = false; + } else { + console.log('error submit!', fields); + } + }); +}; +const closeAdd = () => { + addRecord.value = {}; + chosenIndex.value = -1; +}; +const indexClear = () => { + chosenIndex.value = -1; +}; +const editRecord = (index, row) => { + dialogAddRecord.value = true; + chosenIndex.value = index; + addRecord.value = JSON.parse(JSON.stringify(row)); +}; +// 折线图 +const renderMenu = async (value: string) => { + Session.set('projectId', value); + userInfos.value.projectId = value; + await initBackEndControlRoutes(); +}; +// return { +// renderMenu, +// multipleTableRef, +// tableData, +// currentPage, +// pageSize, +// dialogDetails, +// details, +// deleteDialog, +// dialogAddRecord, +// viewRecord, +// deleteRecord, +// handleSizeChange, +// handleCurrentChange, +// Plus, +// Edit, +// Delete, +// Search, +// Download, +// handleSelectionChange, +// Refresh, +// ...toRefs(state), +// }; +// }, +// }); </script> <style scoped lang="scss"> - $homeNavLengh: 8; - .home-container { - height: 100%; - overflow: hidden; - padding: 20px; - .homeCard{ - width: 100%; - padding: 20px; - background: #fff; - border-radius: 4px; - } - .el-row{ - display: flex; - align-items: center; - margin-bottom: 20px; - &:last-child { - margin-bottom: 0; - } - .grid-content{ - align-items: center; - min-height: 36px; - } +$homeNavLengh: 8; +.home-container { + height: 100%; + overflow: hidden; + padding: 20px; + .homeCard { + width: 100%; + padding: 20px; + background: #fff; + border-radius: 4px; + } + .el-row { + display: flex; + align-items: center; + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + .grid-content { + align-items: center; + min-height: 36px; + } - .topInfo { - display: flex; - align-items: center; - font-size: 16px; - font-weight: bold; + .topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; - &>div{ - white-space: nowrap; - margin-right: 20px; - } - } - } - .mainPages{ - height: 100%; - display: flex; - flex-direction: column; - justify-content: space-between; - } - .main-card{ - width: 100%; - .cardTop{ - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 20px; - .mainCardBtn{ - margin: 0; - } - } - } - .pageBtn{ - display: flex; - align-items: center; - justify-content: right; - margin-top: 20px; + & > div { + white-space: nowrap; + margin-right: 20px; + } + } + } + .mainPages { + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + } + .main-card { + width: 100%; + .cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + .mainCardBtn { + margin: 0; + } + } + } + .pageBtn { + display: flex; + align-items: center; + justify-content: right; + margin-top: 20px; - .demo-pagination-block + .demo-pagination-block { - margin-top: 10px; - } - .demo-pagination-block .demonstration { - margin-bottom: 16px; - } - } - } - .el-input{ - width: 100% !important; - } - .el-date-editor::v-deep{ - width: 100%; - } - .el-select{ - width: 100%; - } + .demo-pagination-block + .demo-pagination-block { + margin-top: 10px; + } + .demo-pagination-block .demonstration { + margin-bottom: 16px; + } + } +} +.el-input { + width: 100% !important; +} +.el-date-editor::v-deep { + width: 100%; +} +.el-select { + width: 100%; +} </style> diff --git a/src/views/doublePrevent/checkTaskManage/record/components/recordDialog.vue b/src/views/doublePrevent/checkTaskManage/record/components/recordDialog.vue new file mode 100644 index 0000000..dbc1d8d --- /dev/null +++ b/src/views/doublePrevent/checkTaskManage/record/components/recordDialog.vue @@ -0,0 +1,308 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowWorkDialog" append-to-body :close-on-click-modal="false" width="50%"> + <div class="work-form"> + <el-form :model="workForm" :rules="workFormRules" ref="workFormRef" size="default" label-width="150px"> + <el-row :gutter="35"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="排查类型" prop="checkWorkType"> + <el-select class="input-add" v-model="workForm.checkWorkType" placeholder="请输入排查类型" clearable> + <el-option v-for="item in checkWorkTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option + ></el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="排查名称" prop="checkWorkName"> + <el-input class="input-add" v-model.trim="workForm.checkWorkName" placeholder="请输入排查名称" clearable></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改部门" prop="depId"> + <el-cascader + @change="achieveUserList" + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-add" + v-model="workForm.depId" + > + </el-cascader> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="执行人" prop="execUserId"> + <el-select class="input-add" v-model="workForm.execUserId" placeholder="请输入执行人" clearable filterable> + <el-option v-for="item in userList" :key="item.uid" :label="item.username" :value="item.uid"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="排查周期" prop="checkCycle"> + <el-input + class="input-add" + type="number" + v-model.trim="workForm.checkCycle" + placeholder="请输入排查周期" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="时间单位" prop="checkCycleUnit"> + <el-select class="input-add" v-model="workForm.checkCycleUnit" placeholder="请输入时间单位" clearable> + <el-option v-for="item in timeType" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="有效时间" prop="validTime"> + <el-input + class="input-add" + type="number" + v-model.trim="workForm.validTime" + placeholder="请输入有效时间" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="时间单位" prop="validTimeUnit"> + <el-select class="input-add" v-model="workForm.validTimeUnit" placeholder="请输入时间单位" clearable> + <el-option v-for="item in timeType" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="提醒时间" prop="noticeTime"> + <el-input + class="input-add" + type="number" + v-model.trim="workForm.noticeTime" + placeholder="请输入提醒时间" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="时间单位" prop="noticeTimeUnit"> + <el-select class="input-add" v-model="workForm.noticeTimeUnit" placeholder="请输入时间单位" clearable> + <el-option v-for="item in timeType" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="任务单元" prop="taskUnitId"> + <el-select class="input-add" v-model="workForm.taskUnitId" placeholder="请输入任务单元" clearable filterable> + <el-option v-for="item in taskUnitList" :key="item.id" :label="item.taskUnitName" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="首次任务开始时间" prop="firstStartTime"> + <el-date-picker + class="input-add" + type="datetime" + value-format="YYYY-MM-DD HH:mm:ss" + v-model="workForm.firstStartTime" + placeholder="请选择首次任务开始时间" + clearable + ></el-date-picker> + </el-form-item> + </el-col> + </el-row> + </el-form> + </div> + + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowWorkDialog = !isShowWorkDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitWork" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script lang="ts"> +import { getUserByDepartment } from '/@/assets/methods'; + +interface stateType { + isShowWorkDialog: Boolean; + workForm: { + checkWorkType: number | null; + checkWorkName: string | null; + taskUnitId: number | null; + execUserId: number | null; + checkCycle: number | null; + checkCycleUnit: number | null; + validTime: number | null; + validTimeUnit: number | null; + noticeTime: number | null; + noticeTimeUnit: number | null; + depId: number | null; + firstStartTime: string | null; + }; + title: string; + activeName: string; + checkWorkTypeList: []; + departmentList: []; + taskUnitList: []; + userList: []; + timeType: Array<timeState>; + workFormRules: {}; +} +interface timeState { + id: number; + name: string; +} +import { reactive, toRefs, ref } from 'vue'; +import { workApi } from '/@/api/doublePreventSystem/work'; +import { ElMessage } from 'element-plus'; +export default { + name: 'workDialog', + setup(props: any, context: any) { + const workFormRef = ref(); + const state = reactive<stateType>({ + title: '', + activeName: 'inspectionPoint', + checkWorkTypeList: [], + departmentList: [], + taskUnitList: [], + userList: [], + timeType: [ + { id: 2, name: '小时' }, + { id: 3, name: '日' }, + { id: 4, name: '月' }, + { id: 5, name: '年' } + ], + isShowWorkDialog: false, + workForm: { + checkWorkType: null, + checkWorkName: null, + taskUnitId: null, + execUserId: null, + checkCycle: null, + checkCycleUnit: null, + validTime: null, + validTimeUnit: null, + noticeTime: null, + noticeTimeUnit: null, + firstStartTime: null, + depId: null + }, + workFormRules: { + produceDeviceName: [{ required: true, message: '请填写生产装置名称', trigger: 'blur' }], + depId: [{ required: true, message: '请选择部门', trigger: 'change' }], + riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], + location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] + } + }); + + //打开模态框 + const openWorkDialog = (type: string, value: object, department: [], checkWorkTypeList: [], taskUnitList: []) => { + state.isShowWorkDialog = true; + state.departmentList = department; + state.taskUnitList = JSON.parse(JSON.stringify(taskUnitList)); + state.checkWorkTypeList = JSON.parse(JSON.stringify(checkWorkTypeList)); + setTimeout(() => { + workFormRef.value.clearValidate(); + }); + if (type === '新增') { + state.title = '新增生产装置'; + state.workForm = { + checkWorkType: null, + checkWorkName: null, + taskUnitId: null, + execUserId: null, + checkCycle: null, + checkCycleUnit: null, + validTime: null, + validTimeUnit: null, + noticeTime: null, + noticeTimeUnit: null, + firstStartTime: null, + depId: null + }; + } else { + state.title = '修改生产装置'; + state.workForm = JSON.parse(JSON.stringify(value)); + } + }; + + //新增修改提交 + const submitWork = async () => { + workFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + if (state.title === '新增生产装置') { + let res = await workApi().addWork(state.workForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '生产装置新增成功', + duration: 2000 + }); + state.isShowWorkDialog = false; + context.emit('refreshWork'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await workApi().modWork(state.workForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '生产装置修改成功', + duration: 2000 + }); + state.isShowWorkDialog = false; + context.emit('refreshWork'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + const achieveUserList = async () => { + state.workForm.execUserId = null; + const user: unknown = await getUserByDepartment(state.workForm.depId); + state.userList = user as []; + }; + + return { + ...toRefs(state), + workFormRef, + submitWork, + openWorkDialog, + achieveUserList + }; + } +}; +</script> + +<style scoped> +::v-deep.el-divider--horizontal { + margin-top: 0px !important; +} + +::v-deep.el-dialog__body { + padding-top: 10px !important; +} +.filter-container { + padding: 10px 0px; +} +</style> diff --git a/src/views/doublePrevent/checkTaskManage/record/index.vue b/src/views/doublePrevent/checkTaskManage/record/index.vue new file mode 100644 index 0000000..2949041 --- /dev/null +++ b/src/views/doublePrevent/checkTaskManage/record/index.vue @@ -0,0 +1,260 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>排查结果:</span> + <el-select class="input-box" v-model="recordData.params.result" placeholder="排查结果" filterable clearable> + <el-option v-for="item in resultList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>排查任务状态:</span> + <el-select class="input-box" v-model="recordData.params.taskStatus" placeholder="排查任务状态" filterable clearable> + <el-option v-for="item in taskStatusList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>任务类型:</span> + <el-select class="input-box" v-model="recordData.params.taskType" placeholder="任务类型" filterable clearable> + <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + <el-table :data="recordData.data" style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="checkRecordName" label="排查名称" show-overflow-tooltip></el-table-column> + <el-table-column prop="checkRecordType" label="排查类型" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.checkRecordType, '排查类型') }} + </template> + </el-table-column> + <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip></el-table-column> + <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column> + <el-table-column prop="status" label="状态" show-overflow-tooltip> </el-table-column> + <el-table-column prop="createUserName" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column label="操作" width="150"> + <template #default="scope"> + <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> + <el-button size="small" text type="danger" @click="onDelrecord(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="recordData.params.pageIndex" + background + v-model:page-size="recordData.params.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="recordData.total" + class="page-position" + > + </el-pagination> + <br /> + <br /> + </el-card> + <recordDialog ref="recordDialogRef" @refreshrecord="initRecordTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import recordDialog from './components/recordDialog.vue'; +import { recordApi } from '/@/api/doublePreventSystem/record/index.ts'; +import { departmentApi } from '/@/api/department'; +import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit'; + +// 定义接口来定义对象的类型 +interface TableData { + roleName: string; + roleSign: string; + describe: string; + sort: number; + status: boolean; + createTime: string; +} +interface TableDataState { + recordData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + result: number | null; + taskStatus: number | null; + taskType: number | null; + }; + }; + taskUnitList: []; + departmentList: Array<DepartmentState>; + resultList: Array<levelListState>; + taskStatusList: Array<levelListState>; + taskTypeList: Array<levelListState>; +} +interface levelListState { + id: number; + name: string; +} +interface DepartmentState {} + +export default defineComponent({ + name: 'record', + components: { recordDialog }, + setup() { + const recordDialogRef = ref(); + const state = reactive<TableDataState>({ + recordData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + result: null, + taskStatus: null, + taskType: null + } + }, + taskUnitList: [], + departmentList: [], + resultList: [ + { id: 1, name: '正常' }, + { id: 2, name: '存在隐患' }, + { id: 3, name: '未排查' }, + { id: 4, name: '其他' } + ], + taskStatusList: [ + { id: 1, name: '待排查' }, + { id: 2, name: '已完成' }, + { id: 3, name: '超时未排查' }, + { id: 4, name: '排查中' } + ], + taskTypeList: [ + { id: 1, name: '周期任务' }, + { id: 2, name: '日常任务' } + ] + }); + // 初始化表格数据 + const initRecordTableData = async () => { + let res = await recordApi().getRecordList(state.recordData.params); + if (res.data.code === '200') { + state.recordData.data = res.data.data; + state.recordData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取部门列表 + const getDepartmentData = async () => { + let res = await departmentApi().getDepartmentList(); + if (res.data.code === '200') { + state.departmentList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + const getCheckUnitData = async () => { + let res = await checkUnitApi().getAllCheckUnitList(); + if (res.data.code === '200') { + state.taskUnitList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开生产装置弹窗 + const onOpenDialogRef = (type: string, value: any) => { + recordDialogRef.value.openRecordDialog(type, value, state.departmentList, state.checkRecordTypeList, state.taskUnitList); + }; + // 删除角色 + const onDelRecord = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await recordApi().deleterecord({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initRecordTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const parseNumber = (value: string | number, type: string) => {}; + + const handleSearch = () => { + initRecordTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.recordData.params.pageSize = val; + initRecordTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.recordData.params.pageIndex = val; + initRecordTableData(); + }; + // 页面加载时 + onMounted(() => { + initRecordTableData(); + getCheckUnitData(); + getDepartmentData(); + }); + + return { + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelRecord, + parseNumber, + onHandleCurrentChange, + recordDialog, + recordDialogRef, + initRecordTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/checkTaskManage/work/components/workDialog.vue b/src/views/doublePrevent/checkTaskManage/work/components/workDialog.vue new file mode 100644 index 0000000..88584e4 --- /dev/null +++ b/src/views/doublePrevent/checkTaskManage/work/components/workDialog.vue @@ -0,0 +1,309 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowWorkDialog" append-to-body :close-on-click-modal="false" width="50%"> + <div class="work-form"> + <el-form :model="workForm" :rules="workFormRules" ref="workFormRef" size="default" label-width="150px"> + <el-row :gutter="35"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="排查类型" prop="checkWorkType"> + <el-select class="input-add" v-model="workForm.checkWorkType" placeholder="请输入排查类型" clearable> + <el-option v-for="item in checkWorkTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option + ></el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="排查名称" prop="checkWorkName"> + <el-input class="input-add" v-model.trim="workForm.checkWorkName" placeholder="请输入排查名称" clearable></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改部门" prop="depId"> + <el-cascader + @change="achieveUserList" + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-add" + v-model="workForm.depId" + > + </el-cascader> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="执行人" prop="execUserId"> + <el-select class="input-add" v-model="workForm.execUserId" placeholder="请输入执行人" clearable filterable> + <el-option v-for="item in userList" :key="item.uid" :label="item.username" :value="item.uid"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="排查周期" prop="checkCycle"> + <el-input + class="input-add" + type="number" + v-model.trim="workForm.checkCycle" + placeholder="请输入排查周期" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="时间单位" prop="checkCycleUnit"> + <el-select class="input-add" v-model="workForm.checkCycleUnit" placeholder="请输入时间单位" clearable> + <el-option v-for="item in timeType" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="有效时间" prop="validTime"> + <el-input + class="input-add" + type="number" + v-model.trim="workForm.validTime" + placeholder="请输入有效时间" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="时间单位" prop="validTimeUnit"> + <el-select class="input-add" v-model="workForm.validTimeUnit" placeholder="请输入时间单位" clearable> + <el-option v-for="item in timeType" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="提醒时间" prop="noticeTime"> + <el-input + class="input-add" + type="number" + v-model.trim="workForm.noticeTime" + placeholder="请输入提醒时间" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="时间单位" prop="noticeTimeUnit"> + <el-select class="input-add" v-model="workForm.noticeTimeUnit" placeholder="请输入时间单位" clearable> + <el-option v-for="item in timeType" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="任务单元" prop="taskUnitId"> + <el-select class="input-add" v-model="workForm.taskUnitId" placeholder="请输入任务单元" clearable filterable> + <el-option v-for="item in taskUnitList" :key="item.id" :label="item.taskUnitName" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="首次任务开始时间" prop="firstStartTime"> + <el-date-picker + class="input-add" + type="datetime" + value-format="YYYY-MM-DD HH:mm:ss" + v-model="workForm.firstStartTime" + placeholder="请选择首次任务开始时间" + clearable + ></el-date-picker> + </el-form-item> + </el-col> + </el-row> + </el-form> + </div> + + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowWorkDialog = !isShowWorkDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitWork" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script lang="ts"> +import { getUserByDepartment } from '/@/assets/methods'; + +interface stateType { + isShowWorkDialog: Boolean; + workForm: { + checkWorkType: number | null; + checkWorkName: string | null; + taskUnitId: number | null; + execUserId: number | null; + checkCycle: number | null; + checkCycleUnit: number | null; + validTime: number | null; + validTimeUnit: number | null; + noticeTime: number | null; + noticeTimeUnit: number | null; + depId: number | null; + firstStartTime: string | null; + }; + title: string; + activeName: string; + checkWorkTypeList: []; + departmentList: []; + taskUnitList: []; + userList: []; + timeType: Array<timeState>; + workFormRules: {}; +} +interface timeState { + id: number; + name: string; +} +import { reactive, toRefs, ref } from 'vue'; +import { workApi } from '/@/api/doublePreventSystem/work'; +import { ElMessage } from 'element-plus'; +export default { + name: 'workDialog', + setup(props: any, context: any) { + const workFormRef = ref(); + const state = reactive<stateType>({ + title: '', + activeName: 'inspectionPoint', + checkWorkTypeList: [], + departmentList: [], + taskUnitList: [], + userList: [], + timeType: [ + { id: 1, name: '分' }, + { id: 2, name: '小时' }, + { id: 3, name: '日' }, + { id: 4, name: '月' }, + { id: 5, name: '年' } + ], + isShowWorkDialog: false, + workForm: { + checkWorkType: null, + checkWorkName: null, + taskUnitId: null, + execUserId: null, + checkCycle: null, + checkCycleUnit: null, + validTime: null, + validTimeUnit: null, + noticeTime: null, + noticeTimeUnit: null, + firstStartTime: null, + depId: null + }, + workFormRules: { + produceDeviceName: [{ required: true, message: '请填写生产装置名称', trigger: 'blur' }], + depId: [{ required: true, message: '请选择部门', trigger: 'change' }], + riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], + location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] + } + }); + + //打开模态框 + const openWorkDialog = (type: string, value: object, department: [], checkWorkTypeList: [], taskUnitList: []) => { + state.isShowWorkDialog = true; + state.departmentList = department; + state.taskUnitList = JSON.parse(JSON.stringify(taskUnitList)); + state.checkWorkTypeList = JSON.parse(JSON.stringify(checkWorkTypeList)); + setTimeout(() => { + workFormRef.value.clearValidate(); + }); + if (type === '新增') { + state.title = '新增生产装置'; + state.workForm = { + checkWorkType: null, + checkWorkName: null, + taskUnitId: null, + execUserId: null, + checkCycle: null, + checkCycleUnit: null, + validTime: null, + validTimeUnit: null, + noticeTime: null, + noticeTimeUnit: null, + firstStartTime: null, + depId: null + }; + } else { + state.title = '修改生产装置'; + state.workForm = JSON.parse(JSON.stringify(value)); + } + }; + + //新增修改提交 + const submitWork = async () => { + workFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + if (state.title === '新增生产装置') { + let res = await workApi().addWork(state.workForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '生产装置新增成功', + duration: 2000 + }); + state.isShowWorkDialog = false; + context.emit('refreshWork'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await workApi().modWork(state.workForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '生产装置修改成功', + duration: 2000 + }); + state.isShowWorkDialog = false; + context.emit('refreshWork'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + const achieveUserList = async () => { + state.workForm.execUserId = null; + const user: unknown = await getUserByDepartment(state.workForm.depId); + state.userList = user as []; + }; + + return { + ...toRefs(state), + workFormRef, + submitWork, + openWorkDialog, + achieveUserList + }; + } +}; +</script> + +<style scoped> +::v-deep.el-divider--horizontal { + margin-top: 0px !important; +} + +::v-deep.el-dialog__body { + padding-top: 10px !important; +} +.filter-container { + padding: 10px 0px; +} +</style> diff --git a/src/views/doublePrevent/checkTaskManage/work/index.vue b/src/views/doublePrevent/checkTaskManage/work/index.vue new file mode 100644 index 0000000..9b936c8 --- /dev/null +++ b/src/views/doublePrevent/checkTaskManage/work/index.vue @@ -0,0 +1,254 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>排查作业类型:</span> + <el-select class="input-box" v-model="workData.params.checkWorkType" placeholder="排查作业类型" filterable clearable> + <el-option v-for="item in checkWorkTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>排查作业状态:</span> + <el-select class="input-box" v-model="workData.params.checkWorkStatus" placeholder="排查作业状态" filterable clearable> + <el-option v-for="item in checkWorkStatusList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>排查作业名称:</span> + <el-input class="input-box" v-model="workData.params.checkWorkName" placeholder="排查作业名称" clearable> </el-input> + </div> + + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增排查任务 + </el-button> + </div> + <el-table :data="workData.data" style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="checkWorkName" label="排查名称" show-overflow-tooltip></el-table-column> + <el-table-column prop="checkWorkType" label="排查类型" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.checkWorkType, '排查类型') }} + </template> + </el-table-column> + <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip></el-table-column> + <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column> + <el-table-column prop="status" label="状态" show-overflow-tooltip> </el-table-column> + <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column label="操作" width="150"> + <template #default="scope"> + <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> + <el-button size="small" text type="danger" @click="onDelWork(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="workData.params.pageIndex" + background + v-model:page-size="workData.params.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="workData.total" + class="page-position" + > + </el-pagination> + <br /> + <br /> + </el-card> + <workDialog ref="workDialogRef" @refreshWork="initWorkTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import workDialog from './components/workDialog.vue'; +import { workApi } from '/@/api/doublePreventSystem/work/index.ts'; +import { departmentApi } from '/@/api/department'; +import { userApi } from '/@/api/user'; +import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit'; + +// 定义接口来定义对象的类型 +interface TableData { + roleName: string; + roleSign: string; + describe: string; + sort: number; + status: boolean; + createTime: string; +} +interface TableDataState { + workData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + checkWorkType: number | null; + checkWorkStatus: number | null; + checkWorkName: string | null; + }; + }; + taskUnitList: []; + departmentList: Array<DepartmentState>; + checkWorkTypeList: Array<levelListState>; + checkWorkStatusList: Array<levelListState>; +} +interface levelListState {} +interface DepartmentState {} + +export default defineComponent({ + name: 'work', + components: { workDialog }, + setup() { + const workDialogRef = ref(); + const state = reactive<TableDataState>({ + workData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + checkWorkType: null, + checkWorkStatus: null, + checkWorkName: null + } + }, + taskUnitList: [], + departmentList: [], + checkWorkTypeList: [ + { id: 1, name: '日常作业' }, + { id: 2, name: '周期作业' } + ], + checkWorkStatusList: [ + { id: 1, name: '开启' }, + { id: 2, name: '关闭' }, + { id: 2, name: '过期' } + ] + }); + // 初始化表格数据 + const initWorkTableData = async () => { + let res = await workApi().getWorkList(state.workData.params); + if (res.data.code === '200') { + state.workData.data = res.data.data; + state.workData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取部门列表 + const getDepartmentData = async () => { + let res = await departmentApi().getDepartmentList(); + if (res.data.code === '200') { + state.departmentList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + const getCheckUnitData = async () => { + let res = await checkUnitApi().getAllCheckUnitList(); + if (res.data.code === '200') { + state.taskUnitList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开生产装置弹窗 + const onOpenDialogRef = (type: string, value: any) => { + workDialogRef.value.openWorkDialog(type, value, state.departmentList, state.checkWorkTypeList, state.taskUnitList); + }; + // 删除角色 + const onDelWork = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await workApi().deleteWork({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initWorkTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const parseNumber = (value: string | number, type: string) => {}; + + const handleSearch = () => { + initWorkTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.workData.params.pageSize = val; + initWorkTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.workData.params.pageIndex = val; + initWorkTableData(); + }; + // 页面加载时 + onMounted(() => { + initWorkTableData(); + getCheckUnitData(); + getDepartmentData(); + }); + + return { + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelWork, + parseNumber, + onHandleCurrentChange, + workDialog, + workDialogRef, + initWorkTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/hiddenInvestigate/hiddenReport/index.vue b/src/views/doublePrevent/hiddenInvestigate/checkTaskManage/record/index.vue similarity index 78% rename from src/views/doublePrevent/hiddenInvestigate/hiddenReport/index.vue rename to src/views/doublePrevent/hiddenInvestigate/checkTaskManage/record/index.vue index bee723e..403aab3 100644 --- a/src/views/doublePrevent/hiddenInvestigate/hiddenReport/index.vue +++ b/src/views/doublePrevent/hiddenInvestigate/checkTaskManage/record/index.vue @@ -1,5 +1,5 @@ <template> - <div>11223</div> + <div>排查记录</div> </template> <script> diff --git a/src/views/doublePrevent/inspect/inspectTask/components/inspectionTaskDialog.vue b/src/views/doublePrevent/hiddenInvestigate/checkTaskManage/work/components/inspectionTaskDialog.vue similarity index 100% copy from src/views/doublePrevent/inspect/inspectTask/components/inspectionTaskDialog.vue copy to src/views/doublePrevent/hiddenInvestigate/checkTaskManage/work/components/inspectionTaskDialog.vue diff --git a/src/views/doublePrevent/inspect/inspectTask/index.vue b/src/views/doublePrevent/hiddenInvestigate/checkTaskManage/work/index.vue similarity index 100% copy from src/views/doublePrevent/inspect/inspectTask/index.vue copy to src/views/doublePrevent/hiddenInvestigate/checkTaskManage/work/index.vue diff --git a/src/views/doublePrevent/hiddenInvestigate/hideenRectify/index.vue b/src/views/doublePrevent/hiddenInvestigate/hideenRectify/index.vue deleted file mode 100644 index ea0d797..0000000 --- a/src/views/doublePrevent/hiddenInvestigate/hideenRectify/index.vue +++ /dev/null @@ -1,9 +0,0 @@ -<template></template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePrevent/hiddenInvestigate/hiddenReport/index.vue b/src/views/doublePrevent/hiddenInvestigate/record/index.vue similarity index 78% copy from src/views/doublePrevent/hiddenInvestigate/hiddenReport/index.vue copy to src/views/doublePrevent/hiddenInvestigate/record/index.vue index bee723e..403aab3 100644 --- a/src/views/doublePrevent/hiddenInvestigate/hiddenReport/index.vue +++ b/src/views/doublePrevent/hiddenInvestigate/record/index.vue @@ -1,5 +1,5 @@ <template> - <div>11223</div> + <div>排查记录</div> </template> <script> diff --git a/src/views/doublePrevent/inspect/inspectTask/components/inspectionTaskDialog.vue b/src/views/doublePrevent/hiddenInvestigate/work/components/inspectionTaskDialog.vue similarity index 100% rename from src/views/doublePrevent/inspect/inspectTask/components/inspectionTaskDialog.vue rename to src/views/doublePrevent/hiddenInvestigate/work/components/inspectionTaskDialog.vue diff --git a/src/views/doublePrevent/inspect/inspectTask/index.vue b/src/views/doublePrevent/hiddenInvestigate/work/index.vue similarity index 100% rename from src/views/doublePrevent/inspect/inspectTask/index.vue rename to src/views/doublePrevent/hiddenInvestigate/work/index.vue diff --git a/src/views/doublePrevent/hiddenInvestigate/hiddenCheck/index.vue b/src/views/doublePrevent/hiddenManage/hiddenCheck/components/checkDialog.vue similarity index 77% rename from src/views/doublePrevent/hiddenInvestigate/hiddenCheck/index.vue rename to src/views/doublePrevent/hiddenManage/hiddenCheck/components/checkDialog.vue index ea0d797..dc90d5a 100644 --- a/src/views/doublePrevent/hiddenInvestigate/hiddenCheck/index.vue +++ b/src/views/doublePrevent/hiddenManage/hiddenCheck/components/checkDialog.vue @@ -2,7 +2,7 @@ <script> export default { - name: 'index' + name: 'checkDialog' }; </script> diff --git a/src/views/doublePrevent/hiddenManage/hiddenCheck/index.vue b/src/views/doublePrevent/hiddenManage/hiddenCheck/index.vue new file mode 100644 index 0000000..d29b15a --- /dev/null +++ b/src/views/doublePrevent/hiddenManage/hiddenCheck/index.vue @@ -0,0 +1,247 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>整改类型:</span> + <el-select class="input-box" v-model="checkData.params.rectifyType" placeholder="整改类型" filterable> + <el-option v-for="item in rectifyTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>整改部门:</span> + <el-cascader + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-box" + v-model="checkData.params.rectifyDepId" + > + </el-cascader> + </div> + + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + <el-table :data="checkData.data" style="width: 100%" fit highlight-current-row> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="rectifyDesc" label="整改内容说明" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="applyTime" label="整改时间" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="rectifyType" label=" 整改类型" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + {{ parseNumber(scope.row.rectifyType, '整改类型') }} + </template> + </el-table-column> + <el-table-column prop="liablePerson" label="整改责任人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="cost" label="整改资金" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="cost" label="验收状态" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column label="操作" width="250" fixed="right" align="center"> + <template #default="scope"> + <el-button size="small" text type="primary" :icon="Check" @click="onOpenDialogRef('验收', scope.row)">验收</el-button> + <el-button size="small" text type="danger" :icon="Delete" @click="onDelProductionDevice(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="checkData.params.pageIndex" + background + v-model:page-size="checkData.params.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="checkData.total" + class="page-position" + > + </el-pagination> + <br /> + <br /> + </el-card> + <checkDialog ref="checkDialogRef" @refreshCheck="initCheckTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import checkDialog from './components/checkDialog.vue'; +import { Check, Delete } from '@element-plus/icons-vue'; +import { departmentApi } from '/@/api/department'; +import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; +import { hiddenReportApi } from '/@/api/doublePreventSystem/report'; +import { hiddenRectifyApi } from '/@/api/doublePreventSystem/rectify'; + +// 定义接口来定义对象的类型 +interface TableData { + quota: string; + quotaUnit: string; + quotaType: string; + createUserName: string; + gmtCreate: string; + lastEditUserName: string; + gmtModitify: string; +} +interface TableDataState { + checkData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + rectifyType: number | null; + rectifyDepId: number | null; + dangerStatus: number | null; + }; + }; + rectifyTypeList: Array<enumType>; + dangerStatusList: Array<enumType>; + departmentList: []; +} +interface enumType { + id: number; + name: string; +} + +export default defineComponent({ + name: 'check', + components: { checkDialog, Check, Delete }, + setup() { + const checkDialogRef = ref(); + const state = reactive<TableDataState>({ + checkData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + rectifyType: null, + rectifyDepId: null, + dangerStatus: 1 + } + }, + departmentList: [], + rectifyTypeList: [ + { id: 1, name: '即查即改' }, + { id: 2, name: '限期整改' } + ], + dangerStatusList: [ + { id: 0, name: '整改中' }, + { id: 1, name: '待验收' }, + { id: 2, name: '延期整改' }, + { id: 4, name: '超期未整改' }, + { id: 9, name: '已验收' } + ] + }); + // 初始化表格数据 + const initCheckTableData = async () => { + let res = await hiddenRectifyApi().getHiddenRectifyList(state.checkData.params); + if (res.data.code === '200') { + state.checkData.data = res.data.data; + state.checkData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取部门列表 + const getDepartmentData = async () => { + let res = await departmentApi().getDepartmentList(); + if (res.data.code === '200') { + state.departmentList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开弹窗 + const onOpenDialogRef = (type: string, value: any) => { + checkDialogRef.value.opencheckDialog(type, value, state.departmentList); + }; + // 删除 + const onDelProductionDevice = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该巡检点:“${row.code}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await hiddencheckApi().deleteHiddencheck({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initCheckTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const parseNumber = (value: string | number, type: string) => { + if (type === '整改类型') { + return state.rectifyTypeList.find((item) => item.id === value)?.name; + } else if (type === '隐患整改状态') { + return state.dangerStatusList.find((item) => item.id === value)?.name; + } + }; + + const handleSearch = () => { + initCheckTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.checkData.params.pageSize = val; + initCheckTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.checkData.params.pageIndex = val; + initCheckTableData(); + }; + // 页面加载时 + onMounted(() => { + initCheckTableData(); + getDepartmentData(); + }); + + return { + Check, + Delete, + parseNumber, + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelProductionDevice, + onHandleCurrentChange, + checkDialog, + checkDialogRef, + initCheckTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/hiddenManage/hiddenRectify/components/rectifyDialog.vue b/src/views/doublePrevent/hiddenManage/hiddenRectify/components/rectifyDialog.vue new file mode 100644 index 0000000..ee5cbd2 --- /dev/null +++ b/src/views/doublePrevent/hiddenManage/hiddenRectify/components/rectifyDialog.vue @@ -0,0 +1,232 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowRectifyDialog" width="600px"> + <el-form :model="rectifyForm" :rules="rectifyFormRules" ref="rectifyFormRef" size="default" label-width="120px"> + <el-row :gutter="35"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> + <el-form-item label="整改说明" prop="rectifyInfo"> + <el-input + class="input-add" + type="textarea" + :rows="2" + v-model.trim="rectifyForm.rectifyInfo" + placeholder="请输入整改说明" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> + <el-form-item label="整改时间" prop="applyTime"> + <el-date-picker + type="datetime" + value-format="YYYY-MM-DD HH:mm:ss" + class="input-add" + v-model="rectifyForm.applyTime" + placeholder="请选择整改时间" + clearable + > + </el-date-picker> + </el-form-item> + </el-col> + </el-row> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowRectifyDialog = !isShowRectifyDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitRectify" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + <el-dialog :title="title" v-model="isShowDelayDialog" width="600px"> + <el-form :model="delayForm" :rules="delayFormRules" ref="rectifyFormRef" size="default" label-width="120px"> + <el-row :gutter="35"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> + <el-form-item label="延期说明" prop="timeOutDesc"> + <el-input + class="input-add" + type="textarea" + :rows="2" + v-model.trim="delayForm.timeOutDesc" + placeholder="请输入延期说明" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> + <el-form-item label="整改期限" prop="rectifyTime"> + <el-date-picker + type="datetime" + value-format="YYYY-MM-DD HH:mm:ss" + class="input-add" + v-model="delayForm.rectifyTime" + placeholder="请选择整改期限" + clearable + > + </el-date-picker> + </el-form-item> + </el-col> + </el-row> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowDelayDialog = !isShowDelayDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitDelay" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script lang="ts"> +interface stateType { + isShowRectifyDialog: Boolean; + isShowDelayDialog: Boolean; + rectifyForm: { + id: number | null; + dangerManagerId: number | null; + rectifyInfo: string | null; + applyTime: string | null; + }; + delayForm: { + id: number | null; + dangerManagerId: number | null; + rectifyTime: string | null; + timeOutDesc: string | null; + }; + title: string; + rectifyTypeList: Array<rectifyTypeState>; + rectifyFormRules: {}; + delayFormRules: {}; +} +interface rectifyTypeState { + regionType: string; + id: number; +} + +import { reactive, toRefs, ref } from 'vue'; +import { ElMessage } from 'element-plus'; +import { hiddenRectifyApi } from '/@/api/doublePreventSystem/rectify'; +export default { + name: 'rectifyDialog', + setup(props: any, context: any) { + const rectifyFormRef = ref(); + const state = reactive<stateType>({ + title: '', + rectifyTypeList: [], + isShowDelayDialog: false, + isShowRectifyDialog: false, + rectifyForm: { + id: null, + dangerManagerId: null, + rectifyInfo: null, + applyTime: null + }, + delayForm: { + id: null, + dangerManagerId: null, + rectifyTime: null, + timeOutDesc: null + }, + rectifyFormRules: { + rectifyInfo: [{ required: true, message: '请填写整改说明', trigger: 'blur' }], + applyTime: [{ required: true, message: '请选择整改时间', trigger: 'change' }] + }, + delayFormRules: { + timeOutDesc: [{ required: true, message: '请填写延期说明', trigger: 'blur' }], + rectifyTime: [{ required: true, message: '请选择整改期限', trigger: 'change' }] + } + }); + + //打开模态框 + const openRectifyDialog = (type: string, value: object) => { + if (type === '延期') { + state.title = '延期'; + state.isShowDelayDialog = true; + const delayForm = JSON.parse(JSON.stringify(value)); + state.delayForm.id = delayForm.id; + state.delayForm.dangerManagerId = delayForm.dangerManagerId; + state.delayForm.timeOutDesc = null; + state.delayForm.rectifyTime = null; + } else { + state.title = '整改'; + state.isShowRectifyDialog = true; + const rectifyForm = JSON.parse(JSON.stringify(value)); + state.rectifyForm.id = rectifyForm.id; + state.rectifyForm.dangerManagerId = rectifyForm.dangerManagerId; + state.rectifyForm.rectifyInfo = null; + state.rectifyForm.applyTime = null; + } + }; + + //提交整改 + const submitRectify = async () => { + rectifyFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + let res = await hiddenRectifyApi().submitHiddenRectify(state.rectifyForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '整改提交成功', + duration: 2000 + }); + state.isShowRectifyDialog = false; + context.emit('refreshRectify'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + //提交延期 + const submitDelay = async () => { + rectifyFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + let res = await hiddenRectifyApi().delayHiddenRectifyTime(state.delayForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患延期成功', + duration: 2000 + }); + state.isShowDelayDialog = false; + context.emit('refreshRectify'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + return { + ...toRefs(state), + rectifyFormRef, + submitDelay, + submitRectify, + openRectifyDialog + }; + } +}; +</script> + +<style scoped> +.input-length { + width: 85%; +} +</style> diff --git a/src/views/doublePrevent/hiddenManage/hiddenRectify/index.vue b/src/views/doublePrevent/hiddenManage/hiddenRectify/index.vue new file mode 100644 index 0000000..f687ea3 --- /dev/null +++ b/src/views/doublePrevent/hiddenManage/hiddenRectify/index.vue @@ -0,0 +1,260 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>整改类型:</span> + <el-select class="input-box" v-model="rectifyData.params.rectifyType" placeholder="整改类型" filterable> + <el-option v-for="item in rectifyTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>整改部门:</span> + <el-cascader :options="departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable filterable class="input-box" v-model="rectifyData.params.rectifyDepId"> </el-cascader> + </div> + + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + <el-table :data="rectifyData.data" style="width: 100%" fit highlight-current-row> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="rectifyDesc" label="整改内容说明" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="rectifyTime" label="整改期限" show-overflow-tooltip min-width="200px"> + <template #default="scope"> + <span>{{ scope.row.rectifyTime }}</span> + <span v-if="scope.row.dangerStatus === 2" class="overdue-img">逾期</span> + <span v-if="scope.row.dangerStatus === 9" class="overdue-img">逾期</span> + </template> + </el-table-column> + <el-table-column prop="rectifyType" label=" 整改类型" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + {{ parseNumber(scope.row.rectifyType, '整改类型') }} + </template> + </el-table-column> + <el-table-column prop="liablePerson" label="整改责任人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="cost" label="整改资金" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="dangerStatus" label="隐患整改状态" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + <el-tag :type="scope.row.dangerStatus === 0 ? 'info' : scope.row.dangerStatus === 1 ? 'primary' : scope.row.dangerStatus === 2 ? 'warning' : scope.row.dangerStatus === 4 ? 'danger' : 'success'"> + {{ parseNumber(scope.row.dangerStatus, '隐患整改状态') }} + </el-tag> + </template> + </el-table-column> + <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip min-width="200px"></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip min-width="200px"></el-table-column> + <el-table-column label="操作" width="250" fixed="right" align="center"> + <template #default="scope"> + <el-button size="small" text type="primary" :icon="Check" v-show="scope.row.dangerStatus === 0" @click="onOpenDialogRef('整改', scope.row)">整改</el-button> + <el-button size="small" text type="primary" :icon="Edit" @click="onOpenDialogRef('延期', scope.row)">延期</el-button> + <el-button size="small" text type="danger" :icon="Delete" @click="onDelHiddenRectify(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="rectifyData.params.pageIndex" background v-model:page-size="rectifyData.params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="rectifyData.total" class="page-position"> </el-pagination> + <br /> + <br /> + </el-card> + <rectifyDialog ref="rectifyDialogRef" @refreshRectify="initRectifyTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import rectifyDialog from './components/rectifyDialog.vue'; +import { Edit, Delete, Check } from '@element-plus/icons-vue'; +import { hiddenRectifyApi } from '/@/api/doublePreventSystem/rectify'; +import { departmentApi } from '/@/api/department'; +import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; + +// 定义接口来定义对象的类型 +interface TableData { + quota: string; + quotaUnit: string; + quotaType: string; + createUserName: string; + gmtCreate: string; + lastEditUserName: string; + gmtModitify: string; +} +interface TableDataState { + rectifyData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + rectifyType: number | null; + rectifyDepId: number | null; + dangerStatus: number | null; + }; + }; + rectifyTypeList: Array<enumType>; + dangerStatusList: Array<enumType>; + departmentList: []; +} +interface enumType { + id: number; + name: string; +} + +export default defineComponent({ + name: 'rectify', + components: { rectifyDialog, Edit, Delete }, + setup() { + const rectifyDialogRef = ref(); + const state = reactive<TableDataState>({ + rectifyData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + rectifyType: null, + rectifyDepId: null, + dangerStatus: null + } + }, + departmentList: [], + rectifyTypeList: [ + { id: 1, name: '即查即改' }, + { id: 2, name: '限期整改' } + ], + dangerStatusList: [ + { id: 0, name: '整改中' }, + { id: 1, name: '待验收' }, + { id: 2, name: '延期整改' }, + { id: 4, name: '超期未整改' }, + { id: 9, name: '已验收' } + ] + }); + + // 初始化表格数据 + const initRectifyTableData = async () => { + let res = await hiddenRectifyApi().getHiddenRectifyList(state.rectifyData.params); + if (res.data.code === '200') { + state.rectifyData.data = res.data.data; + state.rectifyData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取部门列表 + const getDepartmentData = async () => { + let res = await departmentApi().getDepartmentList(); + if (res.data.code === '200') { + state.departmentList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开弹窗 + const onOpenDialogRef = (type: string, value: any) => { + rectifyDialogRef.value.openRectifyDialog(type, value); + }; + // 删除 + const onDelHiddenRectify = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该隐患整改,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await hiddenRectifyApi().deleteHiddenRectify({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initRectifyTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const parseNumber = (value: string | number, type: string) => { + if (type === '整改类型') { + return state.rectifyTypeList.find((item) => item.id === value)?.name; + } else if (type === '隐患整改状态') { + return state.dangerStatusList.find((item) => item.id === value)?.name; + } + }; + + const handleSearch = () => { + initRectifyTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.rectifyData.params.pageSize = val; + initRectifyTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.rectifyData.params.pageIndex = val; + initRectifyTableData(); + }; + // 页面加载时 + onMounted(() => { + initRectifyTableData(); + getDepartmentData(); + }); + + return { + Edit, + Check, + Delete, + parseNumber, + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelHiddenRectify, + onHandleCurrentChange, + rectifyDialog, + rectifyDialogRef, + initRectifyTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped> +.overdue-img { + position: absolute; + background-color: #f56c6c; + border-radius: 4px; + color: #fff; + display: inline-block; + font-size: 12px; + height: 21px; + line-height: 18px; + text-align: center; + white-space: nowrap; + border: 1px solid #fff; + transform: scale(0.8); + padding: 1px 3px 0 3px; +} +</style> diff --git a/src/views/doublePrevent/hiddenManage/hiddenReport/components/reportDialog.vue b/src/views/doublePrevent/hiddenManage/hiddenReport/components/reportDialog.vue new file mode 100644 index 0000000..f675a08 --- /dev/null +++ b/src/views/doublePrevent/hiddenManage/hiddenReport/components/reportDialog.vue @@ -0,0 +1,469 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowReportDialog" width="50%"> + <el-form :model="reportForm" :rules="reportFormRules" ref="reportFormRef" size="default" label-width="120px"> + <el-tabs class="active" v-model="activeNameOne"> + <el-tab-pane label="隐患信息" name="hiddenInfo"> + <el-row :gutter="25"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患描述" prop="dangerDesc"> + <el-input + class="input-add" + v-model.trim="reportForm.dangerDesc" + placeholder="请输入隐患情况描述" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患名称" prop="dangerCode"> + <el-input + class="input-add" + v-model.trim="reportForm.dangerCode" + placeholder="请输入隐患名称" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患所属部门" prop="depId"> + <el-cascader + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-add" + v-model="reportForm.depId" + > + </el-cascader> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="生产装置" prop="produceDeviceId"> + <el-select + class="input-add" + v-model="reportForm.produceDeviceId" + placeholder="请输入生产装置" + clearable + filterable + @change="changeUnit" + > + <el-option + v-for="item in allProduceDeviceData" + :key="item.id" + :label="item.produceDeviceName" + :value="item.id" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="风险分析单元" prop="riskUnitId"> + <el-select + class="input-add" + v-model.trim="reportForm.riskUnitId" + placeholder="请输入风险分析单元" + clearable + filterable + > + <el-option + v-for="item in safetyRiskUnitData" + :key="item.id" + :label="item.riskUnitName" + :value="item.id" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患来源" prop="dangerSource"> + <el-select class="input-add" v-model="reportForm.dangerSource" placeholder="请选择隐患来源" clearable filterable> + <el-option v-for="item in dangerSourceList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患等级" prop="dangerLevel"> + <el-select class="input-add" v-model="reportForm.dangerLevel" placeholder="请选择隐患等级" clearable filterable> + <el-option v-for="item in dangerLevelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患类型" prop="dangerType"> + <el-select class="input-add" v-model="reportForm.dangerType" placeholder="请选择隐患类型" clearable filterable> + <el-option v-for="item in dangerTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患可能后果" prop="dangerResult"> + <el-select + class="input-add" + v-model="reportForm.dangerResult" + placeholder="请选择隐患可能后果" + clearable + filterable + > + <el-option v-for="item in dangerResultList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12"> + <el-form-item label="隐患产生原因" prop="dangerReason"> + <el-input + class="input-add" + type="textarea" + :rows="2" + style="padding-bottom: 10px" + v-model.trim="reportForm.dangerReason" + placeholder="请输入隐患产生原因" + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-tab-pane> + </el-tabs> + + <el-divider></el-divider> + + <el-tabs class="active" v-model="activeNameTwo"> + <el-tab-pane label="整改信息" name="rectifyInfo"> + <el-row> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改类型" prop="rectifyType"> + <el-select class="input-add" v-model="reportForm.rectifyType" placeholder="请选择整改类型" clearable filterable> + <el-option + v-for="item in rectifyTypeList" + :key="item.id" + :label="item.name" + :value="item.id" + ></el-option> </el-select + ></el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改期限" prop="rectifyTime"> + <el-date-picker + type="datetime" + value-format="YYYY-MM-DD HH:mm:ss" + class="input-add" + v-model="reportForm.rectifyTime" + placeholder="请选择整改期限" + clearable + > + </el-date-picker> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改部门" prop="rectifyDepId"> + <el-cascader + @change="achieveUserList" + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-add" + v-model="reportForm.rectifyDepId" + > + </el-cascader> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改责任人" prop="liablePersonId"> + <el-select + class="input-add" + v-model="reportForm.liablePersonId" + placeholder="请选择整改责任人" + clearable + filterable + > + <el-option v-for="item in userList" :key="item.uid" :label="item.username" :value="item.uid"></el-option> + </el-select> + </el-form-item> + </el-col> + + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改资金" prop="dangerResult"> + <el-input class="input-add" type="number" v-model="reportForm.cost" placeholder="请选择整改资金"> </el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12"> + <el-form-item label="整改措施" prop="rectifyDesc"> + <el-input + class="input-add" + type="textarea" + :rows="2" + style="padding-bottom: 10px" + v-model.trim="reportForm.rectifyDesc" + placeholder="请输入整改措施" + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-tab-pane> + </el-tabs> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowReportDialog = !isShowReportDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitReport" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script lang="ts"> +interface stateType { + isShowReportDialog: Boolean; + reportForm: { + dangerDesc: string | null; + dangerCode: string | null; + depId: number | null; + produceDeviceId: number | null; + riskUnitId: number | null; + dangerSource: number | null; + dangerLevel: number | null; + dangerType: number | null; + dangerReason: string | null; + dangerResult: number | null; + rectifyType: number | null; + rectifyDepId: number | null; + liablePersonId: number | null; + rectifyTime: string | null; + cost: number | null; + rectifyDesc: string | null; + }; + title: string; + disabled: boolean; + activeNameOne: string; + activeNameTwo: string; + reportFormRules: {}; + departmentList: []; + userList: []; + allProduceDeviceData: []; + allSafetyRiskUnitData: Array<safetyRiskUnit>; + safetyRiskUnitData: Array<safetyRiskUnit>; + dangerLevelList: Array<enumType>; + dangerSourceList: Array<enumType>; + dangerResultList: Array<enumType>; + dangerTypeList: Array<enumType>; + rectifyTypeList: Array<enumType>; +} +interface enumType { + id: number; + name: string; +} +interface safetyRiskUnit { + produceDeviceId: number; +} +interface T {} +import { reactive, toRefs, ref } from 'vue'; +import { ElMessage } from 'element-plus'; +import { hiddenReportApi } from '/@/api/doublePreventSystem/report'; +import { getUserByDepartment } from '/@/assets/methods'; +export default { + name: 'reportDialog', + setup(props: any, context: any) { + const reportFormRef = ref(); + const state = reactive<stateType>({ + title: '', + disabled: false, + activeNameOne: 'hiddenInfo', + activeNameTwo: 'rectifyInfo', + isShowReportDialog: false, + departmentList: [], + userList: [], + allProduceDeviceData: [], + allSafetyRiskUnitData: [], + safetyRiskUnitData: [], + dangerLevelList: [ + { id: 1, name: '一般隐患' }, + { id: 2, name: '重大隐患' } + ], + dangerSourceList: [ + { id: 1, name: '日常排查' }, + { id: 2, name: '综合性排查' }, + { id: 3, name: '专业性排查' }, + { id: 4, name: '季节性排查' }, + { id: 5, name: '重点时段及节假日前排查' }, + { id: 6, name: '事故类比排查' }, + { id: 7, name: '复产复工前排查' }, + { id: 8, name: '外聘专家诊断式排查' }, + { id: 9, name: '管控措施失效' }, + { id: 10, name: '其他' } + ], + dangerResultList: [ + { id: 1, name: '无' }, + { id: 2, name: '轻伤' }, + { id: 3, name: '重伤' }, + { id: 4, name: '死亡' } + ], + dangerTypeList: [ + { id: 1, name: '安全' }, + { id: 2, name: '工艺' }, + { id: 3, name: '电气' }, + { id: 4, name: '仪表' }, + { id: 5, name: '消防' }, + { id: 6, name: '总图' }, + { id: 7, name: '设备' }, + { id: 8, name: '其他' } + ], + rectifyTypeList: [ + { id: 1, name: '即查即改' }, + { id: 2, name: '限期整改' } + ], + reportForm: { + dangerDesc: null, + dangerCode: null, + depId: null, + produceDeviceId: null, + riskUnitId: null, + dangerSource: null, + dangerLevel: null, + dangerType: null, + dangerReason: null, + dangerResult: null, + rectifyType: null, + rectifyDepId: null, + liablePersonId: null, + rectifyTime: null, + cost: null, + rectifyDesc: null + }, + reportFormRules: { + dangerDesc: [{ required: true, message: '请填写隐患情况描述', trigger: 'blur' }], + dangerCode: [{ required: true, message: '请填写隐患名称', trigger: 'blur' }], + depId: [{ required: true, message: '请选择隐患所属部门', trigger: 'change' }], + produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }], + riskUnitId: [{ required: true, message: '请选择风险分析单元', trigger: 'change' }], + dangerSource: [{ required: true, message: '请选择隐患来源', trigger: 'change' }], + dangerLevel: [{ required: true, message: '请选择隐患等级', trigger: 'change' }], + dangerType: [{ required: true, message: '请选择隐患类型', trigger: 'change' }], + dangerReason: [{ required: true, message: '请填写隐患产生原因分析', trigger: 'blur' }], + dangerResult: [{ required: true, message: '请选择隐患可能后果', trigger: 'change' }], + rectifyType: [{ required: true, message: '请选择整改类型', trigger: 'change' }], + rectifyDepId: [{ required: true, message: '请选择整改单位', trigger: 'change' }], + liablePersonId: [{ required: true, message: '请选择整改责任人', trigger: 'change' }], + rectifyTime: [{ required: true, message: '请选择整改期限', trigger: 'change' }], + cost: [{ required: true, message: '请选择整改资金', trigger: 'blur' }], + rectifyDesc: [{ required: true, message: '请填写整改内容', trigger: 'blur' }] + } + }); + + //打开模态框 + const openReportDialog = (type: string, value: { id: number }, departmentList: [], allProduceDeviceData: [], allSafetyRiskUnitData: []) => { + state.isShowReportDialog = true; + state.departmentList = departmentList; + state.allProduceDeviceData = JSON.parse(JSON.stringify(allProduceDeviceData)); + state.allSafetyRiskUnitData = allSafetyRiskUnitData; + setTimeout(() => { + reportFormRef.value.clearValidate(); + }); + if (type === '新增') { + state.disabled = false; + state.title = '新增隐患'; + state.reportForm = { + dangerDesc: null, + dangerCode: null, + depId: null, + produceDeviceId: null, + riskUnitId: null, + dangerSource: null, + dangerLevel: null, + dangerType: null, + dangerReason: null, + dangerResult: null, + rectifyType: null, + rectifyDepId: null, + liablePersonId: null, + rectifyTime: null, + cost: null, + rectifyDesc: null + }; + } else { + state.title = '修改隐患'; + state.disabled = true; + state.reportForm.rectifyDepId = JSON.parse(JSON.stringify(value)).rectifyDepId; + achieveUserList(); + state.reportForm = JSON.parse(JSON.stringify(value)); + } + }; + + //新增修改提交 + const submitReport = async () => { + reportFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + if (state.title === '新增隐患') { + let res = await hiddenReportApi().addHiddenReport(state.reportForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患新增成功', + duration: 2000 + }); + state.isShowReportDialog = false; + context.emit('refreshReport'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await hiddenReportApi().modHiddenReport(state.reportForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患修改成功', + duration: 2000 + }); + state.isShowReportDialog = false; + context.emit('refreshReport'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + const achieveUserList = async () => { + state.reportForm.liablePersonId = null; + const user: unknown = await getUserByDepartment(state.reportForm.rectifyDepId); + state.userList = user as []; + }; + + const changeUnit = () => { + state.reportForm.riskUnitId = null; + state.safetyRiskUnitData = state.allSafetyRiskUnitData.filter((item) => item.produceDeviceId === state.reportForm.produceDeviceId); + }; + + return { + ...toRefs(state), + changeUnit, + reportFormRef, + submitReport, + achieveUserList, + openReportDialog + }; + } +}; +</script> + +<style scoped> +:deep(.el-dialog__header) { + padding-bottom: 0px !important; +} +</style> diff --git a/src/views/doublePrevent/hiddenManage/hiddenReport/index.vue b/src/views/doublePrevent/hiddenManage/hiddenReport/index.vue new file mode 100644 index 0000000..6508e0e --- /dev/null +++ b/src/views/doublePrevent/hiddenManage/hiddenReport/index.vue @@ -0,0 +1,337 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>隐患等级:</span> + <el-select class="input-box" v-model="reportData.params.dangerLevel" placeholder="隐患等级" filterable clearable> + <el-option v-for="item in dangerLevelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>隐患来源:</span> + <el-select class="input-box" v-model="reportData.params.dangerSource" placeholder="隐患来源" filterable clearable> + <el-option v-for="item in dangerSourceList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>隐患状态:</span> + <el-select class="input-box" v-model="reportData.params.dangerStatus" placeholder="隐患状态" filterable clearable> + <el-option v-for="item in dangerStatusList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>隐患类型:</span> + <el-select class="input-box" v-model="reportData.params.dangerType" placeholder="隐患类型" filterable clearable> + <el-option v-for="item in dangerTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增隐患 + </el-button> + </div> + <el-table :data="reportData.data" style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="dangerDesc" label="隐患情况描述" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="riskUnitName" label="风险分析单元名称" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="dangerSource" label="隐患来源" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + {{ parseNumber(scope.row.dangerSource, '隐患来源') }} + </template> + </el-table-column> + <el-table-column prop="dangerLevel" label="隐患等级" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + <el-tag :type="scope.row.dangerLevel === 1 ? 'warning' : 'danger'"> + {{ parseNumber(scope.row.dangerLevel, '隐患等级') }} + </el-tag> + </template> + </el-table-column> + <el-table-column prop="dangerType" label="隐患类型" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + {{ parseNumber(scope.row.dangerType, '隐患类型') }} + </template> + </el-table-column> + <el-table-column prop="dangerReason" label="隐患产生原因分析" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="dangerResult" label="隐患可能导致后果" show-overflow-tooltip min-width="150px"> + <template #default="scope"> + <el-tag :type="scope.row.dangerResult === 1 ? 'success' : scope.row.dangerResult === 2 ? 'info' : scope.row.dangerResult === 3 ? 'warning' : 'danger'"> {{ parseNumber(scope.row.dangerResult, '隐患可能导致后果') }}</el-tag> + </template> + </el-table-column> + <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip min-width="200px"></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip min-width="200px"></el-table-column> + <el-table-column label="操作" width="250" fixed="right" align="center"> + <template #default="scope"> + <el-button size="small" text type="primary" :icon="Edit" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> + <el-button size="small" text type="danger" :icon="Delete" @click="onDelProductionDevice(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 15, 20, 30]" v-model:current-page="reportData.params.pageIndex" background v-model:page-size="reportData.params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="reportData.total" class="page-position"> </el-pagination> + <br /> + <br /> + </el-card> + <reportDialog ref="reportDialogRef" @refreshReport="initReportTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import reportDialog from './components/reportDialog.vue'; +import { Edit, Delete } from '@element-plus/icons-vue'; +import { hiddenReportApi } from '/@/api/doublePreventSystem/report'; +import { departmentApi } from '/@/api/department'; +import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; +import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; + +// 定义接口来定义对象的类型 +interface TableData { + quota: string; + quotaUnit: string; + quotaType: string; + createUserName: string; + gmtCreate: string; + lastEditUserName: string; + gmtModitify: string; +} +interface TableDataState { + reportData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + dangerLevel: number | null; + dangerSource: number | null; + dangerStatus: string | null; + dangerType: number | null; + }; + }; + dangerLevelList: Array<enumType>; + dangerSourceList: Array<enumType>; + dangerStatusList: Array<enumType>; + dangerTypeList: Array<enumType>; + dangerResultList: Array<enumType>; + departmentList: []; + allProduceDeviceData: []; + allSafetyRiskUnitData: []; +} +interface enumType { + id: number; + name: string; +} + +export default defineComponent({ + name: 'report', + components: { reportDialog, Edit, Delete }, + setup() { + const reportDialogRef = ref(); + const state = reactive<TableDataState>({ + reportData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 15, + dangerLevel: null, + dangerSource: null, + dangerStatus: null, + dangerType: null + } + }, + departmentList: [], + dangerLevelList: [ + { id: 1, name: '一般隐患' }, + { id: 2, name: '重大隐患' } + ], + dangerSourceList: [ + { id: 1, name: '日常排查' }, + { id: 2, name: '综合性排查' }, + { id: 3, name: '专业性排查' }, + { id: 4, name: '季节性排查' }, + { id: 5, name: '重点时段及节假日前排查' }, + { id: 6, name: '事故类比排查' }, + { id: 7, name: '复产复工前排查' }, + { id: 8, name: '外聘专家诊断式排查' }, + { id: 9, name: '管控措施失效' }, + { id: 10, name: '其他' } + ], + dangerStatusList: [ + { id: 0, name: '整改中' }, + { id: 1, name: '待验收' }, + { id: 2, name: '延期整改' }, + { id: 4, name: '超期未整改' }, + { id: 9, name: '已验收' } + ], + dangerTypeList: [ + { id: 1, name: '安全' }, + { id: 2, name: '工艺' }, + { id: 3, name: '电气' }, + { id: 4, name: '仪表' }, + { id: 5, name: '消防' }, + { id: 6, name: '总图' }, + { id: 7, name: '设备' }, + { id: 8, name: '其他' } + ], + dangerResultList: [ + { id: 1, name: '无' }, + { id: 2, name: '轻伤' }, + { id: 3, name: '重伤' }, + { id: 4, name: '死亡' } + ], + allProduceDeviceData: [], + allSafetyRiskUnitData: [] + }); + + // 初始化表格数据 + const initReportTableData = async () => { + let res = await hiddenReportApi().getHiddenReportList(state.reportData.params); + if (res.data.code === '200') { + state.reportData.data = res.data.data; + state.reportData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取生产装置列表 + const getAllProduceDeviceData = async () => { + let res = await productionDeviceApi().getAllProductionDeviceList(); + if (res.data.code === '200') { + state.allProduceDeviceData = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 获取安全风险分析单元数据 + const getAllSafetyRiskEventData = async () => { + let res = await safetyRiskAnalyseUnitApi().getAllSafetyRiskAnalyseUnitList(); + if (res.data.code === '200') { + state.allSafetyRiskUnitData = JSON.parse(JSON.stringify(res.data.data)); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取部门列表 + const getDepartmentData = async () => { + let res = await departmentApi().getDepartmentList(); + if (res.data.code === '200') { + state.departmentList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开弹窗 + const onOpenDialogRef = (type: string, value: any) => { + reportDialogRef.value.openReportDialog(type, value, state.departmentList, state.allProduceDeviceData, state.allSafetyRiskUnitData); + }; + // 删除 + const onDelProductionDevice = (row: any) => { + ElMessageBox.confirm(`此操作将永久该条隐患,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await hiddenReportApi().deleteHiddenReport({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initReportTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const handleSearch = () => { + initReportTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.reportData.params.pageSize = val; + initReportTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.reportData.params.pageIndex = val; + initReportTableData(); + }; + + const parseNumber = (value: string | number, type: string) => { + if (type === '隐患来源') { + return state.dangerSourceList.find((item) => item.id === value)?.name; + } else if (type === '隐患等级') { + return state.dangerLevelList.find((item) => item.id === value)?.name; + } else if (type === '隐患类型') { + return state.dangerTypeList.find((item) => item.id === value)?.name; + } else { + return state.dangerResultList.find((item) => item.id === value)?.name; + } + }; + + // 页面加载时 + onMounted(() => { + initReportTableData(); + getDepartmentData(); + getAllProduceDeviceData(); + getAllSafetyRiskEventData(); + }); + + return { + Edit, + Delete, + parseNumber, + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelProductionDevice, + onHandleCurrentChange, + reportDialog, + reportDialogRef, + initReportTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/inspect/inspectUnit/index.vue b/src/views/doublePrevent/inspect/inspectUnit/index.vue deleted file mode 100644 index 90bbe6f..0000000 --- a/src/views/doublePrevent/inspect/inspectUnit/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>222</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/action/index.vue b/src/views/doublePrevent/riskLevel/action/index.vue index 95634b0..21cba15 100644 --- a/src/views/doublePrevent/riskLevel/action/index.vue +++ b/src/views/doublePrevent/riskLevel/action/index.vue @@ -31,10 +31,22 @@ <el-table-column type="index" label="序号" width="60" /> <el-table-column prop="riskEventName" label="安全风险事件名称" show-overflow-tooltip></el-table-column> <el-table-column prop="controlMeasureCode" label="风控措施编码" show-overflow-tooltip></el-table-column> - <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip></el-table-column> + <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.controlType, '管控方式') }} + </template> + </el-table-column> <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip></el-table-column> + <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.classify1, '管控措施分类1') }} + </template> + </el-table-column> + <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.classify2, '管控措施分类2') }} + </template> + </el-table-column> <el-table-column prop="classify3" label="管控措施分类3" show-overflow-tooltip></el-table-column> <el-table-column prop="measureDesc" label="措施说明" show-overflow-tooltip></el-table-column> <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> @@ -103,12 +115,18 @@ }; controlTypeList: Array<controlTypeType>; classifyOneList: Array<classifyOneType>; - classifyTwoList: Array<classifyTwoType>; + classifyTwoList: Array<classifyOneType>; allSafetyRiskEventData: Array<SafetyRiskEventDataState>; } -interface controlTypeType {} -interface classifyOneType {} -interface classifyTwoType {} +interface controlTypeType { + id: number; + name: string; +} +interface classifyOneType { + id: number; + classifyOneType: string; +} + interface SafetyRiskEventDataState {} // interface controlTypeListType { @@ -265,6 +283,16 @@ .catch(() => {}); }; + const parseNumber = (value: string | number, type: string) => { + if (type === '管控方式') { + return state.controlTypeList.find((item) => item.id === value)?.name; + } else if (type === '管控措施分类1') { + return state.classifyOneList.find((item) => item.id === value)?.riskMeasureName; + } else { + return state.classifyTwoList.find((item) => item.id === value)?.riskMeasureName; + } + }; + const handleSearch = () => { initRiskControlMeasureData(); }; @@ -291,6 +319,7 @@ return { dateFormat, handleSearch, + parseNumber, onOpenDialogRef, onHandleSizeChange, onDelRiskControlMeasure, diff --git a/src/views/doublePrevent/riskLevel/check/components/checkUnitDialog.vue b/src/views/doublePrevent/riskLevel/check/components/checkUnitDialog.vue new file mode 100644 index 0000000..42a7cb2 --- /dev/null +++ b/src/views/doublePrevent/riskLevel/check/components/checkUnitDialog.vue @@ -0,0 +1,227 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowCheckUnitDialog" append-to-body :close-on-click-modal="false" width="50%"> + <el-divider></el-divider> + <div class="checkUnit-form"> + <el-form :model="checkUnitForm" :rules="checkUnitFormRules" ref="checkUnitFormRef" size="default" label-width="120px"> + <el-row :gutter="35"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="任务单元名称" prop="taskUnitName"> + <el-input + class="input-length" + v-model.trim="checkUnitForm.taskUnitName" + placeholder="请输入任务单元名称" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="任务单元说明" prop="note"> + <el-input + class="input-length" + v-model.trim="checkUnitForm.note" + placeholder="请输入任务单元说明" + clearable + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + </div> + + <div class="checkUnit-point"> + <el-tabs class="active" v-model="activeName"> + <el-tab-pane label="检查项信息" name="checkUnit"> + <div class="filter-container"> + <el-button size="default" type="success" @click="onOpenDialogRef('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 选择风险管控措施 + </el-button> + </div> + + <el-table :data="measureData" border fit highlight-current-row style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip align="center"></el-table-column> + <el-table-column label="操作" width="150" align="center"> + <template #default="scope"> + <el-button size="small" text type="danger" @click="onDelCheckUnit(scope.$index, scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + </el-tab-pane> + </el-tabs> + </div> + + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowCheckUnitDialog = !isShowCheckUnitDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitCheckUnit" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + <el-dialog title="选择风险管控措施" v-model="isShowSelectMeasureControlDialog" append-to-body :close-on-click-modal="false" width="70%"> + <select-measure-control-dialog + ref="SelectMeasureControlDialogRef" + @receiveRiskControlId="receiveRiskControlId" + ></select-measure-control-dialog> + </el-dialog> + </div> +</template> + +<script lang="ts"> +import SelectMeasureControlDialog from '/@/views/doublePrevent/riskLevel/checkUnit/components/selectMeasureControlDialog.vue'; +import { reactive, toRefs, ref } from 'vue'; +import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit'; +import { ElMessage } from 'element-plus'; +interface stateType { + isShowCheckUnitDialog: Boolean; + isShowSelectMeasureControlDialog: Boolean; + checkUnitForm: { + taskUnitName: string | null; + note: string | null; + measureList: []; + }; + title: string; + activeName: string; + measureData: []; + checkUnitData: []; + checkUnitFormRules: {}; +} + +export default { + name: 'checkUnitDialog', + components: { SelectMeasureControlDialog }, + setup(props: any, context: any) { + const checkUnitFormRef = ref(); + const riskControlMeasureDialogRef = ref(); + const state = reactive<stateType>({ + title: '', + activeName: 'checkUnit', + measureData: [], + checkUnitData: [], + isShowCheckUnitDialog: false, + isShowSelectMeasureControlDialog: false, + checkUnitForm: { + taskUnitName: null, + note: null, + measureList: [] + }, + checkUnitFormRules: { + taskUnitName: [{ required: true, message: '请填写任务单元名称', trigger: 'blur' }], + note: [{ required: true, message: '请填写任务单元说明', trigger: 'change' }] + } + }); + + //打开模态框 + const openCheckUnitDialog = (type: string, value: object, department: []) => { + state.isShowCheckUnitDialog = true; + setTimeout(() => { + checkUnitFormRef.value.clearValidate(); + }); + if (type === '新增') { + state.title = '新增隐患排查单元'; + state.checkUnitForm = { + taskUnitName: null, + note: null, + measureList: [] + }; + } else { + state.title = '修改隐患排查单元'; + state.checkUnitForm = JSON.parse(JSON.stringify(value)); + } + }; + + const onOpenDialogRef = () => { + state.isShowSelectMeasureControlDialog = true; + }; + + const onDelCheckUnit = (value: number, scope: object) => { + state.measureData.splice(value, 1); + }; + + const receiveRiskControlId = (value: []) => { + state.isShowSelectMeasureControlDialog = false; + state.measureData = value; + state.checkUnitForm.measureList = JSON.parse( + JSON.stringify( + value.map((item: { id: number }) => { + return item.id; + }) + ) + ); + }; + + //新增修改提交 + const submitCheckUnit = async () => { + checkUnitFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + if (state.title === '新增隐患排查单元') { + let res = await checkUnitApi().addCheckUnit(state.checkUnitForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患排查单元新增成功', + duration: 2000 + }); + state.isShowCheckUnitDialog = false; + context.emit('refreshCheckUnit'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await checkUnitApi().modCheckUnit(state.checkUnitForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患排查单元修改成功', + duration: 2000 + }); + state.isShowCheckUnitDialog = false; + context.emit('refreshCheckUnit'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + return { + ...toRefs(state), + checkUnitFormRef, + submitCheckUnit, + onDelCheckUnit, + onOpenDialogRef, + openCheckUnitDialog, + receiveRiskControlId, + riskControlMeasureDialogRef + }; + } +}; +</script> + +<style scoped> +::v-deep.el-divider--horizontal { + margin-top: 0px !important; +} + +::v-deep.el-dialog__body { + padding-top: 10px !important; +} +.filter-container { + padding: 10px 0px; +} +</style> diff --git a/src/views/doublePrevent/riskLevel/check/components/selectMeasureControlDialog.vue b/src/views/doublePrevent/riskLevel/check/components/selectMeasureControlDialog.vue new file mode 100644 index 0000000..df01f4a --- /dev/null +++ b/src/views/doublePrevent/riskLevel/check/components/selectMeasureControlDialog.vue @@ -0,0 +1,219 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>管控方式:</span> + <el-select class="input-box" v-model="riskControlMeasureData.params.controlType" placeholder="管控方式" clearable> + <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>安全风险事件:</span> + <el-select class="input-box" v-model="riskControlMeasureData.params.riskEventId" placeholder="安全风险事件" clearable> + <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskEventName" :value="item.id"></el-option> + </el-select> + </div> + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + <el-table + @selection-change="handleSelectionChange" + ref="table" + :row-key="getRowKey" + :data="riskControlMeasureData.data" + style="width: 100%" + > + <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column> + <el-table-column prop="riskEventName" label="安全风险事件名称" show-overflow-tooltip></el-table-column> + <el-table-column prop="controlMeasureCode" label="风控措施编码" show-overflow-tooltip></el-table-column> + <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.controlType, '管控方式') }} + </template> + </el-table-column> + <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip></el-table-column> + <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.classify1, '管控措施分类1') }} + </template> + </el-table-column> + <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.classify2, '管控措施分类2') }} + </template> + </el-table-column> + <el-table-column prop="classify3" label="管控措施分类3" show-overflow-tooltip></el-table-column> + <el-table-column prop="measureDesc" label="措施说明" show-overflow-tooltip></el-table-column>> + <el-table-column label="操作" width="150"> + <template #default="scope"> + <el-button type="text" @click="giveValue(scope.row)">选择 </el-button> + </template> + </el-table-column> + </el-table> + </el-card> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure/index.ts'; +import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; + +// 定义接口来定义对象的类型 +interface TableData { + roleName: string; + roleSign: string; + describe: string; + sort: number; + status: boolean; + createTime: string; +} +interface TableDataState { + isShowSelectMeasureControlDialog: boolean; + riskControlMeasureIdList: Array<riskControlMeasure>; + riskControlMeasureData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + controlType: number | null; + riskEventId: number | null; + }; + }; + controlTypeList: Array<controlTypeType>; + classifyOneList: Array<classifyOneType>; + classifyTwoList: Array<classifyOneType>; +} +interface controlTypeType { + id: number; + name: string; +} +interface classifyOneType { + id: number; + riskMeasureName: string; +} + +interface riskControlMeasure {} +export default { + name: 'selectMeasureControlDialog', + components: {}, + setup(props: any, context: any) { + const riskControlMeasureDialogRef = ref(); + const state = reactive<TableDataState>({ + isShowSelectMeasureControlDialog: false, + riskControlMeasureIdList: [], + riskControlMeasureData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + controlType: null, + riskEventId: null + } + }, + controlTypeList: [ + { id: 1, name: '自动化监控' }, + { id: 2, name: '隐患排查' } + ], + classifyOneList: [], + classifyTwoList: [] + }); + + // 初始化表格数据 + const initRiskControlMeasureData = async () => { + let res = await riskControlMeasureApi().getAllRiskControlMeasureList(); + if (res.data.code === '200') { + state.riskControlMeasureData.data = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取管控措施分类 + const getClassify = async () => { + let res = await riskControlMeasureApi().getClassifyData(); + if (res.data.code === '200') { + state.classifyOneList = res.data.data.filter((item: any) => item.parentId === null); + state.classifyTwoList = res.data.data.filter((item: any) => item.parentId !== null); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + const parseNumber = (value: string | number, type: string) => { + if (type === '管控方式') { + return state.controlTypeList.find((item) => item.id === value)?.name; + } else if (type === '管控措施分类1') { + return state.classifyOneList.find((item) => item.id === value)?.riskMeasureName; + } else { + return state.classifyTwoList.find((item) => item.id === value)?.riskMeasureName; + } + }; + + const handleSearch = () => { + initRiskControlMeasureData(); + }; + + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.riskControlMeasureData.params.pageSize = val; + initRiskControlMeasureData(); + }; + + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.riskControlMeasureData.params.pageIndex = val; + initRiskControlMeasureData(); + }; + + const handleSelectionChange = (val: []) => { + state.riskControlMeasureIdList = val; + }; + + const getRowKey = (value: { id: number }) => { + return value.id; + }; + + const giveValue = () => { + context.emit('receiveRiskControlId', state.riskControlMeasureIdList); + }; + + // 页面加载时 + onMounted(() => { + initRiskControlMeasureData(); + getClassify(); + }); + + return { + handleSearch, + parseNumber, + getRowKey, + giveValue, + handleSelectionChange, + onHandleSizeChange, + onHandleCurrentChange, + riskControlMeasureDialogRef, + initRiskControlMeasureData, + ...toRefs(state) + }; + } +}; +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/check/index.vue b/src/views/doublePrevent/riskLevel/check/index.vue new file mode 100644 index 0000000..c73e048 --- /dev/null +++ b/src/views/doublePrevent/riskLevel/check/index.vue @@ -0,0 +1,195 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>风险等级:</span> + <el-select v-model="checkUnitData.params.riskLevel" clearable filterable class="input-box" placeholder="请选择风险等级"> + <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>部门:</span> + <el-cascader + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-box" + v-model="checkUnitData.params.depId" + > + </el-cascader> + </div> + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增排查任务 + </el-button> + </div> + <el-table :data="checkUnitData.data" style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="taskUnitName" label="任务单元名称" show-overflow-tooltip></el-table-column> + <el-table-column prop="note" label="任务单元说明" show-overflow-tooltip></el-table-column> + <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column label="操作" width="150"> + <template #default="scope"> + <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> + <el-button size="small" text type="danger" @click="onDelcheckUnit(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="checkUnitData.params.pageIndex" + background + v-model:page-size="checkUnitData.params.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="checkUnitData.total" + class="page-position" + > + </el-pagination> + <br /> + <br /> + </el-card> + <checkUnitDialog ref="checkUnitDialogRef" @refreshCheckUnit="initCheckUnitTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import checkUnitDialog from './components/checkUnitDialog.vue'; +import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit/index.ts'; + +// 定义接口来定义对象的类型 +interface TableData { + roleName: string; + roleSign: string; + describe: string; + sort: number; + status: boolean; + createTime: string; +} +interface TableDataState { + checkUnitData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + taskUnitId: number | null; + }; + }; +} + +export default defineComponent({ + name: 'checkUnit', + components: { checkUnitDialog }, + setup() { + const checkUnitDialogRef = ref(); + const state = reactive<TableDataState>({ + checkUnitData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + taskUnitId: null + } + } + }); + // 初始化表格数据 + const initCheckUnitTableData = async () => { + let res = await checkUnitApi().getCheckUnitList(state.checkUnitData.params); + if (res.data.code === '200') { + state.checkUnitData.data = res.data.data; + state.checkUnitData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开生产装置弹窗 + const onOpenDialogRef = (type: string, value: any) => { + checkUnitDialogRef.value.openCheckUnitDialog(type, value, state.departmentList); + }; + // 删除角色 + const onDelCheckUnit = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await checkUnitApi().deleteCheckUnit({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initCheckUnitTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const handleSearch = () => { + initCheckUnitTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.checkUnitData.params.pageSize = val; + initCheckUnitTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.checkUnitData.params.pageIndex = val; + initCheckUnitTableData(); + }; + // 页面加载时 + onMounted(() => { + initCheckUnitTableData(); + }); + + return { + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelCheckUnit, + onHandleCurrentChange, + checkUnitDialog, + checkUnitDialogRef, + initCheckUnitTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/checkUnit/components/checkUnitDialog.vue b/src/views/doublePrevent/riskLevel/checkUnit/components/checkUnitDialog.vue new file mode 100644 index 0000000..42a7cb2 --- /dev/null +++ b/src/views/doublePrevent/riskLevel/checkUnit/components/checkUnitDialog.vue @@ -0,0 +1,227 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowCheckUnitDialog" append-to-body :close-on-click-modal="false" width="50%"> + <el-divider></el-divider> + <div class="checkUnit-form"> + <el-form :model="checkUnitForm" :rules="checkUnitFormRules" ref="checkUnitFormRef" size="default" label-width="120px"> + <el-row :gutter="35"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="任务单元名称" prop="taskUnitName"> + <el-input + class="input-length" + v-model.trim="checkUnitForm.taskUnitName" + placeholder="请输入任务单元名称" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="任务单元说明" prop="note"> + <el-input + class="input-length" + v-model.trim="checkUnitForm.note" + placeholder="请输入任务单元说明" + clearable + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + </div> + + <div class="checkUnit-point"> + <el-tabs class="active" v-model="activeName"> + <el-tab-pane label="检查项信息" name="checkUnit"> + <div class="filter-container"> + <el-button size="default" type="success" @click="onOpenDialogRef('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 选择风险管控措施 + </el-button> + </div> + + <el-table :data="measureData" border fit highlight-current-row style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip align="center"></el-table-column> + <el-table-column label="操作" width="150" align="center"> + <template #default="scope"> + <el-button size="small" text type="danger" @click="onDelCheckUnit(scope.$index, scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + </el-tab-pane> + </el-tabs> + </div> + + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowCheckUnitDialog = !isShowCheckUnitDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitCheckUnit" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + <el-dialog title="选择风险管控措施" v-model="isShowSelectMeasureControlDialog" append-to-body :close-on-click-modal="false" width="70%"> + <select-measure-control-dialog + ref="SelectMeasureControlDialogRef" + @receiveRiskControlId="receiveRiskControlId" + ></select-measure-control-dialog> + </el-dialog> + </div> +</template> + +<script lang="ts"> +import SelectMeasureControlDialog from '/@/views/doublePrevent/riskLevel/checkUnit/components/selectMeasureControlDialog.vue'; +import { reactive, toRefs, ref } from 'vue'; +import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit'; +import { ElMessage } from 'element-plus'; +interface stateType { + isShowCheckUnitDialog: Boolean; + isShowSelectMeasureControlDialog: Boolean; + checkUnitForm: { + taskUnitName: string | null; + note: string | null; + measureList: []; + }; + title: string; + activeName: string; + measureData: []; + checkUnitData: []; + checkUnitFormRules: {}; +} + +export default { + name: 'checkUnitDialog', + components: { SelectMeasureControlDialog }, + setup(props: any, context: any) { + const checkUnitFormRef = ref(); + const riskControlMeasureDialogRef = ref(); + const state = reactive<stateType>({ + title: '', + activeName: 'checkUnit', + measureData: [], + checkUnitData: [], + isShowCheckUnitDialog: false, + isShowSelectMeasureControlDialog: false, + checkUnitForm: { + taskUnitName: null, + note: null, + measureList: [] + }, + checkUnitFormRules: { + taskUnitName: [{ required: true, message: '请填写任务单元名称', trigger: 'blur' }], + note: [{ required: true, message: '请填写任务单元说明', trigger: 'change' }] + } + }); + + //打开模态框 + const openCheckUnitDialog = (type: string, value: object, department: []) => { + state.isShowCheckUnitDialog = true; + setTimeout(() => { + checkUnitFormRef.value.clearValidate(); + }); + if (type === '新增') { + state.title = '新增隐患排查单元'; + state.checkUnitForm = { + taskUnitName: null, + note: null, + measureList: [] + }; + } else { + state.title = '修改隐患排查单元'; + state.checkUnitForm = JSON.parse(JSON.stringify(value)); + } + }; + + const onOpenDialogRef = () => { + state.isShowSelectMeasureControlDialog = true; + }; + + const onDelCheckUnit = (value: number, scope: object) => { + state.measureData.splice(value, 1); + }; + + const receiveRiskControlId = (value: []) => { + state.isShowSelectMeasureControlDialog = false; + state.measureData = value; + state.checkUnitForm.measureList = JSON.parse( + JSON.stringify( + value.map((item: { id: number }) => { + return item.id; + }) + ) + ); + }; + + //新增修改提交 + const submitCheckUnit = async () => { + checkUnitFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + if (state.title === '新增隐患排查单元') { + let res = await checkUnitApi().addCheckUnit(state.checkUnitForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患排查单元新增成功', + duration: 2000 + }); + state.isShowCheckUnitDialog = false; + context.emit('refreshCheckUnit'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await checkUnitApi().modCheckUnit(state.checkUnitForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患排查单元修改成功', + duration: 2000 + }); + state.isShowCheckUnitDialog = false; + context.emit('refreshCheckUnit'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + return { + ...toRefs(state), + checkUnitFormRef, + submitCheckUnit, + onDelCheckUnit, + onOpenDialogRef, + openCheckUnitDialog, + receiveRiskControlId, + riskControlMeasureDialogRef + }; + } +}; +</script> + +<style scoped> +::v-deep.el-divider--horizontal { + margin-top: 0px !important; +} + +::v-deep.el-dialog__body { + padding-top: 10px !important; +} +.filter-container { + padding: 10px 0px; +} +</style> diff --git a/src/views/doublePrevent/riskLevel/checkUnit/components/selectMeasureControlDialog.vue b/src/views/doublePrevent/riskLevel/checkUnit/components/selectMeasureControlDialog.vue new file mode 100644 index 0000000..df01f4a --- /dev/null +++ b/src/views/doublePrevent/riskLevel/checkUnit/components/selectMeasureControlDialog.vue @@ -0,0 +1,219 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>管控方式:</span> + <el-select class="input-box" v-model="riskControlMeasureData.params.controlType" placeholder="管控方式" clearable> + <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>安全风险事件:</span> + <el-select class="input-box" v-model="riskControlMeasureData.params.riskEventId" placeholder="安全风险事件" clearable> + <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskEventName" :value="item.id"></el-option> + </el-select> + </div> + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + <el-table + @selection-change="handleSelectionChange" + ref="table" + :row-key="getRowKey" + :data="riskControlMeasureData.data" + style="width: 100%" + > + <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column> + <el-table-column prop="riskEventName" label="安全风险事件名称" show-overflow-tooltip></el-table-column> + <el-table-column prop="controlMeasureCode" label="风控措施编码" show-overflow-tooltip></el-table-column> + <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.controlType, '管控方式') }} + </template> + </el-table-column> + <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip></el-table-column> + <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.classify1, '管控措施分类1') }} + </template> + </el-table-column> + <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip> + <template #default="scope"> + {{ parseNumber(scope.row.classify2, '管控措施分类2') }} + </template> + </el-table-column> + <el-table-column prop="classify3" label="管控措施分类3" show-overflow-tooltip></el-table-column> + <el-table-column prop="measureDesc" label="措施说明" show-overflow-tooltip></el-table-column>> + <el-table-column label="操作" width="150"> + <template #default="scope"> + <el-button type="text" @click="giveValue(scope.row)">选择 </el-button> + </template> + </el-table-column> + </el-table> + </el-card> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure/index.ts'; +import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; + +// 定义接口来定义对象的类型 +interface TableData { + roleName: string; + roleSign: string; + describe: string; + sort: number; + status: boolean; + createTime: string; +} +interface TableDataState { + isShowSelectMeasureControlDialog: boolean; + riskControlMeasureIdList: Array<riskControlMeasure>; + riskControlMeasureData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + controlType: number | null; + riskEventId: number | null; + }; + }; + controlTypeList: Array<controlTypeType>; + classifyOneList: Array<classifyOneType>; + classifyTwoList: Array<classifyOneType>; +} +interface controlTypeType { + id: number; + name: string; +} +interface classifyOneType { + id: number; + riskMeasureName: string; +} + +interface riskControlMeasure {} +export default { + name: 'selectMeasureControlDialog', + components: {}, + setup(props: any, context: any) { + const riskControlMeasureDialogRef = ref(); + const state = reactive<TableDataState>({ + isShowSelectMeasureControlDialog: false, + riskControlMeasureIdList: [], + riskControlMeasureData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + controlType: null, + riskEventId: null + } + }, + controlTypeList: [ + { id: 1, name: '自动化监控' }, + { id: 2, name: '隐患排查' } + ], + classifyOneList: [], + classifyTwoList: [] + }); + + // 初始化表格数据 + const initRiskControlMeasureData = async () => { + let res = await riskControlMeasureApi().getAllRiskControlMeasureList(); + if (res.data.code === '200') { + state.riskControlMeasureData.data = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取管控措施分类 + const getClassify = async () => { + let res = await riskControlMeasureApi().getClassifyData(); + if (res.data.code === '200') { + state.classifyOneList = res.data.data.filter((item: any) => item.parentId === null); + state.classifyTwoList = res.data.data.filter((item: any) => item.parentId !== null); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + const parseNumber = (value: string | number, type: string) => { + if (type === '管控方式') { + return state.controlTypeList.find((item) => item.id === value)?.name; + } else if (type === '管控措施分类1') { + return state.classifyOneList.find((item) => item.id === value)?.riskMeasureName; + } else { + return state.classifyTwoList.find((item) => item.id === value)?.riskMeasureName; + } + }; + + const handleSearch = () => { + initRiskControlMeasureData(); + }; + + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.riskControlMeasureData.params.pageSize = val; + initRiskControlMeasureData(); + }; + + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.riskControlMeasureData.params.pageIndex = val; + initRiskControlMeasureData(); + }; + + const handleSelectionChange = (val: []) => { + state.riskControlMeasureIdList = val; + }; + + const getRowKey = (value: { id: number }) => { + return value.id; + }; + + const giveValue = () => { + context.emit('receiveRiskControlId', state.riskControlMeasureIdList); + }; + + // 页面加载时 + onMounted(() => { + initRiskControlMeasureData(); + getClassify(); + }); + + return { + handleSearch, + parseNumber, + getRowKey, + giveValue, + handleSelectionChange, + onHandleSizeChange, + onHandleCurrentChange, + riskControlMeasureDialogRef, + initRiskControlMeasureData, + ...toRefs(state) + }; + } +}; +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/checkUnit/index.vue b/src/views/doublePrevent/riskLevel/checkUnit/index.vue new file mode 100644 index 0000000..c73e048 --- /dev/null +++ b/src/views/doublePrevent/riskLevel/checkUnit/index.vue @@ -0,0 +1,195 @@ +<template> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>风险等级:</span> + <el-select v-model="checkUnitData.params.riskLevel" clearable filterable class="input-box" placeholder="请选择风险等级"> + <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>部门:</span> + <el-cascader + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-box" + v-model="checkUnitData.params.depId" + > + </el-cascader> + </div> + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增排查任务 + </el-button> + </div> + <el-table :data="checkUnitData.data" style="width: 100%"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="taskUnitName" label="任务单元名称" show-overflow-tooltip></el-table-column> + <el-table-column prop="note" label="任务单元说明" show-overflow-tooltip></el-table-column> + <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column label="操作" width="150"> + <template #default="scope"> + <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> + <el-button size="small" text type="danger" @click="onDelcheckUnit(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="checkUnitData.params.pageIndex" + background + v-model:page-size="checkUnitData.params.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="checkUnitData.total" + class="page-position" + > + </el-pagination> + <br /> + <br /> + </el-card> + <checkUnitDialog ref="checkUnitDialogRef" @refreshCheckUnit="initCheckUnitTableData" /> + </div> +</template> + +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import checkUnitDialog from './components/checkUnitDialog.vue'; +import { checkUnitApi } from '/@/api/doublePreventSystem/checkUnit/index.ts'; + +// 定义接口来定义对象的类型 +interface TableData { + roleName: string; + roleSign: string; + describe: string; + sort: number; + status: boolean; + createTime: string; +} +interface TableDataState { + checkUnitData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + taskUnitId: number | null; + }; + }; +} + +export default defineComponent({ + name: 'checkUnit', + components: { checkUnitDialog }, + setup() { + const checkUnitDialogRef = ref(); + const state = reactive<TableDataState>({ + checkUnitData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + taskUnitId: null + } + } + }); + // 初始化表格数据 + const initCheckUnitTableData = async () => { + let res = await checkUnitApi().getCheckUnitList(state.checkUnitData.params); + if (res.data.code === '200') { + state.checkUnitData.data = res.data.data; + state.checkUnitData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开生产装置弹窗 + const onOpenDialogRef = (type: string, value: any) => { + checkUnitDialogRef.value.openCheckUnitDialog(type, value, state.departmentList); + }; + // 删除角色 + const onDelCheckUnit = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await checkUnitApi().deleteCheckUnit({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initCheckUnitTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const handleSearch = () => { + initCheckUnitTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.checkUnitData.params.pageSize = val; + initCheckUnitTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.checkUnitData.params.pageIndex = val; + initCheckUnitTableData(); + }; + // 页面加载时 + onMounted(() => { + initCheckUnitTableData(); + }); + + return { + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelCheckUnit, + onHandleCurrentChange, + checkUnitDialog, + checkUnitDialogRef, + initCheckUnitTableData, + ...toRefs(state) + }; + } +}); +</script> + +<style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/device/index.vue b/src/views/doublePrevent/riskLevel/device/index.vue index afd2f6d..8a7bdfe 100644 --- a/src/views/doublePrevent/riskLevel/device/index.vue +++ b/src/views/doublePrevent/riskLevel/device/index.vue @@ -110,7 +110,7 @@ interface levelListState {} interface DepartmentState {} -export default defineComponent({ +export default { name: 'productionDevice', components: { productionDeviceDialog }, setup() { @@ -225,7 +225,7 @@ ...toRefs(state) }; } -}); +}; </script> <style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/map/components/rectifyDialog.vue b/src/views/doublePrevent/riskLevel/map/components/rectifyDialog.vue new file mode 100644 index 0000000..8bc9c69 --- /dev/null +++ b/src/views/doublePrevent/riskLevel/map/components/rectifyDialog.vue @@ -0,0 +1,397 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" v-model="isShowReportDialog" width="50%"> + <el-form :model="reportForm" :rules="reportFormRules" ref="reportFormRef" size="default" label-width="120px"> + <el-tabs class="active" v-model="activeNameOne"> + <el-tab-pane label="隐患信息" name="hiddenInfo"> + <el-row :gutter="25"> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患描述" prop="dangerDesc"> + <el-input + class="input-add" + v-model.trim="reportForm.dangerDesc" + placeholder="请输入隐患情况描述" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患所属部门" prop="depId"> + <el-cascader + :options="departmentList" + :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" + placeholder="请选择部门" + clearable + filterable + class="input-add" + v-model="reportForm.depId" + > + </el-cascader> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="生产装置" prop="produceDeviceId"> + <el-select + class="input-add" + v-model="reportForm.produceDeviceId" + placeholder="请输入生产装置" + clearable + filterable + @change="changeUnit" + > + <el-option + v-for="item in allProduceDeviceData" + :key="item.id" + :label="item.produceDeviceName" + :value="item.id" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="风险分析单元" prop="riskUnitId"> + <el-select + class="input-add" + v-model.trim="reportForm.riskUnitId" + placeholder="请输入风险分析单元" + clearable + filterable + > + <el-option + v-for="item in safetyRiskUnitData" + :key="item.id" + :label="item.riskUnitName" + :value="item.id" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患来源" prop="dangerSource"> + <el-select class="input-add" v-model="reportForm.dangerSource" placeholder="请选择隐患来源" clearable filterable> + <el-option v-for="item in dangerSourceList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患等级" prop="dangerLevel"> + <el-select class="input-add" v-model="reportForm.dangerLevel" placeholder="请选择隐患等级" clearable filterable> + <el-option v-for="item in dangerLevelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患类型" prop="dangerType"> + <el-select class="input-add" v-model="reportForm.dangerType" placeholder="请选择隐患类型" clearable filterable> + <el-option v-for="item in dangerTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="隐患可能后果" prop="dangerResult"> + <el-select + class="input-add" + v-model="reportForm.dangerResult" + placeholder="请选择隐患可能后果" + clearable + filterable + > + <el-option v-for="item in dangerResultList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12"> + <el-form-item label="隐患产生原因" prop="dangerReason"> + <el-input + class="input-add" + type="textarea" + :rows="2" + style="padding-bottom: 10px" + v-model.trim="reportForm.dangerReason" + placeholder="请输入隐患产生原因" + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-tab-pane> + </el-tabs> + + <el-divider></el-divider> + + <el-tabs class="active" v-model="activeNameTwo"> + <el-tab-pane label="整改信息" name="rectifyInfo"> + <el-row> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改类型" prop="dangerResult"> + <el-select class="input-add" v-model="reportForm.dangerResult" placeholder="请选择整改类型" clearable filterable> + <el-option + v-for="item in RFIDList" + :key="item.id" + :label="item.rfidName" + :value="item.id" + ></el-option> </el-select + ></el-form-item> </el-col + ><el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改责任人" prop="dangerResult"> + <el-select + class="input-add" + v-model="reportForm.dangerResult" + placeholder="请选择整改责任人" + clearable + filterable + > + <el-option v-for="item in RFIDList" :key="item.id" :label="item.rfidName" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改期限" prop="dangerResult"> + <el-select class="input-add" v-model="reportForm.dangerResult" placeholder="请选择整改期限" clearable filterable> + <el-option v-for="item in RFIDList" :key="item.id" :label="item.rfidName" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" class="mb20"> + <el-form-item label="整改资金" prop="dangerResult"> + <el-select class="input-add" v-model="reportForm.cost" placeholder="请选择整改资金"> </el-select> + </el-form-item> + </el-col> + <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12"> + <el-form-item label="整改内容" prop="rectifyDesc"> + <el-input + class="input-add" + type="textarea" + :rows="2" + style="padding-bottom: 10px" + v-model.trim="reportForm.rectifyDesc" + placeholder="请输入整改内容" + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-tab-pane> + </el-tabs> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="isShowReportDialog = !isShowReportDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitReport" v-throttle size="default">确 实</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script lang="ts"> +import { facilityAreaApi } from '/@/api/intellectInspectSystem/facilityAreaManage'; + +interface stateType { + isShowReportDialog: Boolean; + reportForm: { + dangerDesc: string | null; + depId: number | null; + produceDeviceId: number | null; + riskUnitId: number | null; + dangerSource: number | null; + dangerLevel: number | null; + dangerType: number | null; + dangerReason: string | null; + dangerResult: number | null; + rectifyType: number | null; + liablePersonId: number | null; + rectifyTime: string | null; + cost: number | null; + rectifyDesc: string | null; + }; + title: string; + activeNameOne: string; + activeNameTwo: string; + reportFormRules: {}; + departmentList: []; + allProduceDeviceData: []; + allSafetyRiskUnitData: Array<safetyRiskUnit>; + safetyRiskUnitData: Array<safetyRiskUnit>; + dangerLevelList: Array<enumType>; + dangerSourceList: Array<enumType>; + dangerResultList: Array<enumType>; + dangerTypeList: Array<enumType>; +} +interface enumType { + id: number; + name: string; +} +interface safetyRiskUnit { + produceDeviceId: number; +} +import { reactive, toRefs, ref } from 'vue'; +import { ElMessage } from 'element-plus'; +import { hiddenReportApi } from '/@/api/doublePreventSystem/report'; +export default { + name: 'reportDialog', + setup(props: any, context: any) { + const reportFormRef = ref(); + const state = reactive<stateType>({ + title: '', + activeNameOne: 'hiddenInfo', + activeNameTwo: 'rectifyInfo', + isShowReportDialog: false, + departmentList: [], + allProduceDeviceData: [], + allSafetyRiskUnitData: [], + safetyRiskUnitData: [], + dangerLevelList: [ + { id: 1, name: '一般隐患' }, + { id: 2, name: '重大隐患' } + ], + dangerSourceList: [ + { id: 1, name: '日常排查' }, + { id: 2, name: '综合性排查' }, + { id: 3, name: '专业性排查' }, + { id: 4, name: '季节性排查' }, + { id: 5, name: '重点时段及节假日前排查' }, + { id: 6, name: '事故类比排查' }, + { id: 7, name: '复产复工前排查' }, + { id: 8, name: '外聘专家诊断式排查' }, + { id: 9, name: '管控措施失效' }, + { id: 10, name: '其他' } + ], + dangerResultList: [ + { id: 1, name: '无' }, + { id: 2, name: '轻伤' }, + { id: 3, name: '重伤' }, + { id: 4, name: '死亡' } + ], + dangerTypeList: [ + { id: 1, name: '安全' }, + { id: 2, name: '工艺' }, + { id: 3, name: '电气' }, + { id: 4, name: '仪表' }, + { id: 5, name: '消防' }, + { id: 6, name: '总图' }, + { id: 7, name: '设备' }, + { id: 8, name: '其他' } + ], + reportForm: { + dangerDesc: null, + depId: null, + produceDeviceId: null, + riskUnitId: null, + dangerSource: null, + dangerLevel: null, + dangerType: null, + dangerReason: null, + dangerResult: null, + rectifyType: null, + liablePersonId: null, + rectifyTime: null, + cost: null, + rectifyDesc: null + }, + reportFormRules: { + dangerDesc: [{ required: true, message: '请填写隐患情况描述', trigger: 'blur' }], + depId: [{ required: true, message: '请选择隐患所属部门', trigger: 'change' }], + produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] + } + }); + + //打开模态框 + const openReportDialog = (type: string, value: { id: number }, departmentList: [], allProduceDeviceData: [], allSafetyRiskUnitData: []) => { + state.isShowReportDialog = true; + state.departmentList = departmentList; + state.allProduceDeviceData = JSON.parse(JSON.stringify(allProduceDeviceData)); + state.allSafetyRiskUnitData = allSafetyRiskUnitData; + setTimeout(() => { + reportFormRef.value.clearValidate(); + }); + if (type === '新增') { + state.title = '新增隐患'; + state.reportForm = { + dangerDesc: null, + depId: null, + produceDeviceId: null, + riskUnitId: null, + dangerSource: null, + dangerLevel: null, + dangerType: null, + dangerReason: null, + dangerResult: null, + rectifyType: null, + liablePersonId: null, + rectifyTime: null, + cost: null, + rectifyDesc: null + }; + } else { + state.title = '修改隐患'; + state.reportForm = JSON.parse(JSON.stringify(value)); + } + }; + + //新增修改提交 + const submitReport = async () => { + reportFormRef.value.validate(async (valid: Boolean) => { + if (valid) { + if (state.title === '新增隐患') { + let res = await hiddenReportApi().addHiddenReport(state.reportForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患新增成功', + duration: 2000 + }); + state.isShowReportDialog = false; + context.emit('refreshReport'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await hiddenReportApi().modHiddenReport(state.reportForm); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '隐患修改成功', + duration: 2000 + }); + state.isShowReportDialog = false; + context.emit('refreshReport'); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + ElMessage({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }; + + const changeUnit = () => { + debugger; + state.reportForm.riskUnitId = null; + state.safetyRiskUnitData = state.allSafetyRiskUnitData.filter((item) => item.produceDeviceId === state.reportForm.produceDeviceId); + }; + + return { + ...toRefs(state), + changeUnit, + reportFormRef, + submitReport, + openReportDialog + }; + } +}; +</script> + +<style scoped> +:deep(.el-dialog__header) { + padding-bottom: 0px !important; +} +</style> diff --git a/src/views/doublePrevent/riskLevel/map/index.vue b/src/views/doublePrevent/riskLevel/map/index.vue index bee723e..bf0a220 100644 --- a/src/views/doublePrevent/riskLevel/map/index.vue +++ b/src/views/doublePrevent/riskLevel/map/index.vue @@ -1,11 +1,273 @@ <template> - <div>11223</div> + <div class="system-role-container"> + <el-card shadow="hover"> + <div class="system-user-search mb15"> + <div class="basic-line"> + <span>整改类型:</span> + <el-select class="input-box" v-model="rectifyData.params.rectifyType" placeholder="整改类型" filterable> + <el-option v-for="item in dangerLevelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>整改单位:</span> + <el-select class="input-box" v-model="rectifyData.params.constructionUnit" placeholder="整改单位" filterable> + <el-option v-for="item in dangerSourceList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>隐患管理:</span> + <el-select class="input-box" v-model="rectifyData.params.dangerManagerId" placeholder="隐患管理" filterable> + <el-option v-for="item in dangerStatusList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + + <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + <el-table :data="rectifyData.data" style="width: 100%" fit highlight-current-row> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="rectifyDesc" label="整改内容说明" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="rectifyTime" label="整改期限" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="rectifyType" label=" 整改类型" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="liablePerson" label="整改责任人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="cost" label="整改资金" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip min-width="200px"></el-table-column> + <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip min-width="150px"></el-table-column> + <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip min-width="200px"></el-table-column> + <el-table-column label="操作" width="250" fixed="right" align="center"> + <template #default="scope"> + <el-button size="small" text type="primary" :icon="Edit" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> + <el-button size="small" text type="danger" :icon="Delete" @click="onDelProductionDevice(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination + @size-change="onHandleSizeChange" + @current-change="onHandleCurrentChange" + :pager-count="5" + :page-sizes="[10, 20, 30]" + v-model:current-page="rectifyData.params.pageIndex" + background + v-model:page-size="rectifyData.params.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="rectifyData.total" + class="page-position" + > + </el-pagination> + <br /> + <br /> + </el-card> + <rectifyDialog ref="rectifyDialogRef" @refreshrectify="initRectifyTableData" /> + </div> </template> -<script> -export default { - name: 'index' -}; +<script lang="ts"> +import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; +import { ElMessageBox, ElMessage } from 'element-plus'; +import rectifyDialog from './components/rectifyDialog.vue'; +import { Edit, Delete } from '@element-plus/icons-vue'; +import { hiddenRectifyApi } from '/@/api/doublePreventSystem/rectify'; +import { departmentApi } from '/@/api/department'; +import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; + +// 定义接口来定义对象的类型 +interface TableData { + quota: string; + quotaUnit: string; + quotaType: string; + createUserName: string; + gmtCreate: string; + lastEditUserName: string; + gmtModitify: string; +} +interface TableDataState { + rectifyData: { + data: Array<TableData>; + total: number; + loading: boolean; + params: { + pageIndex: number; + pageSize: number; + rectifyType: number | null; + constructionUnit: string | null; + dangerManagerId: number | null; + }; + }; + dangerLevelList: Array<enumType>; + dangerSourceList: Array<enumType>; + dangerStatusList: Array<enumType>; + dangerTypeList: Array<enumType>; + departmentList: []; + allProduceDeviceData: []; +} +interface enumType { + id: number; + name: string; +} + +export default defineComponent({ + name: 'rectify', + components: { rectifyDialog, Edit, Delete }, + setup() { + const rectifyDialogRef = ref(); + const state = reactive<TableDataState>({ + rectifyData: { + data: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + rectifyType: null, + constructionUnit: null, + dangerManagerId: null + } + }, + departmentList: [], + dangerLevelList: [ + { id: 1, name: '一般隐患' }, + { id: 2, name: '重大隐患' } + ], + dangerSourceList: [ + { id: 1, name: '日常排查' }, + { id: 2, name: '综合性排查' }, + { id: 3, name: '专业性排查' }, + { id: 4, name: '季节性排查' }, + { id: 5, name: '重点时段及节假日前排查' }, + { id: 6, name: '事故类比排查' }, + { id: 7, name: '复产复工前排查' }, + { id: 8, name: '外聘专家诊断式排查' }, + { id: 9, name: '管控措施失效' }, + { id: 10, name: '其他' } + ], + dangerStatusList: [ + { id: 1, name: '整改中' }, + { id: 2, name: '待验收' }, + { id: 3, name: '已验收' } + ], + dangerTypeList: [ + { id: 1, name: '安全' }, + { id: 2, name: '工艺' }, + { id: 3, name: '电气' }, + { id: 4, name: '仪表' }, + { id: 5, name: '消防' }, + { id: 6, name: '总图' }, + { id: 7, name: '设备' }, + { id: 8, name: '其他' } + ], + allProduceDeviceData: [] + }); + // 初始化表格数据 + const initRectifyTableData = async () => { + let res = await hiddenRectifyApi().getHiddenRectifyList(state.rectifyData.params); + if (res.data.code === '200') { + state.rectifyData.data = res.data.data; + state.rectifyData.total = res.data.count; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取生产装置列表 + const getAllProduceDeviceData = async () => { + let res = await productionDeviceApi().getAllProductionDeviceList(); + if (res.data.code === '200') { + state.allProduceDeviceData = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + //获取部门列表 + const getDepartmentData = async () => { + let res = await departmentApi().getDepartmentList(); + if (res.data.code === '200') { + state.departmentList = res.data.data; + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }; + + // 打开弹窗 + const onOpenDialogRef = (type: string, value: any) => { + rectifyDialogRef.value.openrectifyDialog(type, value, state.departmentList, state.allProduceDeviceData); + }; + // 删除 + const onDelProductionDevice = (row: any) => { + ElMessageBox.confirm(`此操作将永久删除该巡检点:“${row.code}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await hiddenRectifyApi().deleteHiddenRectify({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await initRectifyTableData(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }; + + const handleSearch = () => { + initRectifyTableData(); + }; + // 分页改变 + const onHandleSizeChange = (val: number) => { + state.rectifyData.params.pageSize = val; + initRectifyTableData(); + }; + // 分页改变 + const onHandleCurrentChange = (val: number) => { + state.rectifyData.params.pageIndex = val; + initRectifyTableData(); + }; + // 页面加载时 + onMounted(() => { + initRectifyTableData(); + getDepartmentData(); + getAllProduceDeviceData(); + }); + + return { + Edit, + Delete, + handleSearch, + onOpenDialogRef, + onHandleSizeChange, + onDelProductionDevice, + onHandleCurrentChange, + rectifyDialog, + rectifyDialogRef, + initRectifyTableData, + ...toRefs(state) + }; + } +}); </script> <style scoped></style> diff --git a/src/views/doublePrevent/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue b/src/views/doublePrevent/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue index 0764dc3..fed0700 100644 --- a/src/views/doublePrevent/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue +++ b/src/views/doublePrevent/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue @@ -95,7 +95,7 @@ produceDeviceId: number | null; }; title: string; - userList: []; + userList: any[]; departmentList: []; allProduceDeviceData: []; safetyRiskAnalyseUnitFormRules: {}; @@ -104,6 +104,7 @@ import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; import { ElMessage } from 'element-plus'; import { userApi } from '/@/api/user'; +import { getUserByDepartment } from '/@/assets/methods'; export default { name: 'productionDeviceDialog', setup(props: any, context: any) { @@ -200,24 +201,24 @@ }); }; - const achieveUserList = () => { + const achieveUserList = async () => { state.safetyRiskAnalyseUnitForm.liablePersonId = null; - state.userList = []; - getUserData(); + const userList: unknown = await getUserByDepartment(state.safetyRiskAnalyseUnitForm.liableDepId); + state.userList = userList as []; }; - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitForm.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; + // //获取用户列表 + // const getUserData = async () => { + // let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitForm.liableDepId); + // if (res.data.code === '200') { + // state.userList = res.data.data; + // } else { + // ElMessage({ + // type: 'warning', + // message: res.data.msg + // }); + // } + // }; return { ...toRefs(state), diff --git a/src/views/doublePreventSystem/inspectManage/inspectionTask/index.vue b/src/views/doublePreventSystem/inspectManage/inspectionTask/index.vue deleted file mode 100644 index e6a1a17..0000000 --- a/src/views/doublePreventSystem/inspectManage/inspectionTask/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>111</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/inspectManage/inspectionUnit/index.vue b/src/views/doublePreventSystem/inspectManage/inspectionUnit/index.vue deleted file mode 100644 index 90bbe6f..0000000 --- a/src/views/doublePreventSystem/inspectManage/inspectionUnit/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>222</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevel/action/components/riskControlMeasureDialog.vue b/src/views/doublePreventSystem/riskLevel/action/components/riskControlMeasureDialog.vue deleted file mode 100644 index 86937df..0000000 --- a/src/views/doublePreventSystem/riskLevel/action/components/riskControlMeasureDialog.vue +++ /dev/null @@ -1,263 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isRiskControlMeasureDialog" width="600px"> - <el-form - :model="riskControlMeasureForm" - :rules="riskControlMeasureFormRules" - ref="riskControlMeasureFormRef" - size="default" - label-width="160px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险事件名称" prop="riskEventId"> - <el-select class="input-length" v-model="riskControlMeasureForm.riskEventId" placeholder="请选择风险事件" clearable> - <el-option - v-for="item in allSafetyRiskEventData" - :key="item.id" - :label="item.riskEventName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险措施编码" prop="controlMeasureCode"> - <el-input - class="input-length" - v-model.trim="riskControlMeasureForm.controlMeasureCode" - placeholder="请输入风险措施编码" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控方式" prop="controlType"> - <el-select class="input-length" v-model="riskControlMeasureForm.controlType" placeholder="请选择管控方式" clearable> - <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控内容" prop="checkContent"> - <el-input - class="input-length" - type="textarea" - :rows="3" - v-model.trim="riskControlMeasureForm.checkContent" - placeholder="请输入管控内容" - clearable - > - </el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类1" prop="classify1"> - <el-select - class="input-length" - v-model.trim="riskControlMeasureForm.classify1" - @change="changeClassifyTwoList" - placeholder="请选择管控方式" - clearable - > - <el-option v-for="item in classifyOneList" :key="item.id" :label="item.riskMeasureName" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类2" prop="classify2"> - <el-select class="input-length" v-model="riskControlMeasureForm.classify2" placeholder="请选择管控方式" clearable> - <el-option v-for="item in classifyTwoList" :key="item.id" :label="item.riskMeasureName" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类3" prop="classify3"> - <el-input class="input-length" v-model.trim="riskControlMeasureForm.classify3" placeholder="请选择管控方式" clearable> - </el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="措施说明" prop="measureDesc"> - <el-input - class="input-length" - type="textarea" - :rows="3" - v-model.trim="riskControlMeasureForm.measureDesc" - placeholder="请输入措施说明" - clearable - > - </el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isRiskControlMeasureDialog = !isRiskControlMeasureDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitRiskControlMeasureDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isRiskControlMeasureDialog: Boolean; - riskControlMeasureForm: { - riskEventId: number | null; - controlMeasureCode: string | null; - controlType: number | null; - checkContent: string | null; - classify1: number | null; - classify2: number | null; - classify3: string | null; - measureDesc: string | null; - }; - title: string; - controlTypeList: Array<controlTypeListType>; - classifyOneList: []; - classifyTwoList: Array<classifyTwoType>; - classifyTwoListAll: []; - allSafetyRiskEventData: []; - riskControlMeasureFormRules: {}; -} -interface classifyTwoType { - id: number; - riskMeasureName: string; -} -interface controlTypeListType {} - -import { reactive, toRefs, ref } from 'vue'; -import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure'; -import { ElMessage } from 'element-plus'; -export default { - name: 'riskControlMeasureDialog', - setup(props: any, context: any) { - const riskControlMeasureFormRef = ref(); - const state = reactive<stateType>({ - title: '', - controlTypeList: [ - { id: 1, name: '自动化监控' }, - { id: 2, name: '隐患排查' } - ], - classifyOneList: [], - classifyTwoList: [], - classifyTwoListAll: [], - allSafetyRiskEventData: [], - isRiskControlMeasureDialog: false, - riskControlMeasureForm: { - riskEventId: null, - controlMeasureCode: null, - controlType: null, - checkContent: null, - classify1: null, - classify2: null, - classify3: null, - measureDesc: null - }, - riskControlMeasureFormRules: { - riskCode: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitName: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }], - liableDepId: [{ required: true, message: '请选择责任部门', trigger: 'change' }], - liablePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }], - produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] - } - }); - - //打开模态框 - const openSafetyRiskEventDialog = (type: string, value: object, allSafetyRiskEventData: [], classifyOneList: [], classifyTwoList: []) => { - state.isRiskControlMeasureDialog = true; - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(allSafetyRiskEventData)); - state.classifyOneList = JSON.parse(JSON.stringify(classifyOneList)); - state.classifyTwoListAll = JSON.parse(JSON.stringify(classifyTwoList)); - state.classifyTwoList = []; - setTimeout(() => { - riskControlMeasureFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险管控措施'; - state.riskControlMeasureForm = { - riskEventId: null, - controlMeasureCode: null, - controlType: null, - checkContent: null, - classify1: null, - classify2: null, - classify3: null, - measureDesc: null - }; - } else { - state.title = '修改风险管控措施'; - state.riskControlMeasureForm = JSON.parse(JSON.stringify(value)); - } - }; - - const changeClassifyTwoList = () => { - state.riskControlMeasureForm.classify2 = null; - state.classifyTwoList = []; - state.classifyTwoList = state.classifyTwoListAll.filter((item: any) => item.parentId === state.riskControlMeasureForm.classify1); - }; - - //新增修改提交 - const submitRiskControlMeasureDialog = async () => { - riskControlMeasureFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险管控措施') { - let res = await riskControlMeasureApi().addRiskControlMeasure(state.riskControlMeasureForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险管控措施新增成功', - duration: 2000 - }); - state.isRiskControlMeasureDialog = false; - context.emit('refreshRiskControlMeasure'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await riskControlMeasureApi().modRiskControlMeasure(state.riskControlMeasureForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险管控措施修改成功', - duration: 2000 - }); - state.isRiskControlMeasureDialog = false; - context.emit('refreshRiskControlMeasure'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - riskControlMeasureFormRef, - changeClassifyTwoList, - submitRiskControlMeasureDialog, - openSafetyRiskEventDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevel/action/index.vue b/src/views/doublePreventSystem/riskLevel/action/index.vue deleted file mode 100644 index 6d79aa1..0000000 --- a/src/views/doublePreventSystem/riskLevel/action/index.vue +++ /dev/null @@ -1,271 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>管控方式:</span> - <el-select class="input-box" v-model="riskControlMeasureData.params.controlType" placeholder="管控方式" clearable> - <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>安全风险事件:</span> - <el-select class="input-box" v-model="riskControlMeasureData.params.riskEventId" placeholder="安全风险事件" clearable> - <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskEventName" :value="item.id"></el-option> - </el-select> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增措施 - </el-button> - </div> - <el-table :data="riskControlMeasureData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="riskEventName" label="安全风险事件名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="controlMeasureCode" label="风控措施编码" show-overflow-tooltip></el-table-column> - <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip></el-table-column> - <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify3" label="管控措施分类3" show-overflow-tooltip></el-table-column> - <el-table-column prop="measureDesc" label="措施说明" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip> - <template #default="scope"> - <span>{{ dateFormat('YYYY-mm-dd HH:MM:SS', '2022-07-07T08:00:00') }}</span> - </template> - </el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelRiskControlMeasure(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="riskControlMeasureData.params.pageIndex" - background - v-model:page-size="riskControlMeasureData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="riskControlMeasureData.total" - > - </el-pagination> - </el-card> - <riskControlMeasureDialog ref="riskControlMeasureDialogRef" @refreshRiskControlMeasure="initRiskControlMeasureData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import riskControlMeasureDialog from './components/riskControlMeasureDialog.vue'; -import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure/index.ts'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - riskControlMeasureData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - controlType: number | null; - riskEventId: number | null; - }; - }; - controlTypeList: Array<controlTypeType>; - classifyOneList: Array<classifyOneType>; - classifyTwoList: Array<classifyTwoType>; - allSafetyRiskEventData: Array<SafetyRiskEventDataState>; -} -interface controlTypeType {} -interface classifyOneType {} -interface classifyTwoType {} -interface SafetyRiskEventDataState {} - -export default { - name: 'riskControlMeasure', - components: { riskControlMeasureDialog }, - setup() { - const riskControlMeasureDialogRef = ref(); - const state = reactive<TableDataState>({ - riskControlMeasureData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - controlType: null, - riskEventId: null - } - }, - controlTypeList: [ - { id: 1, name: '自动化监控' }, - { id: 2, name: '隐患排查' } - ], - classifyOneList: [], - classifyTwoList: [], - allSafetyRiskEventData: [] - }); - - // 初始化表格数据 - const initRiskControlMeasureData = async () => { - let res = await riskControlMeasureApi().getRiskControlMeasureList(state.riskControlMeasureData.params); - if (res.data.code === '200') { - state.riskControlMeasureData.data = res.data.data; - state.riskControlMeasureData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const dateFormat = (fmt: any, date: any) => { - date = new Date(date); - fmt = - date.getFullYear() + - '-' + - (date.getMonth() + 1) + - '-' + - date.getDate() + - ' ' + - date.getHours().toString() + - ':' + - (date.getMinutes().toString() === '0' ? '00' : date.getMinutes().toString()) + - ':' + - (date.getSeconds().toString() === '0' ? '00' : date.getMinutes().toString()); - return fmt; - }; - - //获取安全风险事件 - const getAllSafetyRiskEvent = async () => { - let res = await safetyRiskEventApi().getAllSafetyRiskEventList(); - if (res.data.code === '200') { - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(res.data.data)); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取管控措施分类 - const getClassify = async () => { - let res = await riskControlMeasureApi().getClassifyData(); - if (res.data.code === '200') { - state.classifyOneList = res.data.data.filter((item: any) => item.parentId === null); - state.classifyTwoList = res.data.data.filter((item: any) => item.parentId !== null); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - riskControlMeasureDialogRef.value.openSafetyRiskEventDialog( - type, - value, - state.allSafetyRiskEventData, - state.classifyOneList, - state.classifyTwoList - ); - }; - - // 删除角色 - const onDelRiskControlMeasure = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条风险管控措施:“${row.produceDeviceName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await riskControlMeasureApi().deleteRiskControlMeasure({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initRiskControlMeasureData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initRiskControlMeasureData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.riskControlMeasureData.params.pageSize = val; - initRiskControlMeasureData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.riskControlMeasureData.params.pageIndex = val; - initRiskControlMeasureData(); - }; - - // 页面加载时 - onMounted(() => { - initRiskControlMeasureData(); - getAllSafetyRiskEvent(); - getClassify(); - }); - - return { - dateFormat, - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelRiskControlMeasure, - onHandleCurrentChange, - riskControlMeasureDialog, - riskControlMeasureDialogRef, - initRiskControlMeasureData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevel/device/components/productionDeviceDialog.vue b/src/views/doublePreventSystem/riskLevel/device/components/productionDeviceDialog.vue deleted file mode 100644 index 6b9616e..0000000 --- a/src/views/doublePreventSystem/riskLevel/device/components/productionDeviceDialog.vue +++ /dev/null @@ -1,200 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isShowProductionDeviceDialog" width="600px"> - <el-form - :model="productionDeviceForm" - :rules="productionDeviceFormRules" - ref="productionDeviceFormRef" - size="default" - label-width="120px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="生产装置名称" prop="produceDeviceName"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.produceDeviceName" - placeholder="请输入生产装置名称" - clearable - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="所属部门" prop="depId"> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="productionDeviceForm.depId" - > - </el-cascader> - <!-- <el-select class="input-length" v-model="productionDeviceForm.depName" placeholder="请选择所属部门" clearable filterable></el-select>--> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险等级" prop="riskLevel"> - <el-select - class="input-length" - v-model="productionDeviceForm.riskLevel" - placeholder="请选择风险等级" - clearable - filterable - > - <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="区域位置" prop="location"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.location" - type="textarea" - placeholder="请输入区域位置" - maxlength="150" - ></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isShowProductionDeviceDialog = !isShowProductionDeviceDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitProductionDevice" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isShowProductionDeviceDialog: Boolean; - productionDeviceForm: { - produceDeviceName: string; - depId: number | null; - riskLevel: number | null; - location: string; - }; - title: string; - departmentList: []; - levelList: Array<levelListState>; - productionDeviceFormRules: {}; -} -interface levelListState {} -import { reactive, toRefs, ref } from 'vue'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; -import { ElMessage } from 'element-plus'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const productionDeviceFormRef = ref(); - const state = reactive<stateType>({ - title: '', - departmentList: [], - isShowProductionDeviceDialog: false, - levelList: [ - { id: 1, name: '低风险' }, - { id: 2, name: '一般风险' }, - { id: 3, name: '较大风险' }, - { id: 4, name: '重大风险' } - ], - productionDeviceForm: { - produceDeviceName: '', - depId: null, - riskLevel: null, - location: '' - }, - productionDeviceFormRules: { - produceDeviceName: [{ required: true, message: '请填写生产装置名称', trigger: 'blur' }], - depId: [{ required: true, message: '请选择部门', trigger: 'change' }], - riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], - location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] - } - }); - - //打开模态框 - const openProductionDeviceDialog = (type: string, value: object, department: []) => { - state.isShowProductionDeviceDialog = true; - state.departmentList = department; - setTimeout(() => { - productionDeviceFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增生产装置'; - state.productionDeviceForm = { - produceDeviceName: '', - depId: null, - riskLevel: null, - location: '' - }; - } else { - state.title = '修改生产装置'; - state.productionDeviceForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitProductionDevice = async () => { - productionDeviceFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增生产装置') { - let res = await productionDeviceApi().addProductionDevice(state.productionDeviceForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '生产装置新增成功', - duration: 2000 - }); - state.isShowProductionDeviceDialog = false; - context.emit('refreshProductionDevice'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await productionDeviceApi().modProductionDevice(state.productionDeviceForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '生产装置修改成功', - duration: 2000 - }); - state.isShowProductionDeviceDialog = false; - context.emit('refreshProductionDevice'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - productionDeviceFormRef, - submitProductionDevice, - openProductionDeviceDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevel/device/index.vue b/src/views/doublePreventSystem/riskLevel/device/index.vue deleted file mode 100644 index c240e35..0000000 --- a/src/views/doublePreventSystem/riskLevel/device/index.vue +++ /dev/null @@ -1,226 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>风险等级:</span> - <el-select v-model="productionDeviceData.params.riskLevel" clearable filterable class="input-box" placeholder="请选择风险等级"> - <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>部门:</span> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'id', label: 'name' }" - placeholder="请选择部门" - clearable - filterable - class="input-box" - v-model="productionDeviceData.params.depId" - > - </el-cascader> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增装置 - </el-button> - </div> - <el-table :data="productionDeviceData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="depName" label="所属部门" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip></el-table-column> - <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column> - <el-table-column prop="status" label="状态" show-overflow-tooltip> </el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="productionDeviceData.params.pageIndex" - background - v-model:page-size="productionDeviceData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="productionDeviceData.total" - > - </el-pagination> - </el-card> - <productionDeviceDialog ref="productionDeviceDialogRef" @refreshProductionDevice="initProductionDeviceTableData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import productionDeviceDialog from './components/productionDeviceDialog.vue'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice/index.ts'; -import { departmentApi } from '/@/api/department'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - productionDeviceData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskLevel: number | null; - status: number; - depId: number | null; - location: string | null; - produceDeviceName: string | null; - }; - }; - departmentList: Array<DepartmentState>; - levelList: Array<levelListState>; -} -interface levelListState {} -interface DepartmentState {} - -export default defineComponent({ - name: 'productionDevice', - components: { productionDeviceDialog }, - setup() { - const productionDeviceDialogRef = ref(); - const state = reactive<TableDataState>({ - productionDeviceData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskLevel: null, - status: 1, - depId: null, - location: null, - produceDeviceName: null - } - }, - departmentList: [], - levelList: [ - { id: 1, name: '低风险' }, - { id: 2, name: '一般风险' }, - { id: 3, name: '较大风险' }, - { id: 4, name: '重大风险' } - ] - }); - // 初始化表格数据 - const initProductionDeviceTableData = async () => { - let res = await productionDeviceApi().getProductionDeviceList(state.productionDeviceData.params); - if (res.data.code === '200') { - state.productionDeviceData.data = res.data.data; - state.productionDeviceData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - productionDeviceDialogRef.value.openProductionDeviceDialog(type, value, state.departmentList); - }; - // 删除角色 - const onDelProductionDevice = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await productionDeviceApi().deleteProductionDevice({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initProductionDeviceTableData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - const handleSearch = () => { - initProductionDeviceTableData(); - }; - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.productionDeviceData.params.pageSize = val; - initProductionDeviceTableData(); - }; - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.productionDeviceData.params.pageIndex = val; - initProductionDeviceTableData(); - }; - // 页面加载时 - onMounted(() => { - initProductionDeviceTableData(); - getDepartmentData(); - }); - return { - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelProductionDevice, - onHandleCurrentChange, - productionDeviceDialog, - productionDeviceDialogRef, - initProductionDeviceTableData, - ...toRefs(state) - }; - } -}); -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevel/event/components/safetyRiskEventDialog.vue b/src/views/doublePreventSystem/riskLevel/event/components/safetyRiskEventDialog.vue deleted file mode 100644 index fa2dee1..0000000 --- a/src/views/doublePreventSystem/riskLevel/event/components/safetyRiskEventDialog.vue +++ /dev/null @@ -1,160 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isSafetyRiskEventDialog" width="600px"> - <el-form - :model="safetyRiskEventForm" - :rules="safetyRiskEventFormRules" - ref="safetyRiskAnalyseUnitFormRef" - size="default" - label-width="180px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析单元名称" prop="riskUnitId"> - <el-select class="input-length" v-model="safetyRiskEventForm.riskUnitId" placeholder="请输入安全风险分析单元名称"> - <el-option - v-for="item in allSafetyRiskEventData" - :key="item.id" - :label="item.riskUnitName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险事件名称" prop="riskEventName"> - <el-input - class="input-length" - v-model.trim="safetyRiskEventForm.riskEventName" - placeholder="请输入生产装置名称" - clearable - ></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isSafetyRiskEventDialog = !isSafetyRiskEventDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitSafetyRiskEventDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isSafetyRiskEventDialog: Boolean; - safetyRiskEventForm: { - riskEventName: string | null; - riskUnitId: number | null; - }; - title: string; - departmentList: []; - allSafetyRiskEventData: []; - safetyRiskEventFormRules: {}; -} -import { reactive, toRefs, ref } from 'vue'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; -import { ElMessage } from 'element-plus'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const safetyRiskAnalyseUnitFormRef = ref(); - const state = reactive<stateType>({ - title: '', - departmentList: [], - allSafetyRiskEventData: [], - isSafetyRiskEventDialog: false, - safetyRiskEventForm: { - riskEventName: null, - riskUnitId: null - }, - safetyRiskEventFormRules: { - riskEventName: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitId: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }] - } - }); - - //打开模态框 - const openSafetyRiskEventDialog = (type: string, value: object, department: [], allSafetyRiskEventData: []) => { - state.isSafetyRiskEventDialog = true; - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(allSafetyRiskEventData)); - state.departmentList = department; - setTimeout(() => { - safetyRiskAnalyseUnitFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险事件'; - state.safetyRiskEventForm = { - riskEventName: null, - riskUnitId: null - }; - } else { - state.title = '修改风险事件'; - state.safetyRiskEventForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitSafetyRiskEventDialog = async () => { - safetyRiskAnalyseUnitFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险事件') { - let res = await safetyRiskEventApi().addSafetyRiskEvent(state.safetyRiskEventForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险事件新增成功', - duration: 2000 - }); - state.isSafetyRiskEventDialog = false; - context.emit('refreshSafetyRiskEvent'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await safetyRiskEventApi().modSafetyRiskEvent(state.safetyRiskEventForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险事件修改成功', - duration: 2000 - }); - state.isSafetyRiskEventDialog = false; - context.emit('refreshSafetyRiskEvent'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - safetyRiskAnalyseUnitFormRef, - submitSafetyRiskEventDialog, - openSafetyRiskEventDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevel/event/index.vue b/src/views/doublePreventSystem/riskLevel/event/index.vue deleted file mode 100644 index 89e98ab..0000000 --- a/src/views/doublePreventSystem/riskLevel/event/index.vue +++ /dev/null @@ -1,204 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>安全风险单元名称:</span> - <el-select v-model="safetyRiskEventData.params.riskUnitId" class="input-box" placeholder="安全风险单元名称"> - <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskUnitName" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>安全风险事件名称:</span> - <el-input v-model="safetyRiskEventData.params.riskEventName" class="input-box" placeholder="安全风险事件名称"> </el-input> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon><ele-Search /> </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增事件 - </el-button> - </div> - <el-table :data="safetyRiskEventData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="riskUnitName" label="安全风险分析单元名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskEventName" label="安全风险事件名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelSafetyRiskEvent(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="safetyRiskEventData.params.pageIndex" - background - v-model:page-size="safetyRiskEventData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="safetyRiskEventData.total" - > - </el-pagination> - </el-card> - <safetyRiskEventDialog ref="safetyRiskEventDialogRef" @refreshSafetyRiskEvent="initSafetyRiskEventData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import safetyRiskEventDialog from './components/safetyRiskEventDialog.vue'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent/index.ts'; -import { departmentApi } from '/@/api/department'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - safetyRiskEventData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskEventName: string | null; - }; - }; - allSafetyRiskEventData: Array<safetyRiskEventState>; -} -interface safetyRiskEventState {} - -export default { - name: 'productionDevice', - components: { safetyRiskEventDialog }, - setup() { - const safetyRiskEventDialogRef = ref(); - const state = reactive<TableDataState>({ - safetyRiskEventData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskEventName: null - } - }, - allSafetyRiskEventData: [] - }); - // 初始化表格数据 - const initSafetyRiskEventData = async () => { - let res = await safetyRiskEventApi().getSafetyRiskEventList(state.safetyRiskEventData.params); - if (res.data.code === '200') { - state.safetyRiskEventData.data = res.data.data; - state.safetyRiskEventData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 获取安全风险分析单元数据 - const getAllSafetyRiskEventData = async () => { - let res = await safetyRiskAnalyseUnitApi().getAllSafetyRiskAnalyseUnitList(); - if (res.data.code === '200') { - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(res.data.data)); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开安全风险事件 - const onOpenDialogRef = (type: string, value: any) => { - safetyRiskEventDialogRef.value.openSafetyRiskEventDialog(type, value, state.allSafetyRiskEventData); - }; - - // 删除角色 - const onDelSafetyRiskEvent = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条安全风险事件:“${row.riskEventName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await safetyRiskEventApi().deleteSafetyRiskEvent({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initSafetyRiskEventData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initSafetyRiskEventData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.safetyRiskEventData.params.pageSize = val; - initSafetyRiskEventData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.safetyRiskEventData.params.pageIndex = val; - initSafetyRiskEventData(); - }; - - // 页面加载时 - onMounted(() => { - getAllSafetyRiskEventData(); - initSafetyRiskEventData(); - }); - - return { - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelSafetyRiskEvent, - onHandleCurrentChange, - safetyRiskEventDialog, - safetyRiskEventDialogRef, - initSafetyRiskEventData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue b/src/views/doublePreventSystem/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue deleted file mode 100644 index 0764dc3..0000000 --- a/src/views/doublePreventSystem/riskLevel/unit/components/safetyRiskAnalyseUnitDialog.vue +++ /dev/null @@ -1,237 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isSafetyRiskAnalyseUnitDialog" width="600px"> - <el-form - :model="safetyRiskAnalyseUnitForm" - :rules="safetyRiskAnalyseUnitFormRules" - ref="safetyRiskAnalyseUnitFormRef" - size="default" - label-width="180px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析对象编码" prop="riskCode"> - <el-input - class="input-length" - v-model.trim="safetyRiskAnalyseUnitForm.riskCode" - placeholder="请输入安全风险分析对象编码" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析单元名称" prop="riskUnitName"> - <el-input - class="input-length" - v-model.trim="safetyRiskAnalyseUnitForm.riskUnitName" - placeholder="请输入安全风险分析单元名称" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="生产装置名称" prop="produceDeviceId"> - <el-select - class="input-length" - v-model="safetyRiskAnalyseUnitForm.produceDeviceId" - placeholder="请输入生产装置名称" - clearable - > - <el-option - v-for="item in allProduceDeviceData" - :key="item.id" - :label="item.produceDeviceName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="责任部门" prop="liableDepId"> - <el-cascader - @change="achieveUserList" - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="safetyRiskAnalyseUnitForm.liableDepId" - > - </el-cascader> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="责任人" prop="liablePersonId"> - <el-select - class="input-length" - v-model="safetyRiskAnalyseUnitForm.liablePersonId" - placeholder="请选择责任人" - clearable - filterable - > - <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> - </el-select> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isSafetyRiskAnalyseUnitDialog = !isSafetyRiskAnalyseUnitDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitSafetyRiskAnalyseUnitDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isSafetyRiskAnalyseUnitDialog: Boolean; - safetyRiskAnalyseUnitForm: { - riskCode: string | null; - riskUnitName: string | null; - liablePersonId: number | null; - liableDepId: number | null; - produceDeviceId: number | null; - }; - title: string; - userList: []; - departmentList: []; - allProduceDeviceData: []; - safetyRiskAnalyseUnitFormRules: {}; -} -import { reactive, toRefs, ref } from 'vue'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; -import { ElMessage } from 'element-plus'; -import { userApi } from '/@/api/user'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const safetyRiskAnalyseUnitFormRef = ref(); - const state = reactive<stateType>({ - title: '', - userList: [], - departmentList: [], - allProduceDeviceData: [], - isSafetyRiskAnalyseUnitDialog: false, - safetyRiskAnalyseUnitForm: { - riskCode: null, - riskUnitName: null, - liablePersonId: null, - liableDepId: null, - produceDeviceId: null - }, - safetyRiskAnalyseUnitFormRules: { - riskCode: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitName: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }], - liableDepId: [{ required: true, message: '请选择责任部门', trigger: 'change' }], - liablePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }], - produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] - } - }); - - //打开模态框 - const openSafetyRiskAnalyseUnitDialog = (type: string, value: object, department: [], allProduceDeviceData: []) => { - // console.log(jsonBig.stringify(123124124124214123131)) - state.isSafetyRiskAnalyseUnitDialog = true; - state.allProduceDeviceData = JSON.parse(JSON.stringify(allProduceDeviceData)); - state.departmentList = department; - setTimeout(() => { - safetyRiskAnalyseUnitFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险分析单元'; - state.safetyRiskAnalyseUnitForm = { - riskCode: null, - riskUnitName: null, - liablePersonId: null, - liableDepId: null, - produceDeviceId: null - }; - } else { - state.title = '修改风险分析单元'; - state.safetyRiskAnalyseUnitForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitSafetyRiskAnalyseUnitDialog = async () => { - safetyRiskAnalyseUnitFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险分析单元') { - let res = await safetyRiskAnalyseUnitApi().addSafetyRiskAnalyseUnit(state.safetyRiskAnalyseUnitForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险分析单元新增成功', - duration: 2000 - }); - state.isSafetyRiskAnalyseUnitDialog = false; - context.emit('refreshSafetyRiskAnalyseUnit'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await safetyRiskAnalyseUnitApi().modSafetyRiskAnalyseUnit(state.safetyRiskAnalyseUnitForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险分析单元修改成功', - duration: 2000 - }); - state.isSafetyRiskAnalyseUnitDialog = false; - context.emit('refreshSafetyRiskAnalyseUnit'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - const achieveUserList = () => { - state.safetyRiskAnalyseUnitForm.liablePersonId = null; - state.userList = []; - getUserData(); - }; - - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitForm.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - return { - ...toRefs(state), - achieveUserList, - safetyRiskAnalyseUnitFormRef, - submitSafetyRiskAnalyseUnitDialog, - openSafetyRiskAnalyseUnitDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevel/unit/index.vue b/src/views/doublePreventSystem/riskLevel/unit/index.vue deleted file mode 100644 index 34fd17c..0000000 --- a/src/views/doublePreventSystem/riskLevel/unit/index.vue +++ /dev/null @@ -1,269 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>责任部门:</span> - <el-cascader - @change="achieveUserList" - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'id', label: 'name' }" - placeholder="责任部门" - clearable - filterable - class="input-box" - v-model="safetyRiskAnalyseUnitData.params.liableDepId" - > - </el-cascader> - </div> - <div class="basic-line"> - <span>责任人:</span> - <el-select v-model="safetyRiskAnalyseUnitData.params.liablePersonId" clearable filterable class="input-box" placeholder="责任人"> - <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>单元名称:</span> - <el-input v-model="safetyRiskAnalyseUnitData.params.riskUnitName" clearable filterable class="input-box" placeholder="单元名称"> - </el-input> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增单元 - </el-button> - </div> - <el-table :data="safetyRiskAnalyseUnitData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskUnitName" label="安全风险分析单元名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskCode" label="安全风险分析对象编码" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="liableDep" label="责任部门" show-overflow-tooltip></el-table-column> - <el-table-column prop="liablePerson" label="责任人" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="safetyRiskAnalyseUnitData.params.pageIndex" - background - v-model:page-size="safetyRiskAnalyseUnitData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="safetyRiskAnalyseUnitData.total" - > - </el-pagination> - </el-card> - <safetyRiskAnalyseUnitDialog ref="safetyRiskAnalyseUnitDialogRef" @refreshSafetyRiskAnalyseUnit="initSafetyRiskAnalyseUnitData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import safetyRiskAnalyseUnitDialog from './components/safetyRiskAnalyseUnitDialog.vue'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit/index.ts'; -import { departmentApi } from '/@/api/department'; -import { userApi } from '/@/api/user'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - safetyRiskAnalyseUnitData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskUnitName: string | null; - liableDepId: number | null; - liablePersonId: number | null; - }; - }; - userList: Array<UserState>; - departmentList: Array<DepartmentState>; - allProduceDeviceData: Array<produceDeviceState>; -} -interface produceDeviceState {} -interface DepartmentState {} -interface UserState {} - -export default { - name: 'productionDevice', - components: { safetyRiskAnalyseUnitDialog }, - setup() { - const safetyRiskAnalyseUnitDialogRef = ref(); - const state = reactive<TableDataState>({ - safetyRiskAnalyseUnitData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskUnitName: null, - liableDepId: null, - liablePersonId: null - } - }, - userList: [], - departmentList: [], - allProduceDeviceData: [] - }); - // 初始化表格数据 - const initSafetyRiskAnalyseUnitData = async () => { - let res = await safetyRiskAnalyseUnitApi().getSafetyRiskAnalyseUnitList(state.safetyRiskAnalyseUnitData.params); - if (res.data.code === '200') { - state.safetyRiskAnalyseUnitData.data = res.data.data; - state.safetyRiskAnalyseUnitData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const achieveUserList = () => { - state.safetyRiskAnalyseUnitData.params.liablePersonId = null; - state.userList = []; - getUserData(); - }; - - //获取生产装置列表 - const getAllProduceDeviceData = async () => { - let res = await productionDeviceApi().getAllProductionDeviceList(); - if (res.data.code === '200') { - state.allProduceDeviceData = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取部门列表 - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitData.params.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - safetyRiskAnalyseUnitDialogRef.value.openSafetyRiskAnalyseUnitDialog(type, value, state.departmentList, state.allProduceDeviceData); - }; - - // 删除角色 - const onDelProductionDevice = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条安全风险分析单元:“${row.riskUnitName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await safetyRiskAnalyseUnitApi().deleteSafetyRiskAnalyseUnit({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initSafetyRiskAnalyseUnitData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initSafetyRiskAnalyseUnitData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.safetyRiskAnalyseUnitData.params.pageSize = val; - initSafetyRiskAnalyseUnitData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.safetyRiskAnalyseUnitData.params.pageIndex = val; - initSafetyRiskAnalyseUnitData(); - }; - - // 页面加载时 - onMounted(() => { - initSafetyRiskAnalyseUnitData(); - getAllProduceDeviceData(); - getDepartmentData(); - }); - - return { - handleSearch, - achieveUserList, - onOpenDialogRef, - onHandleSizeChange, - onDelProductionDevice, - onHandleCurrentChange, - safetyRiskAnalyseUnitDialog, - safetyRiskAnalyseUnitDialogRef, - initSafetyRiskAnalyseUnitData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevelManage/productionDevice/components/productionDeviceDialog.vue b/src/views/doublePreventSystem/riskLevelManage/productionDevice/components/productionDeviceDialog.vue deleted file mode 100644 index 6b9616e..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/productionDevice/components/productionDeviceDialog.vue +++ /dev/null @@ -1,200 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isShowProductionDeviceDialog" width="600px"> - <el-form - :model="productionDeviceForm" - :rules="productionDeviceFormRules" - ref="productionDeviceFormRef" - size="default" - label-width="120px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="生产装置名称" prop="produceDeviceName"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.produceDeviceName" - placeholder="请输入生产装置名称" - clearable - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="所属部门" prop="depId"> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="productionDeviceForm.depId" - > - </el-cascader> - <!-- <el-select class="input-length" v-model="productionDeviceForm.depName" placeholder="请选择所属部门" clearable filterable></el-select>--> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险等级" prop="riskLevel"> - <el-select - class="input-length" - v-model="productionDeviceForm.riskLevel" - placeholder="请选择风险等级" - clearable - filterable - > - <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="区域位置" prop="location"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.location" - type="textarea" - placeholder="请输入区域位置" - maxlength="150" - ></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isShowProductionDeviceDialog = !isShowProductionDeviceDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitProductionDevice" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isShowProductionDeviceDialog: Boolean; - productionDeviceForm: { - produceDeviceName: string; - depId: number | null; - riskLevel: number | null; - location: string; - }; - title: string; - departmentList: []; - levelList: Array<levelListState>; - productionDeviceFormRules: {}; -} -interface levelListState {} -import { reactive, toRefs, ref } from 'vue'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; -import { ElMessage } from 'element-plus'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const productionDeviceFormRef = ref(); - const state = reactive<stateType>({ - title: '', - departmentList: [], - isShowProductionDeviceDialog: false, - levelList: [ - { id: 1, name: '低风险' }, - { id: 2, name: '一般风险' }, - { id: 3, name: '较大风险' }, - { id: 4, name: '重大风险' } - ], - productionDeviceForm: { - produceDeviceName: '', - depId: null, - riskLevel: null, - location: '' - }, - productionDeviceFormRules: { - produceDeviceName: [{ required: true, message: '请填写生产装置名称', trigger: 'blur' }], - depId: [{ required: true, message: '请选择部门', trigger: 'change' }], - riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], - location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] - } - }); - - //打开模态框 - const openProductionDeviceDialog = (type: string, value: object, department: []) => { - state.isShowProductionDeviceDialog = true; - state.departmentList = department; - setTimeout(() => { - productionDeviceFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增生产装置'; - state.productionDeviceForm = { - produceDeviceName: '', - depId: null, - riskLevel: null, - location: '' - }; - } else { - state.title = '修改生产装置'; - state.productionDeviceForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitProductionDevice = async () => { - productionDeviceFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增生产装置') { - let res = await productionDeviceApi().addProductionDevice(state.productionDeviceForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '生产装置新增成功', - duration: 2000 - }); - state.isShowProductionDeviceDialog = false; - context.emit('refreshProductionDevice'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await productionDeviceApi().modProductionDevice(state.productionDeviceForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '生产装置修改成功', - duration: 2000 - }); - state.isShowProductionDeviceDialog = false; - context.emit('refreshProductionDevice'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - productionDeviceFormRef, - submitProductionDevice, - openProductionDeviceDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevelManage/productionDevice/index.vue b/src/views/doublePreventSystem/riskLevelManage/productionDevice/index.vue deleted file mode 100644 index c240e35..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/productionDevice/index.vue +++ /dev/null @@ -1,226 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>风险等级:</span> - <el-select v-model="productionDeviceData.params.riskLevel" clearable filterable class="input-box" placeholder="请选择风险等级"> - <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>部门:</span> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'id', label: 'name' }" - placeholder="请选择部门" - clearable - filterable - class="input-box" - v-model="productionDeviceData.params.depId" - > - </el-cascader> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增装置 - </el-button> - </div> - <el-table :data="productionDeviceData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="depName" label="所属部门" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip></el-table-column> - <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column> - <el-table-column prop="status" label="状态" show-overflow-tooltip> </el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="productionDeviceData.params.pageIndex" - background - v-model:page-size="productionDeviceData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="productionDeviceData.total" - > - </el-pagination> - </el-card> - <productionDeviceDialog ref="productionDeviceDialogRef" @refreshProductionDevice="initProductionDeviceTableData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import productionDeviceDialog from './components/productionDeviceDialog.vue'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice/index.ts'; -import { departmentApi } from '/@/api/department'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - productionDeviceData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskLevel: number | null; - status: number; - depId: number | null; - location: string | null; - produceDeviceName: string | null; - }; - }; - departmentList: Array<DepartmentState>; - levelList: Array<levelListState>; -} -interface levelListState {} -interface DepartmentState {} - -export default defineComponent({ - name: 'productionDevice', - components: { productionDeviceDialog }, - setup() { - const productionDeviceDialogRef = ref(); - const state = reactive<TableDataState>({ - productionDeviceData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskLevel: null, - status: 1, - depId: null, - location: null, - produceDeviceName: null - } - }, - departmentList: [], - levelList: [ - { id: 1, name: '低风险' }, - { id: 2, name: '一般风险' }, - { id: 3, name: '较大风险' }, - { id: 4, name: '重大风险' } - ] - }); - // 初始化表格数据 - const initProductionDeviceTableData = async () => { - let res = await productionDeviceApi().getProductionDeviceList(state.productionDeviceData.params); - if (res.data.code === '200') { - state.productionDeviceData.data = res.data.data; - state.productionDeviceData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - productionDeviceDialogRef.value.openProductionDeviceDialog(type, value, state.departmentList); - }; - // 删除角色 - const onDelProductionDevice = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await productionDeviceApi().deleteProductionDevice({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initProductionDeviceTableData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - const handleSearch = () => { - initProductionDeviceTableData(); - }; - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.productionDeviceData.params.pageSize = val; - initProductionDeviceTableData(); - }; - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.productionDeviceData.params.pageIndex = val; - initProductionDeviceTableData(); - }; - // 页面加载时 - onMounted(() => { - initProductionDeviceTableData(); - getDepartmentData(); - }); - return { - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelProductionDevice, - onHandleCurrentChange, - productionDeviceDialog, - productionDeviceDialogRef, - initProductionDeviceTableData, - ...toRefs(state) - }; - } -}); -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevelManage/riskControlMeasure/components/riskControlMeasureDialog.vue b/src/views/doublePreventSystem/riskLevelManage/riskControlMeasure/components/riskControlMeasureDialog.vue deleted file mode 100644 index 86937df..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/riskControlMeasure/components/riskControlMeasureDialog.vue +++ /dev/null @@ -1,263 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isRiskControlMeasureDialog" width="600px"> - <el-form - :model="riskControlMeasureForm" - :rules="riskControlMeasureFormRules" - ref="riskControlMeasureFormRef" - size="default" - label-width="160px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险事件名称" prop="riskEventId"> - <el-select class="input-length" v-model="riskControlMeasureForm.riskEventId" placeholder="请选择风险事件" clearable> - <el-option - v-for="item in allSafetyRiskEventData" - :key="item.id" - :label="item.riskEventName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险措施编码" prop="controlMeasureCode"> - <el-input - class="input-length" - v-model.trim="riskControlMeasureForm.controlMeasureCode" - placeholder="请输入风险措施编码" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控方式" prop="controlType"> - <el-select class="input-length" v-model="riskControlMeasureForm.controlType" placeholder="请选择管控方式" clearable> - <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控内容" prop="checkContent"> - <el-input - class="input-length" - type="textarea" - :rows="3" - v-model.trim="riskControlMeasureForm.checkContent" - placeholder="请输入管控内容" - clearable - > - </el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类1" prop="classify1"> - <el-select - class="input-length" - v-model.trim="riskControlMeasureForm.classify1" - @change="changeClassifyTwoList" - placeholder="请选择管控方式" - clearable - > - <el-option v-for="item in classifyOneList" :key="item.id" :label="item.riskMeasureName" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类2" prop="classify2"> - <el-select class="input-length" v-model="riskControlMeasureForm.classify2" placeholder="请选择管控方式" clearable> - <el-option v-for="item in classifyTwoList" :key="item.id" :label="item.riskMeasureName" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类3" prop="classify3"> - <el-input class="input-length" v-model.trim="riskControlMeasureForm.classify3" placeholder="请选择管控方式" clearable> - </el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="措施说明" prop="measureDesc"> - <el-input - class="input-length" - type="textarea" - :rows="3" - v-model.trim="riskControlMeasureForm.measureDesc" - placeholder="请输入措施说明" - clearable - > - </el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isRiskControlMeasureDialog = !isRiskControlMeasureDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitRiskControlMeasureDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isRiskControlMeasureDialog: Boolean; - riskControlMeasureForm: { - riskEventId: number | null; - controlMeasureCode: string | null; - controlType: number | null; - checkContent: string | null; - classify1: number | null; - classify2: number | null; - classify3: string | null; - measureDesc: string | null; - }; - title: string; - controlTypeList: Array<controlTypeListType>; - classifyOneList: []; - classifyTwoList: Array<classifyTwoType>; - classifyTwoListAll: []; - allSafetyRiskEventData: []; - riskControlMeasureFormRules: {}; -} -interface classifyTwoType { - id: number; - riskMeasureName: string; -} -interface controlTypeListType {} - -import { reactive, toRefs, ref } from 'vue'; -import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure'; -import { ElMessage } from 'element-plus'; -export default { - name: 'riskControlMeasureDialog', - setup(props: any, context: any) { - const riskControlMeasureFormRef = ref(); - const state = reactive<stateType>({ - title: '', - controlTypeList: [ - { id: 1, name: '自动化监控' }, - { id: 2, name: '隐患排查' } - ], - classifyOneList: [], - classifyTwoList: [], - classifyTwoListAll: [], - allSafetyRiskEventData: [], - isRiskControlMeasureDialog: false, - riskControlMeasureForm: { - riskEventId: null, - controlMeasureCode: null, - controlType: null, - checkContent: null, - classify1: null, - classify2: null, - classify3: null, - measureDesc: null - }, - riskControlMeasureFormRules: { - riskCode: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitName: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }], - liableDepId: [{ required: true, message: '请选择责任部门', trigger: 'change' }], - liablePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }], - produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] - } - }); - - //打开模态框 - const openSafetyRiskEventDialog = (type: string, value: object, allSafetyRiskEventData: [], classifyOneList: [], classifyTwoList: []) => { - state.isRiskControlMeasureDialog = true; - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(allSafetyRiskEventData)); - state.classifyOneList = JSON.parse(JSON.stringify(classifyOneList)); - state.classifyTwoListAll = JSON.parse(JSON.stringify(classifyTwoList)); - state.classifyTwoList = []; - setTimeout(() => { - riskControlMeasureFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险管控措施'; - state.riskControlMeasureForm = { - riskEventId: null, - controlMeasureCode: null, - controlType: null, - checkContent: null, - classify1: null, - classify2: null, - classify3: null, - measureDesc: null - }; - } else { - state.title = '修改风险管控措施'; - state.riskControlMeasureForm = JSON.parse(JSON.stringify(value)); - } - }; - - const changeClassifyTwoList = () => { - state.riskControlMeasureForm.classify2 = null; - state.classifyTwoList = []; - state.classifyTwoList = state.classifyTwoListAll.filter((item: any) => item.parentId === state.riskControlMeasureForm.classify1); - }; - - //新增修改提交 - const submitRiskControlMeasureDialog = async () => { - riskControlMeasureFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险管控措施') { - let res = await riskControlMeasureApi().addRiskControlMeasure(state.riskControlMeasureForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险管控措施新增成功', - duration: 2000 - }); - state.isRiskControlMeasureDialog = false; - context.emit('refreshRiskControlMeasure'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await riskControlMeasureApi().modRiskControlMeasure(state.riskControlMeasureForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险管控措施修改成功', - duration: 2000 - }); - state.isRiskControlMeasureDialog = false; - context.emit('refreshRiskControlMeasure'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - riskControlMeasureFormRef, - changeClassifyTwoList, - submitRiskControlMeasureDialog, - openSafetyRiskEventDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevelManage/riskControlMeasure/index.vue b/src/views/doublePreventSystem/riskLevelManage/riskControlMeasure/index.vue deleted file mode 100644 index 6d79aa1..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/riskControlMeasure/index.vue +++ /dev/null @@ -1,271 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>管控方式:</span> - <el-select class="input-box" v-model="riskControlMeasureData.params.controlType" placeholder="管控方式" clearable> - <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>安全风险事件:</span> - <el-select class="input-box" v-model="riskControlMeasureData.params.riskEventId" placeholder="安全风险事件" clearable> - <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskEventName" :value="item.id"></el-option> - </el-select> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增措施 - </el-button> - </div> - <el-table :data="riskControlMeasureData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="riskEventName" label="安全风险事件名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="controlMeasureCode" label="风控措施编码" show-overflow-tooltip></el-table-column> - <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip></el-table-column> - <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip></el-table-column> - <el-table-column prop="classify3" label="管控措施分类3" show-overflow-tooltip></el-table-column> - <el-table-column prop="measureDesc" label="措施说明" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip> - <template #default="scope"> - <span>{{ dateFormat('YYYY-mm-dd HH:MM:SS', '2022-07-07T08:00:00') }}</span> - </template> - </el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelRiskControlMeasure(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="riskControlMeasureData.params.pageIndex" - background - v-model:page-size="riskControlMeasureData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="riskControlMeasureData.total" - > - </el-pagination> - </el-card> - <riskControlMeasureDialog ref="riskControlMeasureDialogRef" @refreshRiskControlMeasure="initRiskControlMeasureData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import riskControlMeasureDialog from './components/riskControlMeasureDialog.vue'; -import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure/index.ts'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - riskControlMeasureData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - controlType: number | null; - riskEventId: number | null; - }; - }; - controlTypeList: Array<controlTypeType>; - classifyOneList: Array<classifyOneType>; - classifyTwoList: Array<classifyTwoType>; - allSafetyRiskEventData: Array<SafetyRiskEventDataState>; -} -interface controlTypeType {} -interface classifyOneType {} -interface classifyTwoType {} -interface SafetyRiskEventDataState {} - -export default { - name: 'riskControlMeasure', - components: { riskControlMeasureDialog }, - setup() { - const riskControlMeasureDialogRef = ref(); - const state = reactive<TableDataState>({ - riskControlMeasureData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - controlType: null, - riskEventId: null - } - }, - controlTypeList: [ - { id: 1, name: '自动化监控' }, - { id: 2, name: '隐患排查' } - ], - classifyOneList: [], - classifyTwoList: [], - allSafetyRiskEventData: [] - }); - - // 初始化表格数据 - const initRiskControlMeasureData = async () => { - let res = await riskControlMeasureApi().getRiskControlMeasureList(state.riskControlMeasureData.params); - if (res.data.code === '200') { - state.riskControlMeasureData.data = res.data.data; - state.riskControlMeasureData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const dateFormat = (fmt: any, date: any) => { - date = new Date(date); - fmt = - date.getFullYear() + - '-' + - (date.getMonth() + 1) + - '-' + - date.getDate() + - ' ' + - date.getHours().toString() + - ':' + - (date.getMinutes().toString() === '0' ? '00' : date.getMinutes().toString()) + - ':' + - (date.getSeconds().toString() === '0' ? '00' : date.getMinutes().toString()); - return fmt; - }; - - //获取安全风险事件 - const getAllSafetyRiskEvent = async () => { - let res = await safetyRiskEventApi().getAllSafetyRiskEventList(); - if (res.data.code === '200') { - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(res.data.data)); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取管控措施分类 - const getClassify = async () => { - let res = await riskControlMeasureApi().getClassifyData(); - if (res.data.code === '200') { - state.classifyOneList = res.data.data.filter((item: any) => item.parentId === null); - state.classifyTwoList = res.data.data.filter((item: any) => item.parentId !== null); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - riskControlMeasureDialogRef.value.openSafetyRiskEventDialog( - type, - value, - state.allSafetyRiskEventData, - state.classifyOneList, - state.classifyTwoList - ); - }; - - // 删除角色 - const onDelRiskControlMeasure = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条风险管控措施:“${row.produceDeviceName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await riskControlMeasureApi().deleteRiskControlMeasure({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initRiskControlMeasureData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initRiskControlMeasureData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.riskControlMeasureData.params.pageSize = val; - initRiskControlMeasureData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.riskControlMeasureData.params.pageIndex = val; - initRiskControlMeasureData(); - }; - - // 页面加载时 - onMounted(() => { - initRiskControlMeasureData(); - getAllSafetyRiskEvent(); - getClassify(); - }); - - return { - dateFormat, - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelRiskControlMeasure, - onHandleCurrentChange, - riskControlMeasureDialog, - riskControlMeasureDialogRef, - initRiskControlMeasureData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevelManage/safetyRiskAnalyseUnit/components/safetyRiskAnalyseUnitDialog.vue b/src/views/doublePreventSystem/riskLevelManage/safetyRiskAnalyseUnit/components/safetyRiskAnalyseUnitDialog.vue deleted file mode 100644 index 0764dc3..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/safetyRiskAnalyseUnit/components/safetyRiskAnalyseUnitDialog.vue +++ /dev/null @@ -1,237 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isSafetyRiskAnalyseUnitDialog" width="600px"> - <el-form - :model="safetyRiskAnalyseUnitForm" - :rules="safetyRiskAnalyseUnitFormRules" - ref="safetyRiskAnalyseUnitFormRef" - size="default" - label-width="180px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析对象编码" prop="riskCode"> - <el-input - class="input-length" - v-model.trim="safetyRiskAnalyseUnitForm.riskCode" - placeholder="请输入安全风险分析对象编码" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析单元名称" prop="riskUnitName"> - <el-input - class="input-length" - v-model.trim="safetyRiskAnalyseUnitForm.riskUnitName" - placeholder="请输入安全风险分析单元名称" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="生产装置名称" prop="produceDeviceId"> - <el-select - class="input-length" - v-model="safetyRiskAnalyseUnitForm.produceDeviceId" - placeholder="请输入生产装置名称" - clearable - > - <el-option - v-for="item in allProduceDeviceData" - :key="item.id" - :label="item.produceDeviceName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="责任部门" prop="liableDepId"> - <el-cascader - @change="achieveUserList" - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="safetyRiskAnalyseUnitForm.liableDepId" - > - </el-cascader> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="责任人" prop="liablePersonId"> - <el-select - class="input-length" - v-model="safetyRiskAnalyseUnitForm.liablePersonId" - placeholder="请选择责任人" - clearable - filterable - > - <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> - </el-select> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isSafetyRiskAnalyseUnitDialog = !isSafetyRiskAnalyseUnitDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitSafetyRiskAnalyseUnitDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isSafetyRiskAnalyseUnitDialog: Boolean; - safetyRiskAnalyseUnitForm: { - riskCode: string | null; - riskUnitName: string | null; - liablePersonId: number | null; - liableDepId: number | null; - produceDeviceId: number | null; - }; - title: string; - userList: []; - departmentList: []; - allProduceDeviceData: []; - safetyRiskAnalyseUnitFormRules: {}; -} -import { reactive, toRefs, ref } from 'vue'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; -import { ElMessage } from 'element-plus'; -import { userApi } from '/@/api/user'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const safetyRiskAnalyseUnitFormRef = ref(); - const state = reactive<stateType>({ - title: '', - userList: [], - departmentList: [], - allProduceDeviceData: [], - isSafetyRiskAnalyseUnitDialog: false, - safetyRiskAnalyseUnitForm: { - riskCode: null, - riskUnitName: null, - liablePersonId: null, - liableDepId: null, - produceDeviceId: null - }, - safetyRiskAnalyseUnitFormRules: { - riskCode: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitName: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }], - liableDepId: [{ required: true, message: '请选择责任部门', trigger: 'change' }], - liablePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }], - produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] - } - }); - - //打开模态框 - const openSafetyRiskAnalyseUnitDialog = (type: string, value: object, department: [], allProduceDeviceData: []) => { - // console.log(jsonBig.stringify(123124124124214123131)) - state.isSafetyRiskAnalyseUnitDialog = true; - state.allProduceDeviceData = JSON.parse(JSON.stringify(allProduceDeviceData)); - state.departmentList = department; - setTimeout(() => { - safetyRiskAnalyseUnitFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险分析单元'; - state.safetyRiskAnalyseUnitForm = { - riskCode: null, - riskUnitName: null, - liablePersonId: null, - liableDepId: null, - produceDeviceId: null - }; - } else { - state.title = '修改风险分析单元'; - state.safetyRiskAnalyseUnitForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitSafetyRiskAnalyseUnitDialog = async () => { - safetyRiskAnalyseUnitFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险分析单元') { - let res = await safetyRiskAnalyseUnitApi().addSafetyRiskAnalyseUnit(state.safetyRiskAnalyseUnitForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险分析单元新增成功', - duration: 2000 - }); - state.isSafetyRiskAnalyseUnitDialog = false; - context.emit('refreshSafetyRiskAnalyseUnit'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await safetyRiskAnalyseUnitApi().modSafetyRiskAnalyseUnit(state.safetyRiskAnalyseUnitForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险分析单元修改成功', - duration: 2000 - }); - state.isSafetyRiskAnalyseUnitDialog = false; - context.emit('refreshSafetyRiskAnalyseUnit'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - const achieveUserList = () => { - state.safetyRiskAnalyseUnitForm.liablePersonId = null; - state.userList = []; - getUserData(); - }; - - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitForm.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - return { - ...toRefs(state), - achieveUserList, - safetyRiskAnalyseUnitFormRef, - submitSafetyRiskAnalyseUnitDialog, - openSafetyRiskAnalyseUnitDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevelManage/safetyRiskAnalyseUnit/index.vue b/src/views/doublePreventSystem/riskLevelManage/safetyRiskAnalyseUnit/index.vue deleted file mode 100644 index 34fd17c..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/safetyRiskAnalyseUnit/index.vue +++ /dev/null @@ -1,269 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>责任部门:</span> - <el-cascader - @change="achieveUserList" - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'id', label: 'name' }" - placeholder="责任部门" - clearable - filterable - class="input-box" - v-model="safetyRiskAnalyseUnitData.params.liableDepId" - > - </el-cascader> - </div> - <div class="basic-line"> - <span>责任人:</span> - <el-select v-model="safetyRiskAnalyseUnitData.params.liablePersonId" clearable filterable class="input-box" placeholder="责任人"> - <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>单元名称:</span> - <el-input v-model="safetyRiskAnalyseUnitData.params.riskUnitName" clearable filterable class="input-box" placeholder="单元名称"> - </el-input> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增单元 - </el-button> - </div> - <el-table :data="safetyRiskAnalyseUnitData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskUnitName" label="安全风险分析单元名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskCode" label="安全风险分析对象编码" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="liableDep" label="责任部门" show-overflow-tooltip></el-table-column> - <el-table-column prop="liablePerson" label="责任人" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="safetyRiskAnalyseUnitData.params.pageIndex" - background - v-model:page-size="safetyRiskAnalyseUnitData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="safetyRiskAnalyseUnitData.total" - > - </el-pagination> - </el-card> - <safetyRiskAnalyseUnitDialog ref="safetyRiskAnalyseUnitDialogRef" @refreshSafetyRiskAnalyseUnit="initSafetyRiskAnalyseUnitData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import safetyRiskAnalyseUnitDialog from './components/safetyRiskAnalyseUnitDialog.vue'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit/index.ts'; -import { departmentApi } from '/@/api/department'; -import { userApi } from '/@/api/user'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - safetyRiskAnalyseUnitData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskUnitName: string | null; - liableDepId: number | null; - liablePersonId: number | null; - }; - }; - userList: Array<UserState>; - departmentList: Array<DepartmentState>; - allProduceDeviceData: Array<produceDeviceState>; -} -interface produceDeviceState {} -interface DepartmentState {} -interface UserState {} - -export default { - name: 'productionDevice', - components: { safetyRiskAnalyseUnitDialog }, - setup() { - const safetyRiskAnalyseUnitDialogRef = ref(); - const state = reactive<TableDataState>({ - safetyRiskAnalyseUnitData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskUnitName: null, - liableDepId: null, - liablePersonId: null - } - }, - userList: [], - departmentList: [], - allProduceDeviceData: [] - }); - // 初始化表格数据 - const initSafetyRiskAnalyseUnitData = async () => { - let res = await safetyRiskAnalyseUnitApi().getSafetyRiskAnalyseUnitList(state.safetyRiskAnalyseUnitData.params); - if (res.data.code === '200') { - state.safetyRiskAnalyseUnitData.data = res.data.data; - state.safetyRiskAnalyseUnitData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const achieveUserList = () => { - state.safetyRiskAnalyseUnitData.params.liablePersonId = null; - state.userList = []; - getUserData(); - }; - - //获取生产装置列表 - const getAllProduceDeviceData = async () => { - let res = await productionDeviceApi().getAllProductionDeviceList(); - if (res.data.code === '200') { - state.allProduceDeviceData = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取部门列表 - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitData.params.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - safetyRiskAnalyseUnitDialogRef.value.openSafetyRiskAnalyseUnitDialog(type, value, state.departmentList, state.allProduceDeviceData); - }; - - // 删除角色 - const onDelProductionDevice = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条安全风险分析单元:“${row.riskUnitName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await safetyRiskAnalyseUnitApi().deleteSafetyRiskAnalyseUnit({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initSafetyRiskAnalyseUnitData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initSafetyRiskAnalyseUnitData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.safetyRiskAnalyseUnitData.params.pageSize = val; - initSafetyRiskAnalyseUnitData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.safetyRiskAnalyseUnitData.params.pageIndex = val; - initSafetyRiskAnalyseUnitData(); - }; - - // 页面加载时 - onMounted(() => { - initSafetyRiskAnalyseUnitData(); - getAllProduceDeviceData(); - getDepartmentData(); - }); - - return { - handleSearch, - achieveUserList, - onOpenDialogRef, - onHandleSizeChange, - onDelProductionDevice, - onHandleCurrentChange, - safetyRiskAnalyseUnitDialog, - safetyRiskAnalyseUnitDialogRef, - initSafetyRiskAnalyseUnitData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevelManage/safetyRiskEvent/components/safetyRiskEventDialog.vue b/src/views/doublePreventSystem/riskLevelManage/safetyRiskEvent/components/safetyRiskEventDialog.vue deleted file mode 100644 index fa2dee1..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/safetyRiskEvent/components/safetyRiskEventDialog.vue +++ /dev/null @@ -1,160 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isSafetyRiskEventDialog" width="600px"> - <el-form - :model="safetyRiskEventForm" - :rules="safetyRiskEventFormRules" - ref="safetyRiskAnalyseUnitFormRef" - size="default" - label-width="180px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析单元名称" prop="riskUnitId"> - <el-select class="input-length" v-model="safetyRiskEventForm.riskUnitId" placeholder="请输入安全风险分析单元名称"> - <el-option - v-for="item in allSafetyRiskEventData" - :key="item.id" - :label="item.riskUnitName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险事件名称" prop="riskEventName"> - <el-input - class="input-length" - v-model.trim="safetyRiskEventForm.riskEventName" - placeholder="请输入生产装置名称" - clearable - ></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isSafetyRiskEventDialog = !isSafetyRiskEventDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitSafetyRiskEventDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isSafetyRiskEventDialog: Boolean; - safetyRiskEventForm: { - riskEventName: string | null; - riskUnitId: number | null; - }; - title: string; - departmentList: []; - allSafetyRiskEventData: []; - safetyRiskEventFormRules: {}; -} -import { reactive, toRefs, ref } from 'vue'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; -import { ElMessage } from 'element-plus'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const safetyRiskAnalyseUnitFormRef = ref(); - const state = reactive<stateType>({ - title: '', - departmentList: [], - allSafetyRiskEventData: [], - isSafetyRiskEventDialog: false, - safetyRiskEventForm: { - riskEventName: null, - riskUnitId: null - }, - safetyRiskEventFormRules: { - riskEventName: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitId: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }] - } - }); - - //打开模态框 - const openSafetyRiskEventDialog = (type: string, value: object, department: [], allSafetyRiskEventData: []) => { - state.isSafetyRiskEventDialog = true; - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(allSafetyRiskEventData)); - state.departmentList = department; - setTimeout(() => { - safetyRiskAnalyseUnitFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险事件'; - state.safetyRiskEventForm = { - riskEventName: null, - riskUnitId: null - }; - } else { - state.title = '修改风险事件'; - state.safetyRiskEventForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitSafetyRiskEventDialog = async () => { - safetyRiskAnalyseUnitFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险事件') { - let res = await safetyRiskEventApi().addSafetyRiskEvent(state.safetyRiskEventForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险事件新增成功', - duration: 2000 - }); - state.isSafetyRiskEventDialog = false; - context.emit('refreshSafetyRiskEvent'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await safetyRiskEventApi().modSafetyRiskEvent(state.safetyRiskEventForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险事件修改成功', - duration: 2000 - }); - state.isSafetyRiskEventDialog = false; - context.emit('refreshSafetyRiskEvent'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - safetyRiskAnalyseUnitFormRef, - submitSafetyRiskEventDialog, - openSafetyRiskEventDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/riskLevelManage/safetyRiskEvent/index.vue b/src/views/doublePreventSystem/riskLevelManage/safetyRiskEvent/index.vue deleted file mode 100644 index 89e98ab..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/safetyRiskEvent/index.vue +++ /dev/null @@ -1,204 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>安全风险单元名称:</span> - <el-select v-model="safetyRiskEventData.params.riskUnitId" class="input-box" placeholder="安全风险单元名称"> - <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskUnitName" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>安全风险事件名称:</span> - <el-input v-model="safetyRiskEventData.params.riskEventName" class="input-box" placeholder="安全风险事件名称"> </el-input> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon><ele-Search /> </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增事件 - </el-button> - </div> - <el-table :data="safetyRiskEventData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="riskUnitName" label="安全风险分析单元名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskEventName" label="安全风险事件名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelSafetyRiskEvent(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="safetyRiskEventData.params.pageIndex" - background - v-model:page-size="safetyRiskEventData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="safetyRiskEventData.total" - > - </el-pagination> - </el-card> - <safetyRiskEventDialog ref="safetyRiskEventDialogRef" @refreshSafetyRiskEvent="initSafetyRiskEventData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import safetyRiskEventDialog from './components/safetyRiskEventDialog.vue'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent/index.ts'; -import { departmentApi } from '/@/api/department'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - safetyRiskEventData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskEventName: string | null; - }; - }; - allSafetyRiskEventData: Array<safetyRiskEventState>; -} -interface safetyRiskEventState {} - -export default { - name: 'productionDevice', - components: { safetyRiskEventDialog }, - setup() { - const safetyRiskEventDialogRef = ref(); - const state = reactive<TableDataState>({ - safetyRiskEventData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskEventName: null - } - }, - allSafetyRiskEventData: [] - }); - // 初始化表格数据 - const initSafetyRiskEventData = async () => { - let res = await safetyRiskEventApi().getSafetyRiskEventList(state.safetyRiskEventData.params); - if (res.data.code === '200') { - state.safetyRiskEventData.data = res.data.data; - state.safetyRiskEventData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 获取安全风险分析单元数据 - const getAllSafetyRiskEventData = async () => { - let res = await safetyRiskAnalyseUnitApi().getAllSafetyRiskAnalyseUnitList(); - if (res.data.code === '200') { - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(res.data.data)); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开安全风险事件 - const onOpenDialogRef = (type: string, value: any) => { - safetyRiskEventDialogRef.value.openSafetyRiskEventDialog(type, value, state.allSafetyRiskEventData); - }; - - // 删除角色 - const onDelSafetyRiskEvent = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条安全风险事件:“${row.riskEventName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await safetyRiskEventApi().deleteSafetyRiskEvent({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initSafetyRiskEventData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initSafetyRiskEventData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.safetyRiskEventData.params.pageSize = val; - initSafetyRiskEventData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.safetyRiskEventData.params.pageIndex = val; - initSafetyRiskEventData(); - }; - - // 页面加载时 - onMounted(() => { - getAllSafetyRiskEventData(); - initSafetyRiskEventData(); - }); - - return { - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelSafetyRiskEvent, - onHandleCurrentChange, - safetyRiskEventDialog, - safetyRiskEventDialogRef, - initSafetyRiskEventData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/riskLevelManage/safetyRiskSpaceImg/index.vue b/src/views/doublePreventSystem/riskLevelManage/safetyRiskSpaceImg/index.vue deleted file mode 100644 index 769e721..0000000 --- a/src/views/doublePreventSystem/riskLevelManage/safetyRiskSpaceImg/index.vue +++ /dev/null @@ -1,13 +0,0 @@ -<template> - <div> - <h1></h1> - </div> -</template> - -<script> -export default { - name: "index", -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test/oneTwoThreeFourFiveSix/index.vue b/src/views/doublePreventSystem/test/oneTwoThreeFourFiveSix/index.vue deleted file mode 100644 index ea0d797..0000000 --- a/src/views/doublePreventSystem/test/oneTwoThreeFourFiveSix/index.vue +++ /dev/null @@ -1,9 +0,0 @@ -<template></template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test/test1-1/index.vue b/src/views/doublePreventSystem/test/test1-1/index.vue deleted file mode 100644 index 90bbe6f..0000000 --- a/src/views/doublePreventSystem/test/test1-1/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>222</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test/test1-2/index.vue b/src/views/doublePreventSystem/test/test1-2/index.vue deleted file mode 100644 index e6a1a17..0000000 --- a/src/views/doublePreventSystem/test/test1-2/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>111</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test/test1-3/index.vue b/src/views/doublePreventSystem/test/test1-3/index.vue deleted file mode 100644 index 4ed6651..0000000 --- a/src/views/doublePreventSystem/test/test1-3/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>333</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test/test1-4/index.vue b/src/views/doublePreventSystem/test/test1-4/index.vue deleted file mode 100644 index 06981ee..0000000 --- a/src/views/doublePreventSystem/test/test1-4/index.vue +++ /dev/null @@ -1,11 +0,0 @@ -<template> - <div>444</div> -</template> - -<script> -export default { - name: 'index' -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test2/riskControlMeasure/components/riskControlMeasureDialog.vue b/src/views/doublePreventSystem/test2/riskControlMeasure/components/riskControlMeasureDialog.vue deleted file mode 100644 index 86937df..0000000 --- a/src/views/doublePreventSystem/test2/riskControlMeasure/components/riskControlMeasureDialog.vue +++ /dev/null @@ -1,263 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isRiskControlMeasureDialog" width="600px"> - <el-form - :model="riskControlMeasureForm" - :rules="riskControlMeasureFormRules" - ref="riskControlMeasureFormRef" - size="default" - label-width="160px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险事件名称" prop="riskEventId"> - <el-select class="input-length" v-model="riskControlMeasureForm.riskEventId" placeholder="请选择风险事件" clearable> - <el-option - v-for="item in allSafetyRiskEventData" - :key="item.id" - :label="item.riskEventName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险措施编码" prop="controlMeasureCode"> - <el-input - class="input-length" - v-model.trim="riskControlMeasureForm.controlMeasureCode" - placeholder="请输入风险措施编码" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控方式" prop="controlType"> - <el-select class="input-length" v-model="riskControlMeasureForm.controlType" placeholder="请选择管控方式" clearable> - <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控内容" prop="checkContent"> - <el-input - class="input-length" - type="textarea" - :rows="3" - v-model.trim="riskControlMeasureForm.checkContent" - placeholder="请输入管控内容" - clearable - > - </el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类1" prop="classify1"> - <el-select - class="input-length" - v-model.trim="riskControlMeasureForm.classify1" - @change="changeClassifyTwoList" - placeholder="请选择管控方式" - clearable - > - <el-option v-for="item in classifyOneList" :key="item.id" :label="item.riskMeasureName" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类2" prop="classify2"> - <el-select class="input-length" v-model="riskControlMeasureForm.classify2" placeholder="请选择管控方式" clearable> - <el-option v-for="item in classifyTwoList" :key="item.id" :label="item.riskMeasureName" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="管控措施分类3" prop="classify3"> - <el-input class="input-length" v-model.trim="riskControlMeasureForm.classify3" placeholder="请选择管控方式" clearable> - </el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="措施说明" prop="measureDesc"> - <el-input - class="input-length" - type="textarea" - :rows="3" - v-model.trim="riskControlMeasureForm.measureDesc" - placeholder="请输入措施说明" - clearable - > - </el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isRiskControlMeasureDialog = !isRiskControlMeasureDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitRiskControlMeasureDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isRiskControlMeasureDialog: Boolean; - riskControlMeasureForm: { - riskEventId: number | null; - controlMeasureCode: string | null; - controlType: number | null; - checkContent: string | null; - classify1: number | null; - classify2: number | null; - classify3: string | null; - measureDesc: string | null; - }; - title: string; - controlTypeList: Array<controlTypeListType>; - classifyOneList: []; - classifyTwoList: Array<classifyTwoType>; - classifyTwoListAll: []; - allSafetyRiskEventData: []; - riskControlMeasureFormRules: {}; -} -interface classifyTwoType { - id: number; - riskMeasureName: string; -} -interface controlTypeListType {} - -import { reactive, toRefs, ref } from 'vue'; -import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure'; -import { ElMessage } from 'element-plus'; -export default { - name: 'riskControlMeasureDialog', - setup(props: any, context: any) { - const riskControlMeasureFormRef = ref(); - const state = reactive<stateType>({ - title: '', - controlTypeList: [ - { id: 1, name: '自动化监控' }, - { id: 2, name: '隐患排查' } - ], - classifyOneList: [], - classifyTwoList: [], - classifyTwoListAll: [], - allSafetyRiskEventData: [], - isRiskControlMeasureDialog: false, - riskControlMeasureForm: { - riskEventId: null, - controlMeasureCode: null, - controlType: null, - checkContent: null, - classify1: null, - classify2: null, - classify3: null, - measureDesc: null - }, - riskControlMeasureFormRules: { - riskCode: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitName: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }], - liableDepId: [{ required: true, message: '请选择责任部门', trigger: 'change' }], - liablePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }], - produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] - } - }); - - //打开模态框 - const openSafetyRiskEventDialog = (type: string, value: object, allSafetyRiskEventData: [], classifyOneList: [], classifyTwoList: []) => { - state.isRiskControlMeasureDialog = true; - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(allSafetyRiskEventData)); - state.classifyOneList = JSON.parse(JSON.stringify(classifyOneList)); - state.classifyTwoListAll = JSON.parse(JSON.stringify(classifyTwoList)); - state.classifyTwoList = []; - setTimeout(() => { - riskControlMeasureFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险管控措施'; - state.riskControlMeasureForm = { - riskEventId: null, - controlMeasureCode: null, - controlType: null, - checkContent: null, - classify1: null, - classify2: null, - classify3: null, - measureDesc: null - }; - } else { - state.title = '修改风险管控措施'; - state.riskControlMeasureForm = JSON.parse(JSON.stringify(value)); - } - }; - - const changeClassifyTwoList = () => { - state.riskControlMeasureForm.classify2 = null; - state.classifyTwoList = []; - state.classifyTwoList = state.classifyTwoListAll.filter((item: any) => item.parentId === state.riskControlMeasureForm.classify1); - }; - - //新增修改提交 - const submitRiskControlMeasureDialog = async () => { - riskControlMeasureFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险管控措施') { - let res = await riskControlMeasureApi().addRiskControlMeasure(state.riskControlMeasureForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险管控措施新增成功', - duration: 2000 - }); - state.isRiskControlMeasureDialog = false; - context.emit('refreshRiskControlMeasure'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await riskControlMeasureApi().modRiskControlMeasure(state.riskControlMeasureForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险管控措施修改成功', - duration: 2000 - }); - state.isRiskControlMeasureDialog = false; - context.emit('refreshRiskControlMeasure'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - riskControlMeasureFormRef, - changeClassifyTwoList, - submitRiskControlMeasureDialog, - openSafetyRiskEventDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/test2/riskControlMeasure/index.vue b/src/views/doublePreventSystem/test2/riskControlMeasure/index.vue deleted file mode 100644 index 66f443f..0000000 --- a/src/views/doublePreventSystem/test2/riskControlMeasure/index.vue +++ /dev/null @@ -1,272 +0,0 @@ -<template> - <div class="system-role-container"> - 111 - <!-- <el-card shadow="hover">--> - <!-- <div class="system-user-search mb15">--> - <!-- <div class="basic-line">--> - <!-- <span>管控方式:</span>--> - <!-- <el-select class="input-box" v-model="riskControlMeasureData.params.controlType" placeholder="管控方式" clearable>--> - <!-- <el-option v-for="item in controlTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option>--> - <!-- </el-select>--> - <!-- </div>--> - <!-- <div class="basic-line">--> - <!-- <span>安全风险事件:</span>--> - <!-- <el-select class="input-box" v-model="riskControlMeasureData.params.riskEventId" placeholder="安全风险事件" clearable>--> - <!-- <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskEventName" :value="item.id"></el-option>--> - <!-- </el-select>--> - <!-- </div>--> - <!-- <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch">--> - <!-- <el-icon>--> - <!-- <ele-Search />--> - <!-- </el-icon>--> - <!-- 查询--> - <!-- </el-button>--> - <!-- <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')">--> - <!-- <el-icon>--> - <!-- <ele-FolderAdd />--> - <!-- </el-icon>--> - <!-- 新增措施--> - <!-- </el-button>--> - <!-- </div>--> - <!-- <el-table :data="riskControlMeasureData.data" style="width: 100%">--> - <!-- <el-table-column type="index" label="序号" width="60" />--> - <!-- <el-table-column prop="riskEventName" label="安全风险事件名称" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="controlMeasureCode" label="风控措施编码" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="controlType" label="管控方式" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="checkContent" label="管控内容" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="classify1" label="管控措施分类1" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="classify2" label="管控措施分类2" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="classify3" label="管控措施分类3" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="measureDesc" label="措施说明" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip>--> - <!-- <template #default="scope">--> - <!-- <span>{{ dateFormat('YYYY-mm-dd HH:MM:SS', '2022-07-07T08:00:00') }}</span>--> - <!-- </template>--> - <!-- </el-table-column>--> - <!-- <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column>--> - <!-- <el-table-column label="操作" width="150">--> - <!-- <template #default="scope">--> - <!-- <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button>--> - <!-- <el-button size="small" text type="danger" @click="onDelRiskControlMeasure(scope.row)">删除</el-button>--> - <!-- </template>--> - <!-- </el-table-column>--> - <!-- </el-table>--> - <!-- <el-pagination--> - <!-- @size-change="onHandleSizeChange"--> - <!-- @current-change="onHandleCurrentChange"--> - <!-- class="mt15"--> - <!-- :pager-count="5"--> - <!-- :page-sizes="[10, 20, 30]"--> - <!-- v-model:current-page="riskControlMeasureData.params.pageIndex"--> - <!-- background--> - <!-- v-model:page-size="riskControlMeasureData.params.pageSize"--> - <!-- layout="total, sizes, prev, pager, next, jumper"--> - <!-- :total="riskControlMeasureData.total"--> - <!-- >--> - <!-- </el-pagination>--> - <!-- </el-card>--> - <!-- <riskControlMeasureDialog ref="riskControlMeasureDialogRef" @refreshRiskControlMeasure="initRiskControlMeasureData" />--> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import riskControlMeasureDialog from './components/riskControlMeasureDialog.vue'; -import { riskControlMeasureApi } from '/@/api/doublePreventSystem/riskControlMeasure/index.ts'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - riskControlMeasureData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - controlType: number | null; - riskEventId: number | null; - }; - }; - controlTypeList: Array<controlTypeType>; - classifyOneList: Array<classifyOneType>; - classifyTwoList: Array<classifyTwoType>; - allSafetyRiskEventData: Array<SafetyRiskEventDataState>; -} -interface controlTypeType {} -interface classifyOneType {} -interface classifyTwoType {} -interface SafetyRiskEventDataState {} - -export default { - name: 'riskControlMeasure', - components: { riskControlMeasureDialog }, - setup() { - const riskControlMeasureDialogRef = ref(); - const state = reactive<TableDataState>({ - riskControlMeasureData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - controlType: null, - riskEventId: null - } - }, - controlTypeList: [ - { id: 1, name: '自动化监控' }, - { id: 2, name: '隐患排查' } - ], - classifyOneList: [], - classifyTwoList: [], - allSafetyRiskEventData: [] - }); - - // 初始化表格数据 - const initRiskControlMeasureData = async () => { - let res = await riskControlMeasureApi().getRiskControlMeasureList(state.riskControlMeasureData.params); - if (res.data.code === '200') { - state.riskControlMeasureData.data = res.data.data; - state.riskControlMeasureData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const dateFormat = (fmt: any, date: any) => { - date = new Date(date); - fmt = - date.getFullYear() + - '-' + - (date.getMonth() + 1) + - '-' + - date.getDate() + - ' ' + - date.getHours().toString() + - ':' + - (date.getMinutes().toString() === '0' ? '00' : date.getMinutes().toString()) + - ':' + - (date.getSeconds().toString() === '0' ? '00' : date.getMinutes().toString()); - return fmt; - }; - - //获取安全风险事件 - const getAllSafetyRiskEvent = async () => { - let res = await safetyRiskEventApi().getAllSafetyRiskEventList(); - if (res.data.code === '200') { - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(res.data.data)); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取管控措施分类 - const getClassify = async () => { - let res = await riskControlMeasureApi().getClassifyData(); - if (res.data.code === '200') { - state.classifyOneList = res.data.data.filter((item: any) => item.parentId === null); - state.classifyTwoList = res.data.data.filter((item: any) => item.parentId !== null); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - riskControlMeasureDialogRef.value.openSafetyRiskEventDialog( - type, - value, - state.allSafetyRiskEventData, - state.classifyOneList, - state.classifyTwoList - ); - }; - - // 删除角色 - const onDelRiskControlMeasure = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条风险管控措施:“${row.produceDeviceName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await riskControlMeasureApi().deleteRiskControlMeasure({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initRiskControlMeasureData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initRiskControlMeasureData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.riskControlMeasureData.params.pageSize = val; - initRiskControlMeasureData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.riskControlMeasureData.params.pageIndex = val; - initRiskControlMeasureData(); - }; - - // 页面加载时 - onMounted(() => { - initRiskControlMeasureData(); - getAllSafetyRiskEvent(); - getClassify(); - }); - - return { - dateFormat, - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelRiskControlMeasure, - onHandleCurrentChange, - riskControlMeasureDialog, - riskControlMeasureDialogRef, - initRiskControlMeasureData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test2/safetyRiskEvent/components/safetyRiskEventDialog.vue b/src/views/doublePreventSystem/test2/safetyRiskEvent/components/safetyRiskEventDialog.vue deleted file mode 100644 index fa2dee1..0000000 --- a/src/views/doublePreventSystem/test2/safetyRiskEvent/components/safetyRiskEventDialog.vue +++ /dev/null @@ -1,160 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isSafetyRiskEventDialog" width="600px"> - <el-form - :model="safetyRiskEventForm" - :rules="safetyRiskEventFormRules" - ref="safetyRiskAnalyseUnitFormRef" - size="default" - label-width="180px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析单元名称" prop="riskUnitId"> - <el-select class="input-length" v-model="safetyRiskEventForm.riskUnitId" placeholder="请输入安全风险分析单元名称"> - <el-option - v-for="item in allSafetyRiskEventData" - :key="item.id" - :label="item.riskUnitName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险事件名称" prop="riskEventName"> - <el-input - class="input-length" - v-model.trim="safetyRiskEventForm.riskEventName" - placeholder="请输入生产装置名称" - clearable - ></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isSafetyRiskEventDialog = !isSafetyRiskEventDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitSafetyRiskEventDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isSafetyRiskEventDialog: Boolean; - safetyRiskEventForm: { - riskEventName: string | null; - riskUnitId: number | null; - }; - title: string; - departmentList: []; - allSafetyRiskEventData: []; - safetyRiskEventFormRules: {}; -} -import { reactive, toRefs, ref } from 'vue'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent'; -import { ElMessage } from 'element-plus'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const safetyRiskAnalyseUnitFormRef = ref(); - const state = reactive<stateType>({ - title: '', - departmentList: [], - allSafetyRiskEventData: [], - isSafetyRiskEventDialog: false, - safetyRiskEventForm: { - riskEventName: null, - riskUnitId: null - }, - safetyRiskEventFormRules: { - riskEventName: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitId: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }] - } - }); - - //打开模态框 - const openSafetyRiskEventDialog = (type: string, value: object, department: [], allSafetyRiskEventData: []) => { - state.isSafetyRiskEventDialog = true; - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(allSafetyRiskEventData)); - state.departmentList = department; - setTimeout(() => { - safetyRiskAnalyseUnitFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险事件'; - state.safetyRiskEventForm = { - riskEventName: null, - riskUnitId: null - }; - } else { - state.title = '修改风险事件'; - state.safetyRiskEventForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitSafetyRiskEventDialog = async () => { - safetyRiskAnalyseUnitFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险事件') { - let res = await safetyRiskEventApi().addSafetyRiskEvent(state.safetyRiskEventForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险事件新增成功', - duration: 2000 - }); - state.isSafetyRiskEventDialog = false; - context.emit('refreshSafetyRiskEvent'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await safetyRiskEventApi().modSafetyRiskEvent(state.safetyRiskEventForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险事件修改成功', - duration: 2000 - }); - state.isSafetyRiskEventDialog = false; - context.emit('refreshSafetyRiskEvent'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - safetyRiskAnalyseUnitFormRef, - submitSafetyRiskEventDialog, - openSafetyRiskEventDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/test2/safetyRiskEvent/index.vue b/src/views/doublePreventSystem/test2/safetyRiskEvent/index.vue deleted file mode 100644 index 89e98ab..0000000 --- a/src/views/doublePreventSystem/test2/safetyRiskEvent/index.vue +++ /dev/null @@ -1,204 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>安全风险单元名称:</span> - <el-select v-model="safetyRiskEventData.params.riskUnitId" class="input-box" placeholder="安全风险单元名称"> - <el-option v-for="item in allSafetyRiskEventData" :key="item.id" :label="item.riskUnitName" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>安全风险事件名称:</span> - <el-input v-model="safetyRiskEventData.params.riskEventName" class="input-box" placeholder="安全风险事件名称"> </el-input> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon><ele-Search /> </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增事件 - </el-button> - </div> - <el-table :data="safetyRiskEventData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="riskUnitName" label="安全风险分析单元名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskEventName" label="安全风险事件名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelSafetyRiskEvent(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="safetyRiskEventData.params.pageIndex" - background - v-model:page-size="safetyRiskEventData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="safetyRiskEventData.total" - > - </el-pagination> - </el-card> - <safetyRiskEventDialog ref="safetyRiskEventDialogRef" @refreshSafetyRiskEvent="initSafetyRiskEventData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import safetyRiskEventDialog from './components/safetyRiskEventDialog.vue'; -import { safetyRiskEventApi } from '/@/api/doublePreventSystem/safetyRiskEvent/index.ts'; -import { departmentApi } from '/@/api/department'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - safetyRiskEventData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskEventName: string | null; - }; - }; - allSafetyRiskEventData: Array<safetyRiskEventState>; -} -interface safetyRiskEventState {} - -export default { - name: 'productionDevice', - components: { safetyRiskEventDialog }, - setup() { - const safetyRiskEventDialogRef = ref(); - const state = reactive<TableDataState>({ - safetyRiskEventData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskEventName: null - } - }, - allSafetyRiskEventData: [] - }); - // 初始化表格数据 - const initSafetyRiskEventData = async () => { - let res = await safetyRiskEventApi().getSafetyRiskEventList(state.safetyRiskEventData.params); - if (res.data.code === '200') { - state.safetyRiskEventData.data = res.data.data; - state.safetyRiskEventData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 获取安全风险分析单元数据 - const getAllSafetyRiskEventData = async () => { - let res = await safetyRiskAnalyseUnitApi().getAllSafetyRiskAnalyseUnitList(); - if (res.data.code === '200') { - state.allSafetyRiskEventData = JSON.parse(JSON.stringify(res.data.data)); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开安全风险事件 - const onOpenDialogRef = (type: string, value: any) => { - safetyRiskEventDialogRef.value.openSafetyRiskEventDialog(type, value, state.allSafetyRiskEventData); - }; - - // 删除角色 - const onDelSafetyRiskEvent = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条安全风险事件:“${row.riskEventName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await safetyRiskEventApi().deleteSafetyRiskEvent({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initSafetyRiskEventData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initSafetyRiskEventData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.safetyRiskEventData.params.pageSize = val; - initSafetyRiskEventData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.safetyRiskEventData.params.pageIndex = val; - initSafetyRiskEventData(); - }; - - // 页面加载时 - onMounted(() => { - getAllSafetyRiskEventData(); - initSafetyRiskEventData(); - }); - - return { - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelSafetyRiskEvent, - onHandleCurrentChange, - safetyRiskEventDialog, - safetyRiskEventDialogRef, - initSafetyRiskEventData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test2/test2-1/components/productionDeviceDialog.vue b/src/views/doublePreventSystem/test2/test2-1/components/productionDeviceDialog.vue deleted file mode 100644 index 6b9616e..0000000 --- a/src/views/doublePreventSystem/test2/test2-1/components/productionDeviceDialog.vue +++ /dev/null @@ -1,200 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isShowProductionDeviceDialog" width="600px"> - <el-form - :model="productionDeviceForm" - :rules="productionDeviceFormRules" - ref="productionDeviceFormRef" - size="default" - label-width="120px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="生产装置名称" prop="produceDeviceName"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.produceDeviceName" - placeholder="请输入生产装置名称" - clearable - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="所属部门" prop="depId"> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="productionDeviceForm.depId" - > - </el-cascader> - <!-- <el-select class="input-length" v-model="productionDeviceForm.depName" placeholder="请选择所属部门" clearable filterable></el-select>--> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="风险等级" prop="riskLevel"> - <el-select - class="input-length" - v-model="productionDeviceForm.riskLevel" - placeholder="请选择风险等级" - clearable - filterable - > - <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="区域位置" prop="location"> - <el-input - class="input-length" - v-model.trim="productionDeviceForm.location" - type="textarea" - placeholder="请输入区域位置" - maxlength="150" - ></el-input> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isShowProductionDeviceDialog = !isShowProductionDeviceDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitProductionDevice" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isShowProductionDeviceDialog: Boolean; - productionDeviceForm: { - produceDeviceName: string; - depId: number | null; - riskLevel: number | null; - location: string; - }; - title: string; - departmentList: []; - levelList: Array<levelListState>; - productionDeviceFormRules: {}; -} -interface levelListState {} -import { reactive, toRefs, ref } from 'vue'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; -import { ElMessage } from 'element-plus'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const productionDeviceFormRef = ref(); - const state = reactive<stateType>({ - title: '', - departmentList: [], - isShowProductionDeviceDialog: false, - levelList: [ - { id: 1, name: '低风险' }, - { id: 2, name: '一般风险' }, - { id: 3, name: '较大风险' }, - { id: 4, name: '重大风险' } - ], - productionDeviceForm: { - produceDeviceName: '', - depId: null, - riskLevel: null, - location: '' - }, - productionDeviceFormRules: { - produceDeviceName: [{ required: true, message: '请填写生产装置名称', trigger: 'blur' }], - depId: [{ required: true, message: '请选择部门', trigger: 'change' }], - riskLevel: [{ required: true, message: '请选择风险等级', trigger: 'change' }], - location: [{ required: true, message: '请填写区域位置', trigger: 'blur' }] - } - }); - - //打开模态框 - const openProductionDeviceDialog = (type: string, value: object, department: []) => { - state.isShowProductionDeviceDialog = true; - state.departmentList = department; - setTimeout(() => { - productionDeviceFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增生产装置'; - state.productionDeviceForm = { - produceDeviceName: '', - depId: null, - riskLevel: null, - location: '' - }; - } else { - state.title = '修改生产装置'; - state.productionDeviceForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitProductionDevice = async () => { - productionDeviceFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增生产装置') { - let res = await productionDeviceApi().addProductionDevice(state.productionDeviceForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '生产装置新增成功', - duration: 2000 - }); - state.isShowProductionDeviceDialog = false; - context.emit('refreshProductionDevice'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await productionDeviceApi().modProductionDevice(state.productionDeviceForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '生产装置修改成功', - duration: 2000 - }); - state.isShowProductionDeviceDialog = false; - context.emit('refreshProductionDevice'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - return { - ...toRefs(state), - productionDeviceFormRef, - submitProductionDevice, - openProductionDeviceDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/test2/test2-1/index.vue b/src/views/doublePreventSystem/test2/test2-1/index.vue deleted file mode 100644 index c240e35..0000000 --- a/src/views/doublePreventSystem/test2/test2-1/index.vue +++ /dev/null @@ -1,226 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>风险等级:</span> - <el-select v-model="productionDeviceData.params.riskLevel" clearable filterable class="input-box" placeholder="请选择风险等级"> - <el-option v-for="item in levelList" :key="item.id" :label="item.name" :value="item.id"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>部门:</span> - <el-cascader - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'id', label: 'name' }" - placeholder="请选择部门" - clearable - filterable - class="input-box" - v-model="productionDeviceData.params.depId" - > - </el-cascader> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增装置 - </el-button> - </div> - <el-table :data="productionDeviceData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="depName" label="所属部门" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskLevel" label="风险等级" show-overflow-tooltip></el-table-column> - <el-table-column prop="location" label="区域位置" show-overflow-tooltip></el-table-column> - <el-table-column prop="status" label="状态" show-overflow-tooltip> </el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="productionDeviceData.params.pageIndex" - background - v-model:page-size="productionDeviceData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="productionDeviceData.total" - > - </el-pagination> - </el-card> - <productionDeviceDialog ref="productionDeviceDialogRef" @refreshProductionDevice="initProductionDeviceTableData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import productionDeviceDialog from './components/productionDeviceDialog.vue'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice/index.ts'; -import { departmentApi } from '/@/api/department'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - productionDeviceData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskLevel: number | null; - status: number; - depId: number | null; - location: string | null; - produceDeviceName: string | null; - }; - }; - departmentList: Array<DepartmentState>; - levelList: Array<levelListState>; -} -interface levelListState {} -interface DepartmentState {} - -export default defineComponent({ - name: 'productionDevice', - components: { productionDeviceDialog }, - setup() { - const productionDeviceDialogRef = ref(); - const state = reactive<TableDataState>({ - productionDeviceData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskLevel: null, - status: 1, - depId: null, - location: null, - produceDeviceName: null - } - }, - departmentList: [], - levelList: [ - { id: 1, name: '低风险' }, - { id: 2, name: '一般风险' }, - { id: 3, name: '较大风险' }, - { id: 4, name: '重大风险' } - ] - }); - // 初始化表格数据 - const initProductionDeviceTableData = async () => { - let res = await productionDeviceApi().getProductionDeviceList(state.productionDeviceData.params); - if (res.data.code === '200') { - state.productionDeviceData.data = res.data.data; - state.productionDeviceData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - productionDeviceDialogRef.value.openProductionDeviceDialog(type, value, state.departmentList); - }; - // 删除角色 - const onDelProductionDevice = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条生产装置:“${row.produceDeviceName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await productionDeviceApi().deleteProductionDevice({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initProductionDeviceTableData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - const handleSearch = () => { - initProductionDeviceTableData(); - }; - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.productionDeviceData.params.pageSize = val; - initProductionDeviceTableData(); - }; - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.productionDeviceData.params.pageIndex = val; - initProductionDeviceTableData(); - }; - // 页面加载时 - onMounted(() => { - initProductionDeviceTableData(); - getDepartmentData(); - }); - return { - handleSearch, - onOpenDialogRef, - onHandleSizeChange, - onDelProductionDevice, - onHandleCurrentChange, - productionDeviceDialog, - productionDeviceDialogRef, - initProductionDeviceTableData, - ...toRefs(state) - }; - } -}); -</script> - -<style scoped></style> diff --git a/src/views/doublePreventSystem/test2/test2-2/components/safetyRiskAnalyseUnitDialog.vue b/src/views/doublePreventSystem/test2/test2-2/components/safetyRiskAnalyseUnitDialog.vue deleted file mode 100644 index 0764dc3..0000000 --- a/src/views/doublePreventSystem/test2/test2-2/components/safetyRiskAnalyseUnitDialog.vue +++ /dev/null @@ -1,237 +0,0 @@ -<template> - <div class="system-add-menu-container"> - <el-dialog :title="title" v-model="isSafetyRiskAnalyseUnitDialog" width="600px"> - <el-form - :model="safetyRiskAnalyseUnitForm" - :rules="safetyRiskAnalyseUnitFormRules" - ref="safetyRiskAnalyseUnitFormRef" - size="default" - label-width="180px" - > - <el-row :gutter="35"> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析对象编码" prop="riskCode"> - <el-input - class="input-length" - v-model.trim="safetyRiskAnalyseUnitForm.riskCode" - placeholder="请输入安全风险分析对象编码" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="安全风险分析单元名称" prop="riskUnitName"> - <el-input - class="input-length" - v-model.trim="safetyRiskAnalyseUnitForm.riskUnitName" - placeholder="请输入安全风险分析单元名称" - ></el-input> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="生产装置名称" prop="produceDeviceId"> - <el-select - class="input-length" - v-model="safetyRiskAnalyseUnitForm.produceDeviceId" - placeholder="请输入生产装置名称" - clearable - > - <el-option - v-for="item in allProduceDeviceData" - :key="item.id" - :label="item.produceDeviceName" - :value="item.id" - ></el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="责任部门" prop="liableDepId"> - <el-cascader - @change="achieveUserList" - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" - placeholder="请选择部门" - clearable - filterable - style="width: 85%" - v-model="safetyRiskAnalyseUnitForm.liableDepId" - > - </el-cascader> - </el-form-item> - </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="责任人" prop="liablePersonId"> - <el-select - class="input-length" - v-model="safetyRiskAnalyseUnitForm.liablePersonId" - placeholder="请选择责任人" - clearable - filterable - > - <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> - </el-select> - </el-form-item> - </el-col> - </el-row> - </el-form> - <template #footer> - <span class="dialog-footer"> - <el-button @click="isSafetyRiskAnalyseUnitDialog = !isSafetyRiskAnalyseUnitDialog" size="default">取 消</el-button> - <el-button type="primary" @click="submitSafetyRiskAnalyseUnitDialog" v-throttle size="default">确 实</el-button> - </span> - </template> - </el-dialog> - </div> -</template> - -<script lang="ts"> -interface stateType { - isSafetyRiskAnalyseUnitDialog: Boolean; - safetyRiskAnalyseUnitForm: { - riskCode: string | null; - riskUnitName: string | null; - liablePersonId: number | null; - liableDepId: number | null; - produceDeviceId: number | null; - }; - title: string; - userList: []; - departmentList: []; - allProduceDeviceData: []; - safetyRiskAnalyseUnitFormRules: {}; -} -import { reactive, toRefs, ref } from 'vue'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit'; -import { ElMessage } from 'element-plus'; -import { userApi } from '/@/api/user'; -export default { - name: 'productionDeviceDialog', - setup(props: any, context: any) { - const safetyRiskAnalyseUnitFormRef = ref(); - const state = reactive<stateType>({ - title: '', - userList: [], - departmentList: [], - allProduceDeviceData: [], - isSafetyRiskAnalyseUnitDialog: false, - safetyRiskAnalyseUnitForm: { - riskCode: null, - riskUnitName: null, - liablePersonId: null, - liableDepId: null, - produceDeviceId: null - }, - safetyRiskAnalyseUnitFormRules: { - riskCode: [{ required: true, message: '请填写安全风险分析对象编码', trigger: 'blur' }], - riskUnitName: [{ required: true, message: '请填写安全风险分析单元名称', trigger: 'blur' }], - liableDepId: [{ required: true, message: '请选择责任部门', trigger: 'change' }], - liablePersonId: [{ required: true, message: '请选择责任人', trigger: 'change' }], - produceDeviceId: [{ required: true, message: '请选择生产装置', trigger: 'change' }] - } - }); - - //打开模态框 - const openSafetyRiskAnalyseUnitDialog = (type: string, value: object, department: [], allProduceDeviceData: []) => { - // console.log(jsonBig.stringify(123124124124214123131)) - state.isSafetyRiskAnalyseUnitDialog = true; - state.allProduceDeviceData = JSON.parse(JSON.stringify(allProduceDeviceData)); - state.departmentList = department; - setTimeout(() => { - safetyRiskAnalyseUnitFormRef.value.clearValidate(); - }); - if (type === '新增') { - state.title = '新增风险分析单元'; - state.safetyRiskAnalyseUnitForm = { - riskCode: null, - riskUnitName: null, - liablePersonId: null, - liableDepId: null, - produceDeviceId: null - }; - } else { - state.title = '修改风险分析单元'; - state.safetyRiskAnalyseUnitForm = JSON.parse(JSON.stringify(value)); - } - }; - - //新增修改提交 - const submitSafetyRiskAnalyseUnitDialog = async () => { - safetyRiskAnalyseUnitFormRef.value.validate(async (valid: Boolean) => { - if (valid) { - if (state.title === '新增风险分析单元') { - let res = await safetyRiskAnalyseUnitApi().addSafetyRiskAnalyseUnit(state.safetyRiskAnalyseUnitForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险分析单元新增成功', - duration: 2000 - }); - state.isSafetyRiskAnalyseUnitDialog = false; - context.emit('refreshSafetyRiskAnalyseUnit'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } else { - let res = await safetyRiskAnalyseUnitApi().modSafetyRiskAnalyseUnit(state.safetyRiskAnalyseUnitForm); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: '风险分析单元修改成功', - duration: 2000 - }); - state.isSafetyRiskAnalyseUnitDialog = false; - context.emit('refreshSafetyRiskAnalyseUnit'); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - } - } else { - ElMessage({ - type: 'warning', - message: '请完善基本信息' - }); - } - }); - }; - - const achieveUserList = () => { - state.safetyRiskAnalyseUnitForm.liablePersonId = null; - state.userList = []; - getUserData(); - }; - - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitForm.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - return { - ...toRefs(state), - achieveUserList, - safetyRiskAnalyseUnitFormRef, - submitSafetyRiskAnalyseUnitDialog, - openSafetyRiskAnalyseUnitDialog - }; - } -}; -</script> - -<style scoped> -.input-length { - width: 85%; -} -</style> diff --git a/src/views/doublePreventSystem/test2/test2-2/index.vue b/src/views/doublePreventSystem/test2/test2-2/index.vue deleted file mode 100644 index 34fd17c..0000000 --- a/src/views/doublePreventSystem/test2/test2-2/index.vue +++ /dev/null @@ -1,269 +0,0 @@ -<template> - <div class="system-role-container"> - <el-card shadow="hover"> - <div class="system-user-search mb15"> - <div class="basic-line"> - <span>责任部门:</span> - <el-cascader - @change="achieveUserList" - :options="departmentList" - :props="{ emitPath: false, checkStrictly: true, value: 'id', label: 'name' }" - placeholder="责任部门" - clearable - filterable - class="input-box" - v-model="safetyRiskAnalyseUnitData.params.liableDepId" - > - </el-cascader> - </div> - <div class="basic-line"> - <span>责任人:</span> - <el-select v-model="safetyRiskAnalyseUnitData.params.liablePersonId" clearable filterable class="input-box" placeholder="责任人"> - <el-option v-for="item in userList" :key="item.uid" :label="item.realName" :value="item.uid"></el-option> - </el-select> - </div> - <div class="basic-line"> - <span>单元名称:</span> - <el-input v-model="safetyRiskAnalyseUnitData.params.riskUnitName" clearable filterable class="input-box" placeholder="单元名称"> - </el-input> - </div> - <el-button size="default" type="primary" class="ml10" v-throttle @click="handleSearch"> - <el-icon> - <ele-Search /> - </el-icon> - 查询 - </el-button> - <el-button size="default" type="success" class="ml10" @click="onOpenDialogRef('新增', '')"> - <el-icon> - <ele-FolderAdd /> - </el-icon> - 新增单元 - </el-button> - </div> - <el-table :data="safetyRiskAnalyseUnitData.data" style="width: 100%"> - <el-table-column type="index" label="序号" width="60" /> - <el-table-column prop="produceDeviceName" label="生产装置名称" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskUnitName" label="安全风险分析单元名称" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="riskCode" label="安全风险分析对象编码" width="180" show-overflow-tooltip></el-table-column> - <el-table-column prop="liableDep" label="责任部门" show-overflow-tooltip></el-table-column> - <el-table-column prop="liablePerson" label="责任人" show-overflow-tooltip></el-table-column> - <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> - <el-table-column prop="lastEditUserName" label="最后修改人" show-overflow-tooltip></el-table-column> - <el-table-column prop="gmtModitify" label="最后修改时间" show-overflow-tooltip></el-table-column> - <el-table-column label="操作" width="150"> - <template #default="scope"> - <el-button size="small" text type="primary" @click="onOpenDialogRef('修改', scope.row)">修改</el-button> - <el-button size="small" text type="danger" @click="onDelProductionDevice(scope.row)">删除</el-button> - </template> - </el-table-column> - </el-table> - <el-pagination - @size-change="onHandleSizeChange" - @current-change="onHandleCurrentChange" - class="mt15" - :pager-count="5" - :page-sizes="[10, 20, 30]" - v-model:current-page="safetyRiskAnalyseUnitData.params.pageIndex" - background - v-model:page-size="safetyRiskAnalyseUnitData.params.pageSize" - layout="total, sizes, prev, pager, next, jumper" - :total="safetyRiskAnalyseUnitData.total" - > - </el-pagination> - </el-card> - <safetyRiskAnalyseUnitDialog ref="safetyRiskAnalyseUnitDialogRef" @refreshSafetyRiskAnalyseUnit="initSafetyRiskAnalyseUnitData" /> - </div> -</template> - -<script lang="ts"> -import { toRefs, reactive, onMounted, ref } from 'vue'; -import { ElMessageBox, ElMessage } from 'element-plus'; -import safetyRiskAnalyseUnitDialog from './components/safetyRiskAnalyseUnitDialog.vue'; -import { safetyRiskAnalyseUnitApi } from '/@/api/doublePreventSystem/safetyRiskAnalyseUnit/index.ts'; -import { departmentApi } from '/@/api/department'; -import { userApi } from '/@/api/user'; -import { productionDeviceApi } from '/@/api/doublePreventSystem/productionDevice'; - -// 定义接口来定义对象的类型 -interface TableData { - roleName: string; - roleSign: string; - describe: string; - sort: number; - status: boolean; - createTime: string; -} -interface TableDataState { - safetyRiskAnalyseUnitData: { - data: Array<TableData>; - total: number; - loading: boolean; - params: { - pageIndex: number; - pageSize: number; - riskUnitName: string | null; - liableDepId: number | null; - liablePersonId: number | null; - }; - }; - userList: Array<UserState>; - departmentList: Array<DepartmentState>; - allProduceDeviceData: Array<produceDeviceState>; -} -interface produceDeviceState {} -interface DepartmentState {} -interface UserState {} - -export default { - name: 'productionDevice', - components: { safetyRiskAnalyseUnitDialog }, - setup() { - const safetyRiskAnalyseUnitDialogRef = ref(); - const state = reactive<TableDataState>({ - safetyRiskAnalyseUnitData: { - data: [], - total: 0, - loading: false, - params: { - pageIndex: 1, - pageSize: 10, - riskUnitName: null, - liableDepId: null, - liablePersonId: null - } - }, - userList: [], - departmentList: [], - allProduceDeviceData: [] - }); - // 初始化表格数据 - const initSafetyRiskAnalyseUnitData = async () => { - let res = await safetyRiskAnalyseUnitApi().getSafetyRiskAnalyseUnitList(state.safetyRiskAnalyseUnitData.params); - if (res.data.code === '200') { - state.safetyRiskAnalyseUnitData.data = res.data.data; - state.safetyRiskAnalyseUnitData.total = res.data.count; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - const achieveUserList = () => { - state.safetyRiskAnalyseUnitData.params.liablePersonId = null; - state.userList = []; - getUserData(); - }; - - //获取生产装置列表 - const getAllProduceDeviceData = async () => { - let res = await productionDeviceApi().getAllProductionDeviceList(); - if (res.data.code === '200') { - state.allProduceDeviceData = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取部门列表 - const getDepartmentData = async () => { - let res = await departmentApi().getDepartmentList(); - if (res.data.code === '200') { - state.departmentList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - //获取用户列表 - const getUserData = async () => { - let res = await userApi().getUserLByDepartment(state.safetyRiskAnalyseUnitData.params.liableDepId); - if (res.data.code === '200') { - state.userList = res.data.data; - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }; - - // 打开生产装置弹窗 - const onOpenDialogRef = (type: string, value: any) => { - safetyRiskAnalyseUnitDialogRef.value.openSafetyRiskAnalyseUnitDialog(type, value, state.departmentList, state.allProduceDeviceData); - }; - - // 删除角色 - const onDelProductionDevice = (row: any) => { - ElMessageBox.confirm(`此操作将永久删除该条安全风险分析单元:“${row.riskUnitName}”,是否继续?`, '提示', { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async () => { - let res = await safetyRiskAnalyseUnitApi().deleteSafetyRiskAnalyseUnit({ id: row.id }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - duration: 2000, - message: '删除成功' - }); - await initSafetyRiskAnalyseUnitData(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } - }) - .catch(() => {}); - }; - - const handleSearch = () => { - initSafetyRiskAnalyseUnitData(); - }; - - // 分页改变 - const onHandleSizeChange = (val: number) => { - state.safetyRiskAnalyseUnitData.params.pageSize = val; - initSafetyRiskAnalyseUnitData(); - }; - - // 分页改变 - const onHandleCurrentChange = (val: number) => { - state.safetyRiskAnalyseUnitData.params.pageIndex = val; - initSafetyRiskAnalyseUnitData(); - }; - - // 页面加载时 - onMounted(() => { - initSafetyRiskAnalyseUnitData(); - getAllProduceDeviceData(); - getDepartmentData(); - }); - - return { - handleSearch, - achieveUserList, - onOpenDialogRef, - onHandleSizeChange, - onDelProductionDevice, - onHandleCurrentChange, - safetyRiskAnalyseUnitDialog, - safetyRiskAnalyseUnitDialogRef, - initSafetyRiskAnalyseUnitData, - ...toRefs(state) - }; - } -}; -</script> - -<style scoped></style> diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 563a41f..4a6a8fd 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,182 +1,193 @@ <template> - <div class="home-container"> - <el-row :gutter="15" class="home-card-one mb15"> - <el-col - :xs="24" - :sm="12" - :md="12" - :lg="4" - :xl="4" - v-for="(v, k) in homeOne" - :key="k" - :class="{ 'home-media home-media-lg': k > 1, 'home-media-sm': k === 1 }" - > - <div class="home-card-item flex" > - <el-button @click="renderMenu(v.id)">{{v.name}}</el-button> - </div> - </el-col> - </el-row> - <el-row :gutter="15" class="home-card-two mb15"> - <el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16"> - <div class="home-card-item"> - <div style="height: 100%"> - <el-button @click="renderMenu('6')">{{'应急管理系统'}}</el-button> - </div> - </div> - </el-col> - <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8" class="home-media"> - <div class="home-card-item"> - <div style="height: 100%"> - <el-button @click="renderMenu('7')">{{'目标责任管理系统'}}</el-button> - </div> - </div> - </el-col> - </el-row> - <el-row :gutter="15" class="home-card-three"> - <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8"> - <div class="home-card-item"> - <el-button @click="renderMenu('8')">{{'事故管理系统'}}</el-button> - </div> - </el-col> - <el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16" class="home-media"> - <div class="home-card-item"> - <div style="height: 100%"> - <el-button @click="renderMenu('9')">{{'设备综合管控系统'}}</el-button> - </div> - </div> - </el-col> - </el-row> - </div> + <div class="home-container"> + <el-row :gutter="15" class="home-card-one mb15"> + <el-col + :xs="24" + :sm="12" + :md="12" + :lg="4" + :xl="4" + v-for="(v, k) in homeOne" + :key="k" + :class="{ 'home-media home-media-lg': k > 1, 'home-media-sm': k === 1 }" + > + <div class="home-card-item flex"> + <el-button @click="renderMenu(v.id)">{{ v.name }}</el-button> + </div> + </el-col> + </el-row> + <el-row :gutter="15" class="home-card-two mb15"> + <el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16"> + <div class="home-card-item"> + <div style="height: 100%"> + <el-button @click="renderMenu('6')">{{ '应急管理系统' }}</el-button> + </div> + </div> + </el-col> + <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8" class="home-media"> + <div class="home-card-item"> + <div style="height: 100%"> + <el-button @click="renderMenu('7')">{{ '目标责任管理系统' }}</el-button> + </div> + </div> + </el-col> + </el-row> + <el-row :gutter="15" class="home-card-three"> + <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8"> + <div class="home-card-item"> + <el-button @click="renderMenu('8')">{{ '事故管理系统' }}</el-button> + </div> + </el-col> + <el-col :xs="24" :sm="14" :md="14" :lg="16" :xl="16" class="home-media"> + <div class="home-card-item"> + <div style="height: 100%"> + <el-button @click="renderMenu('9')">{{ '设备综合管控系统' }}</el-button> + </div> + </div> + </el-col> + </el-row> + </div> </template> <script lang="ts"> -import { toRefs, reactive, defineComponent, } from 'vue'; +import { toRefs, reactive, defineComponent, onMounted } from 'vue'; import { storeToRefs } from 'pinia'; import { initBackEndControlRoutes } from '/@/router/backEnd'; -import {useUserInfo} from "/@/stores/userInfo"; +import { useUserInfo } from '/@/stores/userInfo'; import { Session } from '/@/utils/storage'; +import { NextLoading } from '/@/utils/loading'; let global: any = { - homeChartOne: null, - homeChartTwo: null, - homeCharThree: null, - dispose: [null, '', undefined], + homeChartOne: null, + homeChartTwo: null, + homeCharThree: null, + dispose: [null, '', undefined] }; interface stateType { - homeOne: Array <type> + homeOne: Array<type>; } interface type { - id:number, - name: string + id: number; + name: string; } export default defineComponent({ - name: 'home', - setup() { - const userInfo = useUserInfo() - const { userInfos } = storeToRefs(userInfo); - const state = reactive<stateType>({ - homeOne:[{id:1,name:'基础数据权限管理系统'},{id:2,name:'双重预防系统'},{id:3,name:'系统2'},{id:4,name:'系统3'},{id:5,name:'系统4'}], - }); - // 折线图 - const renderMenu = async (value: string) => { - Session.set('projectId',value) - userInfos.value.projectId = value - await initBackEndControlRoutes(); - }; - return { - renderMenu, - ...toRefs(state), - }; - }, + name: 'home', + setup() { + const userInfo = useUserInfo(); + const { userInfos } = storeToRefs(userInfo); + const state = reactive<stateType>({ + homeOne: [ + { id: 1, name: '基础数据权限管理系统' }, + { id: 2, name: '双重预防系统' }, + { id: 3, name: '系统2' }, + { id: 4, name: '系统3' }, + { id: 5, name: '系统4' } + ] + }); + // 折线图 + const renderMenu = async (value: string) => { + Session.set('projectId', value); + userInfos.value.projectId = value; + await initBackEndControlRoutes(); + }; + onMounted(() => { + // loginBg(); + // loginApp() + }); + return { + renderMenu, + ...toRefs(state) + }; + } }); </script> <style scoped lang="scss"> $homeNavLengh: 8; .home-container { - overflow: hidden; - .home-card-one, - .home-card-two, - .home-card-three { - .home-card-item { - width: 100%; - height: 130px; - border-radius: 4px; - transition: all ease 0.3s; - padding: 20px; - overflow: hidden; - background: var(--el-color-white); - color: var(--el-text-color-primary); - border: 1px solid var(--next-border-color-light); - &:hover { - box-shadow: 0 2px 12px var(--next-color-dark-hover); - transition: all ease 0.3s; - } - &-icon { - width: 70px; - height: 70px; - border-radius: 100%; - flex-shrink: 1; - i { - color: var(--el-text-color-placeholder); - } - } - &-title { - font-size: 15px; - font-weight: bold; - height: 30px; - } - } - } - .home-card-one { - @for $i from 0 through 3 { - .home-one-animation#{$i} { - opacity: 0; - animation-name: error-num; - animation-duration: 0.5s; - animation-fill-mode: forwards; - animation-delay: calc($i/10) + s; - } - } - } - .home-card-two, - .home-card-three { - .home-card-item { - height: 400px; - width: 100%; - overflow: hidden; - .home-monitor { - height: 100%; - .flex-warp-item { - width: 25%; - height: 111px; - display: flex; - .flex-warp-item-box { - margin: auto; - text-align: center; - color: var(--el-text-color-primary); - display: flex; - border-radius: 5px; - background: var(--next-bg-color); - cursor: pointer; - transition: all 0.3s ease; - &:hover { - background: var(--el-color-primary-light-9); - transition: all 0.3s ease; - } - } - @for $i from 0 through $homeNavLengh { - .home-animation#{$i} { - opacity: 0; - animation-name: error-num; - animation-duration: 0.5s; - animation-fill-mode: forwards; - animation-delay: calc($i/10) + s; - } - } - } - } - } - } + overflow: hidden; + .home-card-one, + .home-card-two, + .home-card-three { + .home-card-item { + width: 100%; + height: 130px; + border-radius: 4px; + transition: all ease 0.3s; + padding: 20px; + overflow: hidden; + background: var(--el-color-white); + color: var(--el-text-color-primary); + border: 1px solid var(--next-border-color-light); + &:hover { + box-shadow: 0 2px 12px var(--next-color-dark-hover); + transition: all ease 0.3s; + } + &-icon { + width: 70px; + height: 70px; + border-radius: 100%; + flex-shrink: 1; + i { + color: var(--el-text-color-placeholder); + } + } + &-title { + font-size: 15px; + font-weight: bold; + height: 30px; + } + } + } + .home-card-one { + @for $i from 0 through 3 { + .home-one-animation#{$i} { + opacity: 0; + animation-name: error-num; + animation-duration: 0.5s; + animation-fill-mode: forwards; + animation-delay: calc($i/10) + s; + } + } + } + .home-card-two, + .home-card-three { + .home-card-item { + height: 400px; + width: 100%; + overflow: hidden; + .home-monitor { + height: 100%; + .flex-warp-item { + width: 25%; + height: 111px; + display: flex; + .flex-warp-item-box { + margin: auto; + text-align: center; + color: var(--el-text-color-primary); + display: flex; + border-radius: 5px; + background: var(--next-bg-color); + cursor: pointer; + transition: all 0.3s ease; + &:hover { + background: var(--el-color-primary-light-9); + transition: all 0.3s ease; + } + } + @for $i from 0 through $homeNavLengh { + .home-animation#{$i} { + opacity: 0; + animation-name: error-num; + animation-duration: 0.5s; + animation-fill-mode: forwards; + animation-delay: calc($i/10) + s; + } + } + } + } + } + } } </style> diff --git a/src/views/homeMenu/homeMenu.vue b/src/views/homeMenu/homeMenu.vue index 47ab647..04087b8 100644 --- a/src/views/homeMenu/homeMenu.vue +++ b/src/views/homeMenu/homeMenu.vue @@ -1,5 +1,5 @@ <template> - <div class="login-container"> + <div class="login-container" :key="once"> <div class="topPanel"> <div class="topPanelCont"> <div class="topTit"> @@ -113,6 +113,7 @@ isScan: boolean; count: number; projectId: string; + once: number; } export default defineComponent({ @@ -131,7 +132,8 @@ tabsActiveName: 'account', isScan: false, count: 0, - projectId: '1' + projectId: '1', + once: 0 }); // 获取布局配置信息 const getThemeConfig = computed(() => { @@ -236,6 +238,7 @@ // }; // 页面加载时 onMounted(() => { + state.once += 1; NextLoading.done(); // loginBg(); // loginApp() diff --git a/src/views/intellectInspect/inspectBasic/discriminate/index.vue b/src/views/intellectInspect/inspectBasic/discriminate/index.vue index ecab504..1ddaf5b 100644 --- a/src/views/intellectInspect/inspectBasic/discriminate/index.vue +++ b/src/views/intellectInspect/inspectBasic/discriminate/index.vue @@ -122,11 +122,11 @@ } }; - // 打开生产装置弹窗 + // 打开弹窗 const onOpenDialogRef = (type: string, value: any) => { RFIDDialogRef.value.openRFIDDialog(type, value); }; - // 删除角色 + // 删除 const onDelProductionDevice = (row: any) => { ElMessageBox.confirm(`此操作将永久删除该RFID:“${row.rfidName}”,是否继续?`, '提示', { confirmButtonText: '确认', diff --git a/src/views/intellectInspect/inspectBasic/facility/index.vue b/src/views/intellectInspect/inspectBasic/facility/index.vue index e25ffd3..d4502f3 100644 --- a/src/views/intellectInspect/inspectBasic/facility/index.vue +++ b/src/views/intellectInspect/inspectBasic/facility/index.vue @@ -144,11 +144,11 @@ } }; - // 打开生产装置弹窗 + // 打开弹窗 const onOpenDialogRef = (type: string, value: any) => { facilityAreaDialogRef.value.openFacilityAreaDialog(type, value, state.facilityAreaTypeList); }; - // 删除角色 + // 删除 const onDelProductionDevice = (row: any) => { ElMessageBox.confirm(`此操作将永久删除该条设备区域:“${row.region}”,是否继续?`, '提示', { confirmButtonText: '确认', diff --git a/src/views/intellectInspect/inspectBasic/inspectPoint/index.vue b/src/views/intellectInspect/inspectBasic/inspectPoint/index.vue index 69aea63..635b1be 100644 --- a/src/views/intellectInspect/inspectBasic/inspectPoint/index.vue +++ b/src/views/intellectInspect/inspectBasic/inspectPoint/index.vue @@ -159,11 +159,11 @@ } }; - // 打开生产装置弹窗 + // 打开弹窗 const onOpenDialogRef = (type: string, value: any) => { inspectPointDialogRef.value.openInspectPointDialog(type, value, state.regionNameList, state.RFIDList); }; - // 删除角色 + // 删除 const onDelProductionDevice = (row: any) => { ElMessageBox.confirm(`此操作将永久删除该巡检点:“${row.code}”,是否继续?`, '提示', { confirmButtonText: '确认', -- Gitblit v1.9.2