|
|
@ -17,7 +17,7 @@ Page({ |
|
|
|
data: { |
|
|
|
scenePointId: null, |
|
|
|
planList: null, |
|
|
|
index: null, |
|
|
|
planListVisible: true, |
|
|
|
dataList: '', |
|
|
|
imgs: [], //上传图片
|
|
|
|
imgUrl: getApp().globalData.imgUrl, |
|
|
@ -28,11 +28,17 @@ Page({ |
|
|
|
address: '', //当前位置
|
|
|
|
}, |
|
|
|
|
|
|
|
bindPickerChange: function (e) { |
|
|
|
onPickerChange(e) { |
|
|
|
const { key } = e.currentTarget.dataset; |
|
|
|
const { value } = e.detail; |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
index: e.detail.value |
|
|
|
}) |
|
|
|
const curPlan = this.data.planList[e.detail.value]; |
|
|
|
[`${key}Visible`]: false, |
|
|
|
[`${key}Value`]: value, |
|
|
|
[`${key}Text`]: value.join(' '), |
|
|
|
}); |
|
|
|
|
|
|
|
const curPlan = this.data.planList[e.detail.columns[0].index]; |
|
|
|
let points = curPlan.points.map(e => { |
|
|
|
return e.name |
|
|
|
}).join('、') |
|
|
@ -45,6 +51,17 @@ Page({ |
|
|
|
this.getPatrolRecord(); |
|
|
|
}, |
|
|
|
|
|
|
|
onPickerCancel(e) { |
|
|
|
const { key } = e.currentTarget.dataset; |
|
|
|
this.setData({ |
|
|
|
[`${key}Visible`]: false, |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
onPlanListPicker() { |
|
|
|
this.setData({ planListVisible: true }); |
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeTwo(e) { |
|
|
|
this.setData({ |
|
|
|
changeTwo: e.detail.value |
|
|
@ -398,14 +415,18 @@ Page({ |
|
|
|
const userInfo = wx.getStorageSync('userInfo'); |
|
|
|
Request.get(getPatrolPlan(), { userId: userInfo.id }).then(res => { |
|
|
|
wx.hideLoading(); |
|
|
|
const pointPlan = res.rows.filter(plan => { |
|
|
|
let pointPlan = res.rows.filter(plan => { |
|
|
|
for (const point of plan.points) { |
|
|
|
if (point.id == scenePointId) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
}) |
|
|
|
}).map(p => ({ |
|
|
|
label: p.name, |
|
|
|
value: p.name, |
|
|
|
...p |
|
|
|
})) |
|
|
|
if (!pointPlan.length) { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|