diff --git a/.env.production b/.env.production index b15b7a6..7df11fd 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ -#生产环境 +#开发环境 NODE_ENV:"production" # 页面标题 VUE_APP_TITLE = 汉邦唐全真数字服务平台 @@ -7,10 +7,13 @@ VUE_APP_GATEWAY_URL="/prod-api" # 服务地址 VUE_APP_BASE_API_URL="" # 服务前-- 请严格遵守格式 不允许换行 -VUE_APP_SERVICE_PREFIX= '{"knowledge":"/knowledge","system":"/system"}' +VUE_APP_SERVICE_PREFIX= '{"system":"/system","file":"/file","prevention":"/prevention","bpm":"/bpm"}' # 是否显示全部菜单 VUE_APP_ALL_MENU = false -# 微前端地址 +# # 微前端地址 +# VUE_APP_REMOTES_URL="http://192.168.1.20:8090" +# # 当前应用部署地址 +# VUE_APP_EXPOSES_URL="http://192.168.1.20:8090" VUE_APP_REMOTES_URL="http://119.45.158.12/common/" # 当前应用部署地址 -VUE_APP_EXPOSES_URL="" \ No newline at end of file +VUE_APP_EXPOSES_URL="/prevention" \ No newline at end of file diff --git a/src/components/analEvaluation.component.vue b/src/components/analEvaluation.component.vue index fca537b..1b38237 100644 --- a/src/components/analEvaluation.component.vue +++ b/src/components/analEvaluation.component.vue @@ -278,7 +278,7 @@ export default class AnalEvaluationComponent extends Vue { { name: "危害分析", key: "hazardAnalysis", - type: "text", + type: "textarea", require: true, width: "calc(100% - 20px)" }, diff --git a/src/components/measure.component.vue b/src/components/measure.component.vue index e0a93c6..411ab95 100644 --- a/src/components/measure.component.vue +++ b/src/components/measure.component.vue @@ -31,8 +31,8 @@ - + @@ -127,15 +127,17 @@ export default class MeasureComponent extends Vue { width: "25%", datas: this.secondTypeItem }, { + name:"", key: "thirdType", type: "text", require: true, width: "25%", + showError: false, }, { name: "措施描述", key: "description", - type: "text", + type: "textarea", require: true, width: "100%" }]; @@ -202,7 +204,7 @@ export default class MeasureComponent extends Vue { }, { name: "隐患排查任务", key: "name", - type: "text", + type: "textarea", width: "100%", require: true, }, { @@ -324,7 +326,7 @@ export default class MeasureComponent extends Vue { public buildTable() { // 排查任务制定 - this.tableColumn.push({ name: '序号', key: "index" ,width:"80px"}); + this.tableColumn.push({ name: '序号', key: "index", width: "80px" }); this.tableColumn.push({ name: "任务名称", key: "name" }) this.tableColumn.push({ name: "执行岗位", key: "executePostName" }) this.tableColumn.push({ name: "执行人", key: "chargeUserName" }) diff --git a/src/service/jobHazard.service.ts b/src/service/jobHazard.service.ts index b8a7036..c6cae07 100644 --- a/src/service/jobHazard.service.ts +++ b/src/service/jobHazard.service.ts @@ -44,4 +44,9 @@ export default class JobHazardService extends BaseService{ const url = this.prefix.prevention+'/job/inventory/filter/list'; return this.post(url,params,{},true) } + //过滤区域单元 + public getDistinctList(params: any):Promise>>{ + const url = this.prefix.prevention+'/job/inventory/getDistinctList'; + return this.post(url,params) + } } \ No newline at end of file diff --git a/src/views/hiddenDanger/safe/plan.component.vue b/src/views/hiddenDanger/safe/plan.component.vue index 646232f..ff3dd4f 100644 --- a/src/views/hiddenDanger/safe/plan.component.vue +++ b/src/views/hiddenDanger/safe/plan.component.vue @@ -197,25 +197,32 @@ export default class PlanComponent extends BaseRecordComponent { showError: false, datas: this.$store.state.prevention_danger_check_type }, { - name: "巡检周期", + name: "巡检周期 每隔", key: "inspectCycleValue", type: "number", hide: this.updateParams.planType === 1, - controls: false, - width: "calc(50% - 20px)", + controls: true, + width: "calc(35% - 20px)", require: true, showError: false, }, { - name: "巡检周期单位", + // name: "巡检周期单位", key: "inspectCycleUnit", format: "inspectCycleUnitName", type: "select", hide: this.updateParams.planType === 1, - width: "calc(50% - 20px)", + width: "calc(15% - 20px)", require: true, showError: false, datas: this.$store.state.prevention_cycle_unit }, { + name: "1次", + key: "times", + type: 'null', + labelWidth:"0px", + // width: "30px", + hide: this.updateParams.planType === 1, + },{ name: "检查区域", key: "areaIds", format: "areaNames", @@ -345,9 +352,9 @@ export default class PlanComponent extends BaseRecordComponent { public buildTable() { - this.tableColumn.push({ name: '检查标题', key: "name", width: "100px" }); + this.tableColumn.push({ name: '检查标题', key: "name", width: "250px" }); this.tableColumn.push({ - name: '检查类型', width: "100px", render: (data) => { + name: '检查类型', render: (data) => { return this.$store.getters.prevention_danger_check_type_map[data.inspectType] } }); @@ -356,9 +363,9 @@ export default class PlanComponent extends BaseRecordComponent { return data.startTime + (data.endTime ? '~' + data.endTime : "") } }); - this.tableColumn.push({ name: '检查负责人', key: "chargeUserName", width: "100px" }); - this.tableColumn.push({ name: '检查范围', width: "270px", key: "scope" }); - this.tableColumn.push({ name: '发现隐患数量', key: "dangerCount", width: "120px" }); + this.tableColumn.push({ name: '检查负责人', key: "chargeUserName",}); + this.tableColumn.push({ name: '检查范围', key: "scope" }); + this.tableColumn.push({ name: '发现隐患数量', key: "dangerCount",}); this.tableColumn.push({ name: '检查类型', render: (data) => { return this.planTypeMap[data.planType] diff --git a/src/views/reward/rewardsRecord/rewardsRecord.component.vue b/src/views/reward/rewardsRecord/rewardsRecord.component.vue index 2d42d9a..7a7aaec 100644 --- a/src/views/reward/rewardsRecord/rewardsRecord.component.vue +++ b/src/views/reward/rewardsRecord/rewardsRecord.component.vue @@ -96,7 +96,7 @@ export default class RewardsRecord extends BaseRecordComponent { name: "姓名", key: "userId", type: "select", - datas:this.$store.state.userList + datas: this.$store.state.userList }, { name: "岗位", key: "postName", @@ -156,7 +156,7 @@ export default class RewardsRecord extends BaseRecordComponent { name: "岗位:", type: "text", key: "postName", - require: true, + // require: true, width: "calc(50% - 20px)", showError: false, disable: true, @@ -188,7 +188,7 @@ export default class RewardsRecord extends BaseRecordComponent { showError: false, datas: this.rewardsType }, { - name: "发生金额/¥", + name: "发生金额/元", type: "number", key: "money", require: true, @@ -244,12 +244,16 @@ export default class RewardsRecord extends BaseRecordComponent { if (item && item.key === 'userId') { this.userService.getDetailsByIds({ userId: data }).then((res: any) => { if (res.code === 200) { - const postName = res.posts.map((item) => item.postName).join(",") + const postName = res.postIds.map((item) => { + if (item) { + return this.$store.getters.post_map[item] + } + } + ).join(",") this.updateParams.userName = res.data.nickName this.updateParams.postName = postName this.buildUpdateForm() } - }) } } @@ -282,7 +286,7 @@ export default class RewardsRecord extends BaseRecordComponent { } }); this.subTableColumn.push({ name: '事由', key: "reason", }); - this.subTableColumn.push({ name: '发生金额/¥', key: "money" }); + this.subTableColumn.push({ name: '发生金额/元', key: "money" }); this.subTableColumn.push({ name: '实施人', key: "operatorName", }); this.subTableColumn.push({ name: '实施部门', key: "operateDeptName", }); } diff --git a/src/views/reward/selfAssessment/selfAssessment.component.html b/src/views/reward/selfAssessment/selfAssessment.component.html index 8180436..0f677d1 100644 --- a/src/views/reward/selfAssessment/selfAssessment.component.html +++ b/src/views/reward/selfAssessment/selfAssessment.component.html @@ -107,7 +107,7 @@ v-if="scope.row.recordFlag" @blur="inputClick(scope.row)" v-focus> {{'点击输入评估记录'}} + v-if="!scope.row.recordFlag && !scope.row.record">{{isReadonly?'--': '点击输入评估记录'}} {{scope.row.record}} diff --git a/src/views/reward/selfAssessment/selfAssessment.component.vue b/src/views/reward/selfAssessment/selfAssessment.component.vue index 37ca63c..9f9ad69 100644 --- a/src/views/reward/selfAssessment/selfAssessment.component.vue +++ b/src/views/reward/selfAssessment/selfAssessment.component.vue @@ -188,11 +188,7 @@ export default class SelfAssessment extends BaseRecordComponent { public updateActions = [{ name: "取消", value: "cancel" - }, { - name: "保存并继续添加", - value: "saveAndContinue", - type: "primary" - }, { + },{ name: "保存", value: "save", type: "primary" diff --git a/src/views/risk/area/area.component.vue b/src/views/risk/area/area.component.vue index cf12351..0b6a020 100644 --- a/src/views/risk/area/area.component.vue +++ b/src/views/risk/area/area.component.vue @@ -12,7 +12,7 @@ import DrawComponent from '@/components/draw.component.vue'; import SystemService from "hbt-common/service/system.service" @Component({ template, - components:{ + components: { FormComponent, TableComponent, DrawComponent, @@ -24,17 +24,17 @@ export default class AreaManagerComponent extends BaseRecordComponent { public systemService = new SystemService(); // 列表参数 public params = { - name:"", - chargeDeptId:null, - majorHazardFlag:null + name: "", + chargeDeptId: null, + majorHazardFlag: null } as any; public filters = [{ - text:"未绘制", - value:0 - },{ - text:"已绘制", - value:1 + text: "未绘制", + value: 0 + }, { + text: "已绘制", + value: 1 }] public isArea = true; @@ -46,51 +46,51 @@ export default class AreaManagerComponent extends BaseRecordComponent { // 列表搜索条件按钮 public formActions = [{ - name:"查询", - value:"search", - icon:"el-icon-search", - type:"primary" - },{ - name:"清空", - icon:"el-icon-tickets", - value:"reset" + name: "查询", + value: "search", + icon: "el-icon-search", + type: "primary" + }, { + name: "清空", + icon: "el-icon-tickets", + value: "reset" }]; // 列表头部按钮 public tableActions = [{ - name:"添加", - value:"add", - icon:"el-icon-plus", - type:"primary" - },{ - name:"批量绘制", - value:"drawList", - plain:true, - icon:"el-icon-plus", - type:"primary" - },{ - name:"批量删除", - value:"delete", - plain:true, - icon:"el-icon-delete", - type:"danger" + name: "添加", + value: "add", + icon: "el-icon-plus", + type: "primary" + }, { + name: "批量绘制", + value: "drawList", + plain: true, + icon: "el-icon-plus", + type: "primary" + }, { + name: "批量删除", + value: "delete", + plain: true, + icon: "el-icon-delete", + type: "danger" }]; // 列表底部按钮 public footerActions = [{ - name:"选择全部", - value:"selectAll", - type:"primary" - },{ - name:"反向选择", - value:"reverse" + name: "选择全部", + value: "selectAll", + type: "primary" + }, { + name: "反向选择", + value: "reverse" }]; // 搜索条件表单 - public formOptions:FormOption[] = []; + public formOptions: FormOption[] = []; public showUpdate = false; public currentId = -1; - public updateParams = {} as any; + public updateParams = {} as any; // 新增/更新表单 - public updateOptions:FormOption[] = []; + public updateOptions: FormOption[] = []; public showDraw = false; @@ -100,201 +100,206 @@ export default class AreaManagerComponent extends BaseRecordComponent { public isReadonly = false; - public updateActions:BtnOption[] = []; + public updateActions: BtnOption[] = []; public selectData = []; - @Watch("$store.state.deptList",{immediate:true,deep:true}) - onChanges(){ + @Watch("$store.state.deptList", { immediate: true, deep: true }) + onChanges() { this.buildFormOptions() } - - created(){ + + created() { } - public buildFormOptions(){ + public buildFormOptions() { this.updateOptions = [{ - name:"区域编号", - key:"number", - type:"text", - disable:true, - showError:false, - width:"calc(50% - 20px)", - require:true - },{ - name:"区域名称", - key:"name", - type:"text", - showError:false, - width:"calc(50% - 20px)", - require:true - },{ - name:"责任部门", - key:"chargeDeptId", - format:"chargeDeptName", - type:"treeSelect", - width:"calc(50% - 20px)", - require:true, - expandLevel:Infinity, - showError:false, - datas:this.$store.state.deptTreeList - },{ - name:"责任人", - key:"chargeUserId", - format:"chargeUserName", - type:"select", - width:"calc(50% - 20px)", - require:true, - showError:false, - datas:this.$store.state.userList - },{ - name:"属于重大危险源", - key:"majorHazardFlag", - format:"majorHazardFlagName", - type:"radio", - width:"calc(50% - 20px)", - labelWidth:"auto", - require:true, - showError:false, - datas:this.$store.state.common_yes_no - },{ - name:"重大危险源名称", - key:"majorHazardName", - hide:!this.updateParams.majorHazardFlag, - type:"text", - width:"calc(50% - 20px)", - require:true, - showError:false, - },{ - name:"重大危险源等级", - key:"majorHazardLevel", - type:"select", - hide:!this.updateParams.majorHazardFlag, - width:"calc(50% - 20px)", - require:true, - showError:false, - datas:[{ - name:"一级", - value:1 - },{ - name:"二级", - value:2 - },{ - name:"三级", - value:3 - },{ - name:"四级", - value:4 - },{ - name:"不涉及", - value:5 + name: "区域编号", + key: "number", + type: "text", + disable: true, + showError: false, + width: "calc(50% - 20px)", + require: true + }, { + name: "区域名称", + key: "name", + type: "text", + showError: false, + width: "calc(50% - 20px)", + require: true + }, { + name: "责任部门", + key: "chargeDeptId", + format: "chargeDeptName", + type: "treeSelect", + width: "calc(50% - 20px)", + require: true, + expandLevel: Infinity, + showError: false, + datas: this.$store.state.deptTreeList + }, { + name: "责任人", + key: "chargeUserId", + format: "chargeUserName", + type: "select", + width: "calc(50% - 20px)", + require: true, + showError: false, + datas: this.$store.state.userList + }, { + name: "属于重大危险源", + key: "majorHazardFlag", + format: "majorHazardFlagName", + type: "radio", + width: "calc(50% - 20px)", + labelWidth: "auto", + require: true, + showError: false, + datas: this.$store.state.common_yes_no + }, { + name: "重大危险源名称", + key: "majorHazardName", + hide: !this.updateParams.majorHazardFlag, + type: "text", + width: "calc(50% - 20px)", + require: true, + showError: false, + }, { + name: "重大危险源等级", + key: "majorHazardLevel", + format: "majorHazardLevelName", + type: "select", + hide: !this.updateParams.majorHazardFlag, + width: "calc(50% - 20px)", + require: true, + showError: false, + datas: [{ + name: "一级", + value: 1 + }, { + name: "二级", + value: 2 + }, { + name: "三级", + value: 3 + }, { + name: "四级", + value: 4 + }, { + name: "不涉及", + value: 5 }] - },{ - type:"btn", - name:"区域绘制", - width:"calc(50% - 20px)", - btn:[{ - name:"开始绘制", - value:"draw", - height:"36px", - hide:this.isReadonly, - size:"small", - icon:"el-icon-edit-outline", - type:"primary" - },{ - name:"查看绘制", - value:"readDraw", - hide:!this.isReadonly, - height:"36px", - size:"small", - icon:"el-icon-edit-outline", - type:"primary" + }, { + type: "btn", + name: "区域绘制", + width: "calc(50% - 20px)", + btn: [{ + name: "开始绘制", + value: "draw", + height: "36px", + hide: this.isReadonly, + size: "small", + icon: "el-icon-edit-outline", + type: "primary" + }, { + name: "查看绘制", + value: "readDraw", + hide: !this.isReadonly, + height: "36px", + size: "small", + icon: "el-icon-edit-outline", + type: "primary" }] - },{ - name:"分析对象编号", - key:"analTargetNum", - type:"text", - showError:false, - width:"calc(50% - 20px)", - require:true, + }, { + name: "分析对象编号", + key: "analTargetNum", + type: "text", + showError: false, + width: "calc(50% - 20px)", + require: true, }]; this.updateActions = [{ - name:"取消", - value:"cancel" - },{ - name:"保存并继续添加", - value:"saveAndContinue", - hide:this.currentId!=-1, - type:"primary" - },{ - name:"保存", - value:"submit", - type:"primary" + name: "取消", + value: "cancel" + }, { + name: "保存并继续添加", + value: "saveAndContinue", + hide: this.currentId != -1, + type: "primary" + }, { + name: "保存", + value: "submit", + type: "primary" }]; - this.formOptions=[{ - name:"区域名称", - key:"name", - type:"text" - },{ - name:"责任部门", - key:"chargeDeptId", - type:"select", - datas:this.$store.state.deptList - },{ - name:"是否重大危险源", - key:"majorHazardFlag", - type:"select", - datas:this.$store.state.common_yes_no + this.formOptions = [{ + name: "区域名称", + key: "name", + type: "text" + }, { + name: "责任部门", + key: "chargeDeptId", + type: "select", + datas: this.$store.state.deptList + }, { + name: "是否重大危险源", + key: "majorHazardFlag", + type: "select", + datas: this.$store.state.common_yes_no }] } - public getQrCode(row){ + public getQrCode(row) { this.tableService.getQrCode({ - url:"/", - id:row.id, - system:"prevention", - type:0, - data:"", - params:{ - "区域名称" : row.name, - "区域编号" : row.number, - "责任人" : row.chargeUserName, - "责任部门" : row.chargeDeptName, - "重大危险源名称" : row.majorHazardName + url: "/", + id: row.id, + system: "prevention", + type: 0, + data: "", + params: { + "区域名称": row.name, + "区域编号": row.number, + "责任人": row.chargeUserName, + "责任部门": row.chargeDeptName, + "重大危险源名称": row.majorHazardName } - }).then((res:any)=>{ + }).then((res: any) => { this.showQrCode = true; this.qrUrl = res.data.url; }) } - public buildTable(){ - this.tableColumn.push({name:'区域名称',key:"name"}); - this.tableColumn.push({name:'责任部门',key:"chargeDeptName"}); - this.tableColumn.push({name:'责任人',key:"chargeUserName"}); - this.tableColumn.push({name:'是否属于重大危险源',key:"majorHazardFlag",render:(data)=>{ - return this.$store.getters.common_yes_no_map[data.majorHazardFlag] - }}); - this.tableColumn.push({name:'绘制情况',filters:this.filters,filterMethod:(data,row)=>{ - if(data){ - return row.geoJson && row.geoJson!=="[]" - }else{ - return !row.geoJson || row.geoJson === "[]" + public buildTable() { + this.tableColumn.push({ name: '区域名称', key: "name" }); + this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" }); + this.tableColumn.push({ name: '责任人', key: "chargeUserName" }); + this.tableColumn.push({ + name: '是否属于重大危险源', key: "majorHazardFlag", render: (data) => { + return this.$store.getters.common_yes_no_map[data.majorHazardFlag] } - }, render:(data)=>{ - if(data.geoJson==='[]' || !data.geoJson){ - return "未绘制" - }else{ - return "已绘制" + }); + this.tableColumn.push({ + name: '绘制情况', filters: this.filters, filterMethod: (data, row) => { + if (data) { + return row.geoJson && row.geoJson !== "[]" + } else { + return !row.geoJson || row.geoJson === "[]" + } + }, render: (data) => { + if (data.geoJson === '[]' || !data.geoJson) { + return "未绘制" + } else { + return "已绘制" + } } - }}); + }); } - public doDraw(){ - if(!this.updateParams.name){ + public doDraw() { + if (!this.updateParams.name) { this.$message.error("请先输入区域名称"); return } @@ -302,106 +307,120 @@ export default class AreaManagerComponent extends BaseRecordComponent { this.showDraw = true; } - public getCreateNumber(){ - this.tableService.getAreaNumber().then((res)=>{ - this.updateParams = {bottomHeight:0,topHeight:0,geoJson:"[]",number:res.data} as any; + public getCreateNumber() { + this.tableService.getAreaNumber().then((res) => { + this.updateParams = { bottomHeight: 0, topHeight: 0, geoJson: "[]", number: res.data } as any; this.buildFormOptions(); this.showUpdate = true }) } - public doSave(goOn?){ - this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res)=>{ - this.$message.success(this.currentId===-1?"新增成功!":"修改成功!"); - if(goOn){ + public doSave(goOn?) { + this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then((res) => { + this.$message.success(this.currentId === -1 ? "新增成功!" : "修改成功!"); + if (goOn) { this.getCreateNumber(); - }else{ + } else { this.handleClose(); } this.getTableData(); }) } - public change(data,item?){ + public change(data, item?) { // 新增编辑选择部门 - if(item && item.key === "chargeDeptId"){ + if (item && item.key === "chargeDeptId") { this.updateParams.chargeDeptName = this.$store.getters.dept_map[data]; } // 新增编辑选择人员 - if(item && item.key === "chargeUserId"){ + if (item && item.key === "chargeUserId") { this.updateParams.chargeUserName = this.$store.getters.user_map[data]; } // 新增编辑选择是否重大危险源 - if(item && item.key === "majorHazardFlag"){ + if (item && item.key === "majorHazardFlag") { this.updateOptions[5].hide = !data; this.updateOptions[6].hide = !data; } } - public callback(data,type?){ - if(type){ + public callback(data, type?) { + if (type) { this.params[type] = data; this.getTableData(); return } // 查询 - if(data && data.value==="search"){ + if (data && data.value === "search") { this.getTableData() - // 重置 - }else if(data && data.value === "reset"){ + // 重置 + } else if (data && data.value === "reset") { this.reset() - // 反选 - }else if(data && data.value === "reverse"){ + // 反选 + } else if (data && data.value === "reverse") { this.toggleAll() - // 全选 - }else if(data && data.value === "selectAll"){ + // 全选 + } else if (data && data.value === "selectAll") { this.selectAll() - }else if(data && data.value === "add"){ + } else if (data && data.value === "add") { this.showUpdateModel() - }else if(data && data.value === "delete"){ - this.deleteData(this.selectData.map((item:any)=>item.id)) - }else if(data && (data.value === "draw" || data.value==="readDraw")){ + } else if (data && data.value === "delete") { + this.deleteData(this.selectData.map((item: any) => item.id)) + } else if (data && (data.value === "draw" || data.value === "readDraw")) { this.doDraw() - }else if(data && data.value === "drawList"){ + } else if (data && data.value === "drawList") { this.drawModel = "list"; this.showDraw = true; - }else if(data && data.value === "submit"){ + } else if (data && data.value === "submit") { this.doSave() - }else if(data && data.value === "saveAndContinue"){ + } else if (data && data.value === "saveAndContinue") { this.doSave(true) - }else if(data && data.value === "cancel"){ + } else if (data && data.value === "cancel") { this.updateParams = {} as any; this.handleClose(); } } // 重置数据 - public reset(){ + public reset() { this.params = { - name:null, - chargeDeptId:null, - majorHazardFlag:null, - pageNum:1, - pageSize:20, + name: null, + chargeDeptId: null, + majorHazardFlag: null, + pageNum: 1, + pageSize: 20, } as any; } - public showUpdateModel(data?,isRead?){ - if(!data){ + public showUpdateModel(data?, isRead?) { + if (!data) { this.currentId = -1; this.getCreateNumber(); - }else{ + } else { this.currentId = data.id; - this.updateParams = Object.assign({bottomHeight:0,topHeight:0,geoJson:"[]",majorHazardFlagName:this.$store.getters.common_yes_no_map[data.majorHazardFlag]},data); - + this.updateParams = Object.assign({ bottomHeight: 0, topHeight: 0, geoJson: "[]", majorHazardFlagName: this.$store.getters.common_yes_no_map[data.majorHazardFlag], majorHazardLevelName: this.levelName(data.majorHazardLevel) }, data); + this.isReadonly = !!isRead; this.buildFormOptions(); this.showUpdate = true } } - public handleClose(){ + public levelName(type) { + if (type === 1) { + return "一级" + } else if (type === 2) { + return "二级" + } else if (type === 3) { + return "三级" + } else if (type === 4) { + return "四级" + } else if (type === 5) { + return "不涉及级" + } + } + + public handleClose() { this.showUpdate = false; this.currentId = -1; this.isReadonly = false; @@ -409,30 +428,30 @@ export default class AreaManagerComponent extends BaseRecordComponent { public toggleAll() { - - this.tableData.datas.forEach((item,index)=>{ + + this.tableData.datas.forEach((item, index) => { (this.$refs.multipleTable as any).toggleRowSelection(item); }) } - public selectAll(){ - if(!this.selectData.length){ + public selectAll() { + if (!this.selectData.length) { this.toggleAll() - }else{ - this.tableData.datas.forEach((item,index)=>{ - const find = this.selectData.find((data:any)=>data.id === item.id); - if(!find){ + } else { + this.tableData.datas.forEach((item, index) => { + const find = this.selectData.find((data: any) => data.id === item.id); + if (!find) { (this.$refs.multipleTable as any).toggleRowSelection(item); } }) } } - public handleSelectionChange(data){ + public handleSelectionChange(data) { this.selectData = data; } - mounted(){ + mounted() { } } diff --git a/src/views/risk/assessment/device/device.component.html b/src/views/risk/assessment/device/device.component.html index 9eba537..97b118b 100644 --- a/src/views/risk/assessment/device/device.component.html +++ b/src/views/risk/assessment/device/device.component.html @@ -22,11 +22,11 @@ diff --git a/src/views/risk/assessment/device/device.component.vue b/src/views/risk/assessment/device/device.component.vue index 8aea0ab..28842a3 100644 --- a/src/views/risk/assessment/device/device.component.vue +++ b/src/views/risk/assessment/device/device.component.vue @@ -291,7 +291,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent { public buildTable() { this.tableColumn.push({ name: '区域名称', key: "areaName", width: "200px" }); this.tableColumn.push({ name: '风险分析单元', key: "unitName", width: "200px" }); - this.tableColumn.push({ name: '设备名称', key: "name" }); + this.tableColumn.push({ name: '设备名称', key: "name",width:"250px",showTip: true, }); this.tableColumn.push({ name: '设备类别', key: "type", render: (data) => { if (data.type) { diff --git a/src/views/risk/assessment/device/deviceAnal.component.html b/src/views/risk/assessment/device/deviceAnal.component.html index b0656b4..cd3c70d 100644 --- a/src/views/risk/assessment/device/deviceAnal.component.html +++ b/src/views/risk/assessment/device/deviceAnal.component.html @@ -46,7 +46,7 @@ + :visible.sync="showUpdate" width="1080px" :before-close="handleClose" destroy-on-close>
安全检查表分析法
diff --git a/src/views/risk/assessment/device/deviceAnal.component.vue b/src/views/risk/assessment/device/deviceAnal.component.vue index bca13d9..7c118ad 100644 --- a/src/views/risk/assessment/device/deviceAnal.component.vue +++ b/src/views/risk/assessment/device/deviceAnal.component.vue @@ -748,11 +748,9 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent if (!data) { data = [] } - if (data.length > 0 && data.includes(0)) { - data = [] - this.updateParams.majorSign = [] - data.push(0) - this.updateParams.majorSign.push(0) + if (this.updateParams.majorSign.includes(0)) { + this.updateParams.majorSign = this.updateParams.majorSign.filter(item => item === 0) + data = this.updateParams.majorSign.filter(item => item === 0) } } this.buildUpdateForm() @@ -812,10 +810,14 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent this.tableService.selectById(this.currentId).then((res: any) => { if (isReadonly) { const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'] + const majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null + const regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null + const regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null + this.updateParams = Object.assign({ - majorHazardName: !res.data.majorHazard ? null : res.data.majorHazard.split(",").map(item => this.sourceMap[item]).join(","), - regulatoryProcessName: !res.data.regulatoryProcess ? null : res.data.regulatoryProcess.split(",").map(item => this.craftMap[item]).join(","), - regulatoryChemicalName: !res.data.regulatoryChemical ? null : res.data.regulatoryChemical.split(",").map(item => this.chemicaltMap[item]).join(","), + majorHazardName: majorHazard || majorHazard === 0 ? this.sourceMap[majorHazard] : null, + regulatoryProcessName: regulatoryProcess || regulatoryProcess === 0 ? this.craftMap[regulatoryProcess] : null, + regulatoryChemicalName: regulatoryChemical || regulatoryChemical === 0 ? this.chemicaltMap[regulatoryChemical] : null, majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","), riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel], remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel], @@ -836,9 +838,9 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent this.isModifyonly = true this.updateParams = res.data; this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : [] - this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard) - this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess) - this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical) + this.updateParams.majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null + this.updateParams.regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null + this.updateParams.regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'] this.updateParams.analRiskLevel = areaAnalRiskLevel this.loadUnitData(res.data.areaId) @@ -863,9 +865,9 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent public doSave(goOn?) { // 如果是新增工作危害分析清单 this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign) - this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess) - this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical) - this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard) + this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess) + this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical) + this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard) this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor) if (!this.updateParams.id) { if (this.updateParams.steps && this.updateParams.steps.length > 0) { @@ -885,9 +887,9 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent public doSaveDraft() { // 如果是新增工作危害分析清单 this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign) - this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess) - this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical) - this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard) + this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess) + this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical) + this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard) this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor) if (this.updateParams.steps && this.updateParams.steps.length > 0) { this.updateParams.items = this.updateParams.steps @@ -994,6 +996,16 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent return data.split(",").map((item) => parseInt(item)) } } + + //数字转字符串 + public numberChangeString(data) { + if (data || data === 0) { + return data.toString() + } else { + return null + } + } + } diff --git a/src/views/risk/assessment/work/work.component.vue b/src/views/risk/assessment/work/work.component.vue index 5c8a6f0..576e41f 100644 --- a/src/views/risk/assessment/work/work.component.vue +++ b/src/views/risk/assessment/work/work.component.vue @@ -97,6 +97,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { public updateParams = { identifyTime: moment().format('YYYY-MM-DD'), identifyUserId: this.account.userId, + steps: [], } as any; public selectData = []; @@ -351,14 +352,14 @@ export default class WorkManagerComponent extends BaseRecordComponent { const isTarget = el.target.classList.contains("link"); if (isTarget) { this.showSteptable = true; - this.tableService.getListDetail({ id: data.id }).then((res:any) => { + this.tableService.getListDetail({ id: data.id }).then((res: any) => { this.currentStepTableData.datas = res.data.steps.map((item, index) => { - item.index = index + 1; - return item - }) + item.index = index + 1; + return item + }) }) - + } } @@ -482,7 +483,10 @@ export default class WorkManagerComponent extends BaseRecordComponent { this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); this.updateParams = { postCode: [], - safetyFactor: [] + safetyFactor: [], + identifyTime: moment().format('YYYY-MM-DD'), + identifyUserId: this.account.userId, + steps: [] } as any this.showUpdate = !!goOn; this.getTableData(); diff --git a/src/views/risk/assessment/work/workAnal.component.html b/src/views/risk/assessment/work/workAnal.component.html index ff67373..034c5dd 100644 --- a/src/views/risk/assessment/work/workAnal.component.html +++ b/src/views/risk/assessment/work/workAnal.component.html @@ -46,7 +46,7 @@ + :visible.sync="showUpdate" width="1080px" :before-close="handleClose" destroy-on-close>
工作危害分析法
@@ -97,7 +97,7 @@
+ width="940px"> { format: "analRiskLevelName", require: true, width: "calc(50% - 20px)", - labelWidth:"140px", + labelWidth: "140px", type: "select", showError: false, disable: true, @@ -263,57 +263,60 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { key: "majorSign", format: "majorSignName", type: "checkbox", - labelWidth:"140px", + labelWidth: "140px", width: "calc(100% - 20px)", require: true, + showError: false, datas: [{ name: "不涉及", - disable: false, value: 0 }, { name: "重大危险源", - disable: this.updateParams.majorSign.includes(0), + disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0), value: 1 }, { name: "重大监管化工工艺", - disable: this.updateParams.majorSign.includes(0), + disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0), value: 2 }, { name: "重点监管危化品", - disable: this.updateParams.majorSign.includes(0), + disable: this.updateParams.majorSign && this.updateParams.majorSign.includes(0), value: 3 }], }, { name: "重大危险源", key: "majorHazard", - hide: !this.updateParams.majorSign || this.updateParams.majorSign.length === 0 || (!this.updateParams.majorSign.includes(1) || this.updateParams.majorSign.includes(0)), + hide: (!this.updateParams.majorSign) || (this.updateParams.majorSign && (this.updateParams.majorSign.length === 0 || !this.updateParams.majorSign.includes(1) || this.updateParams.majorSign.includes(0))), type: "select", format: "majorHazardName", width: "calc(50% - 20px)", require: true, // multiple: true, - datas: this.dictData.source + datas: this.dictData.source, + showError: false, }, { name: "重点监管工艺", key: "regulatoryProcess", format: "regulatoryProcessName", - hide: !this.updateParams.majorSign || this.updateParams.majorSign.length === 0 || !this.updateParams.majorSign.includes(2) || this.updateParams.majorSign.includes(0), + hide: (!this.updateParams.majorSign) || (this.updateParams.majorSign && (this.updateParams.majorSign.length === 0 || !this.updateParams.majorSign.includes(2) || this.updateParams.majorSign.includes(0))), type: "select", width: "calc(50% - 20px)", require: true, // multiple: true, datas: this.dictData.craft, + showError: false, }, { name: "重点监管化学品", key: "regulatoryChemical", format: "regulatoryChemicalName", - hide: !this.updateParams.majorSign || this.updateParams.majorSign.length === 0 || !this.updateParams.majorSign.includes(3) || this.updateParams.majorSign.includes(0), + hide: (!this.updateParams.majorSign) || (this.updateParams.majorSign && (this.updateParams.majorSign.length === 0 || !this.updateParams.majorSign.includes(3) || this.updateParams.majorSign.includes(0))), type: "select", width: "calc(50% - 20px)", require: true, // multiple: true, datas: this.dictData.chemical, + showError: false, }]; this.subTableActions = [{ @@ -335,6 +338,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { require: true, width: "calc(50% - 20px)", disable: true, + showError: false, datas: this.$store.state.prevention_risk_level }, { name: "残余风险等级", @@ -342,8 +346,9 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { format: "remainRiskLevelName", type: "select", require: true, - width: "calc(50% - 20px)", + width: "calc(50% - 20px)", disable: true, + showError: false, datas: this.$store.state.prevention_risk_level }] } @@ -417,11 +422,11 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { public loadAreaData() { this.unitList = []; this.jobList = []; - this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => { - this.areaList = res.data.datas.map(item => { + this.tableService.getDistinctList({}).then((res: any) => { + this.areaList = res.data.map(item => { return { - name: item.name, - value: item.id, + name: item.areaName, + value: item.areaId, analRiskLevel: item.analRiskLevel ? item.analRiskLevel : null, } }); @@ -430,14 +435,14 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { } // 加载单元列表 public loadUnitData(id?) { - this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => { - this.unitList = res.data.datas.map(item => { + this.tableService.getDistinctList({ areaId: id }).then((res: any) => { + this.unitList = res.data.map(item => { return { - name: item.name, - value: item.id, + name: item.unitName, + value: item.unitId, deptId: item.chargeDeptId, - userId: item.chargeUserId, deptName: item.chargeDeptName, + userId: item.chargeUserId, userName: item.chargeUserName, } }); @@ -742,11 +747,9 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { if (!data) { data = [] } - if (data.includes(0)) { - data = [] - this.updateParams.majorSign = [] - data.push(0) - this.updateParams.majorSign.push(0) + if (this.updateParams.majorSign.includes(0)) { + this.updateParams.majorSign = this.updateParams.majorSign.filter(item => item === 0) + data = this.updateParams.majorSign.filter(item => item === 0) } } @@ -796,10 +799,13 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { this.tableService.selectById(this.currentId).then((res: any) => { if (isReadonly) { const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'] + const majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null + const regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null + const regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null this.updateParams = Object.assign({ - majorHazardName: !res.data.majorHazard ? null : res.data.majorHazard.split(",").map(item => this.sourceMap[item]).join(","), - regulatoryProcessName: !res.data.regulatoryProcess ? null : res.data.regulatoryProcess.split(",").map(item => this.craftMap[item]).join(","), - regulatoryChemicalName: !res.data.regulatoryChemical ? null : res.data.regulatoryChemical.split(",").map(item => this.chemicaltMap[item]).join(","), + majorHazardName: majorHazard || majorHazard === 0 ? this.sourceMap[majorHazard] : null, + regulatoryProcessName: regulatoryProcess || regulatoryProcess === 0 ? this.craftMap[regulatoryProcess] : null, + regulatoryChemicalName: regulatoryChemical || regulatoryChemical === 0 ? this.chemicaltMap[regulatoryChemical] : null, majorSignName: !res.data.majorSign ? null : res.data.majorSign.split(",").map(item => this.$store.getters.prevention_majorsign_map[item]).join(","), riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel], remainRiskLevelName: this.$store.getters.prevention_risk_level_map[res.data.remainRiskLevel], @@ -821,9 +827,9 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { this.isModifyonly = true this.updateParams = res.data; this.updateParams.majorSign = res.data.majorSign ? this.stringChangeArray(res.data.majorSign) : [] - this.updateParams.majorHazard = this.stringChangeArray(res.data.majorHazard) - this.updateParams.regulatoryProcess = this.stringChangeArray(res.data.regulatoryProcess) - this.updateParams.regulatoryChemical = this.stringChangeArray(res.data.regulatoryChemical) + this.updateParams.majorHazard = res.data.majorHazard ? parseInt(res.data.majorHazard) : null + this.updateParams.regulatoryProcess = res.data.regulatoryProcess ? parseInt(res.data.regulatoryProcess) : null + this.updateParams.regulatoryChemical = res.data.regulatoryChemical ? parseInt(res.data.regulatoryChemical) : null const areaAnalRiskLevel = this.areaList.filter((item) => item.value === res.data.areaId)[0]['analRiskLevel'] this.updateParams.analRiskLevel = areaAnalRiskLevel this.loadUnitData(res.data.areaId) @@ -844,7 +850,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { this.showUpdate = false; } - public handleAnalyClose(){ + public handleAnalyClose() { this.showSubUpdate = false } @@ -852,9 +858,9 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { public doSave(goOn?) { // 如果是新增工作危害分析清单 this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign) - this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess) - this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical) - this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard) + this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess) + this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical) + this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard) this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor) this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id || this.updateParams.status === 1 ? true : false).then((res) => { this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); @@ -866,9 +872,9 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { public doSaveDraft() { // 如果是新增工作危害分析清单 this.updateParams.majorSign = this.arrayChangeString(this.updateParams.majorSign) - this.updateParams.regulatoryProcess = this.arrayChangeString(this.updateParams.regulatoryProcess) - this.updateParams.regulatoryChemical = this.arrayChangeString(this.updateParams.regulatoryChemical) - this.updateParams.majorHazard = this.arrayChangeString(this.updateParams.majorHazard) + this.updateParams.regulatoryProcess = this.numberChangeString(this.updateParams.regulatoryProcess) + this.updateParams.regulatoryChemical = this.numberChangeString(this.updateParams.regulatoryChemical) + this.updateParams.majorHazard = this.numberChangeString(this.updateParams.majorHazard) this.updateParams.safetyFactor = this.arrayChangeString(this.updateParams.safetyFactor) this.tableService.addOrDraft(this.updateParams, !this.updateParams.id).then((res) => { this.$message.success(!this.updateParams.id ? "新增成功!" : "编辑成功!"); @@ -877,8 +883,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { }) } public toggleAll() { - - this.tableData.datas.forEach((item,index)=>{ + + this.tableData.datas.forEach((item, index) => { (this.$refs.multipleTable as any).toggleRowSelection(item); }) } @@ -969,6 +975,16 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { return data.split(",").map((item) => parseInt(item)) } } + + //数字转字符串 + public numberChangeString(data) { + if (data || data === 0) { + return data.toString() + } else { + return null + } + } + } diff --git a/src/views/risk/duty/dutyRecords.component.vue b/src/views/risk/duty/dutyRecords.component.vue index 4b45305..72ecefc 100644 --- a/src/views/risk/duty/dutyRecords.component.vue +++ b/src/views/risk/duty/dutyRecords.component.vue @@ -219,9 +219,9 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent { - if (data.status == 1) { + if (data.dangerFlag == 1) { return "" - } else if (data.status == 0) { + } else if (data.dangerFlag == 0) { return "" } } @@ -239,8 +239,8 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent{ + + this.tableData.datas.forEach((item, index) => { (this.$refs.multipleTable as any).toggleRowSelection(item); }) } @@ -361,7 +361,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent { require: true, width: "calc(50% - 20px)", showError: false, - rules: [ - { pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', } - ] + // rules: [ + // { pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', } + // ] }, { name: "应急联络方式", @@ -259,9 +259,9 @@ export default class EmergencyCard extends BaseRecordComponent { require: true, width: "calc(50% - 20px)", showError: false, - rules: [ - { pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', } - ] + // rules: [ + // { pattern: /^1[3|5|7|8|9]\d{9}$/, message: '请输入正确的号码格式', } + // ] }, { name: "附件", diff --git a/src/views/workprogress/trainRecords.component.vue b/src/views/workprogress/trainRecords.component.vue index 71d1972..c1eb777 100644 --- a/src/views/workprogress/trainRecords.component.vue +++ b/src/views/workprogress/trainRecords.component.vue @@ -276,6 +276,7 @@ export default class TrainRecords extends BaseRecordComponent { require: true, width: "calc(50% - 20px)", showError: false, + hide: !(this.subUpdateParams.examStatus === 1) },] } @@ -345,6 +346,13 @@ export default class TrainRecords extends BaseRecordComponent { this.updateParams.endTime = null } } + + if (item && item.key === "examStatus") { + if (data === 0) { + this.subUpdateParams.score = null + } + this.buildSubForm() + } } public callback(data, type) {