|
|
|
@ -87,71 +87,6 @@ |
|
|
|
<div class="div_btn"> |
|
|
|
<el-button size="small" type="primary " @click="patrolAddd()">新增</el-button> |
|
|
|
</div> |
|
|
|
<el-row v-for="(item, index) in tableData" :key="index" :gutter="20" style="margin-bottom: 20px;" |
|
|
|
v-if="tableData"> |
|
|
|
<el-row style="margin-top: 20px;"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-tag type="primary" effect="plain" class="custom-tag">●</el-tag>{{item.checkTime}} |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row style="margin-top: 15px;"> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"> <span style="color: #888; ">检查人员:</span> {{ |
|
|
|
item.checkPersons }}</el-col> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">检查结论:</span> {{ |
|
|
|
item.checkResultFlag === 1?'合格':'不合格' }}</el-col> |
|
|
|
<el-col :span="6" style="padding-left: 65px;" v-if="item.checkResultFlag !== 1"><span style="color: #888; ">拟复查时间: </span> {{ |
|
|
|
item.reviewTime || '--' }}</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;"> |
|
|
|
<el-col :span="24" style="padding-left: 65px;"><span |
|
|
|
style="color: #888; ">{{item.flag?'已整改隐患':'隐患明细'}}: </span> |
|
|
|
<div v-if="item.hiddenDangeList"> |
|
|
|
<p style="margin-left: 60px;" |
|
|
|
v-for="(itemC,index) in item.hiddenDangeList.filter(item=>item.hazardStatus ==1)"> |
|
|
|
{{index+1}}.{{itemC.hazardDesc}}</p> |
|
|
|
</div> |
|
|
|
<span v-else>--</span> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;" v-if="item.flag"> |
|
|
|
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">未整改隐患: </span> |
|
|
|
<div v-if="item.hiddenDangeList"> |
|
|
|
<p style="margin-left: 60px;" |
|
|
|
v-for="(itemC,index) in item.hiddenDangeList.filter(item=>item.hazardStatus == 0)"> |
|
|
|
{{index+1}}.{{itemC.hazardDesc}}</p> |
|
|
|
</div> |
|
|
|
<span v-else>--</span> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;" v-else> |
|
|
|
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">整改要求: </span> |
|
|
|
<p style="margin-left: 60px;"> |
|
|
|
{{index+1}}.{{item.hiddenDangeList.find(item=>item.hazardStatus == 2).hazardDesc}} |
|
|
|
</p> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;"> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"> |
|
|
|
<span style="color: #888; ">附件: </span> |
|
|
|
<span v-for="(itemI,indexI) in item.attachmentUrls" :key="itemI.fileName" |
|
|
|
style="margin-right:10px;cursor:pointer" |
|
|
|
@click="handelCLickImage(itemI.attachmentUrl)">{{ |
|
|
|
itemI.fileName }} |
|
|
|
</span> |
|
|
|
<div class="imagePreview" v-if="preViewImageFlag" @click="preViewImageFlag = false"> |
|
|
|
<img :src="preViewImage" alt=""> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">备注: </span>{{ |
|
|
|
item.remark || '--' }}</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
<div style="width:100%;height:300px;display:flex;align-items:center;justify-content: center;" |
|
|
|
v-if="tableData.length === 0&& !patrolAdd"> |
|
|
|
<span>暂无数据~</span> |
|
|
|
</div> |
|
|
|
<!-- 巡查记录新增 --> |
|
|
|
<el-form :inline="true" :model="patrolForm" ref="form3" :rules="patrolRule" :label-width="'105px'" |
|
|
|
v-if="patrolAdd"> |
|
|
|
@ -179,14 +114,14 @@ |
|
|
|
<el-col :span="18"> |
|
|
|
<el-form-item label="检查结论" prop="checkResultFlag"> |
|
|
|
<el-select v-model.trim="patrolForm.checkResultFlag" :disabled="disabled" |
|
|
|
placeholder="请选择" class="list_item_width_1" size="small"> |
|
|
|
placeholder="请选择" class="list_item_width_1" size="small" @change="handelChangeCheckResultFlag"> |
|
|
|
<el-option v-for="item in resultArray" :label="item.label" :value="item.value" |
|
|
|
:key="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="18"> |
|
|
|
<el-col :span="18" v-if="patrolForm.checkResultFlag === '0'"> |
|
|
|
<el-form-item label="拟复查时间" prop="reviewTime"> |
|
|
|
<el-date-picker class="list_item_width_1" size="small" |
|
|
|
v-model.trim="patrolForm.reviewTime" type="datetime" |
|
|
|
@ -195,10 +130,9 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row v-if="checkResultFlag !== 1"> |
|
|
|
<el-row v-if="checkResultFlag == 0 && patrolForm.checkResultFlag =='0'"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="隐患明细" prop="hiddenDange" |
|
|
|
style="white-space: nowrap;overflow: hidden;"> |
|
|
|
<el-form-item :label="`${checkResultFlag == 0?'未更改隐患':'隐患明细'}`" prop="hiddenDange" :class="{ 'inputRequirt': true, 'inputRequirtSave': messageFlag }" style="white-space: nowrap;overflow: hidden;"> |
|
|
|
<el-checkbox-group v-model="hiddenDangeArr" size="small"> |
|
|
|
<el-col v-for="option in checkboxOptions" :key="option.value"> |
|
|
|
<el-checkbox :label="option.value" >{{ |
|
|
|
@ -208,23 +142,24 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="18" v-for="(item, index) in inputList" :key="index" |
|
|
|
style="margin-left: 100px;"> |
|
|
|
<el-form-item label="" prop="textarea" class="input-container"> |
|
|
|
<el-input v-model="item.hazardDesc" rows="3" placeholder="请输入隐患信息" size="small" |
|
|
|
<el-row v-if="patrolForm.checkResultFlag === '0'"> |
|
|
|
<el-col :span="18" v-for="(item, indexC) in inputList" :key="indexC" |
|
|
|
:style="{'margin-left': indexC === 0 ? '0px' : '106px'}" |
|
|
|
> |
|
|
|
<el-form-item :label="`${indexC === 0 ?'隐患明细':''}`" class="input-container"> |
|
|
|
<el-input v-model="inputList[indexC].hazardDesc" rows="3" placeholder="请输入隐患信息" size="small" |
|
|
|
class="list_item_width_1"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-button @click="removeInput(index)" v-if="inputList.length > 1" |
|
|
|
<el-button @click="removeInput(indexC)" v-if="inputList.length > 1" |
|
|
|
class="remove-button"> |
|
|
|
<el-icon name="minus"></el-icon> |
|
|
|
</el-button> |
|
|
|
<el-button @click="addInput" v-if="index === inputList.length - 1"> |
|
|
|
<el-button @click="addInput" v-if="indexC === inputList.length - 1"> |
|
|
|
<el-icon name="plus"></el-icon> |
|
|
|
</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row v-if="checkResultFlag === 1 || tableData.length === 0"> |
|
|
|
<el-row v-if="(checkResultFlag === 1 || tableData.length === 0) && patrolForm.checkResultFlag === '0'"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="整改意见" prop="principalName" |
|
|
|
style="white-space: nowrap;overflow: hidden;"> |
|
|
|
@ -249,6 +184,72 @@ |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<!-- 巡查记录新增end --> |
|
|
|
<el-row v-for="(item, index) in tableData" :key="index" :gutter="20" style="margin-bottom: 20px;" |
|
|
|
v-if="tableData"> |
|
|
|
<el-row style="margin-top: 20px;"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-tag type="primary" effect="plain" class="custom-tag">●</el-tag>{{item.checkTime}} |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row style="margin-top: 15px;"> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"> <span style="color: #888; ">检查人员:</span> {{ |
|
|
|
item.checkPersons }}</el-col> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">检查结论:</span> {{ |
|
|
|
item.checkResultFlag === 1?'合格':'不合格' }}</el-col> |
|
|
|
<el-col :span="6" style="padding-left: 65px;" v-if="item.checkResultFlag !== 1"><span style="color: #888; ">拟复查时间: </span> {{ |
|
|
|
item.reviewTime || '--' }}</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;"> |
|
|
|
<el-col :span="24" style="padding-left: 65px;"><span |
|
|
|
style="color: #888; ">{{item.flag?'已整改隐患':'隐患明细'}}: </span> |
|
|
|
<div v-if="item.hiddenDangeList"> |
|
|
|
<p style="margin-left: 60px;" |
|
|
|
v-for="(itemC,index) in item.hiddenDangeList.filter(item=>item.hazardStatus ==1)"> |
|
|
|
{{index+1}}.{{itemC.hazardDesc}}</p> |
|
|
|
</div> |
|
|
|
<span v-else>--</span> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;" v-if="item.flag"> |
|
|
|
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">未整改隐患: </span> |
|
|
|
<div v-if="item.hiddenDangeList"> |
|
|
|
<p style="margin-left: 60px;" |
|
|
|
v-for="(itemC,index) in item.hiddenDangeList.filter(item=>item.hazardStatus == 0)"> |
|
|
|
{{index+1}}.{{itemC.hazardDesc}}</p> |
|
|
|
</div> |
|
|
|
<span v-else>--</span> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;" v-else> |
|
|
|
<el-col :span="24" style="padding-left: 65px;"><span style="color: #888; ">整改要求: </span> |
|
|
|
<p style="margin-left: 60px;"> |
|
|
|
{{index+1}}.{{item.hiddenDangeList.find(item=>item.hazardStatus == 2).hazardDesc}} |
|
|
|
</p> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
<el-row style="margin-top: 15px;"> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"> |
|
|
|
<span style="color: #888; ">附件: </span> |
|
|
|
<span v-for="(itemI,indexI) in item.attachmentUrls" :key="itemI.fileName" |
|
|
|
style="margin-right:10px;cursor:pointer" |
|
|
|
@click="handelCLickImage(itemI.attachmentUrl)">{{ |
|
|
|
itemI.fileName }} |
|
|
|
</span> |
|
|
|
<div class="imagePreview" v-if="preViewImageFlag" @click="preViewImageFlag = false"> |
|
|
|
<img :src="preViewImage" alt=""> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" style="padding-left: 65px;"><span style="color: #888; ">备注: </span>{{ |
|
|
|
item.remark || '--' }}</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
<div style="width:100%;height:300px;display:flex;align-items:center;justify-content: center;" |
|
|
|
v-if="tableData.length === 0&& !patrolAdd"> |
|
|
|
<span>暂无数据~</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -379,7 +380,8 @@ export default { |
|
|
|
loading: false, |
|
|
|
searchOptions: [], |
|
|
|
preViewImage:null, |
|
|
|
preViewImageFlag:false |
|
|
|
preViewImageFlag:false, |
|
|
|
messageFlag:false |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
@ -394,9 +396,6 @@ export default { |
|
|
|
if (this.pageType != 'add' && this.pageType != 'patrol') { |
|
|
|
this.getDetail(); |
|
|
|
}else if(this.pageType == 'patrol') { |
|
|
|
if(this.checkResultFlag ===1){ |
|
|
|
delete this.patrolRule.reviewTime |
|
|
|
} |
|
|
|
this.getCompanyDetail() |
|
|
|
this.getStafflist() |
|
|
|
}else { |
|
|
|
@ -406,6 +405,15 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
handelChangeCheckResultFlag(val){ |
|
|
|
if(val == 1){ |
|
|
|
this.hiddenDangeArr = [] |
|
|
|
delete this.patrolRule.reviewTime |
|
|
|
}else{ |
|
|
|
this.hiddenDangeArr = this.checkboxOptions.map(item=>item.value) |
|
|
|
this.$set(this.patrolRule,'reviewTime',[{ required: true, message: '拟复查时间不能为空', trigger: 'blur' }]) |
|
|
|
} |
|
|
|
}, |
|
|
|
handelCLickImage(url){ |
|
|
|
this.preViewImageFlag = true; |
|
|
|
this.preViewImage = url; |
|
|
|
@ -547,11 +555,17 @@ export default { |
|
|
|
}else if(this.pageType === 'patrol'){ |
|
|
|
this.$refs['form3'].validate(valid => { |
|
|
|
if (valid){ |
|
|
|
if(this.checkboxOptions.length > 0 && this.hiddenDangeArr.length === 0){ |
|
|
|
this.messageFlag = true; |
|
|
|
return |
|
|
|
}else{ |
|
|
|
this.messageFlag = false; |
|
|
|
} |
|
|
|
this.save(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
// this.save(); |
|
|
|
this.save(); |
|
|
|
}, |
|
|
|
async save() { |
|
|
|
console.log('this.formData', this.formData); |
|
|
|
@ -566,13 +580,15 @@ export default { |
|
|
|
}else if(this.pageType == 'patrol'){ |
|
|
|
url = '/actual/base/companyInfo/addRecord'; |
|
|
|
params = { ...this.patrolForm }; |
|
|
|
for(let i in this.hiddenDangeArr){ |
|
|
|
console.log(this.hiddenDangeArr); |
|
|
|
this.checkboxOptions.forEach(item => { |
|
|
|
if(item.value == this.hiddenDangeArr[i]){ |
|
|
|
this.$set(item,'hazardStatus', '1'); |
|
|
|
if(this.hiddenDangeArr.findIndex(itemC=>itemC === item.value) == -1){ |
|
|
|
item.hazardStatus = '1'; |
|
|
|
}else{ |
|
|
|
item.hazardStatus = '0'; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
for (let i in this.inputList) { |
|
|
|
let option = this.inputList[i]; |
|
|
|
if (this.patrolForm.checkResultFlag === '1') { |
|
|
|
@ -588,13 +604,14 @@ export default { |
|
|
|
params.companyId = this.detailId; |
|
|
|
params.attachmentUrls = this.fileList; |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
this.$message.success('操作成功'); |
|
|
|
this.handleCancle(); |
|
|
|
} else if (code >= 8000) { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
console.log(params); |
|
|
|
// const { data, code, msg } = await requestPost(url, params); |
|
|
|
// if (code === 0) { |
|
|
|
// this.$message.success('操作成功'); |
|
|
|
// this.handleCancle(); |
|
|
|
// } else if (code >= 8000) { |
|
|
|
// this.$message.error(msg); |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle() { |
|
|
|
@ -737,4 +754,24 @@ export default { |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
} |
|
|
|
.inputRequirt { |
|
|
|
position: relative; |
|
|
|
min-width: 300px; |
|
|
|
} |
|
|
|
.inputRequirt::after { |
|
|
|
content: '*'; |
|
|
|
color: #f56c6c; |
|
|
|
position: absolute; |
|
|
|
left: 8px; |
|
|
|
top: 10px; |
|
|
|
} |
|
|
|
.inputRequirtSave::before { |
|
|
|
content: '请选择未更改隐患'; |
|
|
|
color: #f56c6c; |
|
|
|
position: absolute; |
|
|
|
left: 104px; |
|
|
|
bottom: -1px; |
|
|
|
width: 300px; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|