|
|
@ -47,7 +47,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad (options) { |
|
|
|
onLoad(options) { |
|
|
|
const { shootingid, tabIndex } = options |
|
|
|
if (shootingid) { |
|
|
|
this.setData({ |
|
|
@ -69,14 +69,20 @@ Page({ |
|
|
|
points: { |
|
|
|
...issue.PatrolRecord.points, |
|
|
|
inspectContent: (() => { |
|
|
|
let inspectContent = [] |
|
|
|
for (let k in issue.PatrolRecord.points.inspectContent) { |
|
|
|
inspectContent.push({ |
|
|
|
...issue.PatrolRecord.points.inspectContent[k], |
|
|
|
itemName: k |
|
|
|
}) |
|
|
|
// 1.1 版本(2023-10-18)之前 dataList.points.inspectContent 为 Object, 1.1版本因增加点位关联设备改为 Array
|
|
|
|
const priorToV1_1 = moment(issue.PatrolRecord.inspectionTime).isBefore(moment('2023-10-18')) |
|
|
|
if (priorToV1_1) { |
|
|
|
let inspectContent = [] |
|
|
|
for (let k in issue.PatrolRecord.points.inspectContent) { |
|
|
|
inspectContent.push({ |
|
|
|
...issue.PatrolRecord.points.inspectContent[k], |
|
|
|
name: k, |
|
|
|
}) |
|
|
|
} |
|
|
|
return [{ checkItems: inspectContent }] |
|
|
|
} else { |
|
|
|
return issue.PatrolRecord.points.inspectContent |
|
|
|
} |
|
|
|
return inspectContent |
|
|
|
})() |
|
|
|
} |
|
|
|
} |
|
|
@ -88,6 +94,7 @@ Page({ |
|
|
|
isRepair: tabIndex == 0 && (issue.state == 4 || issue.state == 7), |
|
|
|
isCheck: tabIndex == 0 && issue.state == 5, |
|
|
|
}) |
|
|
|
console.log(nextData, 'nextData') |
|
|
|
this.setData({ |
|
|
|
strucFocusUser: { |
|
|
|
...strucUser, |
|
|
@ -135,13 +142,13 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onPointItemCollapseActiveChange (event) { |
|
|
|
onPointItemCollapseActiveChange(event) { |
|
|
|
this.setData({ |
|
|
|
pointItemCollapseActiveNames: event.detail, |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
onMaintenancePersonPopupChange (e) { |
|
|
|
onMaintenancePersonPopupChange(e) { |
|
|
|
if (e.target.dataset.type == 'zhijian') { |
|
|
|
this.setData({ |
|
|
|
qualityPersonIndex: e.detail.value |
|
|
@ -155,13 +162,13 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
showPlanStartTimePopup () { |
|
|
|
showPlanStartTimePopup() { |
|
|
|
if (this.data.isPlanState) { |
|
|
|
this.setData({ planStartTimePopupShow: true }) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
closePlanStartTimePopup (e) { |
|
|
|
closePlanStartTimePopup(e) { |
|
|
|
this.setData({ planStartTimePopupShow: false }) |
|
|
|
if (e.target.dataset.option == 'cancel') { |
|
|
|
// this.setData({ planStartTime: '' })
|
|
|
@ -172,19 +179,19 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onPlanStartTimeChange (event) { |
|
|
|
onPlanStartTimeChange(event) { |
|
|
|
this.setData({ |
|
|
|
planStartTime: event.detail, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
showPlanEndTimePopup () { |
|
|
|
showPlanEndTimePopup() { |
|
|
|
if (this.data.isPlanState) { |
|
|
|
this.setData({ planEndTimePopupShow: true }) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
closePlanEndTimePopup (e) { |
|
|
|
closePlanEndTimePopup(e) { |
|
|
|
this.setData({ planEndTimePopupShow: false }) |
|
|
|
if (e.target.dataset.option == 'confirmed') { |
|
|
|
this.setData({ |
|
|
@ -193,13 +200,13 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onPlanEndTimeChange (event) { |
|
|
|
onPlanEndTimeChange(event) { |
|
|
|
this.setData({ |
|
|
|
planEndTime: event.detail, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onInputChange (e) { |
|
|
|
onInputChange(e) { |
|
|
|
let value = e.detail.value |
|
|
|
if (e.target.dataset.type === 'cost' && !/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) { |
|
|
|
wx.showToast({ |
|
|
@ -215,8 +222,8 @@ Page({ |
|
|
|
|
|
|
|
// 预览图片
|
|
|
|
previewImg: function (e) { |
|
|
|
const { index, itemindex, type } = e.currentTarget.dataset |
|
|
|
const imgs = type == 'point' ? this.data.data.PatrolRecord.points.inspectContent[itemindex].imgs : this.data[type]; |
|
|
|
const { index, itemindex, deviceidx, type } = e.currentTarget.dataset |
|
|
|
const imgs = type == 'point' ? this.data.data.PatrolRecord.points.inspectContent[deviceidx].checkItems[itemindex].imgs : this.data[type]; |
|
|
|
const newImgs = imgs.map(i => this.data.imgServer + i); |
|
|
|
wx.previewImage({ |
|
|
|
current: newImgs[index], |
|
|
@ -324,7 +331,7 @@ Page({ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async confirm (e) { |
|
|
|
async confirm(e) { |
|
|
|
const { approve } = e.target.dataset |
|
|
|
const { state } = this.data.data |
|
|
|
const { |
|
|
@ -465,7 +472,7 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
mustInput (field) { |
|
|
|
mustInput(field) { |
|
|
|
let fieldMap = { |
|
|
|
repairPerson: '维修人', |
|
|
|
checkPerson: '质检人', |
|
|
@ -488,49 +495,49 @@ Page({ |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
*/ |
|
|
|
onReady () { |
|
|
|
onReady() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
*/ |
|
|
|
onShow () { |
|
|
|
onShow() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
*/ |
|
|
|
onHide () { |
|
|
|
onHide() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面卸载 |
|
|
|
*/ |
|
|
|
onUnload () { |
|
|
|
onUnload() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
|
|
*/ |
|
|
|
onPullDownRefresh () { |
|
|
|
onPullDownRefresh() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
|
*/ |
|
|
|
onReachBottom () { |
|
|
|
onReachBottom() { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户点击右上角分享 |
|
|
|
*/ |
|
|
|
onShareAppMessage () { |
|
|
|
onShareAppMessage() { |
|
|
|
|
|
|
|
} |
|
|
|
}) |