zhangqun 11 months ago
parent e82eb94708
commit 67c8899459
  1. 2
      pages/investigation/components/investigation-item2.vue
  2. 149
      pages/investigation/components/problem-tree-item.vue
  3. 123
      pages/investigation/task.vue

@ -2,7 +2,7 @@
<view>
<view class="custom-pop-head">
<view class="left" @click="showInvestigationDetail = false">取消</view>
<view class="left" @click="$emit('show',false)">取消</view>
<view class="title">{{ investigationDetailTitle }}</view>
<view class="right" @click="investigationDetailHandle">确认</view>
</view>

@ -1,34 +1,49 @@
<template>
<view>
<view class="breadcrumb" style="min-height: 120rpx">
<!-- <uni-breadcrumb separator=">" style="overflow-x: auto">-->
<!-- <uni-breadcrumb-item >-->
<!-- {{route.itemname}}-->
<!-- </uni-breadcrumb-item>-->
<!-- </uni-breadcrumb>-->
<!-- <uni-breadcrumb separator=">" style="overflow-x: auto">-->
<!-- <uni-breadcrumb-item >-->
<!-- {{route.itemname}}-->
<!-- </uni-breadcrumb-item>-->
<!-- </uni-breadcrumb>-->
<scroll-view class="breadcrumb" >
<view class="item" v-for="(route,index) in problemTreeSelectConfirmList" :key="index" @click="handleClick(route)">
{{route.itemname}} {{index === problemTreeSelectConfirmList.length - 1 ? '' : '>' }}
<scroll-view class="breadcrumb">
<view
class="item"
v-for="(route, index) in problemTreeSelectConfirmList"
:key="index"
@click="handleClick(route)"
>
{{ route.itemname }}
{{ index === problemTreeSelectConfirmList.length - 1 ? "" : ">" }}
</view>
</scroll-view>
</view>
<view class="investigation-item"
:class="problemTreeSelect === index ? 'active' : ''"
v-for="(item, index) in problemTreeSelectList"
:key="item.itemname"
@click="handleSelectProblem(item, index)"
<view
class="investigation-item"
:class="problemTreeSelect === item.id ? 'active' : ''"
v-for="(item, index) in problemTreeSelectList"
:key="item.itemname"
@click="handleSelectProblem(item, index)"
>
<text>{{ item.itemname }}</text>
<uni-icons type="checkmarkempty" size="24" :style="{color: '#2663BF', visibility: problemTreeSelect === index ? 'visible' : 'hidden'}"/>
<uni-icons
type="checkmarkempty"
size="24"
:style="{
color: '#2663BF',
visibility: problemTreeSelect === item.id ? 'visible' : 'hidden',
}"
/>
</view>
</view>
</template>
<script>
export default {
//
// hiddenDangerList2
components: {},
props: ["hiddenDangerList2"],
data() {
return {
// js
@ -36,59 +51,86 @@ export default {
originList: [],
problemTreeSelect: null,
problemTreeSelectList: [],
problemTreeSelectConfirmList: []
}
problemTreeSelectConfirmList: [],
};
},
//
onLoad(e) {
console.log(12312312312)
console.log(12312312312);
// this.getData()
},
mounted(){
this.getData()
mounted() {
this.getData();
},
//
onShow() {
},
onShow() {},
//
computed: {},
//
methods: {
getData(){
this.$request.globalRequest('/hiddenDanger/highDanger/getDangerItems', {}, 'GET').then(res => {
if(res.code == 200){
this.originList = res.result
this.problemTreeSelectList = res.result
}
})
getData() {
this.$request
.globalRequest("/hiddenDanger/highDanger/getDangerItems", {}, "GET")
.then((res) => {
if (res.code == 200) {
this.originList = res.result;
this.problemTreeSelectList = res.result;
if(this.hiddenDangerList2.length>0) {
this.problemTreeSelectConfirmList = this.hiddenDangerList2
console.log(this.hiddenDangerList2)
this.problemTreeSelectList = this.hiddenDangerList2[1].children
this.problemTreeSelect = this.hiddenDangerList2[2].id
}
}
});
},
//
skipPage(even){
this.$.open(even)
skipPage(even) {
this.$.open(even);
},
handleSelectProblem(item, index){
this.problemTreeSelectConfirmList[Number(item.nlevel) - 1] = item
if (item.children && item.children.length > 0){
this.problemTreeSelectList = item.children
handleSelectProblem(item, index) {
this.problemTreeSelectConfirmList[Number(item.nlevel) - 1] = item;
if (item.children && item.children.length > 0) {
this.problemTreeSelectList = item.children;
} else {
this.problemTreeSelect = index
this.problemTreeSelect = item.id;
}
this.$emit('select', this.problemTreeSelectConfirmList)
this.$emit("select", this.problemTreeSelectConfirmList);
},
handleClick(item){
console.log(item)
const selectIndex = this.problemTreeSelectConfirmList.indexOf(item)
const index = selectIndex - 1 < 0 ? this.originList.indexOf(item) : this.problemTreeSelectConfirmList[selectIndex - 1].children.indexOf(item)
this.problemTreeSelectList = selectIndex - 1 < 0 ? this.originList : this.problemTreeSelectConfirmList[selectIndex - 1].children
handleClick(item) {
console.log(item);
const selectIndex = this.problemTreeSelectConfirmList.indexOf(item);
const index =
selectIndex - 1 < 0
? this.originList.indexOf(item)
: this.problemTreeSelectConfirmList[selectIndex - 1].children.indexOf(
item
);
this.problemTreeSelectList =
selectIndex - 1 < 0
? this.originList
: this.problemTreeSelectConfirmList[selectIndex - 1].children;
this.problemTreeSelect = index;
}
},
onReady() {
if (item.nlevel == 1) {
this.problemTreeSelectConfirmList = JSON.parse(
JSON.stringify([this.problemTreeSelectConfirmList[0]])
);
}
if (item.nlevel == 2) {
this.problemTreeSelectConfirmList = JSON.parse(
JSON.stringify([
this.problemTreeSelectConfirmList[0],
this.problemTreeSelectConfirmList[1],
])
);
}
console.log(this.problemTreeSelectConfirmList);
},
},
onReady() {},
//
onUnload() {
},
onUnload() {},
//
onPullDownRefresh() {
//
@ -97,19 +139,18 @@ export default {
}, 1500);
},
//
onReachBottom() {
},
}
onReachBottom() {},
};
</script>
<style>
page {
background:#FFFFFF;
background: #ffffff;
}
</style>
<style lang="scss" scoped>
.investigation-item {
margin:0 auto 20rpx;
margin: 0 auto 20rpx;
width: 90%;
border-radius: 8rpx;
padding: 20rpx;
@ -119,7 +160,7 @@ page {
align-items: center;
overflow: hidden;
&.active {
background: #DFEBF8;
background: #dfebf8;
}
}
.breadcrumb {

@ -262,7 +262,11 @@
<InvestigationItem @select="select2"></InvestigationItem>
</u-popup>
<u-popup :show="showInvestigation2" @close="showInvestigation2 = false">
<InvestigationItem2 :json="showInvestigation2Item" @select="select3"></InvestigationItem2>
<InvestigationItem2
:json="showInvestigation2Item"
@show="showInvestigation2 = false"
@select="select3"
></InvestigationItem2>
</u-popup>
<!-- <u-popup :show="showInvestigation" @close="showInvestigation = false">
<view class="custom-pop-head">
@ -379,9 +383,7 @@
<view class="problem-item">
<view style="display: flex; justify-content: space-between">
<view style="width: 80%">
{{ item.bigCategoryName }}-{{ item.smallCategoryName }}-{{
item.hdTermName
}}
{{ item.dangerProblem }}
</view>
<view>
<view class="check" @click="onHiddenDangerList(item)">
@ -402,13 +404,7 @@
</view>
</view>
<u-col :span="12">
<view
class="problem-item add"
@click="
showProblem = true;
hiddenDangerList2 = [];
"
>
<view class="problem-item add" @click="add">
<uni-icons
type="plusempty"
size="24"
@ -435,16 +431,12 @@
<view class="right" @click="investigationHandle2">确认</view>
</view>
<view class="problem-box">
<view class="detail-item" @click="add">
<view class="detail-item" @click="addFL">
<uni-forms-item
label="隐患问题"
label-position="top"
label-width="100px"
style="display: flex; align-items: center"
@click="
showProblemTreeSelect = true;
showProblem = false;
"
/>
<view v-if="this.hiddenDangerList2.length > 0"
@ -452,20 +444,17 @@
this.hiddenDangerList2[1].itemname
}}/{{ this.hiddenDangerList2[2].itemname }}</view
>
<!-- <u-input
placeholder="请选择"
border="none"
type="textarea"
v-else
/> -->
<view
v-else
@click="
showProblemTreeSelect = true;
showProblem = false;
"
>请选择</view
>
<view v-else-if="this.dangerProblem">{{
this.dangerProblem
}}</view>
<view v-else>请选择</view>
<!-- -->
</view>
<view class="detail-item">
@ -521,14 +510,16 @@
@click="
showProblemTreeSelect = false;
showProblem = true;
hiddenDangerList2 = [];
"
>取消</view
>
<view class="title">选择隐患</view>
<view class="right" @click="showProblemTreeSelectHandle">确认</view>
</view>
<ProblemTreeItem @select="select"></ProblemTreeItem>
<ProblemTreeItem
:hiddenDangerList2="hiddenDangerList2"
@select="select"
></ProblemTreeItem>
</u-popup>
</view>
<view class="blank" />
@ -701,12 +692,14 @@ export default {
problemTreeSelectConfirmList: [],
hiddenDangerList: [],
hiddenDangerList2: [],
hiddenDangerList3: [],
dangerProblem: "",
};
},
methods: {
showInvestigationTag(v) {
this.showInvestigation2 = true;
this.showInvestigation2Item = v
this.showInvestigation2Item = v;
},
select2(v, list) {
this.showInvestigation = false;
@ -726,28 +719,32 @@ export default {
},
select3(v) {
this.investigationSelectList.map((r) => {
if (r.nid == v.nid) {
r = v
r = v;
}
});
this.showInvestigation2Item = {}
this.showInvestigation2 = false
this.showInvestigation2Item = {};
this.showInvestigation2 = false;
},
onHiddenDangerList(v) {
this.showProblem = true
console.log(this.problemTreeSelectConfirmList)
this.showProblem = true;
this.dangerProblem = v.dangerProblem;
this.describe = {
bigCategory: "",
smallCategory: "",
hdTerm: "",
bigCategory: v.bigCategory,
smallCategory: v.smallCategory,
hdTerm: v.hdTerm,
hdDesc: v.hdDesc,
hdPic: "",
hdPic: v.hdPic,
hdInfo: v.hdInfo,
};
// this.fileList = [v.hdPic];
},
add() {
this.showProblemTreeSelect = true;
this.showProblem = false;
this.showProblem = true;
this.hiddenDangerList2 = [];
this.dangerProblem = '';
this.describe = {
bigCategory: "",
smallCategory: "",
@ -758,6 +755,19 @@ export default {
};
this.fileList = [];
},
addFL() {
this.showProblemTreeSelect = true;
this.showProblem = false;
// this.describe = {
// bigCategory: "",
// smallCategory: "",
// hdTerm: "",
// hdDesc: "",
// hdPic: "",
// hdInfo: "",
// };
// this.fileList = [];
},
getBaseData(businessId) {
this.$request
.globalRequest(
@ -800,14 +810,14 @@ export default {
)
.then((res) => {
if (res.code === 200) {
this.investigationSelectList.map(r => {
r.extraConfigs = []
res.result.map(m =>{
if(r.nid == m.scenesId){
r.extraConfigs.push(m)
this.investigationSelectList.map((r) => {
r.extraConfigs = [];
res.result.map((m) => {
if (r.nid == m.scenesId) {
r.extraConfigs.push(m);
}
})
})
});
});
}
});
}
@ -831,7 +841,7 @@ export default {
)
.then((res) => {
if (res.code === 200) {
console.log(res.result)
console.log(res.result);
this.hiddenDangerList = res.result;
}
});
@ -851,8 +861,17 @@ export default {
// this.problemTreeSelectConfirmList.push(item)
},
showProblemTreeSelectHandle() {
this.showProblemTreeSelect = false;
this.showProblem = true;
if (this.hiddenDangerList3.length == 3) {
this.showProblemTreeSelect = false;
this.showProblem = true;
this.hiddenDangerList2 = JSON.parse(
JSON.stringify(this.hiddenDangerList3)
);
}
},
select(v) {
this.hiddenDangerList3 = v;
},
//
deletePic(event) {
@ -893,7 +912,6 @@ export default {
}
},
investigationHandle2() {
this.hiddenDangerList.push({
bigCategory: this.hiddenDangerList2[0].id,
bigCategoryName: this.hiddenDangerList2[0].itemname,
@ -963,6 +981,7 @@ export default {
});
},
async afterRead(event, key) {
console.log(key)
// multiple true , file
const id = this.uuid();
this[key].push({
@ -997,9 +1016,6 @@ export default {
);
}
},
select(v) {
this.hiddenDangerList2 = v;
},
submit(temporary) {
console.log(this.formData);
console.log(this.investigationSelectList);
@ -1009,7 +1025,8 @@ export default {
r.extraConfigs.map((s) => {
s.scenesId = r.nid;
if (s.type == 4) {
s.standar = s.fileList && s.fileList.length > 0 ? s.fileList[0].url : "";
s.standar =
s.fileList && s.fileList.length > 0 ? s.fileList[0].url : "";
}
s.fileList = "";
s.nid = "";

Loading…
Cancel
Save