From 08bf6da5e3164a1b3ee5c79bb5d666e6385b4653 Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期一, 23 五月 2022 18:33:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master --- src/api/riskLevelManage.js | 11 src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue | 5 src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue | 4 src/views/specialWorkManage/specialWork/taskCreate/components/taskBasic/index.vue | 36 + src/views/specialWorkManage/specialWork/taskCreate/components/taskCreate.vue | 3 src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue | 61 +-- src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue | 57 ++ src/views/doublePreventAction/riskLevelManage/analyseUnit/components/departmentChart.vue | 89 ++++ src/views/doublePreventAction/hiddenDanger/inspectionRecord/components/detail.vue | 240 ++++++++++++- src/components/Tab/Marker.vue | 542 +++++++++++++++--------------- 10 files changed, 683 insertions(+), 365 deletions(-) diff --git a/src/api/riskLevelManage.js b/src/api/riskLevelManage.js index a9c61fb..0bd178c 100644 --- a/src/api/riskLevelManage.js +++ b/src/api/riskLevelManage.js @@ -149,3 +149,14 @@ method: 'get', }) } + + +export function getDepartmentChart() { + return request({ + headers: { + 'Authorization': getToken() + }, + url: process.env.BASE_API + '/riskAnaUnit/department-analysis', + method: 'post', + }) +} diff --git a/src/components/Tab/Marker.vue b/src/components/Tab/Marker.vue index f3149da..71b0322 100644 --- a/src/components/Tab/Marker.vue +++ b/src/components/Tab/Marker.vue @@ -1,290 +1,290 @@ <template> - <div class="container"> - <div class="images"> - <img - v-for="image in images" - :key="image.url" - :src="image.url" - @click="clickCreateHandle(image.url)" - /> - </div> - <div class="model-panel-list"> - <el-row :gutter="10"> - <el-col :span="6"> - <el-button - icon="el-icon-plus" - size="small" - type="primary" - @click="showCreateHandle" - > - 创建 - </el-button> - </el-col> - <el-col :span="6"> - <el-button - icon="el-icon-delete" - size="small" - type="danger" - @click="clearHandle" - > - 清空 - </el-button> - </el-col> - <el-col :span="6"> - <el-button - icon="el-icon-view" - size="small" - :type="showPlot ? 'success' : 'info'" - @click="toggleVisible" - > - {{ showPlot ? '隐藏' : '显示' }} - </el-button> - </el-col> - </el-row> - <el-row :gutter="10" v-for="marker in markers" :key="marker.attr.id"> - <el-col :span="2"> - <img :src="marker.style.image" style="width:22px;height:22px;" /> - </el-col> - <el-col :span="12"> - {{ marker.attr.name || ' ' }} - </el-col> - <el-col :span="10" style="textAlign:right"> - <el-button - icon="el-icon-s-promotion" - size="mini" - circle - @click="() => focusHandle(marker.attr.id)" - /> - <el-button - icon="el-icon-edit" - size="mini" - circle - @click="() => editHandle(marker)" - /> - <el-button - icon="el-icon-delete" - type="danger" - size="mini" - circle - @click="() => removeHandle(marker.attr.id)" - /> - </el-col> - </el-row> - </div> - <el-dialog - :visible="showCreatePanel" - width="380px" - title="创建图标" - :append-to-body="true" - :close-on-click-modal="false" - :before-close="closeCreateHandle" - > - <p>请输入内容:</p> - <el-input v-model="marker.name" placeholder="请输入内容" /> - <div class="image-list"> - <ul> - <li - v-for="item in images" - :key="item.url" - @click="marker.image = item.url" - :class="marker.image === item.url ? 'active' : ''" - > - <img :src="item.url" /> - </li> - </ul> - </div> - <span slot="footer" class="dialog-footer"> + <div class="container"> + <div class="images"> + <!-- <img--> + <!-- v-for="image in images"--> + <!-- :key="image.url"--> + <!-- :src="image.url"--> + <!-- @click="clickCreateHandle(image.url)"--> + <!-- />--> + </div> + <div class="model-panel-list"> + <el-row :gutter="10"> + <el-col :span="6"> + <el-button + icon="el-icon-plus" + size="small" + type="primary" + @click="showCreateHandle" + > + 创建 + </el-button> + </el-col> + <el-col :span="6"> + <el-button + icon="el-icon-delete" + size="small" + type="danger" + @click="clearHandle" + > + 清空 + </el-button> + </el-col> + <el-col :span="6"> + <el-button + icon="el-icon-view" + size="small" + :type="showPlot ? 'success' : 'info'" + @click="toggleVisible" + > + {{ showPlot ? '隐藏' : '显示' }} + </el-button> + </el-col> + </el-row> + <el-row :gutter="10" v-for="marker in markers" :key="marker.attr.id"> + <el-col :span="2"> + <img :src="marker.style.image" style="width:22px;height:22px;" /> + </el-col> + <el-col :span="12"> + {{ marker.attr.name || ' ' }} + </el-col> + <el-col :span="10" style="textAlign:right"> + <el-button + icon="el-icon-s-promotion" + size="mini" + circle + @click="() => focusHandle(marker.attr.id)" + /> + <el-button + icon="el-icon-edit" + size="mini" + circle + @click="() => editHandle(marker)" + /> + <el-button + icon="el-icon-delete" + type="danger" + size="mini" + circle + @click="() => removeHandle(marker.attr.id)" + /> + </el-col> + </el-row> + </div> + <el-dialog + :visible="showCreatePanel" + width="380px" + title="创建图标" + :append-to-body="true" + :close-on-click-modal="false" + :before-close="closeCreateHandle" + > + <p>请输入内容:</p> + <el-input v-model="marker.name" placeholder="请输入内容" /> + <div class="image-list"> + <ul> + <li + v-for="item in images" + :key="item.url" + @click="marker.image = item.url" + :class="marker.image === item.url ? 'active' : ''" + > + <img :src="item.url" /> + </li> + </ul> + </div> + <span slot="footer" class="dialog-footer"> <el-button @click="closeCreateHandle">取 消</el-button> <el-button type="primary" @click="createHandle">确 定</el-button> </span> - </el-dialog> - </div> + </el-dialog> + </div> </template> <script> -import { global } from '@/global'; + import { global } from '@/global'; -export default { - components: {}, - data() { - return { - images: [ - { url: '../../../public/images/icon/1.png', type: '消防预警' }, - { url: '../../../public/images/icon/2.png', type: '风险预警' }, - { url: '../../../public/images/icon/3.png', type: '监控' }, - { url: '../../../public/images/wet.png', type: '车辆1' }, - { url: '../../../public/images/dry.png', type: '车辆2' }, - { url: '../../../public/images/alarm1.png', type: '告警' }, - { url: '../../../public/images/police.png', type: '警察' }, - ], - marker: { - id: null, - name: '', - image: null, - scale: 0.25, - }, - showCreatePanel: false, - showPlot: true, - }; - }, - computed: { - timestamp() { - return this.$store.state.map.timestamp; - }, - markers() { - return this.entities.map(entity => entity.attribute); - }, - entities() { - let entities = - this.timestamp && global.map - ? global.map.plotDrawTool.getEntitys() - : []; - return entities.filter(entity => entity.attribute.type === 'billboard'); - }, - }, - methods: { - editHandle(marker) { - if (!global.map) return; - this.marker = { - id: marker.attr.id, - name: marker.attr.name, - image: marker.style.image, - scale: 0.5, - }; - this.showCreatePanel = true; - }, - removeHandle(id) { - if (!global.map) return; - global.map.deletePlot(id); - this.$store.dispatch('map/updateTimestamp'); - }, - closeCreateHandle() { - this.showCreatePanel = false; - }, - showCreateHandle() { - this.showCreatePanel = true; - }, - _initMarker() { - this.marker = { - id: null, - name: '', - image: '', - scale: 0.25, - }; - }, - createHandle() { - if (!global.map) return; - let map = global.map; - const { id, image, scale, name } = this.marker; - const entity = id && map.getPlotById(id); - this.closeCreateHandle(); - if (entity) { - map.updatePlotStyle(id, { image, scale }); - map.updatePlotAttribute(id, { name }); - this._initMarker(); - this.$store.dispatch('map/updateTimestamp'); - } else { - map.startDraw( - { - type: 'billboard', - style: { - image, - scale, - }, - attr: { - name, - }, - }, - () => { - this._initMarker(); - } - ); - } - }, - toggleVisible() { - this.showPlot = !this.showPlot; - if (global.map) { - this.entities.forEach(entity => { - entity.show = this.showPlot; - }); - } - this.$store.dispatch('map/updateTimestamp'); - }, - focusHandle(markerId) { - if (global.map) { - const entity = global.map.getPlotById(markerId); - if (entity) { - global.map.viewer.flyTo(entity, { duration: 1 }); - } - } - }, - clickCreateHandle(url) { - if (!global.map) return; - global.map.startDraw( - { - type: 'billboard', - style: { - image: url, - scale: 0.25, - }, + export default { + components: {}, + data() { + return { + images: [ + { url: '../../../public/images/icon/1.png', type: '消防预警' }, + { url: '../../../public/images/icon/2.png', type: '风险预警' }, + { url: '../../../public/images/icon/3.png', type: '监控' }, + { url: '../../../public/images/wet.png', type: '车辆1' }, + { url: '../../../public/images/dry.png', type: '车辆2' }, + { url: '../../../public/images/alarm1.png', type: '告警' }, + { url: '../../../public/images/police.png', type: '警察' }, + ], + marker: { + id: null, + name: '', + image: null, + scale: 0.25, + }, + showCreatePanel: false, + showPlot: true, + }; }, - () => { - this.$store.dispatch('map/updateTimestamp'); - } - ); - }, - clearHandle() { - if (global.map) { - this.entities.forEach(entity => { - global.map.plotDrawTool.deleteEntity(entity); - }); - } - this.$store.dispatch('map/updateTimestamp'); - }, - }, -}; + computed: { + timestamp() { + return this.$store.state.map.timestamp; + }, + markers() { + return this.entities.map(entity => entity.attribute); + }, + entities() { + let entities = + this.timestamp && global.map + ? global.map.plotDrawTool.getEntitys() + : []; + return entities.filter(entity => entity.attribute.type === 'billboard'); + }, + }, + methods: { + editHandle(marker) { + if (!global.map) return; + this.marker = { + id: marker.attr.id, + name: marker.attr.name, + image: marker.style.image, + scale: 0.5, + }; + this.showCreatePanel = true; + }, + removeHandle(id) { + if (!global.map) return; + global.map.deletePlot(id); + this.$store.dispatch('map/updateTimestamp'); + }, + closeCreateHandle() { + this.showCreatePanel = false; + }, + showCreateHandle() { + this.showCreatePanel = true; + }, + _initMarker() { + this.marker = { + id: null, + name: '', + image: '', + scale: 0.25, + }; + }, + createHandle() { + if (!global.map) return; + let map = global.map; + const { id, image, scale, name } = this.marker; + const entity = id && map.getPlotById(id); + this.closeCreateHandle(); + if (entity) { + map.updatePlotStyle(id, { image, scale }); + map.updatePlotAttribute(id, { name }); + this._initMarker(); + this.$store.dispatch('map/updateTimestamp'); + } else { + map.startDraw( + { + type: 'billboard', + style: { + image, + scale, + }, + attr: { + name, + }, + }, + () => { + this._initMarker(); + } + ); + } + }, + toggleVisible() { + this.showPlot = !this.showPlot; + if (global.map) { + this.entities.forEach(entity => { + entity.show = this.showPlot; + }); + } + this.$store.dispatch('map/updateTimestamp'); + }, + focusHandle(markerId) { + if (global.map) { + const entity = global.map.getPlotById(markerId); + if (entity) { + global.map.viewer.flyTo(entity, { duration: 1 }); + } + } + }, + clickCreateHandle(url) { + if (!global.map) return; + global.map.startDraw( + { + type: 'billboard', + style: { + image: url, + scale: 0.25, + }, + }, + () => { + this.$store.dispatch('map/updateTimestamp'); + } + ); + }, + clearHandle() { + if (global.map) { + this.entities.forEach(entity => { + global.map.plotDrawTool.deleteEntity(entity); + }); + } + this.$store.dispatch('map/updateTimestamp'); + }, + }, + }; </script> <style scoped> -.images img { - width: 36px; - height: auto; - margin: 0px 5px; - cursor: pointer; -} + .images img { + width: 36px; + height: auto; + margin: 0px 5px; + cursor: pointer; + } -.model-panel-list > div { - margin-bottom: 5px; - padding: 5px 0 5px 0; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); -} + .model-panel-list > div { + margin-bottom: 5px; + padding: 5px 0 5px 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + } -.image-list { - margin: 20px 0; -} + .image-list { + margin: 20px 0; + } -.image-list ul, -.image-list li { - margin: 0; - padding: 0; - list-style: none; -} + .image-list ul, + .image-list li { + margin: 0; + padding: 0; + list-style: none; + } -.image-list li { - display: inline-block; - margin: 0 5px 5px 5px; - cursor: pointer; - padding: 5px 8px; - border-radius: 3px; -} + .image-list li { + display: inline-block; + margin: 0 5px 5px 5px; + cursor: pointer; + padding: 5px 8px; + border-radius: 3px; + } -.image-list li img { - width: 32px; - height: 32px; -} + .image-list li img { + width: 32px; + height: 32px; + } -.image-list li:hover, -.image-list li.active { - box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.15); -} + .image-list li:hover, + .image-list li.active { + box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.15); + } </style> diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionRecord/components/detail.vue b/src/views/doublePreventAction/hiddenDanger/inspectionRecord/components/detail.vue index c3fc9e0..e3b1d0e 100644 --- a/src/views/doublePreventAction/hiddenDanger/inspectionRecord/components/detail.vue +++ b/src/views/doublePreventAction/hiddenDanger/inspectionRecord/components/detail.vue @@ -70,7 +70,7 @@ <el-row> <el-col :span="24"> <el-form-item label="巡检结果" prop="result"> - <el-select v-model="inspectionRecordDetailForm.result" :disabled="ifShow" class="input" @change="ifNormal = !ifNormal"> + <el-select v-model="inspectionRecordDetailForm.result" :disabled="ifShow" class="input" @change="ifNormal = (inspectionRecordDetailForm.result === 2 ? true : false)"> <el-option v-for="item in resultList" :key="item.id" @@ -84,10 +84,24 @@ <div v-if="ifNormal"> <el-row> <el-col :span="24"> + <el-form-item label="异常通知部门" prop="noticeDepId"> + <el-select v-model="inspectionRecordDetailForm.noticeDepId" filterable clearable class="input" @change="changeDepartment('notice')" :disabled="ifShow"> + <el-option + v-for="item in departmentList" + :key="item.id" + :value="item.id" + :label="item.department" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> <el-form-item label="异常通知人员" prop="noticeUid"> <el-select v-model="inspectionRecordDetailForm.noticeUid" clearable filterable :disabled="ifShow" class="input"> <el-option - v-for="item in userList" + v-for="item in noticeUserList" :key="item.id" :value="item.id" :label="item.realname" @@ -103,12 +117,26 @@ </el-form-item> </el-col> </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="异常整改部门" prop="fixDepId"> + <el-select v-model="inspectionRecordDetailForm.fixDepId" filterable clearable class="input" :disabled="ifShow" @change="changeDepartment('fix')"> + <el-option + v-for="item in departmentList" + :key="item.id" + :value="item.id" + :label="item.department" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> <el-row > <el-col :span="24"> <el-form-item label="整改人" prop="fixUid"> <el-select v-model="inspectionRecordDetailForm.fixUid" clearable filterable :disabled="ifShow" class="input"> <el-option - v-for="item in userList" + v-for="item in fixUserList" :key="item.id" :value="item.id" :label="item.realname" @@ -127,7 +155,7 @@ </el-row> <el-row> <el-col :span="24"> - <el-form-item label="上报图片" prop="img"> + <el-form-item label="上报图片" prop="imgInfoList"> <el-upload accept=".pdf,.jpg,.png" :action="fileRoad" @@ -137,7 +165,7 @@ :data="uploadForm" list-type="picture-card" :file-list="fileList" - v-model="inspectionRecordDetailForm.img" + v-model="inspectionRecordDetailForm.imgInfoList" :on-change="handleChangeFile" :on-success="onFileSuccess" :multiple="false" @@ -169,7 +197,122 @@ </el-col> </el-row> </div> - <div style="text-align: center"> + <div v-if="ifLook"> + <el-row> + <el-col :span="24"> + <el-form-item label="异常通知部门" prop="noticeDepId"> + <el-select v-model="inspectionRecordDetailForm.problem.noticeDepId" filterable clearable class="input" @change="changeDepartment('notice')" readonly> + <el-option + v-for="item in departmentList" + :key="item.id" + :value="item.id" + :label="item.department" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="异常通知人员" prop="noticeUid"> + <el-select v-model="inspectionRecordDetailForm.problem.noticeUid" clearable filterable readonly class="input"> + <el-option + v-for="item in noticeUserList" + :key="item.id" + :value="item.id" + :label="item.realname" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="整改时间" prop="fixTime"> + <el-date-picker placeholder="选择时间" v-model="inspectionRecordDetailForm.problem.fixTime" class="input" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" readonly></el-date-picker> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="异常整改部门" prop="fixDepId"> + <el-select v-model="inspectionRecordDetailForm.problem.fixDepId" filterable clearable class="input" readonly> + <el-option + v-for="item in departmentList" + :key="item.id" + :value="item.id" + :label="item.department" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row > + <el-col :span="24"> + <el-form-item label="整改人" prop="fixUid"> + <el-select v-model="inspectionRecordDetailForm.problem.fixUid" clearable filterable readonly class="input"> + <el-option + v-for="item in fixUserList" + :key="item.id" + :value="item.id" + :label="item.realname" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="巡检结果备注" prop="info" > + <el-input type="textarea" :rows="3" v-model="inspectionRecordDetailForm.problem.info" aria-readonly="true" class="input"> + </el-input> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="24"> + <el-form-item label="上报图片" prop="imgInfoList"> + <el-upload + accept=".pdf,.jpg,.png" + :action="fileRoad" + class="upload-demo" + ref="upload" + :headers="header" + :data="uploadForm" + list-type="picture-card" + :file-list="fileList" + v-model="inspectionRecordDetailForm.imgInfoList" + :on-change="handleChangeFile" + :on-success="onFileSuccess" + :auto-upload="true"> + <i slot="default" class="el-icon-plus"></i> + <div slot="file" slot-scope="{file}"> + <img + class="el-upload-list__item-thumbnail" + :src="file.url" alt="" + > + <span class="el-upload-list__item-actions"> + <span + class="el-upload-list__item-preview" + @click="handleFile(file)" + > + <i class="el-icon-zoom-in"></i> + </span> + <span + v-if="!disabled" + class="el-upload-list__item-delete" + @click="handleRemove(file,'one')" + > + <i class="el-icon-delete"></i> + </span> + </span> + </div> + </el-upload> + </el-form-item> + </el-col> + </el-row> + </div> + <div style="text-align: center" v-show="ifConfirm"> <el-button @click="inspectionRecordDetailFormVisible = false">取消</el-button> <el-button type="primary" @click="submitInspectionRecordDetail()">确认</el-button> </div> @@ -212,12 +355,14 @@ execUid: null, fixTime: null, fixUid: null, - img: null, + imgInfoList: [], info: null, noticeUid: null, - result: 1, + result: null, taskId: null, - unitId: null + unitId: null, + fixDepId:null, + noticeDepId:null, }, inspectionRecordDetailFormRules:{ img: [{ required: true, validator: validateImg, trigger: 'blur' }], @@ -226,13 +371,20 @@ fixTime: [{ required: true, message: '整改时间不能为空', trigger: 'change' }], fixUid: [{ required: true, message: '描整改人员不能为空', trigger: 'change' }], info: [{ required: true, message: '巡检结果备注不能为空', trigger: 'blur' }], + fixDepId: [{ required: true, message: '异常整改部门不能为空', trigger: 'blur' }], + noticeDepId: [{ required: true, message: '异常通知部门不能为空', trigger: 'blur' }], }, inspectionRecordDetailFormVisible:false, ifShow:true, ifNormal:false, + ifLook:false, + ifConfirm:false, userList:[], + noticeUserList:[], + fixUserList:[], + departmentList:[], fileList:[], - resultList:[{id:1,name:'正常'},{id:2,name:'异常'}], + resultList:[{id:0,name:'未巡检'},{id:1,name:'正常'},{id:2,name:'异常'}], typeList:[{id:1,name:'日常检查'},{id:2,name:'周期检查'}], statusList:[{id:1,name:'待巡检'},{id:2,name:'巡检中'},{id:3,name:'已完成'},{id:4,name:'超时未巡检'},{id:5,name:'已取消'}], } @@ -245,47 +397,69 @@ this.inspectionRecordFormVisible = true this.inspectionRecordForm = JSON.parse(JSON.stringify(value)) }, - showInspectionRecordDetailForm(value,type,userList) { + showInspectionRecordDetailForm(value,type,userList,departmentList) { this.inspectionRecordDetailFormVisible = true + this.$nextTick(() =>{ + this.$refs["inspectionRecordDetailForm"].clearValidate() + }) this.userList = userList + this.departmentList = departmentList if(type === '查看'){ - this.titleDetail = '巡检单元查看' - this.ifShow = true + this.titleDetail = '查看单元上报' + this.ifNormal = false + this.ifLook = true + this.ifConfirm = false this.inspectionRecordDetailForm = JSON.parse(JSON.stringify(value)) - if(value.result === 2){ - this.ifNormal = true + if(this.inspectionRecordDetailForm.problem.imageInfoList === null){ this.fileList = [] - this.fileList.push({url:process.env.IMG_API + value.img}) + }else{ + this.fileList = this.inspectionRecordDetailForm.problem.imageInfoList.map( item => { return { url : process.env.IMG_API + item.imgPath}}) } }else{ this.titleDetail = '巡检单元上报' this.ifShow = false + this.ifNormal = false + this.ifLook = false + this.ifConfirm = true this.inspectionRecordDetailForm = { execUid: Cookies.get('userId'), fixTime: null, fixUid: null, - img: null, + imgInfoList: [], info: null, noticeUid: null, - result: 1, + result: null, + fixDepId:null, + noticeDepId:null, taskId: value.taskId, unitId: value.id } } }, submitInspectionRecordDetail() { - if(this.ifNormal = false){ + if(this.ifNormal === false){ this.inspectionRecordDetailForm.noticeUid = null this.inspectionRecordDetailForm.fixTime = null this.inspectionRecordDetailForm.fixUid = null this.inspectionRecordDetailForm.info = null - this.inspectionRecordDetailForm.img = null + this.inspectionRecordDetailForm.imgInfoList = [] + this.inspectionRecordDetailForm.noticeDepId = null + this.inspectionRecordDetailForm.fixDepId = null } this.$refs["inspectionRecordDetailForm"].validate((valid) =>{ if(valid){ + if(this.inspectionRecordDetailForm.result === 0){ + this.$message({ + type:'warning', + message:'请选择正确的巡检结果' + }) + return + } + this.inspectionRecordDetailForm.imgInfoList = this.inspectionRecordDetailForm.imgInfoList.map(item =>{ return { imagePath:item.imagePath}}) submitUnitOne(this.inspectionRecordDetailForm).then( res =>{ if(res.data.code === '200'){ this.inspectionRecordDetailFormVisible = false + this.$emit('getList') this.$message({ type:'success', message:'上报成功', @@ -308,13 +482,30 @@ } }) }, + changeDepartment(type){ + if(type === 'notice'){ + if(this.inspectionRecordDetailForm.noticeDepId === ''){ + this.noticeUserList = [] + }else{ + let department = this.departmentList.find(item => item.id === this.inspectionRecordDetailForm.noticeDepId).department + this.noticeUserList = this.userList.filter ( item => item.department === department) + } + }else{ + if(this.inspectionRecordDetailForm.fixDepId === ''){ + this.fixUserList = [] + }else{ + let department = this.departmentList.find(item => item.id === this.inspectionRecordDetailForm.fixDepId).department + this.fixUserList = this.userList.filter ( item => item.department === department) + } + } + }, handleChangeFile(){ this.header.Authorization = Cookies.get('token') }, onFileSuccess(response){ if(response.code === '200'){ - this.inspectionRecordDetailForm.img = response.result.path - this.fileList.push({url:process.env.IMG_API + response.result.path}) + this.inspectionRecordDetailForm.imgInfoList.push({imagePath:response.result.path,name:response.result.name,}) + this.fileList.push({url:process.env.IMG_API + response.result.path,name:response.result.name,}) this.$notify({ type:'success', duration:2000, @@ -333,13 +524,14 @@ this.dialogVisible = true; }, handleRemove(file){ + debugger return this.$confirm(`确定移除 ${ file.name }?`,'提示',{ confirmButtonText:'确定', cancelButtonText:'取消', type:'warning', }).then(()=> { - this.inspectionRecordDetailForm.img = null - this.fileList = [] + this.inspectionRecordDetailForm.imgInfoList.splice(this.inspectionRecordDetailForm.imgInfoList.findIndex(item =>item.name === file.name),1) + this.fileList.splice(this.inspectionRecordDetailForm.imgInfoList.findIndex(item =>item.name === file.name),1) }) }, } diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue index 80ae467..9f03856 100644 --- a/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue +++ b/src/views/doublePreventAction/hiddenDanger/inspectionRecord/index.vue @@ -7,7 +7,7 @@ </div> <div class="basic_search"> <span>结束时间:</span> - <el-date-picker v-model="listQuery.startTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="巡检结束时间"></el-date-picker> + <el-date-picker v-model="listQuery.endTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="巡检结束时间"></el-date-picker> </div> <div class="basic_search"> <span>任务类型:</span> @@ -35,17 +35,6 @@ <span>巡检任务创建人员:</span> <el-select v-model="listQuery.createUid" filterable clearable> <el-option - v-for="item in userList" - :key="item.id" - :value="item.id" - :label="item.realname" - ></el-option> - </el-select> - </div> - <div class="basic_search"> - <span>异常通知人员:</span> - <el-select v-model="listQuery.noticeUid" filterable clearable> - <el-option v-for="item in userList" :key="item.id" :value="item.id" @@ -94,6 +83,9 @@ <el-table-column label="上报说明" prop="info" align="center"> </el-table-column> <el-table-column label="上报照片" prop="img" align="center"> + <template slot-scope="scope"> + <el-button type="text" @click="downloadFile(scope.row)">下载</el-button> + </template> </el-table-column> <el-table-column label="状态" prop="status" align="center"> <template slot-scope="scope"> @@ -151,33 +143,7 @@ /> <br> </div> - <el-dialog :title="title" :visible.sync="inspectionRecordVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> - <el-form ref="inspectionRecordForm" :model="inspectionRecordForm" label-position="right" label-width="165px"> - <el-form-item label="责任部门" prop="hazardDep"> - <el-select v-model="inspectionRecordForm.hazardDep" class="analyseUnit_input"> - <el-option - v-for="item in departmentList" - :key="item.id" - :value="item.department" - :label="item.department" - ></el-option> - </el-select> - </el-form-item> - <el-form-item label="责任人" prop="hazardLiablePerson"> - <el-input v-model="inspectionRecordForm.hazardLiablePerson" class="analyseUnit_input"></el-input> - </el-form-item> - <el-form-item label="安全风险分析对象编码" prop="hazardCode"> - <el-input v-model="inspectionRecordForm.hazardCode" class="analyseUnit_input"></el-input> - </el-form-item> - <el-form-item label="安全风险分析单元名称" prop="riskUnitName"> - <el-input v-model="inspectionRecordForm.riskUnitName" class="analyseUnit_input"></el-input> - </el-form-item> - </el-form> - <div align="right"> - <el-button @click="unitFormVisible = false">取消</el-button> - </div> - </el-dialog> - <detail ref="detail"></detail> + <detail ref="detail" @getList="getInspectionRecordData"></detail> </div> </template> @@ -250,7 +216,6 @@ title:'', company:'', code:'', - inspectionRecordVisible:false, inspectionRecordForm:{ }, @@ -317,7 +282,7 @@ this.$refs.detail.showInspectionRecordForm(value) }, showInspectionRecordDetailForm(value,type) { - this.$refs.detail.showInspectionRecordDetailForm(value,type,this.userList) + this.$refs.detail.showInspectionRecordDetailForm(value,type,this.userList,this.departmentList) }, async submitInspectionRecordForm(value){ if(value.unitList.find(item => item.status === 1) === undefined){ @@ -330,6 +295,7 @@ taskId: value.id }) if(res.data.code === '200'){ + this.getInspectionRecordData() this.$message({ type:'success', message:'提交成功', @@ -349,6 +315,19 @@ }) } }, + downloadFile(value){ + debugger + if(value.problem.imageInfoList === null){ + this.$message({ + type:'warning', + message:'无文件可下载' + }) + }else{ + for(let i in value.problem.imageInfoList){ + window.open(process.env.IMG_API + value.problem.imageInfoList[i].imgPath, '_blank') + } + } + }, refreshHandle(){ this.getInspectionRecordData() }, diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue b/src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue index 01f12bd..eb6c39d 100644 --- a/src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue +++ b/src/views/doublePreventAction/hiddenDanger/inspectionTask/index.vue @@ -445,7 +445,7 @@ if(type === '新增'){ this.ifShow = false this.title = '新建巡检计划设定' - this.noticeDepartment = '' + // this.noticeDepartment = '' this.execDepartment = '' this.inspectionTaskForm = { type:null, @@ -467,6 +467,7 @@ }else{ this.ifShow = true this.title = '编辑巡检计划设定' + debugger // this.noticeDepartment = this.handleDepartment(JSON.parse(JSON.stringify(value)).noticeUid) // this.changeNotice() this.execDepartment = this.handleDepartment(JSON.parse(JSON.stringify(value)).execUid) @@ -481,6 +482,7 @@ } }, handleDepartment(value){ + debugger let department = '' for(let i in this.userList){ if(this.userList[i].id === value){ diff --git a/src/views/doublePreventAction/riskLevelManage/analyseUnit/components/departmentChart.vue b/src/views/doublePreventAction/riskLevelManage/analyseUnit/components/departmentChart.vue new file mode 100644 index 0000000..94a4888 --- /dev/null +++ b/src/views/doublePreventAction/riskLevelManage/analyseUnit/components/departmentChart.vue @@ -0,0 +1,89 @@ +<template> + <el-dialog title="各部门风险分析单元" :visible.sync="chartsVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> + <div id="departmentChart" style="width:90%;height:360px;margin: 0 auto;"> + </div> + </el-dialog> +</template> + +<script> + import {getDepartmentChart} from "../../../../../api/riskLevelManage"; + + export default { + name: "departmentChart", + data() { + return { + numData:[], + departmentData:[], + myChart:'', + chartsVisible:false, + } + }, + mounted() { + + }, + methods : { + show(){ + this.chartsVisible = true + this.getChart() + }, + async getChart() { + let res = await getDepartmentChart() + if(res.data.code === '200') { + debugger + this.numData = res.data.result.map(item =>{ + return item["count"] + }) + this.departmentData = res.data.result.map(item =>{ + return item.department + }) + this.myChart = this.$echarts.init(document.getElementById('departmentChart')) + this.myChart.setOption({ + tooltip: { + trigger: 'item' + }, + legend: { + top: '5%', + left: 'center', + orient:'vertical' + }, + xAxis: { + type: 'category', + data: this.departmentData + }, + yAxis: { + type: 'value' + }, + series: [ + { + data: this.numData, + type: 'bar', + itemStyle: { + normal: { + color: function(params) { + // 给出颜⾊组 + var colorList = ['#fac858','#5470c6','#91cc75','#fac858','#ee6666','#73c0de','#fc8452','#3ba272','#9a60b4','#ea7ccc']; + return colorList[params.dataIndex] + }, + } + }, + showBackground: true, + backgroundStyle: { + color: '#5470c6' + } + }] + }) + }else{ + this.$message({ + type:'warning', + message:res.data.message + }) + } + + }, + } + } +</script> + +<style scoped> + +</style> diff --git a/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue b/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue index 49c059c..b5ec3a3 100644 --- a/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue +++ b/src/views/doublePreventAction/riskLevelManage/analyseUnit/index.vue @@ -81,15 +81,24 @@ </div> <el-dialog :title="title" :visible.sync="analyseUnitVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> <el-form ref="analyseUnitForm" :rules="analyseUnitFormRules" :model="analyseUnitForm" label-position="right" label-width="165px"> - <el-form-item label="责任部门" prop="hazardDepId"> - <el-select v-model="analyseUnitForm.hazardDepId" class="analyseUnit_input" > - <el-option - v-for="item in departmentList" - :key="item.id" - :value="item.id" - :label="item.department" - ></el-option> - </el-select> + <el-form-item label="责任部门" prop="hazardDep"> + <el-row> + <el-col :span="21"> + <el-select v-model="analyseUnitForm.hazardDep" value-key="item" class="analyseUnit_input" @change="departmentChange" @clear="departmentClear"> + <el-option + v-for="item in departmentList" + :key="item.id" + :value="item" + :label="item.department" + ></el-option> + </el-select> + </el-col> + <el-col :span="3"> + <img src="../../../../assets/map.png" class="image" @click="showDepartmentChart"></img> + </el-col> + </el-row> + + </el-form-item> <el-form-item label="责任人" prop="hazardLiablePerson"> <el-select v-model="analyseUnitForm.hazardLiablePerson" value-key="item" class="analyseUnit_input"@change="personChange" @clear="personClear" > @@ -113,15 +122,19 @@ <el-button type="primary" @click="submitAnalyseUnit()">确认</el-button> </div> </el-dialog> + <department-chart ref="chart"></department-chart> + </div> </template> <script> + import departmentChart from "./components/departmentChart"; import { mapGetters } from 'vuex' import { computePageCount } from '@/utils' import { addAnalyseUnit, deleteAnalyseUnit, getAnalyseUnitList, updateAnalyseUnit } from '@/api/riskLevelManage' import {getAllDepartment, getDepartmentList} from "../../../../api/departmentManage"; import {safetyInspectionItemName} from "../../../../api/safetySelfInspection"; + import {getDepartmentChart} from "../../../../api/riskLevelManage"; export default { name: 'index', filters: { @@ -137,6 +150,9 @@ ...mapGetters([ 'userType' ]) + }, + components :{ + departmentChart }, data() { return { @@ -154,7 +170,7 @@ code:'', analyseUnitVisible:false, analyseUnitFormRules:{ - hazardDepId: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], + hazardDep: [{ required: true, message: '责任部门不能为空', trigger: 'change' }], hazardLiablePerson: [{ required: true, message: '责任人不能为空', trigger: 'blur' }], hazardCode: [{ required: true, message: '安全风险分析对象编码不能为空', trigger: 'blur' }], riskUnitName: [{ required: true, message: '安全风险分析单元名称不能为空', trigger: 'blur' }], @@ -171,7 +187,7 @@ updateBy: "", validFlag: null, hazardLiablePersonId: null, - hazardDepId: null + hazardDepId: 1 }, listQuery:{ pageIndex:1, @@ -229,6 +245,9 @@ }) } }, + showDepartmentChart() { + this.$refs.chart.show() + }, showAnalyseUnitForm(value,type){ this.analyseUnitVisible = true this.$nextTick(() =>{ @@ -248,7 +267,7 @@ updateBy: "", validFlag: null, hazardLiablePersonId: null, - hazardDepId: null + hazardDepId: 1 } }else{ this.title = '修改' @@ -325,12 +344,18 @@ this.analyseUnitForm.hazardLiablePerson = val.realname this.analyseUnitForm.hazardLiablePersonId = val.id }, - + departmentChange(val){ + this.analyseUnitForm.hazardDep = val.department + this.analyseUnitForm.hazardDepId = val.id + }, personClear(){ this.analyseUnitForm.hazardLiablePerson = null this.analyseUnitForm.hazardLiablePersonId = null }, - + departmentClear(){ + this.analyseUnitForm.hazardDep = null + this.analyseUnitForm.hazardDepId = null + }, refreshHandle(){ this.getAnalyseUnitData() }, @@ -353,4 +378,8 @@ .analyseUnit_input{ width:320px; } + .image{ + width:70%; + height:70%; + } </style> diff --git a/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue b/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue index f593625..bc116f5 100644 --- a/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue +++ b/src/views/doublePreventAction/riskLevelManage/safetyRiskSpace/index.vue @@ -174,7 +174,6 @@ status: null }, listQuery:{ - eid:'', status:0, }, } @@ -187,7 +186,6 @@ async getSafetyRiskSpaceData(){ this.listLoading = true let params = {} - params["eid"] = (this.listQuery.eid === '' ? Cookies.get('companyid') : this.listQuery.eid) params["status"] = this.listQuery.status let res = await getSafetyRiskSpaceList(params) if(res.data.code === '200'){ @@ -230,7 +228,7 @@ if(type === '新增'){ this.title = '新增' this.safetyRiskSpaceForm = { - createUid: Cookies.get('userId'), + createUid: parseInt(Cookies.get('userId')), descInfo: null, img: null, } @@ -296,6 +294,7 @@ if(response.code === '200'){ debugger this.safetyRiskSpaceForm.img = response.result.path + this.fileList = [] this.fileList.push({url:process.env.IMG_API + response.result.path}) this.$notify({ type:'success', diff --git a/src/views/specialWorkManage/specialWork/taskCreate/components/taskBasic/index.vue b/src/views/specialWorkManage/specialWork/taskCreate/components/taskBasic/index.vue index 6d3e3fa..63505c9 100644 --- a/src/views/specialWorkManage/specialWork/taskCreate/components/taskBasic/index.vue +++ b/src/views/specialWorkManage/specialWork/taskCreate/components/taskBasic/index.vue @@ -71,15 +71,18 @@ </el-select> </el-form-item> </el-col> - <el-col :span="16"> - <el-form-item label="作业地点:" prop="area"> - <el-input v-model="taskBasicForm.area"></el-input> + <el-col :span="8"> + <el-form-item label="吨位类型:" prop="etype" > + <el-select v-model="taskBasicForm.etype" clearable class="taskBasic_select"> + <el-option + v-for="item in etypeList" + :key="item.id" + :value="item.id" + :label="item.name" + ></el-option> + </el-select> </el-form-item> </el-col> - </el-row> - - <el-row> - <el-col :span="8"> <el-form-item label="是否节假日:" prop="isholiday" > <el-select v-model="taskBasicForm.isholiday" clearable class="taskBasic_select"> @@ -92,7 +95,17 @@ </el-select> </el-form-item> </el-col> - <el-col :span="16"> + + </el-row> + + <el-row> + + <el-col :span="12"> + <el-form-item label="作业地点:" prop="area"> + <el-input v-model="taskBasicForm.area"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> <el-form-item label="作业内容:" prop="description"> <el-input v-model="taskBasicForm.description"></el-input> </el-form-item> @@ -678,13 +691,15 @@ description:'', isanalysis:'', analysisarea:'', - analysismedium:'' + analysismedium:'', + etype:'', }, activeNames:['0'], companyList:[], fireTypeList:[], hazardList:[], userList:[], + etypeList:[{id:1,name:'60万吨'},{id:2,name:'130万吨'}], list:[{id:0,name:'否'},{id:1,name:'是'}], levelList:[{id:2,name:'特级'},{id:1,name:'一级'},{id:0,name:'二级'},], spaceCategoryList:[{id:0,name:'密闭设备:如船舱、贮罐、车载槽罐、反应塔(釜)、冷藏箱、压力容器、管道、烟道、锅炉等'},{id:1,name:'地下有限空间:如地下管道、地下室、地下仓库、地下工程、暗沟、隧道、涵洞、地坑、废井、地窖、污水池(井)、沼气池、化粪池、下水道等'},{id:2,name:'地上有限空间:如储藏室、酒糟池、发酵池、垃圾站、温室、冷库、粮仓、料仓等'},], @@ -731,7 +746,8 @@ description:[{ required: true, message: '作业内容不能为空', trigger: 'blur' }], isanalysis:[{ required: true, message: '是否需要气体检测不能为空', trigger: 'change' }], analysisarea:[{ required: true, message: '分析地点不能为空', trigger: 'blur' }], - analysismedium:[{ required: true, message: '分析介质不能为空', trigger: 'blur' }] + analysismedium:[{ required: true, message: '分析介质不能为空', trigger: 'blur' }], + etype:[{ required: true, message: '吨位类型不能为空', trigger: 'change' }] }, ifIncludeArea:null, ifHoisting:null, diff --git a/src/views/specialWorkManage/specialWork/taskCreate/components/taskCreate.vue b/src/views/specialWorkManage/specialWork/taskCreate/components/taskCreate.vue index 87e4ab7..a6e7317 100644 --- a/src/views/specialWorkManage/specialWork/taskCreate/components/taskCreate.vue +++ b/src/views/specialWorkManage/specialWork/taskCreate/components/taskCreate.vue @@ -253,7 +253,8 @@ description:'', isanalysis:'', analysisarea:'', - analysismedium:'' + analysismedium:'', + etype:'', } this.$refs.taskBasic.ifIncludeArea = null this.$refs.taskBasic.ifHoisting = null -- Gitblit v1.9.2