From 6ba91207deaf938a60dec34f0240a1d3c3896c61 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Fri, 10 May 2024 18:00:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4,=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourceManagement/enterprise/addForm.vue | 177 ++++++++---------- .../resourceManagement/enterprise/index.vue | 2 +- 2 files changed, 75 insertions(+), 104 deletions(-) diff --git a/src/views/modules/resourceManagement/enterprise/addForm.vue b/src/views/modules/resourceManagement/enterprise/addForm.vue index 50563444a..c005e6219 100644 --- a/src/views/modules/resourceManagement/enterprise/addForm.vue +++ b/src/views/modules/resourceManagement/enterprise/addForm.vue @@ -102,29 +102,36 @@ {{item.flag?'已整改隐患':'隐患明细'}}: -
-

{{index+1}}.{{itemC.hazardDesc}}

+
+

{{index+1}}.{{itemC.hazardDesc}}

- -- + -- 未整改隐患: -
-

{{index+1}}.{{itemC.hazardDesc}}

+
+

{{index+1}}.{{itemC.hazardDesc}}

- -- + -- 整改要求: -

{{index+1}}.{{item.hazardDetails.find(item=>item.hazardStatus == 2).hazardDesc}}

+

{{index+1}}.{{item.hiddenDangeList.find(item=>item.hazardStatus == 2).hazardDesc}}

