存在隐患 新增编辑bug修复

main
limingtao 11 months ago
parent 67c8899459
commit b65cc08bc8
  1. 19
      pages/investigation/components/problem-tree-item.vue
  2. 77
      pages/investigation/task.vue
  3. 2
      pages/logIn/logIn.vue

@ -51,6 +51,7 @@ export default {
originList: [], originList: [],
problemTreeSelect: null, problemTreeSelect: null,
problemTreeSelectList: [], problemTreeSelectList: [],
problemTreeSelectAllList: [],
problemTreeSelectConfirmList: [], problemTreeSelectConfirmList: [],
}; };
}, },
@ -74,14 +75,15 @@ export default {
.globalRequest("/hiddenDanger/highDanger/getDangerItems", {}, "GET") .globalRequest("/hiddenDanger/highDanger/getDangerItems", {}, "GET")
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.originList = res.result; this.originList =JSON.parse(JSON.stringify( res.result));
this.problemTreeSelectList = res.result; this.problemTreeSelectList =JSON.parse(JSON.stringify( res.result));
if(this.hiddenDangerList2.length>0) { this.problemTreeSelectAllList=JSON.parse(JSON.stringify( res.result))
this.problemTreeSelectConfirmList = this.hiddenDangerList2 // if(this.hiddenDangerList2.length>0) {
console.log(this.hiddenDangerList2) // // this.problemTreeSelectConfirmList = this.hiddenDangerList2
this.problemTreeSelectList = this.hiddenDangerList2[1].children // console.log(this.hiddenDangerList2)
this.problemTreeSelect = this.hiddenDangerList2[2].id // this.problemTreeSelectList = this.hiddenDangerList2[1].children
} // this.problemTreeSelect = this.hiddenDangerList2[2].id
// }
} }
}); });
}, },
@ -90,6 +92,7 @@ export default {
this.$.open(even); this.$.open(even);
}, },
handleSelectProblem(item, index) { handleSelectProblem(item, index) {
console.log(11111)
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;

@ -376,7 +376,7 @@
<view class="title">存在隐患</view> <view class="title">存在隐患</view>
<u-row :gutter="0" justify="flex-start" style="flex-wrap: wrap"> <u-row :gutter="0" justify="flex-start" style="flex-wrap: wrap">
<view <view
v-for="item in hiddenDangerList" v-for="(item,index) in hiddenDangerList"
:key="item" :key="item"
style="width: 100%" style="width: 100%"
> >
@ -386,7 +386,7 @@
{{ item.dangerProblem }} {{ item.dangerProblem }}
</view> </view>
<view> <view>
<view class="check" @click="onHiddenDangerList(item)"> <view class="check" @click="onHiddenDangerList(item,index)">
<image <image
style="width: 10px; height: 16px" style="width: 10px; height: 16px"
src="../../static/scimg/right6.png" src="../../static/scimg/right6.png"
@ -438,11 +438,10 @@
label-width="100px" label-width="100px"
style="display: flex; align-items: center" style="display: flex; align-items: center"
/> />
<view v-if="hiddenDangerList2.length > 0"
<view v-if="this.hiddenDangerList2.length > 0" >{{ hiddenDangerList2[0].itemname }}/{{
>{{ this.hiddenDangerList2[0].itemname }}/{{ hiddenDangerList2[1].itemname
this.hiddenDangerList2[1].itemname }}/{{ hiddenDangerList2[2].itemname }}</view
}}/{{ this.hiddenDangerList2[2].itemname }}</view
> >
<!-- <u-input <!-- <u-input
@ -451,8 +450,8 @@
type="textarea" type="textarea"
v-else v-else
/> --> /> -->
<view v-else-if="this.dangerProblem">{{ <view v-else-if="dangerProblem">{{
this.dangerProblem dangerProblem
}}</view> }}</view>
<view v-else>请选择</view> <view v-else>请选择</view>
<!-- --> <!-- -->
@ -694,6 +693,11 @@ export default {
hiddenDangerList2: [], hiddenDangerList2: [],
hiddenDangerList3: [], hiddenDangerList3: [],
dangerProblem: "", dangerProblem: "",
//
addInvestigationInfo:{
type:'',
index:0
}
}; };
}, },
methods: { methods: {
@ -726,8 +730,11 @@ export default {
this.showInvestigation2Item = {}; this.showInvestigation2Item = {};
this.showInvestigation2 = false; this.showInvestigation2 = false;
}, },
onHiddenDangerList(v) { onHiddenDangerList(v,index) {
console.log(this.problemTreeSelectConfirmList) this.addInvestigationInfo={
type:'edit',
index:index
}
this.showProblem = true; this.showProblem = true;
this.dangerProblem = v.dangerProblem; this.dangerProblem = v.dangerProblem;
this.describe = { this.describe = {
@ -738,10 +745,22 @@ export default {
hdPic: v.hdPic, hdPic: v.hdPic,
hdInfo: v.hdInfo, hdInfo: v.hdInfo,
}; };
console.log(v)
let newArr=[]
try{
newArr= v.dangerProblem.split('/')
}catch(e){
newArr=['','','']
}
this.hiddenDangerList2=[{id:v.bigCategory,itemname:newArr[0]},
{id:v.smallCategory,itemname:newArr[1]},
{id:v.hdTerm,itemname:newArr[2]}]
console.log(this.hiddenDangerList2)
// this.fileList = [v.hdPic]; // this.fileList = [v.hdPic];
}, },
add() { add() {
// this.addInvestigationInfo.type='add'
this.$set(this.addInvestigationInfo,'type','add')
this.showProblem = true; this.showProblem = true;
this.hiddenDangerList2 = []; this.hiddenDangerList2 = [];
this.dangerProblem = ''; this.dangerProblem = '';
@ -868,6 +887,7 @@ export default {
JSON.stringify(this.hiddenDangerList3) JSON.stringify(this.hiddenDangerList3)
); );
} }
console.log(this.hiddenDangerList2)
}, },
select(v) { select(v) {
@ -912,7 +932,8 @@ export default {
} }
}, },
investigationHandle2() { investigationHandle2() {
this.hiddenDangerList.push({ if(this.hiddenDangerList2.length>0){
let form={
bigCategory: this.hiddenDangerList2[0].id, bigCategory: this.hiddenDangerList2[0].id,
bigCategoryName: this.hiddenDangerList2[0].itemname, bigCategoryName: this.hiddenDangerList2[0].itemname,
smallCategory: this.hiddenDangerList2[1].id, smallCategory: this.hiddenDangerList2[1].id,
@ -922,7 +943,15 @@ export default {
hdDesc: this.describe.hdDesc, hdDesc: this.describe.hdDesc,
hdPic: this.fileList.url, hdPic: this.fileList.url,
hdInfo: this.describe.hdInfo, hdInfo: this.describe.hdInfo,
}); dangerProblem:this.hiddenDangerList2[0].itemname+'/'+ this.hiddenDangerList2[1].itemname+'/'+ this.hiddenDangerList2[2].itemname
}
if(this.addInvestigationInfo.type=='add'){
this.hiddenDangerList.push(form);
}else{
this.$set(this.hiddenDangerList,this.addInvestigationInfo.index,form)
}
}
this.showProblem = false; this.showProblem = false;
}, },
investigationDetailHandle() { investigationDetailHandle() {
@ -1019,7 +1048,13 @@ export default {
submit(temporary) { submit(temporary) {
console.log(this.formData); console.log(this.formData);
console.log(this.investigationSelectList); console.log(this.investigationSelectList);
console.log(this.hiddenDangerList); console.log({
...this.formData,
businessId: this.businessId,
extraConfigs: extraConfigs,
describe: this.hiddenDangerList,
temporary,
});
let extraConfigs = []; let extraConfigs = [];
this.investigationSelectList.map((r) => { this.investigationSelectList.map((r) => {
r.extraConfigs.map((s) => { r.extraConfigs.map((s) => {
@ -1049,11 +1084,11 @@ export default {
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
this.$.toast("保存成功"); this.$.toast("保存成功");
setTimeout(() => { // setTimeout(() => {
uni.navigateBack({ // uni.navigateBack({
delta: 1, // 1 // delta: 1, // 1
}); // });
}, 1000); // }, 1000);
// this.data = res.result; // this.data = res.result;
// this.rname = this.data[0].name; // this.rname = this.data[0].name;
@ -1310,6 +1345,8 @@ export default {
width: 100%; width: 100%;
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
max-height: calc(100vh - 100px);
overflow: auto;
.detail-item { .detail-item {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }

@ -167,7 +167,7 @@ export default {
this.isDisabled = true this.isDisabled = true
this.$request.globalRequest(url, datas, 'POST').then(res => { this.$request.globalRequest(url, datas, 'POST').then(res => {
if(res.code === 200){ if(res.code === 200){
this.$.toast('成功') this.$.toast('登录成功')
this.$.setData('token',res.result) this.$.setData('token',res.result)
this.$.setData('userInfo', { username: res.result }) this.$.setData('userInfo', { username: res.result })
setTimeout(() => { setTimeout(() => {

Loading…
Cancel
Save