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>
<view class="custom-pop-head"> <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="title">{{ investigationDetailTitle }}</view>
<view class="right" @click="investigationDetailHandle">确认</view> <view class="right" @click="investigationDetailHandle">确认</view>
</view> </view>

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

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

Loading…
Cancel
Save