diff --git a/.env.development b/.env.development index fe9577c..bbdad11 100644 --- a/.env.development +++ b/.env.development @@ -7,7 +7,7 @@ VUE_APP_GATEWAY_URL="/dev-api" # 服务地址 VUE_APP_BASE_API_URL="http://192.168.2.187:8081" # 服务前-- 请严格遵守格式 不允许换行 -VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file-zy","prevention":"/prevention-yx"}' +VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file-zy","prevention":"/prevention-zsz","bpm":"/bpm-zsz"}' # 是否显示全部菜单 VUE_APP_ALL_MENU = false # 微前端地址 diff --git a/src/service/manager.service.ts b/src/service/manager.service.ts index 97603a6..591a025 100644 --- a/src/service/manager.service.ts +++ b/src/service/manager.service.ts @@ -7,7 +7,7 @@ export default class ManagerService extends BaseService{ } // 查询列表 public selectByPage(params: any):Promise>>{ - const url = this.prefix.prevention+'/danger/manage/list'; + const url = this.prefix.prevention+'/danger/manage/manageList'; return this.get(url,params,true) } // 批量删除 @@ -34,6 +34,10 @@ export default class ManagerService extends BaseService{ return this.put(url,params,{},showLoading) } } + public selectByPage2(params: any):Promise>>{ + const url = this.prefix.prevention+'/danger/manage/dataList'; + return this.get(url,params,true) + } public getFileUrls(params):Promise>>{ const url = this.prefix.file+'/getSysFiles'; diff --git a/src/service/workFlow.service.ts b/src/service/workFlow.service.ts new file mode 100644 index 0000000..19c3ceb --- /dev/null +++ b/src/service/workFlow.service.ts @@ -0,0 +1,22 @@ +import BaseService from "hbt-common/service/base.service" +import type { AxiosResponse } from 'axios' +import { ActionResult } from "hbt-common/models/actionResult"; +export default class WorkFlowService extends BaseService{ + constructor(){ + super() + } + + public startWorkFlow(params,showLoading?:boolean): Promise>>{ + const url = this.prefix.bpm+'/workflow-task/create-process'; + return this.post(url,params,{},true) + } + + public again(params,showLoading?:boolean): Promise>>{ + const url = this.prefix.bpm+'/workflow-task/again-candidate'; + return this.post(url,params,{},true) + } + public taskHandle(params,showLoading?:boolean): Promise>>{ + const url = this.prefix.bpm+'/workflow-task/task-handle'; + return this.post(url,params,{},true) + } +} \ No newline at end of file diff --git a/src/views/common.component.scss b/src/views/common.component.scss index aab8387..998ed10 100644 --- a/src/views/common.component.scss +++ b/src/views/common.component.scss @@ -120,6 +120,8 @@ height: 1px; margin-top: 8px; background: #FFFFFF; + display: flex; + flex-direction: column; border-radius: 4px; border: 1px solid #EEEEEE; padding: 24px 24px 0; diff --git a/src/views/hiddenDanger/clap.component.vue b/src/views/hiddenDanger/clap.component.vue index 6060631..3cb8f39 100644 --- a/src/views/hiddenDanger/clap.component.vue +++ b/src/views/hiddenDanger/clap.component.vue @@ -10,6 +10,7 @@ import FormOption from "hbt-common/models/formOptions" import BtnOption from "hbt-common/models/btnOptions" import DrawComponent from '@/components/draw.component.vue'; import NoteService from '@/service/note.service'; +import WorkFlowService from "@/service/workFlow.service" import UnitService from '@/service/unit.service'; import MapComponent from "@/components/map.component.vue" import mapboxgl from "mapbox-gl"; @@ -22,13 +23,14 @@ import moment from 'moment'; DrawComponent, MapComponent }, -}) +} as any) export default class HiddenDangerClapComponent extends BaseRecordComponent { public tableService = new NoteService(); public areaService = new AreaService(); public unitService = new UnitService(); + public workFlowService = new WorkFlowService() public areaList = []; @@ -105,11 +107,11 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent value:"cancel" },{ name:"保存并下发", - value:"saveAndContinue", + value:"submit", type:"primary" },{ name:"保存", - value:"save", + value:"draft", type:"primary" }]; @@ -463,8 +465,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent }else if(data.value ==="fixed"){ this.showMap = true - }else if(data.value.indexOf("save")>=0){ - this.doSave(); + }else if(data.value ==="draft" || data.value ==="submit"){ + this.doSave(data.value === "submit"); }else{ this.handleClose() } @@ -506,6 +508,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent this.tableService.selectById(row.id).then((res:any)=>{ Object.assign(this.updateParams,{ classifyName:this.$store.getters.prevention_dangrous_type_map[res.data.classify], + attributeClassifyName:this.$store.getters.prevention_safe_reason_map[row.attributeClassify], dangerTypeName:this.$store.getters.prevention_danger_type_map[res.data.dangerType], inspectTypeName:this.$store.getters.prevention_danger_check_type_map[res.data.inspectType], levelName:this.levelMap[res.data.level], @@ -610,15 +613,43 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent window.open(file.url,"_blank") } } - public doSave(){ + public doSave(isSubmit){ this.updateParams.resourceId = this.photoList.map(item=>item.id).join(",") this.updateParams.resourceName = this.photoList.map(item=>item.name).join(",") this.updateParams.resourceOtherId = this.fileList.map(item=>item.id).join(",") this.updateParams.resourceOtherName = this.fileList.map(item=>item.name).join(",") this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then(res=>{ this.$message.success(!this.updateParams.id?"新增成功!":"编辑成功"); + if(isSubmit){ + this.startWorkFlow([res.data],[this.updateParams.reformUserId]) + }else{ + this.getTableData(); + } this.handleClose(); - this.getTableData(); + }) + } + + public startWorkFlow(ids,userIds){ + const keyValue = ids.map(id=>{ + return { + F_Id:id, + F_FormId:1742822461669376, + F_Type:2, + F_UrlAddress:"ceshi1" + } + }) + this.workFlowService.startWorkFlow({ + "F_Id": "1743872031226688", + "relationTaskList": "[]", + "keyValue": JSON.stringify(keyValue), + "userJson": "[]", + "fileValue": [], + "nextNodeName":"确认", + "nodeName":"上报", + "userList": userIds + }).then((res:any)=>{ + this.getTableData() + // 发起工作流成功 }) } diff --git a/src/views/hiddenDanger/common.component.html b/src/views/hiddenDanger/common.component.html index 6832553..661a749 100644 --- a/src/views/hiddenDanger/common.component.html +++ b/src/views/hiddenDanger/common.component.html @@ -5,13 +5,18 @@ :full-btn="false" @change="change" btn-position="end">
- + + {{item.name}} + +
+ - +
{{scope.$index+1}}
@@ -19,7 +24,7 @@
@@ -119,12 +124,12 @@
{{reformModeMap[scope.row.reformMode]}}
-
+
{{scope.row.description}} + :src="scope.row.urls[0]" + :preview-src-list="scope.row.urls">
@@ -150,7 +155,34 @@ - 隐患信息
+ + +
隐患确认
+ + + +
隐患整改
+ + + +
隐患验证
+ diff --git a/src/views/hiddenDanger/files.component.vue b/src/views/hiddenDanger/files.component.vue index 0e33f40..39e8fbc 100644 --- a/src/views/hiddenDanger/files.component.vue +++ b/src/views/hiddenDanger/files.component.vue @@ -8,15 +8,16 @@ import TableComponent from "hbt-common/components/common/table.component.vue" import ManagerService from "@/service/manager.service" import FormOption from "hbt-common/models/formOptions" import BtnOption from "hbt-common/models/btnOptions" -import DrawComponent from '@/components/draw.component.vue'; +import MapComponent from "@/components/map.component.vue" +import mapboxgl from "mapbox-gl"; @Component({ template, components:{ FormComponent, TableComponent, - DrawComponent, + MapComponent }, -}) +} as any) export default class HiddenDangerFilesComponent extends BaseRecordComponent { public tableService = new ManagerService(); @@ -52,115 +53,80 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent public formOptions:FormOption[] = []; public showUpdate = false; - public currentId = -1; public updateParams = {} as any; - public updateOptions:FormOption[] = [{ - name:"区域编号", - key:"no", - type:"text", - width:"calc(50% - 20px)", - require:true - },{ - name:"区域名称", - key:"areaName", - type:"text", - width:"calc(50% - 20px)", - require:true - },{ - name:"责任部门", - key:"deptId", - type:"select", - width:"calc(50% - 20px)", - require:true, - datas:[{ - name:"部门1", - value:0 - },{ - name:"部门2", - value:1 - }] - },{ - name:"责任人", - key:"person", - type:"select", - width:"calc(50% - 20px)", - require:true, - datas:[{ - name:"人员1", - value:0 - },{ - name:"人员2", - value:1 - }] - },{ - name:"属于重大危险源", - key:"isDangrous", - type:"radio", - width:"calc(50% - 20px)", - require:true, - datas:[{ - name:"是", - value:0 - },{ - name:"否", - value:1 - }] - },{ - name:"重大危险源名称", - key:"dangrousName", - type:"text", - width:"calc(50% - 20px)", - require:true, - },{ - name:"重大危险源等级", - key:"level", - type:"select", - width:"calc(50% - 20px)", - require:true, - datas:[{ - name:"一级", - value:0 - },{ - name:"二级", - value:1 - }] - },{ - type:"btn", - name:"区域绘制", - width:"calc(50% - 20px)", - btn:[{ - name:"开始绘制", - value:"draw", - type:"primary" - }] - }]; - - - public showDraw = false; - - public drawModel = "list"; - - - public updateActions = [{ - name:"取消", - value:"cancel" - },{ - name:"保存并继续添加", - value:"saveAndContinue", - type:"primary" - },{ - name:"保存", - value:"save", - type:"primary" - }]; + public updateOptions:FormOption[] = []; + public updateActions = []; public selectData = []; - + public levelMap = ["","一般隐患","重大隐患"] + public reformModeMap = ["","即查即改","限期整改"]; + public executeResultMap = ["","完成","降低标准完成","未完成","延期完成","延期未完成"]; + public isReadonly = true + public isSureMap = ["未确认","确认"]; + public isPassMap = ["不通过","通过"]; + public isAcceptMap = ["不接受","接受"]; + + public fileList = [] as any; + public photoList = [] as any; + + public fileList2 = [] as any; + public photoList2 = [] as any; + public showFile = false; + public currentUrl = null; + public center = [118.751353,31.969568]; + public marker:any = null; + public map:any = null; + public showMap = false; + public executeResultList= [{ + text:"完成", + value:1 + },{ + text:"降低标准完成", + value:2 + },{ + text:"未完成", + value:3 + },{ + text:"延期完成", + value:4, + },{ + text:"延期未完成", + value:5 + }]; created(){ } + public getTableData(){ + this.tableService.selectByPage2(this.params).then(res=>{ + this.tableData = res.data; + this.getTableCallback(); + }) + } + + public getMap(map){ + this.map = map; + this.addMarker(); + } + public addMarker(){ + this.marker = new mapboxgl.Marker({draggable:!this.isReadonly && this.updateParams.status<2}) + .setLngLat(this.center) + .addTo(this.map); + this.map.flyTo({center:this.center}) + } + + public onDragEnd() { + const lngLat = this.marker.getLngLat(); + this.updateParams.locationLng = lngLat.lng; + this.updateParams.locationLat = lngLat.lat; + this.center = [lngLat.lng,lngLat.lat] + // this.updateParams.locationName = lngLat.lng+","+lngLat.lat; + this.handleClose() + } + + + public getTableCallback(){ this.formOptions = [{ name:"隐患等级", @@ -190,20 +156,458 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent value:2 }] }] + + this.updateOptions = [{ + name:"隐患编号", + key:"number", + disable:true, + width:"calc(50% - 20px)", + require:true, + showError:false, + type:"text" + },{ + name:"隐患来源", + key:"source", + format:"sourceName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:this.$store.state.prevention_danger_resource + },{ + name:"隐患标题", + key:"title", + width:"100%", + require:true, + showError:false, + type:"text" + },{ + name:"隐患描述", + width:"100%", + key:"description", + require:true, + showError:false, + type:"text" + },{ + name:"隐患级别", + key:"level", + format:"levelName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:[{ + name:"一般隐患", + value:1 + },{ + name:"重大隐患", + value:2 + }] + },{ + name:"整改方式", + key:"reformMode", + format:"reformModeName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:[{ + name:"即查即改", + value:1 + },{ + name:"限期整改", + value:2 + }] + },{ + name:"隐患位置", + key:"locationName", + type:"text", + width:"calc(50% - 20px)", + require:true, + showError:false, + unit:{ + type:"btn", + name:(this.updateParams.status>1 || this.isReadonly)?"查看定位":"点击定位", + value:"fixed", + btnType:"primary" + } + },{ + name:"隐患分类", + key:"classify", + format:"classifyName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:this.$store.state.prevention_dangrous_type + },{ + name:"整改部门", + key:"reformDeptId", + format:"reformDeptName", + type:"treeSelect", + width:"calc(50% - 20px)", + require:true, + expandLevel:Infinity, + showError:false, + datas:this.$store.state.deptTreeList + },{ + name:"整改责任人", + key:"reformUserId", + format:"reformUserName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:this.$store.state.userList, + },{ + name:"验证人", + key:"verifyUserId", + format:"verifyUserName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:this.$store.state.userList, + },{ + name:"整改时限", + key:"reformDeadline", + type:"date", + subType:"datetime", + format:"yyyy-MM-dd HH", + width:"calc(50% - 20px)", + require:true, + showError:false, + },{ + name:"隐患照片", + key:"photo", + ref:"photo", + type:"upload", + width:"calc(50% - 20px)", + require:true, + onSucess:this.onSuccess, + onMove:this.onRemove, + showError:false, + autoUpload:true, + onPreview:this.onPreview, + accept:"image/png, image/jpeg", + listType:"picture-card", + fileList:this.photoList, + icon:"el-icon-plus", + },{ + name:"相关附件", + key:"file", + ref:"file", + type:"upload", + width:"calc(50% - 20px)", + showError:false, + onSucess:this.onSuccess2, + onMove:this.onRemove2, + onPreview:this.onPreview, + autoUpload:true, + accept:"image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf", + listType:"text", + tip:this.isReadonly?"":"请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件", + fileList:this.fileList, + btn:[{ + name:"上传", + value:"upload", + hide:this.isReadonly, + size:"small", + type:"primary" + }] + },{ + name:"隐患类别", + key:"dangerType", + format:"dangerTypeName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:this.$store.state.prevention_danger_type, + },{ + name:"检查类型", + key:"inspectType", + format:"inspectTypeName", + type:"select", + width:"calc(50% - 20px)", + require:true, + showError:false, + datas:this.$store.state.prevention_danger_check_type, + },{ + name:"违章人数", + key:"violateNumber", + type:"number", + width:"calc(50% - 20px)", + showError:false, + },{ + name:"专业分类", + key:"professionClassify", + format:"professionClassifyName", + type:"select", + width:"calc(50% - 20px)", + showError:false, + datas:this.$store.state.prevention_major_type, + },{ + name:"属性分类", + key:"attributeClassify", + format:"attributeClassifyName", + type:"select", + width:"calc(50% - 20px)", + showError:false, + datas:this.$store.state.prevention_safe_reason, + },{ + name:"发生环节", + key:"occurNode", + format:"occurNodeName", + type:"select", + width:"calc(50% - 20px)", + showError:false, + datas:this.$store.state.prevention_occur_step, + },{ + name:"违反规定条款", + key:"violateTerm", + type:"textarea", + width:"100%", + showError:false, + },{ + name:"隐患整改要求", + key:"reformDemand", + type:"textarea", + width:"100%", + showError:false, + }] + + this.updateOptions2 = [{ + name:"隐患确认", + key:"reformConfirmFlag", + format:"reformConfirmFlagName", + type:"radio", + width:"100%", + require:true, + showError:false, + datas:this.isSure + },{ + name:"原因说明", + type:"textarea", + width:"100%", + key:"reformReasonDescription", + require:true, + hide:this.updateParams.reformConfirmFlag, + showError:false, + placeholder:"请输入未确认原因" + },{ + name:"治理人", + type:"select", + width:"calc(50% - 20px)", + require:true, + key:"executeUserId", + format:"executeUserName", + showError:false, + hide:this.updateParams.reformConfirmFlag===0, + datas:this.$store.state.userList + },{ + name:"治理时限", + type:"date", + subType:"datetime", + width:"calc(50% - 20px)", + require:true, + key:"executeDeadline", + format:"yyyy-MM-dd HH:mm", + showError:false, + hide:this.updateParams.reformConfirmFlag===0, + },{ + name:"治理措施及要求", + type:"textarea", + width:"100%", + key:"executeMeasure", + require:true, + hide:this.updateParams.reformConfirmFlag===0, + showError:false, + placeholder:"请输入治理措施与要求" + },{ + name:"治理资金", + type:"number", + width:"35%", + key:"executeMoney", + require:true, + hide:this.updateParams.reformConfirmFlag===0, + showError:false, + unit:{ + name:"¥", + type:"text" + } + },{ + name:"", + type:"textarea", + width:"calc(65% - 40px)", + key:"executeMoneySource", + hide:this.updateParams.reformConfirmFlag===0, + placeholder:"请输入资金来源" + },{ + name:"确认人", + type:"text", + width:"calc(50% - 20px)", + key:"realConfirmUserName", + require:true, + disable:true, + },{ + name:"确认时间", + type:"date", + subType:"datetime", + width:"calc(50% - 20px)", + require:true, + key:"realConfirmTime", + format:"yyyy-MM-dd HH:mm", + showError:false, + }] + this.updateOptions3 = [{ + name:"接受确认", + key:"executeConfirmFlag", + format:"executeConfirmFlagName", + type:"radio", + width:"100%", + require:true, + showError:false, + datas:this.isAccept + },{ + name:"整改结果", + key:"executeResult", + format:"executeResultName", + type:"radio", + hide:this.updateParams.executeConfirmFlag===0, + width:"100%", + require:true, + showError:false, + datas:this.executeResultList + },{ + name:"治理情况汇报", + type:"textarea", + width:"100%", + key:"executeSituation", + require:true, + hide:this.updateParams.executeConfirmFlag===0, + showError:false, + placeholder:"请输入治理措施与要求" + },{ + name:"原因说明", + type:"textarea", + width:"100%", + key:"executeReasonDescription", + require:true, + hide:this.updateParams.executeConfirmFlag, + showError:false, + placeholder:"请输入未确认原因" + },{ + name:"照片及相关附件", + key:"file2", + type:"upload", + hide:this.updateParams.executeConfirmFlag===0, + width:"100%", + showError:false, + onSucess:this.onSuccess3, + onMove:this.onRemove3, + onPreview:this.onPreview, + autoUpload:true, + accept:"image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf", + listType:"text", + tip:this.isReadonly?"":"请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件", + fileList:this.fileList2, + btn:[{ + name:"点击上传附件", + value:"upload", + hide:this.isReadonly, + size:"small", + type:"primary" + }] + },{ + name:"整改人", + type:"text", + width:"calc(50% - 20px)", + key:"realExecuteUserName", + require:true, + disable:true, + },{ + name:"整改时间", + type:"date", + subType:"datetime", + width:"calc(50% - 20px)", + require:true, + key:"realExecuteTime", + format:"yyyy-MM-dd HH:mm", + showError:false, + }] + this.updateOptions4 = [{ + name:"验证结果", + key:"verifyConfirmFlag", + format:"verifyConfirmFlagName", + type:"radio", + width:"100%", + require:true, + showError:false, + datas:this.isPass + },{ + name:"验证情况", + type:"textarea", + width:"100%", + key:"executeReasonDescription", + hide:this.updateParams.executeConfirmFlag, + placeholder:"请输入验证情况" + },{ + name:"照片", + key:"photo2", + type:"upload", + width:"100%", + onSucess:this.onSuccess4, + onMove:this.onRemove4, + autoUpload:true, + onPreview:this.onPreview, + accept:"image/png, image/jpeg", + listType:"picture-card", + fileList:this.photoList2, + icon:"el-icon-plus", + },{ + name:"验证人", + type:"text", + width:"calc(50% - 20px)", + key:"realVerifyUserName", + require:true, + disable:true, + },{ + name:"验证时间", + type:"date", + subType:"datetime", + width:"calc(50% - 20px)", + require:true, + key:"realVerifyTime", + format:"yyyy-MM-dd HH:mm", + showError:false, + }] } public buildTable(){ - this.tableColumn.push({name:'隐患整改状态',key:"areaName"}); - this.tableColumn.push({name:'隐患来源',key:"deptName"}); - this.tableColumn.push({name:'隐患标题',key:"person"}); - this.tableColumn.push({name:'隐患描述',key:"isDangrous"}); - this.tableColumn.push({name:'隐患等级',key:"isDangrous"}); - this.tableColumn.push({name:'隐患分类',key:"isDangrous"}); - this.tableColumn.push({name:'整改方式',key:"isDangrous"}); - this.tableColumn.push({name:'隐患位置',key:"isDangrous"}); - this.tableColumn.push({name:'治理责任人',key:"isDangrous"}); - this.tableColumn.push({name:'整改结果',key:"isDangrous"}); - this.tableColumn.push({name:'整改时限',key:"isDangrous"}); + this.tableColumn.push({name:'隐患整改状态',width:"120",filters:[{text:"已整改",value:5},{text:"已作废",value:7},{text:"整改中",value:0}],filterMethod:(data,row)=>{ + return row.status == data; + },render:(data)=>{ + if(data.status===5){ + return "已整改" + }else if(data.status===7){ + return "已作废" + }else{ + return "整改中" + } + }}); + this.tableColumn.push({name:'隐患来源',width:"150",render:(data)=>this.$store.getters.prevention_danger_resource_map[data.source]}); + this.tableColumn.push({name:'隐患标题',width:"150",key:"title"}); + this.tableColumn.push({name:'隐患描述',width:"150",key:"description"}); + this.tableColumn.push({name:'隐患等级',render:(data)=>this.levelMap[data.level]}); + this.tableColumn.push({name:'隐患分类',render:(data)=>this.$store.getters.prevention_dangrous_type_map[data.dangerType]}); + this.tableColumn.push({name:'整改方式',render:(data)=>this.reformModeMap[data.reformMode]}); + this.tableColumn.push({name:'隐患位置',width:"150",key:"locationName"}); + this.tableColumn.push({name:'治理责任人',width:"150",key:"executeUserName"}); + this.tableColumn.push({name:'整改结果',width:"150",filters:this.executeResultList,filterMethod:(data,row)=>{ + return row.executeResult == data; + },render:(data)=>this.executeResultMap[data.executeResult]}); + this.tableColumn.push({name:'整改时限',width:"100",key:"reformDeadline"}); } public callback(data){ @@ -219,16 +623,11 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent // 全选 }else if(data.value === "selectAll"){ this.selectAll() - }else if(data.value === "add"){ - this.showUpdateModel(-1) }else if(data.value === "delete"){ this.deleteData(this.selectData.map((item:any)=>item.id)) - }else if(data.value === "draw"){ - this.drawModel = "area"; - this.showDraw = true; - }else if(data.value === "drawList"){ - this.drawModel = "list"; - this.showDraw = true; + }else if(data.value ==="fixed"){ + this.showMap = true + } } // 重置数据 @@ -241,14 +640,71 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent - public showUpdateModel(id){ - if(id!==-1){ + public showUpdateModel(row){ + Object.assign(this.updateParams,{ + verifyConfirmFlagName:this.isPassMap[row.verifyConfirmFlag], + executeConfirmFlagName:this.isAcceptMap[row.executeConfirmFlag], + reformConfirmFlagName:this.isSureMap[row.reformConfirmFlag], + executeResultName:this.executeResultMap[row.executeResult], + sourceName:this.$store.getters.prevention_danger_resource_map[row.source], + attributeClassifyName:this.$store.getters.prevention_safe_reason_map[row.attributeClassify], + classifyName:this.$store.getters.prevention_dangrous_type_map[row.classify], + dangerTypeName:this.$store.getters.prevention_danger_type_map[row.dangerType], + inspectTypeName:this.$store.getters.prevention_danger_check_type_map[row.inspectType], + levelName:this.levelMap[row.level], + occurNodeName:this.$store.getters.prevention_occur_step_map[row.occurNode], + professionClassifyName:this.$store.getters.prevention_major_type_map[row.professionClassify], + reformModeName:this.reformModeMap[row.reformMode], + },row); + + this.getTableCallback() + // 获取url + if(row.resourceId){ + this.tableService.getFileUrls({ids:row.resourceId.split(",")}).then((photos:any)=>{ + this.photoList = photos.data.map(item=>{ + return { + name:item.originalName, + url:item.url, + type:item.type, + id:item.id + } + }) + + this.getTableCallback() + }) + } + if(row.resourceOtherId){ + this.tableService.getFileUrls({ids:row.resourceOtherId.split(",")}).then((files:any)=>{ + this.fileList = files.data.map(item=>{ + return { + name:item.originalName, + url:item.url, + type:item.type, + id:item.id + } + }) + this.getTableCallback() + }) + } + this.showUpdate = true + } + public onPreview(file){ + if(file.type.indexOf("png")>=0 || file.type.indexOf("jp")>=0){ + this.currentUrl = file.url; + this.showFile = true; + }else{ + window.open(file.url,"_blank") } - this.currentId = id; - this.showUpdate = true } public handleClose(){ + if(this.showMap){ + this.showMap = false; + this.marker.remove(); + this.marker = null; + return + } + this.updateParams = {} as any this.showUpdate = false; } diff --git a/src/views/hiddenDanger/manager.component.vue b/src/views/hiddenDanger/manager.component.vue index 7925850..1390397 100644 --- a/src/views/hiddenDanger/manager.component.vue +++ b/src/views/hiddenDanger/manager.component.vue @@ -5,10 +5,9 @@ import template from "./common.component.html" import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue" import FormComponent from "hbt-common/components/common/form.component.vue" import TableComponent from "hbt-common/components/common/table.component.vue" -import AreaService from "@/service/area.service" +import WorkFlowService from "@/service/workFlow.service" import FormOption from "hbt-common/models/formOptions" import BtnOption from "hbt-common/models/btnOptions" -import DrawComponent from '@/components/draw.component.vue'; import MapComponent from "@/components/map.component.vue" import ManagerService from '@/service/manager.service'; import mapboxgl from "mapbox-gl"; @@ -18,12 +17,12 @@ import moment from 'moment'; components:{ FormComponent, TableComponent, - DrawComponent, MapComponent }, -}) +} as any) export default class HiddenDangerManagerComponent extends BaseRecordComponent { public tableService = new ManagerService(); + public workFlowService = new WorkFlowService() // 是否显示删改查按钮 public isBase = true; // 显示治理列表按钮 @@ -32,8 +31,11 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent[] = []; public showUpdate = false; public currentId = -1; public updateParams = {} as any; public updateOptions:FormOption[] = []; + public updateOptions2:FormOption[] = []; + public updateOptions3:FormOption[] = []; + public updateOptions4:FormOption[] = []; public fileList = [] as any; public photoList = [] as any; + + public fileList2 = [] as any; + public photoList2 = [] as any; public showFile = false; public currentUrl = null; public center = [118.751353,31.969568]; @@ -81,28 +98,93 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent1, + type:"primary" + },{ + name:"提交", + value:"submit", + type:"primary" + }]; this.formOptions = [{ name:"隐患等级", key:"level", @@ -136,10 +218,19 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent1 || this.isReadonly)?"查看定位":"点击定位", value:"fixed", btnType:"primary" } @@ -342,23 +433,304 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponentthis.statusMap[data.status]}); + this.tableColumn.push({name:'当前执行人',width:"100",key:"executor"}); + this.tableColumn.push({name:'最新提交时间',width:"180",key:"updateTime"}); + this.tableColumn.push({name:'隐患来源',width:"150",render:(data)=>this.$store.getters.prevention_danger_resource_map[data.source]}); + this.tableColumn.push({name:'隐患标题',width:"150",render:(data)=>{ + if(this.params.type===2){ + return `${data.title}` + }else{ + return data.title + } + }}); + this.tableColumn.push({name:'隐患描述',key:"description"}); + this.tableColumn.push({name:'隐患等级',render:(data)=>this.levelMap[data.level]}); + this.tableColumn.push({name:'隐患分类',render:(data)=>this.$store.getters.prevention_dangrous_type_map[data.dangerType]}); + this.tableColumn.push({name:'整改方式',render:(data)=>this.reformModeMap[data.reformMode]}); + this.tableColumn.push({name:'隐患位置',width:"150",key:"locationName"}); + this.tableColumn.push({name:'治理责任人',width:"100",key:"executeUserName"}); + this.tableColumn.push({name:'整改结果',render:(data)=>this.executeResultMap[data.executeResult]}); + this.tableColumn.push({name:'整改时限',width:"100",key:"reformDeadline"}); + } + + public rowCallback(el,data){ + const isTarget = el.target.classList.contains("link"); + if(isTarget){ + if(data.status===2){ + data = Object.assign({ + realConfirmUserId:this.account.userId, + realConfirmUserName:this.account.nickName, + realConfirmTime:moment().format("YYYY-MM-DD HH:mm") + },data) + } + if(data.status===3){ + data = Object.assign({ + realExecuteUserId:this.account.userId, + realExecuteUserName:this.account.nickName, + realExecuteTime:moment().format("YYYY-MM-DD HH:mm") + },data) + } + if(data.status===4){ + data = Object.assign({ + realVerifyUserId:this.account.userId, + realVerifyUserName:this.account.nickName, + realVerifyTime:moment().format("YYYY-MM-DD HH:mm") + },data) + } + this.showUpdateModel(data) + } + + } + + public changeStatus(data,newStatus){ + this.$confirm("确认要"+(newStatus>60?"中断数据?":newStatus===7?"作废数据?":"恢复数据"),"操作确认",{ + type: 'warning' + }).then(()=>{ + data.status = newStatus; + this.tableService.addOrUpdate(data,false).then(res=>{ + this.$message.success(newStatus>60?"中断成功":"作废成功"); + this.getTableData() + }) + }) + + } + + public change(data,item){ + if(item && (item.key === "reformConfirmFlag" || item.key==="executeConfirmFlag")){ + this.getTableCallback() + return + } + if(item && item.key === "inspectUserId"){ + this.updateParams.inspectUserName = this.$store.getters.user_map[data] + return + } + if(item && item.key === "executeUserId"){ + this.updateParams.executeUserName = this.$store.getters.user_map[data] + return + } + if(item && item.key === "reformDeptId"){ + this.updateParams.reformDeptName = this.$store.getters.dept_map[data] + return + } + if(item && item.key === "reformUserId"){ + this.updateParams.reformUserName = this.$store.getters.user_map[data] + return + } + if(item && item.key === "verifyUserId"){ + this.updateParams.verifyUserName = this.$store.getters.user_map[data] + return + } + // } public callback(data){ @@ -375,12 +747,15 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponentitem.id)) }else if(data.value ==="fixed"){ this.showMap = true + }else if(data.value ==="draft" || data.value==="submit"){ + this.doSave(data.value==="submit"); + } } // 重置数据 @@ -393,11 +768,187 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent{ + this.updateParams.number = res.data + this.getTableCallback(); + this.showUpdate = true + }) + }else{ + Object.assign(this.updateParams,{ + verifyConfirmFlagName:this.isPassMap[row.verifyConfirmFlag], + executeConfirmFlagName:this.isAcceptMap[row.executeConfirmFlag], + reformConfirmFlagName:this.isSureMap[row.reformConfirmFlag], + executeResultName:this.executeResultMap[row.executeResult], + sourceName:this.$store.getters.prevention_danger_resource_map[row.source], + attributeClassifyName:this.$store.getters.prevention_safe_reason_map[row.attributeClassify], + classifyName:this.$store.getters.prevention_dangrous_type_map[row.classify], + dangerTypeName:this.$store.getters.prevention_danger_type_map[row.dangerType], + inspectTypeName:this.$store.getters.prevention_danger_check_type_map[row.inspectType], + levelName:this.levelMap[row.level], + occurNodeName:this.$store.getters.prevention_occur_step_map[row.occurNode], + professionClassifyName:this.$store.getters.prevention_major_type_map[row.professionClassify], + reformModeName:this.reformModeMap[row.reformMode], + },row); + + this.getTableCallback() + // 获取url + if(row.resourceId){ + this.tableService.getFileUrls({ids:row.resourceId.split(",")}).then((photos:any)=>{ + this.photoList = photos.data.map(item=>{ + return { + name:item.originalName, + url:item.url, + type:item.type, + id:item.id + } + }) + if(!this.isReadonly && this.updateParams.status<2){ + this.updateParams.photo = this.photoList.length + } + + this.getTableCallback() + }) + } + if(row.resourceOtherId){ + this.tableService.getFileUrls({ids:row.resourceOtherId.split(",")}).then((files:any)=>{ + this.fileList = files.data.map(item=>{ + return { + name:item.originalName, + url:item.url, + type:item.type, + id:item.id + } + }) + this.getTableCallback() + }) + } + this.showUpdate = true } - this.currentId = id; - this.showUpdate = true + } + + public doSave(isSubmit){ + // 如果是提交 状态直接改成2变成代办 防止隐患确认退回变成草稿 + // 从草稿或者新创建的 要记住 走startWorkFlow + // 从状态1 上报来不走startWorkFlow + let preStatus = this.updateParams.status; + const handleParams = { + "taskId": this.updateParams.taskId, + "btnValue": "agree_", + "message": "", + "esignature": "", + "esignature_pwd": null, + "forwarderList": "[]", + "formValue": "[]", + "keyValue": JSON.stringify([{ + F_Id:this.updateParams.id, + F_FormId:1742822461669376, + F_Type:2, + F_UrlAddress:"ceshi1" + }]), + "rejectNodeId": null, + "userJson": "[]", + "fileValue": [] + } + let userIds = [] as any; + if(!preStatus || preStatus===1){ + this.updateParams.status = 2; + userIds = [this.updateParams.reformUserId] + }else if(preStatus===2){ + // 确认下一步 退回上一步 + if(this.updateParams.reformConfirmFlag){ + this.updateParams.status+=1; + userIds = [this.updateParams.executeUserId] + }else{ + this.updateParams.status-=1; + handleParams.btnValue = "reject_" + handleParams.rejectNodeId = "Activity_1r5fgcn" as any; + } + }else if(preStatus===3){ + // 确认下一步 退回上一步 + if(this.updateParams.executeConfirmFlag){ + this.updateParams.status+=1 + userIds = [this.updateParams.verifyUserId] + }else{ + this.updateParams.status-=1 + handleParams.btnValue = "reject_" + handleParams.rejectNodeId = "Activity_1ue7dkh" as any; + } + }else if(preStatus===4){ + // 确认下一步 退回上一步 + if(this.updateParams.verifyConfirmFlag){ + this.updateParams.status+=1 + }else{ + this.updateParams.status-=1 + handleParams.btnValue = "reject_" + handleParams.rejectNodeId = "Activity_1exiors" as any; + } + } + this.updateParams.resourceId = this.photoList.map(item=>item.id).join(",") + this.updateParams.resourceName = this.photoList.map(item=>item.name).join(",") + this.updateParams.resourceOtherId = this.fileList.map(item=>item.id).join(",") + this.updateParams.resourceOtherName = this.fileList.map(item=>item.name).join(",") + this.updateParams.executeResourceId = this.fileList2.map(item=>item.id).join(",") + this.updateParams.executeResourceName = this.fileList2.map(item=>item.name).join(",") + this.updateParams.verifyResourceId = this.photoList2.map(item=>item.id).join(",") + this.updateParams.verifyResourceName = this.photoList2.map(item=>item.name).join(",") + + this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then(res=>{ + this.$message.success(!this.updateParams.id?"新增成功":"编辑成功"); + if(!preStatus){ + this.startWorkFlow([res.data],[this.updateParams.reformUserId]) + }else{ + this.workFlowService.taskHandle(handleParams).then((data)=>{ + // 验证不需要走下一步 + if(this.updateParams.status > preStatus && preStatus!==4){ + this.doAgain(data.data,userIds) + }else{ + + this.getTableData() + } + }) + } + this.handleClose(); + }) + } + + public startWorkFlow(ids,userIds){ + const keyValue = ids.map(id=>{ + return { + F_Id:id, + F_FormId:1742822461669376, + F_Type:2, + F_UrlAddress:"ceshi1" + } + }) + this.workFlowService.startWorkFlow({ + "F_Id": "1743872031226688", + "relationTaskList": "[]", + "keyValue": JSON.stringify(keyValue), + "userJson": "[]", + "fileValue": [], + "nextNodeName":"确认", + "nodeName":"上报", + "userList": userIds + }).then((res:any)=>{ + this.getTableData() + // 发起工作流成功 + }) + } + + public doAgain(data,userIds){ + this.workFlowService.again([{ + "name": "确认", + "taskId": data.CandidateInfo[0].taskId, + "userList": userIds + }]).then(()=>{ + this.getTableData() + // 发起工作流成功 + }) + } public getMap(map){ @@ -405,7 +956,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponentitem.id === file.response.data.id),1) @@ -450,6 +1021,12 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponentitem.id === file.response.data.id),1) } + public onRemove3(file,fileList){ + this.fileList2.splice(this.fileList2.findIndex(item=>item.id === file.response.data.id),1) + } + public onRemove4(file,fileList){ + this.photoList2.splice(this.photoList2.findIndex(item=>item.id === file.response.data.id),1) + } public onPreview(file){ if(file.type.indexOf("png")>=0 || file.type.indexOf("jp")>=0){ @@ -467,6 +1044,10 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent - + + diff --git a/src/views/hiddenDanger/safe/action.component.vue b/src/views/hiddenDanger/safe/action.component.vue index 4a5a12e..90af393 100644 --- a/src/views/hiddenDanger/safe/action.component.vue +++ b/src/views/hiddenDanger/safe/action.component.vue @@ -611,8 +611,11 @@ export default class RulesManagerComponent extends BaseRecordComponent { } public getTroubleList(){ - this.tableService.getTroubleList(this.recordParams).then(res=>{ - this.troubleTableData = res.data + this.tableService.getTroubleList(this.recordParams).then((res:any)=>{ + this.troubleTableData =res.data.map(data=>{ + data.urls = data.resources.map(source=>source.resourceUrl) || []; + return data + }); }) } @@ -669,7 +672,7 @@ export default class RulesManagerComponent extends BaseRecordComponent { }) } - public showCheckTable(el,data){ + public rowCallback(el,data){ const isTarget = el.target.classList.contains("link"); if(isTarget){ this.hideActions = true; diff --git a/src/views/hiddenDanger/safe/plan.component.vue b/src/views/hiddenDanger/safe/plan.component.vue index 4dbcfef..0495786 100644 --- a/src/views/hiddenDanger/safe/plan.component.vue +++ b/src/views/hiddenDanger/safe/plan.component.vue @@ -542,13 +542,16 @@ export default class PlanComponent extends BaseRecordComponent { const datas = (await this.tableService.getRecordList(this.recordParams)).data as any; item.tableItems = datas; }) - this.currentTableId = this.tableTabs[0].id; + this.currentTableId = this.tableTabs[0]?.id; this.currentTable = this.tableTabs[0] }) } public getTroubleList(){ - this.tableService.getTroubleList(this.recordParams).then(res=>{ - this.troubleTableData = res.data + this.tableService.getTroubleList(this.recordParams).then((res:any)=>{ + this.troubleTableData = res.data.map(data=>{ + data.urls = data.resources.map(source=>source.resourceUrl) || []; + return data + }); }) } diff --git a/src/views/risk/unit/unit.component.vue b/src/views/risk/unit/unit.component.vue index a336899..f7ae1ca 100644 --- a/src/views/risk/unit/unit.component.vue +++ b/src/views/risk/unit/unit.component.vue @@ -219,6 +219,7 @@ export default class UnitManagerComponent extends BaseRecordComponent { key:"areaId", placeholder:"请选择区域名称", width:"calc(50% - 20px)", + format:"areaName", type:"select", require:true, datas:this.areaList @@ -480,7 +481,7 @@ export default class UnitManagerComponent extends BaseRecordComponent { this.showUpdate = true }else{ this.currentId = data.id; - this.updateParams = Object.assign({bottomHeight:0,topHeight:0,status:1,geoJson:"[]",number:null,statusName:["停用","启用"][data.status]},data); + this.updateParams = Object.assign({areaName:this.areaList.find(item=>item.value===data.areaId)?.name,bottomHeight:0,topHeight:0,status:1,geoJson:"[]",number:null,statusName:["停用","启用"][data.status]},data); if(isRead){ this.repairTableData.datas = this.updateParams.repairs.map((item,i)=>{ item.index = i+1;