|
@@ -95,29 +95,22 @@
|
|
|
</view>
|
|
|
<view class="input-for-max-box">
|
|
|
<view class="for-box" v-for="(item,index) in dataList" :key="index" v-if="optionData.infoType==0">
|
|
|
- <view class="for-box-n" v-html="brightenKeyword(item.hazardCheckCode1,item.hazardCheckName1,searchValue)">
|
|
|
- {{item.hazardCheckCode1}}{{item.hazardCheckName1}}
|
|
|
+ <view v-html="brightenKeyword(item.hazardCheckCode1,item.hazardCheckName1,searchValue)" class="for-box-n">
|
|
|
+ {{item.hazardCheckCode1}} {{item.hazardCheckName1}}
|
|
|
</view>
|
|
|
- <view class="for-box-n" v-html="brightenKeyword(item.hazardCheckCode2,item.hazardCheckName2,searchValue)">
|
|
|
- {{item.hazardCheckCode2}}{{item.hazardCheckName2}}
|
|
|
- </view>
|
|
|
- <view v-for="(item2,index2) in item.data">
|
|
|
- <view class="for-box-n" v-html="brightenKeyword(item2.hazardCheckCode,item2.hazardCheckName,searchValue)">
|
|
|
- {{item2.hazardCheckCode}}{{item2.hazardCheckName}}
|
|
|
+ <view v-for="(item2,index2) in item.children">
|
|
|
+ <view v-html="brightenKeyword(item2.hazardCheckCode2,item2.hazardCheckName2,searchValue)" class="for-box-n">
|
|
|
+ {{item2.hazardCheckCode2}} {{item2.hazardCheckName2}}
|
|
|
</view>
|
|
|
- <view class="for-box-n" @click="checkItemButton(item2,item3)"
|
|
|
- v-for="(item3,index3) in item2.hazardCheckPointList" v-html="brightenKeyword('',item3,searchValue)">
|
|
|
- {{item3}}
|
|
|
+ <view class="for-box-n"
|
|
|
+ v-for="(item3,index3) in item2.children">
|
|
|
+ <view v-html="brightenKeyword(item3.hazardCheckCode,item3.hazardCheckName,searchValue)">{{item3.hazardCheckCode}} {{item3.hazardCheckName}}</view>
|
|
|
+ <view class="for-box-n-b" @click="checkItemButton(item3,item4)"
|
|
|
+ v-for="(item4,index4) in item3.hazardCheckPointList">
|
|
|
+ <view v-html="brightenKeyword('',item4,searchValue)">{{item4}}</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- </view>
|
|
|
-
|
|
|
- <view class="for-box" @click="checkItemButton(item,'')" v-for="(item,index) in dataList" :key="index"
|
|
|
- v-if="optionData.infoType==1 || optionData.infoType==2">
|
|
|
- <view class="for-box-n">
|
|
|
- {{item.hazardCheckCode}}{{item.hazardCheckName}}
|
|
|
- </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -129,18 +122,11 @@
|
|
|
<view v-if="levelListThree" @click="cascadeButton(3)">三级检查</view>
|
|
|
</view>
|
|
|
<view class="check-for-max-box">
|
|
|
- <view v-if="!levelListThree" v-for="(item,index) in checkList" :key="index" @click="cascadeItemButton(item,item2)">
|
|
|
- <view>{{item.hazardCheckCode?item.hazardCheckCode:item.code}}
|
|
|
- {{item.hazardCheckName?item.hazardCheckName:item.name}}
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view v-for="(item,index) in checkList" :key="index" v-if="levelListThree">
|
|
|
- <view>{{item.hazardCheckCode?item.hazardCheckCode:item.code}}
|
|
|
- {{item.hazardCheckName?item.hazardCheckName:item.name}}
|
|
|
- </view>
|
|
|
- <view v-for="(item2,index2) in item.hazardCheckPointList" @click="checkItemButton(item,item2)">
|
|
|
- {{item2}}
|
|
|
+ <view v-for="(item,index) in checkList" :key="index" @click="cascadeItemButton(item)">
|
|
|
+ <view>
|
|
|
+ {{item.code}} {{item.name}}
|
|
|
</view>
|
|
|
+ <view v-for="(minItem,minIndex) in item.hazardCheckPointList" @click="checkItemButton(item,minItem)">{{minItem}}</view>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -155,6 +141,7 @@
|
|
|
securityAppCheckSetOptionList,
|
|
|
securityAppCheckSetOptionGetReviewList,
|
|
|
securityAppCheckDangerGetCheckDangerSubId,
|
|
|
+ securityAppCheckPlanSetGetOptionList,
|
|
|
} from '@/pages_safetyCheck/api/index.js'
|
|
|
export default {
|
|
|
name: "checkItemModule",
|
|
@@ -171,6 +158,8 @@
|
|
|
searchValue: "",
|
|
|
//输入搜索返回列表
|
|
|
dataList: [],
|
|
|
+ //当前级联数据
|
|
|
+ cascadeButtonType:1,
|
|
|
//一级-级联数据
|
|
|
levelListOne: null,
|
|
|
//二级-级联数据
|
|
@@ -186,7 +175,6 @@
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$set(this, 'optionData', JSON.parse(JSON.stringify(this.propsData)));
|
|
|
- console.log('检查项列表',this.optionData)
|
|
|
this.$nextTick(() => {
|
|
|
this.securityCheckOptionSelAllList();
|
|
|
})
|
|
@@ -199,7 +187,8 @@
|
|
|
getSearchValue() {
|
|
|
if (this.optionData.infoType == 0) {
|
|
|
//检查
|
|
|
- this.securityAppCheckSetOptionList();
|
|
|
+ // this.securityAppCheckSetOptionList();
|
|
|
+ this.securityCheckOptionSelAllList();
|
|
|
} else if (this.optionData.infoType == 1) {
|
|
|
//复查
|
|
|
this.securityAppCheckSetOptionGetReviewList();
|
|
@@ -228,6 +217,7 @@
|
|
|
},
|
|
|
//级联等级点击
|
|
|
cascadeButton(type) {
|
|
|
+ this.$set(this,'cascadeButtonType',type);
|
|
|
if (type == 1) {
|
|
|
this.$set(this, 'levelListTwo', null);
|
|
|
this.$set(this, 'levelListThree', null);
|
|
@@ -252,9 +242,6 @@
|
|
|
})
|
|
|
}
|
|
|
this.$set(this, 'checkList', item.children);
|
|
|
- } else if (item.level == 3) {
|
|
|
- this.checkItemButton(item, item2);
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
//选中检查项
|
|
@@ -265,7 +252,7 @@
|
|
|
brightenKeyword(code,val, editKeyword) {
|
|
|
const Reg = new RegExp(editKeyword);
|
|
|
if (val) {
|
|
|
- const res = code+ val.replace(Reg, `<span style="color: #0183FA;">${editKeyword }</span>`);
|
|
|
+ const res = code + ' ' + val.replace(Reg, `<span style="color: #0183FA;">${editKeyword }</span>`);
|
|
|
return res;
|
|
|
}
|
|
|
},
|
|
@@ -279,7 +266,8 @@
|
|
|
let maxList = this.getCascaderData(JSON.parse(JSON.stringify(data.data)), 2)
|
|
|
this.$nextTick(() => {
|
|
|
if (this.optionData.infoType == 0) {
|
|
|
- this.securityAppCheckSetOptionList(maxList);
|
|
|
+ this.securityAppCheckPlanSetGetOptionList(maxList);
|
|
|
+ // this.securityAppCheckSetOptionList(maxList);
|
|
|
} else if (this.optionData.infoType == 1) {
|
|
|
this.securityAppCheckSetOptionGetReviewList(maxList);
|
|
|
} else if (this.optionData.infoType == 2) {
|
|
@@ -288,6 +276,52 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ //查询批次下-检查项
|
|
|
+ async securityAppCheckPlanSetGetOptionList(maxList){
|
|
|
+ let self = this;
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await securityAppCheckPlanSetGetOptionList({
|
|
|
+ planSetId:this.optionData.planSetId,
|
|
|
+ searchValue: this.searchValue
|
|
|
+ });
|
|
|
+ if (data.code == 200) {
|
|
|
+ if (data.data[0]) {
|
|
|
+ let minList = JSON.parse(JSON.stringify(data.data))
|
|
|
+ this.newCascadeData(maxList, minList);
|
|
|
+ }else{
|
|
|
+ this.$set(this, 'levelListOne', JSON.parse(JSON.stringify({
|
|
|
+ level: 0,
|
|
|
+ children: []
|
|
|
+ })));
|
|
|
+ this.$set(this, 'dataList', []);
|
|
|
+ this.$set(this, 'checkList', []);
|
|
|
+ this.$set(this, 'cascadeButtonType', 1);
|
|
|
+ this.$set(this, 'levelListOne', null);
|
|
|
+ this.$set(this, 'levelListTwo', null);
|
|
|
+ this.$set(this, 'levelListThree', null);
|
|
|
+ }
|
|
|
+
|
|
|
+ // //查询数据
|
|
|
+ // let map = new Map();
|
|
|
+ // for (let item of data.data) {
|
|
|
+ // let hazardCheckCode2 = item.hazardCheckCode2;
|
|
|
+ // if (!map.has(hazardCheckCode2)) {
|
|
|
+ // map.set(hazardCheckCode2, {
|
|
|
+ // hazardCheckCode2: hazardCheckCode2,
|
|
|
+ // hazardCheckName2: item.hazardCheckName2,
|
|
|
+ // hazardCheckCode1: item.hazardCheckCode1,
|
|
|
+ // hazardCheckName1: item.hazardCheckName1,
|
|
|
+ // data: [item]
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // map.get(hazardCheckCode2).data.push(item);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // let finalResult = Array.from(map.values());
|
|
|
+ // this.$set(this, 'dataList', finalResult);
|
|
|
+ }
|
|
|
+ },
|
|
|
/********************** 检查相关查询 **********************/
|
|
|
async securityAppCheckSetOptionList(maxList) {
|
|
|
let self = this;
|
|
@@ -337,8 +371,6 @@
|
|
|
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
/********************** 复查相关查询 **********************/
|
|
|
async securityAppCheckSetOptionGetReviewList(maxList) {
|
|
|
let self = this;
|
|
@@ -407,10 +439,72 @@
|
|
|
children: list
|
|
|
})));
|
|
|
this.$set(this, 'checkList', JSON.parse(JSON.stringify(list)));
|
|
|
+ this.$set(this, 'cascadeButtonType', 1);
|
|
|
+ this.$set(this, 'levelListTwo', null);
|
|
|
+ this.$set(this, 'levelListThree', null);
|
|
|
})
|
|
|
|
|
|
|
|
|
},
|
|
|
+ newCascadeData(maxList, minList) {
|
|
|
+ for (let i = 0; i < maxList.length; i++) {
|
|
|
+ for (let o = 0; o < maxList[i].children.length; o++) {
|
|
|
+ for (let x = 0; x < minList.length; x++) {
|
|
|
+ if (maxList[i].children[o].id == minList[x].parentId) {
|
|
|
+ //一级
|
|
|
+ maxList[i].hazardCheckPro = minList[x].id
|
|
|
+ maxList[i].hazardCheckCode = minList[x].code
|
|
|
+ maxList[i].hazardCheckName = minList[x].name
|
|
|
+ maxList[i].hazardCheckPro2 = maxList[i].children[o].id
|
|
|
+ maxList[i].hazardCheckCode2 = maxList[i].children[o].code
|
|
|
+ maxList[i].hazardCheckName2 = maxList[i].children[o].name
|
|
|
+ maxList[i].hazardCheckPro1 = maxList[i].id
|
|
|
+ maxList[i].hazardCheckCode1 = maxList[i].code
|
|
|
+ maxList[i].hazardCheckName1 = maxList[i].name
|
|
|
+ //二级
|
|
|
+ maxList[i].children[o].hazardCheckPro = minList[x].id
|
|
|
+ maxList[i].children[o].hazardCheckCode = minList[x].code
|
|
|
+ maxList[i].children[o].hazardCheckName = minList[x].name
|
|
|
+ maxList[i].children[o].hazardCheckPro2 = maxList[i].children[o].id
|
|
|
+ maxList[i].children[o].hazardCheckCode2 = maxList[i].children[o].code
|
|
|
+ maxList[i].children[o].hazardCheckName2 = maxList[i].children[o].name
|
|
|
+ maxList[i].children[o].hazardCheckPro1 = maxList[i].id
|
|
|
+ maxList[i].children[o].hazardCheckCode1 = maxList[i].code
|
|
|
+ maxList[i].children[o].hazardCheckName1 = maxList[i].name
|
|
|
+ //三级
|
|
|
+ minList[x].level = 3;
|
|
|
+ minList[x].hazardCheckPro = minList[x].id
|
|
|
+ minList[x].hazardCheckCode = minList[x].code
|
|
|
+ minList[x].hazardCheckName = minList[x].name
|
|
|
+ minList[x].hazardCheckPro2 = maxList[i].children[o].id
|
|
|
+ minList[x].hazardCheckCode2 = maxList[i].children[o].code
|
|
|
+ minList[x].hazardCheckName2 = maxList[i].children[o].name
|
|
|
+ minList[x].hazardCheckPro1 = maxList[i].id
|
|
|
+ minList[x].hazardCheckCode1 = maxList[i].code
|
|
|
+ minList[x].hazardCheckName1 = maxList[i].name
|
|
|
+ minList[x].hazardCheckPointList = minList[x].mainPoint.split('#')
|
|
|
+ if (maxList[i].children[o].children) {
|
|
|
+ maxList[i].children[o].children.push(minList[x])
|
|
|
+ } else {
|
|
|
+ maxList[i].children[o].children = [minList[x]]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let list = this.getCascaderData(JSON.parse(JSON.stringify(maxList)), 3)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$set(this, 'levelListOne', JSON.parse(JSON.stringify({
|
|
|
+ level: 0,
|
|
|
+ children: list
|
|
|
+ })));
|
|
|
+ this.$set(this, 'dataList', JSON.parse(JSON.stringify(list)));
|
|
|
+ this.$set(this, 'checkList', JSON.parse(JSON.stringify(list)));
|
|
|
+ this.$set(this, 'cascadeButtonType', 1);
|
|
|
+ this.$set(this, 'levelListTwo', null);
|
|
|
+ this.$set(this, 'levelListThree', null);
|
|
|
+ })
|
|
|
+ },
|
|
|
/********************** 检查项格式处理 **********************/
|
|
|
getCascaderData(list, type) {
|
|
|
let self = this
|
|
@@ -577,6 +671,13 @@
|
|
|
background-color: #fff;
|
|
|
border-bottom: 1rpx solid #E0E0E0;
|
|
|
}
|
|
|
+ .for-box-n-b {
|
|
|
+ margin: 0 21rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ line-height: 40rpx;
|
|
|
+ padding: 20rpx 0;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|