- 附件: {{ - item.attachmentUrl }} + + 附件: + {{ + itemI.fileName }} + +
+ +
+
备注: {{ item.remark || '--' }}
@@ -140,7 +147,8 @@ + value-format="yyyy-MM-dd HH:mm:ss" + value="yyyy-MM-dd HH:mm:ss"placeholder="选择日期"> @@ -169,25 +177,26 @@ + value-format="yyyy-MM-dd HH:mm:ss" + value="yyyy-MM-dd HH:mm:ss"placeholder="选择日期"> - - + + - {{ option.label }} + {{ option.hazardDesc }} - + - + @@ -198,7 +207,7 @@ - + @@ -208,8 +217,7 @@ - + @@ -297,90 +305,19 @@ export default { return { orgOptions:[], orgOptionProps, - inputList: [{ value: '' }],//隐患输入框 + inputList: [{ hazardDesc: '',hazardStatus:'0' }],//隐患输入框 fileList:[], patrolAdd: false, - checkboxOptions: [ - { label: 'Option 1', value: 'option1' }, - { label: 'Option 2', value: 'option2' }, - { label: '已整改患', value: '已整改隐患' }, - ], - hazardDetails:[], + checkboxOptions: [], + hiddenDangeArr:[], - tableData: [ - // { - // checkTime: '2019-04-22 09:30', - // checkPersons: '张三,李四', - // checkResultFlag: '不合格', - // reviewTime: '2019-04-22 09:30', - // hazardDetails:[ - // { - // "id": "hd1111", - // "customerId": "45687aa479955f9d06204d415238f7cc", - // "companyId": "c1111", - // "recordId": "r1111", - // "hazardStatus": 0, - // "hazardDesc": "小马哥请原谅我", - // "delFlag": null, - // "revision": 0, - // "createdBy": "zxc", - // "createdTime": "2024-05-03 16:26:37", - // "updatedBy": "zxc", - // "updatedTime": "2024-05-03 16:26:49" - // }, - // { - // "id": "hd1112", - // "customerId": "45687aa479955f9d06204d415238f7cc", - // "companyId": "c1111", - // "recordId": "r1111", - // "hazardStatus": 1, - // "hazardDesc": "小马哥喝一点酒太亢奋", - // "delFlag": null, - // "revision": 2, - // "createdBy": "zxc", - // "createdTime": "2024-05-03 16:26:37", - // "updatedBy": "zxc", - // "updatedTime": "2024-05-03 16:26:49" - // }, - // { - // "id": "hd1113", - // "customerId": "45687aa479955f9d06204d415238f7cc", - // "companyId": "c1111", - // "recordId": "r1111", - // "hazardStatus": 2, - // "hazardDesc": "我不想这样做,但是找不到更好的原因了,抱歉小马哥", - // "delFlag": null, - // "revision": 0, - // "createdBy": "zxc", - // "createdTime": "2024-05-03 16:26:37", - // "updatedBy": "zxc", - // "updatedTime": "2024-05-03 16:26:49" - // } - // ], - // attachmentUrl: '123456789.jPg', - // remark: '请相关负责人尽快处理' - // }, - // { - // checkTime: '2019-04-22 09:30', - // checkPersons: '张三,李四', - // checkResultFlag: '不合格', - // reviewTime: '2019-04-22 09:30', - // hazardDetails:[ - // { - // hazardStatus:1, - // hazardDesc:'卫生没整好2' - // } - // ], - // attachmentUrl: '123456789.jPg', - // remark: '请相关负责人尽快处理' - // }, - ], + tableData: [], btnDisable: false, user: '', agencyId: '', gridList: [], //所属网格list--场所区域 placeTypeList: [], //场所类型 - resultArray: [{ value: '0', label: '合格' }, { value: '1', label: '不合格' }], + resultArray: [{ value: '1', label: '合格' }, { value: '0', label: '不合格' }], stafflist: [], formData: { agencyId:'', @@ -407,9 +344,9 @@ export default { checkTime:null, checkPersonsIdList:null, checkResultFlag:null, + attachmentUrls:[], reviewTime:null, - hazardDetails:null, - attachmentUrl:null, + hiddenDangeList:null, remark:null, }, patrolRule:{ @@ -420,7 +357,9 @@ export default { }, //地图 loading: false, - searchOptions: [] + searchOptions: [], + preViewImage:null, + preViewImageFlag:false }; }, watch: {}, @@ -447,6 +386,10 @@ export default { }, methods: { + handelCLickImage(url){ + this.preViewImageFlag = true; + this.preViewImage = url; + }, handleChangeAgency(val) { this.formData.agencyId = val.length ? val[val.length - 1] : val[0]; }, @@ -467,7 +410,7 @@ export default { }) }, addInput() { - this.inputList.push({ value: '' }); // 新增一个输入框,对应一个新的对象 + this.inputList.push({ hazardDesc: '',hazardStatus:'0' }); // 新增一个输入框,对应一个新的对象 }, removeInput(index) { this.inputList.splice(index, 1); // 删除对应索引的输入框 @@ -480,6 +423,7 @@ export default { let ob = { fileType: item.raw.type, fileUrl: item.response.data.url, + attachmentUrl:item.response.data.url, fileName:item.response.data.fileName } this.fileList.push(ob) @@ -506,16 +450,21 @@ export default { // 巡查记录 async getCompanyDetail(){ const url = `/actual/base/companyInfo/showRecord`; - const { data, code, msg } = await requestPost(url,{id:this.detailId}); + let { data, code, msg } = await requestPost(url,{id:this.detailId}); if (code === 0) { data.forEach(item=>{ if(!item.hiddenDangeList){ item.flag = true; }else{ - item.flag = item.hazardDetails.findIndex(item=>item.hazardStatus === 2) === -1; + item.flag = item.hiddenDangeList.findIndex(item=>item.hazardStatus === 2) === -1; } }) - console.log(data); + if(data[0].hiddenDangeList){ + this.checkboxOptions = data[0].hiddenDangeList.filter(item=>item.hazardStatus === 0).map(item=>({hazardDesc:item.hazardDesc,value:item.id,hazardStatus:0})); + this.fileList = data[0].attachmentUrls; + console.log(this.fileList); + } + this.tableData = data; } else { this.$message.error(msg); @@ -575,8 +524,16 @@ export default { }else if(this.pageType == 'patrol'){ url = '/actual/base/companyInfo/addRecord'; params = { ...this.patrolForm }; + for(let i in this.hiddenDangeArr){ + this.checkboxOptions.forEach(item => { + if(item.value == this.hiddenDangeArr[i]){ + item.hazardStatus = '1'; + } + }) + } + params.hiddenDangeList =[...this.inputList,...this.checkboxOptions] ; params.companyId = this.detailId; - params.attachmentUrl = this.fileList[0]; + params.attachmentUrls = this.fileList; } const { data, code, msg } = await requestPost(url, params); @@ -714,4 +671,18 @@ export default { font-size: 16px; /* 设置圆点大小 */ border: none; /* 去掉边框 */ } +.imagePreview { + width:100vw; + height:100vh; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index:5000; + background-color: rgba(12, 12, 12, 0.1); + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/views/modules/resourceManagement/enterprise/index.vue b/src/views/modules/resourceManagement/enterprise/index.vue index 75a893109..0e499bce8 100644 --- a/src/views/modules/resourceManagement/enterprise/index.vue +++ b/src/views/modules/resourceManagement/enterprise/index.vue @@ -315,7 +315,7 @@ export default { .catch(err => { }); }, async del(id) { - const url = `/actual/base/companyInfo/deleteCompany`; + const url = `/actual/base/companyInfo/delete`; const { data, code, msg } = await requestPost(url, {id}); if (code === 0) { this.$message.success('删除成功!');