diff --git a/src/views/modules/resourceManagement/enterprise/addForm.vue b/src/views/modules/resourceManagement/enterprise/addForm.vue index c1717eec9..d163b94c1 100644 --- a/src/views/modules/resourceManagement/enterprise/addForm.vue +++ b/src/views/modules/resourceManagement/enterprise/addForm.vue @@ -6,8 +6,8 @@ 查看 巡查记录 -
-
+
+
@@ -132,7 +132,7 @@ - + {{ @@ -144,9 +144,8 @@ - + :style="{'margin-left': indexC === 0 && checkResultFlag != 0 ? '0' : '106px'}"> + @@ -161,10 +160,10 @@ - + placeholder="请输入整改要求"> @@ -205,7 +204,7 @@ style="color: #888; ">{{item.flag?'已整改隐患':'隐患明细'}}:

+ v-for="(itemC,index) in item.hiddenDangeList.filter(itemF=>itemF.hazardStatus ==item.flag?1:0)"> {{index+1}}.{{itemC.hazardDesc}}

-- @@ -381,7 +380,8 @@ export default { searchOptions: [], preViewImage:null, preViewImageFlag:false, - messageFlag:false + checkboxMessageFlag:false, + inputMessageFlag:false }; }, watch: {}, @@ -410,7 +410,7 @@ export default { this.hiddenDangeArr = [] delete this.patrolRule.reviewTime }else{ - this.hiddenDangeArr = this.checkboxOptions.map(item=>item.value) + // this.hiddenDangeArr = this.checkboxOptions.map(item=>item.value) this.$set(this.patrolRule,'reviewTime',[{ required: true, message: '拟复查时间不能为空', trigger: 'blur' }]) } }, @@ -553,21 +553,22 @@ export default { if (valid){ this.save(); } - }); + }); }else if(this.pageType === 'patrol'){ + if(this.checkboxOptions.length > 0 && this.hiddenDangeArr.length != 0 && this.checkResultFlag != '1' && this.this.patrolForm.checkResultFlag != '1'){ + this.checkboxMessageFlag = true; + }else if(this.patrolForm.checkResultFlag == '0'&& this.inputList[0].hazardDesc === '' && this.checkResultFlag == '1'){ + this.inputMessageFlag = true; + }else{ + this.checkboxMessageFlag = false; + this.inputMessageFlag = false; + } this.$refs['form3'].validate(valid => { - if (valid){ - if(this.checkboxOptions.length > 0 && this.hiddenDangeArr.length === 0){ - this.messageFlag = true; - return - }else{ - this.messageFlag = false; - } + if (valid && (this.checkboxMessageFlag === false && this.inputMessageFlag === false)){ this.save(); } }); } - this.save(); }, async save() { console.log('this.formData', this.formData); @@ -589,7 +590,7 @@ export default { }else{ item.hazardStatus = '0'; } - }) + }) for (let i in this.inputList) { let option = this.inputList[i]; @@ -603,6 +604,13 @@ export default { ...this.inputList.filter(item => item.hazardDesc.trim() !== ''), ...this.checkboxOptions ]; + if(this.patrolForm.rectificationOpinion){ + params.hiddenDangeList.push({ + hazardStatus:'2', + hazardDesc:this.patrolForm.rectificationOpinion + }) + delete params.rectificationOpinion; + } params.companyId = this.detailId; params.attachmentUrls = this.fileList; } @@ -735,6 +743,11 @@ export default { .el-dialog__body { padding: 30px 80px; } +.dialog-h-content{ + height: 600px; + overflow-y: scroll; + overflow-x: hidden; +} .div_btn { display: flex; } @@ -756,6 +769,26 @@ export default { align-items: center; justify-content: center; } +.checkboxRequirt { + position: relative; + min-width: 300px; +} +.checkboxRequirt::after { + content: '*'; + color: #f56c6c; + position: absolute; + left: 8px; + top: 10px; +} +.checkboxRequirtSave::before { + content: '未更改隐患不能为空'; + color: #f56c6c; + position: absolute; + left: 104px; + bottom: -1px; + width: 300px; +} + .inputRequirt { position: relative; min-width: 300px; @@ -764,16 +797,21 @@ export default { content: '*'; color: #f56c6c; position: absolute; - left: 8px; + left: 21px; top: 10px; } .inputRequirtSave::before { - content: '请选择未更改隐患'; + content: '隐患明细不能为空'; color: #f56c6c; position: absolute; left: 104px; - bottom: -1px; + bottom: -17px; width: 300px; } +.inputRequirtSave{ + /deep/ .el-input input{ + border-color: #f56c6c; + } +}