|
@ -1,13 +1,13 @@ |
|
|
<template> |
|
|
<template> |
|
|
<el-dialog title="提示" :visible.sync="dialogVisible" width="1370px" :before-close="handleCancle"> |
|
|
<el-dialog title="提示" :visible.sync="dialogVisible" width="1370px" :before-close="handleCancle"> |
|
|
|
|
|
<div class="dialog-h-content"> |
|
|
<span slot="title"> |
|
|
<span slot="title"> |
|
|
<span v-if="pageType == 'add'">新增</span> |
|
|
<span v-if="pageType == 'add'">新增</span> |
|
|
<span v-if="pageType == 'edit'">修改</span> |
|
|
<span v-if="pageType == 'edit'">修改</span> |
|
|
<span v-if="pageType == 'view'">查看</span> |
|
|
<span v-if="pageType == 'view'">查看</span> |
|
|
<span v-if="pageType == 'patrol'">巡查记录</span> |
|
|
<span v-if="pageType == 'patrol'">巡查记录</span> |
|
|
</span> |
|
|
</span> |
|
|
<div> |
|
|
<div class="div_form"> |
|
|
<div class="dialog-h-content scroll-h div_form"> |
|
|
|
|
|
<el-form :inline="true" :model="formData" ref="form" :rules="dataRule" :label-width="'90px'" |
|
|
<el-form :inline="true" :model="formData" ref="form" :rules="dataRule" :label-width="'90px'" |
|
|
v-if="pageType != 'patrol'"> |
|
|
v-if="pageType != 'patrol'"> |
|
|
<el-row> |
|
|
<el-row> |
|
@ -132,7 +132,7 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-row v-if="checkResultFlag == 0 && patrolForm.checkResultFlag =='0'"> |
|
|
<el-row v-if="checkResultFlag == 0 && patrolForm.checkResultFlag =='0'"> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item :label="`${checkResultFlag == 0?'未更改隐患':'隐患明细'}`" prop="hiddenDange" :class="{ 'inputRequirt': true, 'inputRequirtSave': messageFlag }" style="white-space: nowrap;overflow: hidden;"> |
|
|
<el-form-item :label="`${checkResultFlag == 0?'未更改隐患':'隐患明细'}`" prop="hiddenDange" :class="{ 'checkboxRequirt': true, 'checkboxRequirtSave': checkboxMessageFlag }" style="white-space: nowrap;overflow: hidden;"> |
|
|
<el-checkbox-group v-model="hiddenDangeArr" size="small"> |
|
|
<el-checkbox-group v-model="hiddenDangeArr" size="small"> |
|
|
<el-col v-for="option in checkboxOptions" :key="option.value"> |
|
|
<el-col v-for="option in checkboxOptions" :key="option.value"> |
|
|
<el-checkbox :label="option.value" >{{ |
|
|
<el-checkbox :label="option.value" >{{ |
|
@ -144,9 +144,8 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
<el-row v-if="patrolForm.checkResultFlag === '0'"> |
|
|
<el-row v-if="patrolForm.checkResultFlag === '0'"> |
|
|
<el-col :span="18" v-for="(item, indexC) in inputList" :key="indexC" |
|
|
<el-col :span="18" v-for="(item, indexC) in inputList" :key="indexC" |
|
|
:style="{'margin-left': indexC === 0 ? '0px' : '106px'}" |
|
|
:style="{'margin-left': indexC === 0 && checkResultFlag != 0 ? '0' : '106px'}"> |
|
|
> |
|
|
<el-form-item :label="`${indexC === 0 && checkResultFlag != 0 ?'隐患明细':''}`" :class="{ 'inputRequirt': indexC === 0 && checkResultFlag != 0,'input-container':true, 'inputRequirtSave': inputMessageFlag && indexC === 0 }" > |
|
|
<el-form-item :label="`${indexC === 0 ?'隐患明细':''}`" class="input-container"> |
|
|
|
|
|
<el-input v-model="inputList[indexC].hazardDesc" rows="3" placeholder="请输入隐患信息" size="small" |
|
|
<el-input v-model="inputList[indexC].hazardDesc" rows="3" placeholder="请输入隐患信息" size="small" |
|
|
class="list_item_width_1"></el-input> |
|
|
class="list_item_width_1"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -381,7 +380,8 @@ export default { |
|
|
searchOptions: [], |
|
|
searchOptions: [], |
|
|
preViewImage:null, |
|
|
preViewImage:null, |
|
|
preViewImageFlag:false, |
|
|
preViewImageFlag:false, |
|
|
messageFlag:false |
|
|
checkboxMessageFlag:false, |
|
|
|
|
|
inputMessageFlag:false |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
watch: {}, |
|
|
watch: {}, |
|
@ -410,7 +410,7 @@ export default { |
|
|
this.hiddenDangeArr = [] |
|
|
this.hiddenDangeArr = [] |
|
|
delete this.patrolRule.reviewTime |
|
|
delete this.patrolRule.reviewTime |
|
|
}else{ |
|
|
}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' }]) |
|
|
this.$set(this.patrolRule,'reviewTime',[{ required: true, message: '拟复查时间不能为空', trigger: 'blur' }]) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -555,19 +555,20 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}else if(this.pageType === 'patrol'){ |
|
|
}else if(this.pageType === 'patrol'){ |
|
|
this.$refs['form3'].validate(valid => { |
|
|
|
|
|
if (valid){ |
|
|
|
|
|
if(this.checkboxOptions.length > 0 && this.hiddenDangeArr.length === 0){ |
|
|
if(this.checkboxOptions.length > 0 && this.hiddenDangeArr.length === 0){ |
|
|
this.messageFlag = true; |
|
|
this.checkboxMessageFlag = true; |
|
|
return |
|
|
}else if(this.patrolForm.checkResultFlag == '0'&& this.inputList[0].hazardDesc === '' && checkResultFlag == '0'){ |
|
|
|
|
|
this.inputMessageFlag = true; |
|
|
}else{ |
|
|
}else{ |
|
|
this.messageFlag = false; |
|
|
this.checkboxMessageFlag = false; |
|
|
|
|
|
this.inputMessageFlag = false; |
|
|
} |
|
|
} |
|
|
|
|
|
this.$refs['form3'].validate(valid => { |
|
|
|
|
|
if (valid && (this.checkboxMessageFlag === false && this.inputMessageFlag === false)){ |
|
|
this.save(); |
|
|
this.save(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
this.save(); |
|
|
|
|
|
}, |
|
|
}, |
|
|
async save() { |
|
|
async save() { |
|
|
console.log('this.formData', this.formData); |
|
|
console.log('this.formData', this.formData); |
|
@ -606,6 +607,7 @@ export default { |
|
|
params.companyId = this.detailId; |
|
|
params.companyId = this.detailId; |
|
|
params.attachmentUrls = this.fileList; |
|
|
params.attachmentUrls = this.fileList; |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(params); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.$message.success('操作成功'); |
|
|
this.$message.success('操作成功'); |
|
@ -735,6 +737,11 @@ export default { |
|
|
.el-dialog__body { |
|
|
.el-dialog__body { |
|
|
padding: 30px 80px; |
|
|
padding: 30px 80px; |
|
|
} |
|
|
} |
|
|
|
|
|
.dialog-h-content{ |
|
|
|
|
|
height: 600px; |
|
|
|
|
|
overflow-y: scroll; |
|
|
|
|
|
overflow-x: hidden; |
|
|
|
|
|
} |
|
|
.div_btn { |
|
|
.div_btn { |
|
|
display: flex; |
|
|
display: flex; |
|
|
} |
|
|
} |
|
@ -756,6 +763,26 @@ export default { |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: 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 { |
|
|
.inputRequirt { |
|
|
position: relative; |
|
|
position: relative; |
|
|
min-width: 300px; |
|
|
min-width: 300px; |
|
@ -764,16 +791,21 @@ export default { |
|
|
content: '*'; |
|
|
content: '*'; |
|
|
color: #f56c6c; |
|
|
color: #f56c6c; |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
left: 8px; |
|
|
left: 21px; |
|
|
top: 10px; |
|
|
top: 10px; |
|
|
} |
|
|
} |
|
|
.inputRequirtSave::before { |
|
|
.inputRequirtSave::before { |
|
|
content: '请选择未更改隐患'; |
|
|
content: '隐患明细不能为空'; |
|
|
color: #f56c6c; |
|
|
color: #f56c6c; |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
left: 104px; |
|
|
left: 104px; |
|
|
bottom: -1px; |
|
|
bottom: -17px; |
|
|
width: 300px; |
|
|
width: 300px; |
|
|
} |
|
|
} |
|
|
|
|
|
.inputRequirtSave{ |
|
|
|
|
|
/deep/ .el-input input{ |
|
|
|
|
|
border-color: #f56c6c; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |
|
|