diff --git a/src/views/modules/resourceManagement/enterprise/addForm.vue b/src/views/modules/resourceManagement/enterprise/addForm.vue index c005e6219..7f2198cd1 100644 --- a/src/views/modules/resourceManagement/enterprise/addForm.vue +++ b/src/views/modules/resourceManagement/enterprise/addForm.vue @@ -18,40 +18,42 @@ --> - - + + - + - + - + - - - - + + + + - + @@ -62,8 +64,8 @@ - + @@ -85,7 +87,8 @@
新增
- + {{item.checkTime}} @@ -101,9 +104,12 @@ item.reviewTime || '--' }} - {{item.flag?'已整改隐患':'隐患明细'}}: + {{item.flag?'已整改隐患':'隐患明细'}}:
-

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

+

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

--
@@ -111,32 +117,39 @@ 未整改隐患:
-

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

-
- -- +

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

+ + --
整改要求: -

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

+

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

- +
附件: - {{ - itemI.fileName }} - -
+ {{ + itemI.fileName }} + +
-
- +
+
备注: {{ item.remark || '--' }}
-
+
暂无数据~
@@ -147,56 +160,60 @@ + value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd HH:mm:ss" + placeholder="选择日期"> - - - - + + + + - - - - + + + + + value-format="yyyy-MM-dd HH:mm:ss" value="yyyy-MM-dd HH:mm:ss" + placeholder="选择日期"> - - + + - {{ option.hazardDesc }} + {{ + option.hazardDesc }} - - + + - + @@ -209,15 +226,18 @@ - - + + - + @@ -234,7 +254,7 @@
取消 - 确定 + 确定 @@ -410,7 +430,10 @@ export default { }) }, addInput() { - this.inputList.push({ hazardDesc: '',hazardStatus:'0' }); // 新增一个输入框,对应一个新的对象 + if (this.inputList.some(item => item.hazardDesc.trim() === '')) { + } else { + this.inputList.push({ hazardDesc: '', hazardStatus: '0' }); + } }, removeInput(index) { this.inputList.splice(index, 1); // 删除对应索引的输入框 @@ -527,11 +550,30 @@ export default { for(let i in this.hiddenDangeArr){ this.checkboxOptions.forEach(item => { if(item.value == this.hiddenDangeArr[i]){ - item.hazardStatus = '1'; + item.hazardStatus = '0'; } }) } - params.hiddenDangeList =[...this.inputList,...this.checkboxOptions] ; + for (let i in this.checkboxOptions) { + let option = this.checkboxOptions[i]; + if (this.patrolForm.checkResultFlag === '1') { + option.hazardStatus = '1'; + } else if (this.patrolForm.checkResultFlag === '0') { + option.hazardStatus = '0'; + } + } + for (let i in this.inputList) { + let option = this.inputList[i]; + if (this.patrolForm.checkResultFlag === '1') { + option.hazardStatus = '1'; + } else if (this.patrolForm.checkResultFlag === '0') { + option.hazardStatus = '0'; + } + } + params.hiddenDangeList = [ + ...this.inputList.filter(item => item.hazardDesc.trim() !== ''), + ...this.checkboxOptions + ]; params.companyId = this.detailId; params.attachmentUrls = this.fileList; }