From 478b1e3b848309bec27e460143413b2da103dce6 Mon Sep 17 00:00:00 2001 From: kongyeqing <2697454777@qq.com> Date: Mon, 25 Sep 2023 17:40:22 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=8F=8C?= =?UTF-8?q?=E9=A2=84=E9=98=B2=E5=B9=B3=E5=8F=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/analEvaluation.component.vue | 28 ++++-- src/service/areaanal.service.ts | 4 +- src/views/hiddenDanger/clap.component.vue | 28 ++++-- .../rules/rulesManager.component.vue | 85 ++++++++++++++++--- .../hiddenDanger/safe/plan.component.vue | 3 +- .../areaAnal/areaAnal.component.vue | 2 +- .../assessment/work/workAnal.component.html | 12 ++- .../assessment/work/workAnal.component.vue | 8 +- src/views/risk/duty/duty.component.vue | 37 +++++++- src/views/risk/duty/dutyRecords.component.vue | 33 +++++-- .../measuresReport.component.vue | 12 +-- 11 files changed, 194 insertions(+), 58 deletions(-) diff --git a/src/components/analEvaluation.component.vue b/src/components/analEvaluation.component.vue index c6ee5b5..8c3dc1e 100644 --- a/src/components/analEvaluation.component.vue +++ b/src/components/analEvaluation.component.vue @@ -154,8 +154,8 @@ export default class AnalEvaluationComponent extends Vue { public showRiskValueUpdate = false; - public showRiskValueModal: any = 'lslvalue' - ; + public showRiskValueModal: any = 'lslvalue'; + public riskTitle: any = '选择L值'; public riskTableData = [] as any; @@ -200,6 +200,12 @@ export default class AnalEvaluationComponent extends Vue { required: true, }) public analysisUpdateParams!: any; + @Watch("analysisUpdateParams", { immediate: true }) + onChangeData(newValue, oldVale) { + if (!oldVale || (newValue.id !== oldVale.id)) { + this.buildInitData() + } + } @PropSync("show", { required: true, @@ -469,6 +475,7 @@ export default class AnalEvaluationComponent extends Vue { width: "calc(50% - 20px)", datas: this.$store.state.prevention_control_level, showError: false, + disable: this.analysisUpdateParams.riskLevel === 4 }]; } public triTableActions = [{ @@ -638,7 +645,13 @@ export default class AnalEvaluationComponent extends Vue { datas: this.$store.state.prevention_risk_level },]; - created() { + // created () { + // this.buildInitData() + // } + /** + * 初始化数据 + */ + public buildInitData() { this.$store.state.prevention_measures_sort.map((item) => { this.measuresSelectData[item.value] = this.treeSelectData(item.children) }) @@ -741,7 +754,7 @@ export default class AnalEvaluationComponent extends Vue { } public dataCallback(data) { - console.log('返回数据', data); + //console.log('返回数据', data); } @@ -884,7 +897,9 @@ export default class AnalEvaluationComponent extends Vue { } } } - + if(this.analysisUpdateParams.riskLevel === 4){ + this.analysisUpdateParams.riskControlLevel = 1 + } this.riskUpdateForm() this.remainUpdateForm() } @@ -1071,9 +1086,7 @@ export default class AnalEvaluationComponent extends Vue { //清除必填提示 this.clearShowError(this.methodUpdateParams, this.riskLECUpdateOptions) } - this.showRiskValueUpdate = false; - console.log('methodUpdateParams', this.methodUpdateParams); } } /** @@ -1170,7 +1183,6 @@ export default class AnalEvaluationComponent extends Vue { vaildParams = false } if (vaildParams === true) { - console.log('this.analysisUpdateParams', this.analysisUpdateParams); if (this.analysisUpdateParams.measures.length === 0) { this.$message.warning('请添加管控措施!') return diff --git a/src/service/areaanal.service.ts b/src/service/areaanal.service.ts index 6454ee2..e4b5ecf 100644 --- a/src/service/areaanal.service.ts +++ b/src/service/areaanal.service.ts @@ -36,8 +36,8 @@ export default class AreaAnalService extends BaseService{ } } - public getAnalControls():Promise>>{ + public getAnalControls(params?):Promise>>{ const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls'; - return this.get(url,null,false) + return this.post(url,params,{},false) } } \ No newline at end of file diff --git a/src/views/hiddenDanger/clap.component.vue b/src/views/hiddenDanger/clap.component.vue index 934a648..963dcfa 100644 --- a/src/views/hiddenDanger/clap.component.vue +++ b/src/views/hiddenDanger/clap.component.vue @@ -471,9 +471,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent } public addMarker() { - this.marker = new mapboxgl.Marker({ draggable: !this.isReadonly }) - .setLngLat(this.center) - .addTo(this.map); + this.marker = new mapboxgl.Marker({ draggable: !this.isReadonly }).setLngLat(this.center).addTo(this.map); this.map.flyTo({ center: this.center }) } @@ -579,7 +577,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent this.tableService.getNumber().then(res => { this.updateParams.number = res.data; this.center = [118.751353, 31.969568]; - this.buildUpdateForm() + this.buildUpdateForm(); + //清除附件缓存 + this.clearFileListMethod(); this.showUpdate = true; }) } else { @@ -602,6 +602,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent // 地图定位 this.center = [res.data.locationLng, res.data.locationLat]; this.buildUpdateForm(); + //清除附件缓存 + this.clearFileListMethod(); if (row && !isRead) { //区域是否删除 let isDeleteArea = !res.data.areaId ? true : this.judgeDeleteAreaMethod(res.data); @@ -702,6 +704,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent return } this.showUpdate = false; + //清除附件缓存 + this.clearFileListMethod(); this.updateParams = {} as any; } @@ -730,11 +734,12 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent } public onRemove(file, fileList) { - this.photoList.splice(this.photoList.findIndex(item => item.id === file.response.data.id), 1) + this.photoList.splice(this.photoList.findIndex(item => item.id === file.id), 1) this.updateParams.photo = this.photoList.length || null; } public onRemove2(file, fileList) { - this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1) + this.fileList.splice(this.fileList.findIndex(item => item.id === file.id), 1); + this.updateParams.fileList = this.photoList.length || null; } public onPreview(file) { @@ -813,6 +818,17 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent public selectable(row) { return row } + /** + * 清除附件数据 + */ + public clearFileListMethod() { + this.photoList = []; + this.fileList = []; + const photoOption = this.updateOptions.find(item => item.key === "photo") as any; + photoOption.fileList = []; + const fileOption = this.updateOptions.find(item => item.key === "file") as any; + fileOption.fileList = []; + } } diff --git a/src/views/hiddenDanger/rules/rulesManager.component.vue b/src/views/hiddenDanger/rules/rulesManager.component.vue index 794255f..e96a9c1 100644 --- a/src/views/hiddenDanger/rules/rulesManager.component.vue +++ b/src/views/hiddenDanger/rules/rulesManager.component.vue @@ -115,6 +115,10 @@ export default class RulesManagerComponent extends BaseRecordComponent { public checkUpdateActions = [] as any; public subUpdateOptions = [] as any; + //检查对象 + public analControlList = [] as any; + //检查对象名称集合 + public analControlNameList = [] as any; public subUpdateActions = [{ name: "取消", @@ -220,6 +224,7 @@ export default class RulesManagerComponent extends BaseRecordComponent { }, { name: "适用类型", key: "types", + format: "typesName", type: "select", width: "calc(50% - 20px)", require: true, @@ -315,11 +320,33 @@ export default class RulesManagerComponent extends BaseRecordComponent { option.datas = this.unitList; if (isVerify) { //单元是否删除 - this.judgeDeleteUnitMethod(); + const isDeleteUnit = this.judgeDeleteUnitMethod(this.updateParams); + console.log('isDeleteUnit',isDeleteUnit); + + if (!isDeleteUnit) { + this.judgeAnalControl(this.updateParams) + } } }) } + //加载检查对象 + public loadAnalControlList(ids?) { + return new Promise((resove, reject) => { + this.areaService.getAnalControls(ids).then((res: any) => { + this.analControlList = res.data.map((item) => { + this.analControlNameList[item.value] = item.name + return item + }) + const option = this.updateOptions.find(item => item.key === "targets") as any; + if (option) { + option.datas = this.analControlList; + } + resove() + }) + }) + } + public getNumber() { this.tableService.getNumber().then(res => { this.updateParams.number = res.data @@ -329,9 +356,9 @@ export default class RulesManagerComponent extends BaseRecordComponent { public buildTable() { this.tableColumn = []; this.tableColumn.push({ name: '检查表名称', key: "name" }); - this.tableColumn.push({ name: '区域名称', key: "areas" }); - this.tableColumn.push({ name: '单元名称', key: "units" }); - this.tableColumn.push({ name: '对象名称', key: "targets" }); + this.tableColumn.push({ name: '适用区域', key: "areas" }); + this.tableColumn.push({ name: '适用单元', key: "units" }); + this.tableColumn.push({ name: '适用对象', key: "targets" }); this.tableColumn.push({ name: '适用部门', key: "depts" }); this.tableColumn.push({ name: '适用类型', key: "types", filters: this.$store.state.prevention_dangrous_type.map(item => { @@ -373,6 +400,10 @@ export default class RulesManagerComponent extends BaseRecordComponent { this.loadUnitData(data) } + //检查单元 + if (item && item.key === 'units') { + this.loadAnalControlList(data) + } } public callback(data, type?) { @@ -488,8 +519,6 @@ export default class RulesManagerComponent extends BaseRecordComponent { this.showSubUpdate = true; } - - public showUpdateModel(row?, isRead?) { this.updateParams = { number: null, tableItems: [] } as any; this.isReadonly = !!isRead; @@ -505,13 +534,16 @@ export default class RulesManagerComponent extends BaseRecordComponent { this.tableService.selectById(this.currentId, true).then((res: any) => { if (isRead) { this.updateParams = Object.assign(res.data, row) + this.updateParams.typesName = this.updateParams.types.split(',').map((item) => { + item = +item + return this.$store.getters.prevention_dangrous_type_map[item] + }).join(',') } else { this.updateParams = res.data; //区域是否删除 let isDeleteArea = this.judgeDeleteAreaMethod(res); if (!isDeleteArea) { this.loadUnitData(res.data.areas, true); - } } this.updateParams.tableItems.forEach((item, i) => { @@ -537,7 +569,8 @@ export default class RulesManagerComponent extends BaseRecordComponent { if (deleteData.length > 0) { this.updateParams.areas = null; this.updateParams.units = null; - this.$confirm(`风险区域信息变更,请重新选择!`, "", { + this.updateParams.targets = null; + this.$confirm(`适用区域信息已变更,请重新选择!`, "", { type: 'warning', showCancelButton: false, closeOnClickModal: false, @@ -555,17 +588,18 @@ export default class RulesManagerComponent extends BaseRecordComponent { * 判断单元是否删除 * @param res */ - public judgeDeleteUnitMethod() { + public judgeDeleteUnitMethod(paramsData: any) { let deleteData = [] as any; - this.updateParams.units.forEach((item, index) => { + paramsData.units.forEach((item, index) => { const find = this.unitList.find((data: any) => data.value === item); if (!find) { deleteData.push(item); } - }); + }); if (deleteData.length > 0) { this.updateParams.units = null; - this.$confirm(`风险单元信息变更,请重新选择!`, "", { + this.updateParams.targets = null; + this.$confirm(`适用单元信息已变更,请重新选择!`, "", { type: 'warning', showCancelButton: false, closeOnClickModal: false, @@ -578,6 +612,33 @@ export default class RulesManagerComponent extends BaseRecordComponent { return !!deleteData.length } + /** + * 判断检查对象是否删除 + */ + public judgeAnalControl(paramsData: any) { + let deleteData = [] as any; + paramsData.targets.forEach((item, index) => { + const find = this.analControlList.find((data: any) => data.value === item); + if (!find) { + deleteData.push(item); + } + }); + if (deleteData.length > 0) { + this.updateParams.targets = null; + this.$confirm(`适用对象信息已变更,请重新选择!`, "", { + type: 'warning', + showCancelButton: false, + closeOnClickModal: false, + }).then(() => { + // + }).catch(() => { + // + }) + } + return !!deleteData.length + } + + public doSubSave(goOn?) { if (!this.subUpdateParams.index) { this.subUpdateParams.index = this.updateParams.tableItems.length + 1; diff --git a/src/views/hiddenDanger/safe/plan.component.vue b/src/views/hiddenDanger/safe/plan.component.vue index dc0a5c1..70277c2 100644 --- a/src/views/hiddenDanger/safe/plan.component.vue +++ b/src/views/hiddenDanger/safe/plan.component.vue @@ -407,8 +407,7 @@ export default class PlanComponent extends BaseRecordComponent { }) }) } - - + public buildTable() { this.tableColumn.push({ name: '检查标题', key: "name", width: "250px" }); this.tableColumn.push({ diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.vue b/src/views/risk/assessment/areaAnal/areaAnal.component.vue index 13d3691..9ce1754 100644 --- a/src/views/risk/assessment/areaAnal/areaAnal.component.vue +++ b/src/views/risk/assessment/areaAnal/areaAnal.component.vue @@ -249,7 +249,7 @@ export default class AreaAnalComponent extends BaseRecordComponent { } }) tmpRiskDatas.forEach((item: any) => { - item.result = Math.ceil(value / len).toString() + item.result =value ? Math.ceil(value / len).toString() :0 }) } if (this.popTitle === 'S') { diff --git a/src/views/risk/assessment/work/workAnal.component.html b/src/views/risk/assessment/work/workAnal.component.html index dedbaf3..161a3a1 100644 --- a/src/views/risk/assessment/work/workAnal.component.html +++ b/src/views/risk/assessment/work/workAnal.component.html @@ -93,10 +93,10 @@ + destroy-on-close> + :checkRiskType="checkRiskType" ref="analEvaluation" > 可能发生事故:{{!item.seriousResult ? '--' :item.seriousResult.split(",").map(items => seriousResultMap[items]).join(",")}} -
风险等级: {{!item.riskLevel ? '--':riskLevelMap[item.riskLevel]}}
-
残余风险等级:{{!item.remainLevel ? '--':riskLevelMap[item.remainLevel]}}
+
风险等级: {{!item.riskLevel ? + '--':riskLevelMap[item.riskLevel]}}
+
残余风险等级:{{!item.remainLevel ? + '--':riskLevelMap[item.remainLevel]}}
diff --git a/src/views/risk/assessment/work/workAnal.component.vue b/src/views/risk/assessment/work/workAnal.component.vue index 658ff46..9d0ae8f 100644 --- a/src/views/risk/assessment/work/workAnal.component.vue +++ b/src/views/risk/assessment/work/workAnal.component.vue @@ -392,7 +392,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { // 加载区域列表 public loadAreaData() { - this.unitList = []; this.jobList = []; this.tableService.getDistinctList({}).then((res: any) => { @@ -979,13 +978,13 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { this.analyIsReadonly = true; //select 翻译 this.analysisTransformParam(row); - this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) }; + this.analysisUpdateParams = Object.assign(this.analysisUpdateParams, row); //管控措施 this.initAnalysisMeasure(); } else { this.analyIsReadonly = false // 暂存数据 用于取消修改 - this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) }; + this.analysisUpdateParams = Object.assign(this.analysisUpdateParams, row); //编辑 参数处理 this.updateAnalysisParam(row); //管控措施 @@ -993,7 +992,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { } } - this.showSubUpdate = true + this.showSubUpdate = true; } //工作危害分析法 查看翻译 @@ -1063,7 +1062,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent { return item }) } - } diff --git a/src/views/risk/duty/duty.component.vue b/src/views/risk/duty/duty.component.vue index cb59044..8843df0 100644 --- a/src/views/risk/duty/duty.component.vue +++ b/src/views/risk/duty/duty.component.vue @@ -26,7 +26,9 @@ export default class DutyManagerComponent extends BaseRecordComponent { public params = { orderByColumn: "", - isAsc: "desc" + isAsc: "desc", + pageNum: 1, + pageSize: 20, } as any; @@ -72,6 +74,20 @@ export default class DutyManagerComponent extends BaseRecordComponent { key: "majorHazard", type: "select", datas: this.$store.state.prevention_risk_source + }, { + name: "状态", + key: "status", + type: "select", + datas: [{ + name: '已排查', + value: 1 + }, { + name: '待排查', + value: 2 + }, { + name: '超期未排查', + value: 3 + }] }]; public showUpdate = false; @@ -222,9 +238,9 @@ export default class DutyManagerComponent extends BaseRecordComponent { onMove: this.onRemove2, onPreview: this.onPreview, autoUpload: true, - accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf", + accept: "image/png, image/jpeg", listType: "text", - tip: "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件", + tip: "请上传.pdf,.png,.jpg格式文件", fileList: this.fileList, btn: [{ name: "点击上传", @@ -342,6 +358,8 @@ export default class DutyManagerComponent extends BaseRecordComponent { if (type) { if (type === 'pageSize' || type === 'pageNum') { this.params[type] = data; + } else { + this.params.pageNum = 1 } this.getTableData(); return @@ -395,7 +413,7 @@ export default class DutyManagerComponent extends BaseRecordComponent { this.$store.state.userList.map((item) => { this.userListName[item.value] = item.name }) - + this.updateParams.checkTime = moment().format('YYYY-MM-DD HH:mm:ss') this.updateParams.taskChargeUserName = this.userListName[this.account.userId] this.updateParams.ownerName = this.userListName[this.updateParams.ownerId] this.tableService.addOrUpdate(this.updateParams, this.updateParams.id).then((res) => { @@ -511,6 +529,8 @@ export default class DutyManagerComponent extends BaseRecordComponent { } //排查任务 public showSubModal(row) { + //清除缓存数据 + this.clearFileListMethod() const mathData = Math.floor(Math.random() * 1000); this.updateParams = Object.assign({ // checkUserId: this.account.userId, @@ -536,6 +556,15 @@ export default class DutyManagerComponent extends BaseRecordComponent { } this.getTableData() } + + /** + * 清除附件数据 + */ + public clearFileListMethod() { + this.fileList = []; + const option = this.subUpdateOptions.find(item => item.key === "resourceId") as any; + option.fileList = []; + } } diff --git a/src/views/risk/duty/dutyRecords.component.vue b/src/views/risk/duty/dutyRecords.component.vue index b48e172..a6a72c3 100644 --- a/src/views/risk/duty/dutyRecords.component.vue +++ b/src/views/risk/duty/dutyRecords.component.vue @@ -123,26 +123,30 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent{ + return data.insuranceDutyFlag === 1 ? '是':'否' + }}) this.tableColumn.push({ name: '隐患排查任务', key: "taskName", with: "250px" }); this.tableColumn.push({ name: '重大危险源', key: 'majorHazard', render: (data) => { @@ -258,7 +265,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent { this.photoList = photos.data.map(item => { @@ -384,18 +391,28 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent item.key === "resourceId") as any; + option.fileList = []; } } diff --git a/src/views/risk/measuresReport/measuresReport.component.vue b/src/views/risk/measuresReport/measuresReport.component.vue index 13424c6..457536b 100644 --- a/src/views/risk/measuresReport/measuresReport.component.vue +++ b/src/views/risk/measuresReport/measuresReport.component.vue @@ -98,23 +98,23 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent< }]; public formOptions: FormOption[] = [{ name: "管控对象", - key: "controlName", + key: "analControlName", type: "text", }, { name: "分析对象", - key: "analName", + key: "itemName", type: "text", }, { name: "隐患排查任务", key: "taskName", type: "text", - },{ + }, { name: "重大危险源", key: "majorHazard", type: "select", - datas:this.$store.state.prevention_risk_source + datas: this.$store.state.prevention_risk_source } -]; + ]; public showUpdate = false; public updateParams = {} as any; @@ -331,7 +331,7 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent< public callback(data, type) { if (type) { - if (type === 'pageSize' || type === 'pageNum') { + if (type === 'pageSize' || type === 'pageNum') { this.params[type] = data; } this.getTableData();