|
@@ -133,9 +133,9 @@
|
|
|
ref="cascaderGet"
|
|
|
style="width:300px;"
|
|
|
v-model="item.jcxId"
|
|
|
- :options="checkOptionList[index]"
|
|
|
+ :options="defaultCheckOptionList"
|
|
|
@change="(val)=>cascaderChange(val,index)"
|
|
|
- @blur="blurCheck(index)"
|
|
|
+ @focus="focusClick()"
|
|
|
:props="{ expandTrigger: 'hover',value: 'id', label: 'name' }">
|
|
|
<template slot-scope="{ node, data }">
|
|
|
<el-tooltip :disabled="data.name.length < 14" class="item" effect="dark" :content="data.name" placement="top-start">
|
|
@@ -143,7 +143,7 @@
|
|
|
</el-tooltip>
|
|
|
</template>
|
|
|
</el-cascader>
|
|
|
- <!--<span class="add-span" style="margin-left:20px;" @click="blurCheck(index)">重置检查项</span>-->
|
|
|
+ <!--<span class="add-span" style="margin-left:20px;" @click="focusCheck(index)">重置检查项</span>-->
|
|
|
<span class="text-span">没有找到对应的隐患</span>
|
|
|
<span class="add-span" @click="dialogClick(index)">手动添加</span>
|
|
|
<p style="color:#999999;" v-if="item.yhcount">此检查项在当前实验室累计出现<span style="color:#FF2D2D;">{{item.yhcount}}</span>次隐患</p>
|
|
@@ -160,7 +160,7 @@
|
|
|
</el-form>
|
|
|
<!--新增检查项-->
|
|
|
<el-dialog title="添加检查项" :visible.sync="open" width="500px" append-to-body>
|
|
|
- <el-form ref="form" :model="examinationForm" :rules="rules" label-width="100px">
|
|
|
+ <el-form ref="addForm" :model="examinationForm" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="检查项名称" prop="name">
|
|
|
<el-input type="textarea" maxlength="20" v-model="examinationForm.name" placeholder="请输入检查项名称" rows="3" resize="none"></el-input>
|
|
|
</el-form-item>
|
|
@@ -329,7 +329,7 @@ export default {
|
|
|
},
|
|
|
//检查项
|
|
|
defaultCheckOptionList:[],
|
|
|
- checkOptionList:[],
|
|
|
+ defaultCheckOption:[],
|
|
|
checkOptionListExamination:[],
|
|
|
//临时数据组
|
|
|
temporaryIdList:[],
|
|
@@ -343,14 +343,13 @@ export default {
|
|
|
checkName:"",
|
|
|
},
|
|
|
formData:{},
|
|
|
+ addList:[],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- // this.getListCheckOption();
|
|
|
this.getListCheckOptionData();
|
|
|
this.getListCheckOptionTwo();
|
|
|
this.treeselect();
|
|
|
- // this.selectDeptListUserDeptId();
|
|
|
},
|
|
|
methods: {
|
|
|
remindOff(){
|
|
@@ -359,16 +358,6 @@ export default {
|
|
|
remindButton(){
|
|
|
this.remindOpen = false;
|
|
|
},
|
|
|
- blurCheck(index){
|
|
|
- // this.getListCheckOptionData(index);
|
|
|
- let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
|
- list[index] = JSON.parse(JSON.stringify(this.defaultCheckOptionList));
|
|
|
- this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
|
|
|
- },
|
|
|
- filterRegion(value,index){
|
|
|
- this.getListCheckOptionOne(value,index);
|
|
|
- return false
|
|
|
- },
|
|
|
jcDwChange(val){
|
|
|
let self = this;
|
|
|
for(let i=0;i<self.inspectionUnitArrayData.length;i++){
|
|
@@ -428,7 +417,6 @@ export default {
|
|
|
},
|
|
|
//删除隐患
|
|
|
delDanger(index){
|
|
|
- this.checkOptionList.splice(index,1)
|
|
|
this.form.detailsList.splice(index,1)
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
@@ -447,7 +435,6 @@ export default {
|
|
|
yhMs:"",
|
|
|
};
|
|
|
this.form.detailsList.push(obj);
|
|
|
- this.getListCheckOption();
|
|
|
},
|
|
|
//上传
|
|
|
handleAvatarSuccess(res, file, index) {
|
|
@@ -490,9 +477,9 @@ export default {
|
|
|
this.formData.checkName = this.nameForm.checkName;
|
|
|
checkRecordAdd(this.formData).then( response => {
|
|
|
this.msgSuccess('提交成功')
|
|
|
+ this.addList = [];
|
|
|
+ this.getListCheckOptionData();
|
|
|
this.delForm();
|
|
|
- this.$set(this,'checkOptionList',[]);
|
|
|
- // this.getListCheckOption();
|
|
|
this.nameOpen = false;
|
|
|
this.loading = false;
|
|
|
});
|
|
@@ -529,9 +516,9 @@ export default {
|
|
|
this.loading = true;
|
|
|
checkRecordAddC(this.formData).then( response => {
|
|
|
this.msgSuccess('保存草稿成功')
|
|
|
+ this.addList = [];
|
|
|
+ this.getListCheckOptionData();
|
|
|
this.delForm();
|
|
|
- this.$set(this,'checkOptionList',[]);
|
|
|
- // this.getListCheckOption();
|
|
|
this.loading = false;
|
|
|
});
|
|
|
}else{
|
|
@@ -621,7 +608,6 @@ export default {
|
|
|
this.$set(this.form.detailsList[index],'jcxName',"");
|
|
|
this.$set(this.form.detailsList[index],'jcxSstkNum',"");
|
|
|
this.$set(this.form.detailsList[index],'jcxSstkMs',"");
|
|
|
- // this.getListCheckOption();
|
|
|
}
|
|
|
console.log('val',val);
|
|
|
if(val[0]){
|
|
@@ -645,20 +631,19 @@ export default {
|
|
|
},
|
|
|
//新增检查项
|
|
|
dialogSubmitForm(){
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["addForm"].validate(valid => {
|
|
|
if (valid) {
|
|
|
let obj = {
|
|
|
name:this.examinationForm.name,
|
|
|
parentId:this.examinationForm.idList[this.examinationForm.idList.length-1]
|
|
|
};
|
|
|
addTempCheckOption(obj).then( response => {
|
|
|
- let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
|
let obj = {
|
|
|
id:response.data.id,
|
|
|
name:response.data.name,
|
|
|
};
|
|
|
- list[this.openIndex].push(obj);
|
|
|
- this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)));
|
|
|
+ this.defaultCheckOptionList.push(obj);
|
|
|
+ this.addList.push(obj);
|
|
|
this.temporaryIdList.push(response.data.id);
|
|
|
this.$set(this.form.detailsList[this.openIndex],'jcxId',response.data.id);
|
|
|
this.$set(this.form.detailsList[this.openIndex],'jcxName',response.data.name);
|
|
@@ -760,28 +745,22 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //获取检查项
|
|
|
- getListCheckOption() {
|
|
|
- let newObj = {
|
|
|
- level:4,
|
|
|
- }
|
|
|
- listCheckOption(newObj).then( response => {
|
|
|
- let list = this.getTreeData(response.data);
|
|
|
- this.checkOptionList.push(JSON.parse(JSON.stringify(list)));
|
|
|
- });
|
|
|
- this.$forceUpdate();
|
|
|
- },
|
|
|
getListCheckOptionData(){
|
|
|
let newObj = {
|
|
|
level:4,
|
|
|
}
|
|
|
listCheckOption(newObj).then( response => {
|
|
|
this.defaultCheckOptionList = this.getTreeData(response.data);
|
|
|
- // let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
|
- // list[index] = this.getTreeData(response.data);
|
|
|
- // this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
|
|
|
+ this.$set(this,'defaultCheckOption',this.defaultCheckOptionList);
|
|
|
});
|
|
|
},
|
|
|
+ focusClick(){
|
|
|
+ this.$set(this,'defaultCheckOptionList',JSON.parse(JSON.stringify(this.defaultCheckOption.concat(this.addList))));
|
|
|
+ },
|
|
|
+ filterRegion(value,index){
|
|
|
+ this.getListCheckOptionOne(value,index);
|
|
|
+ return false
|
|
|
+ },
|
|
|
//获取检查项
|
|
|
getListCheckOptionOne(data,index) {
|
|
|
let newObj = {
|
|
@@ -789,10 +768,10 @@ export default {
|
|
|
searchValue:data
|
|
|
}
|
|
|
listCheckOption(newObj).then( response => {
|
|
|
- let list = JSON.parse(JSON.stringify(this.checkOptionList));
|
|
|
- list[index] = this.getTreeData(response.data);
|
|
|
- if(list[index][0]){
|
|
|
- this.$set(this,'checkOptionList',JSON.parse(JSON.stringify(list)))
|
|
|
+ let list = this.getTreeData(response.data);
|
|
|
+ if(list[0]){
|
|
|
+ list = list.concat(this.addList);
|
|
|
+ this.$set(this,'defaultCheckOptionList',JSON.parse(JSON.stringify(list)))
|
|
|
this.$forceUpdate()
|
|
|
}else{
|
|
|
this.msgError('未找到相关检查项')
|