|
|
@ -59,7 +59,6 @@ Page({ |
|
|
|
Request.get(getStructuresUsers(), {}) |
|
|
|
] |
|
|
|
).then(res => { |
|
|
|
console.log(res, 222); |
|
|
|
const [issue, strucUser] = res |
|
|
|
const nextData = { |
|
|
|
...issue, |
|
|
@ -81,7 +80,6 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(nextData); |
|
|
|
this.setData({ |
|
|
|
data: nextData, |
|
|
|
isPlanState: tabIndex == 0 && (issue.state == 1 || issue.state == 3), |
|
|
@ -100,7 +98,6 @@ Page({ |
|
|
|
}) |
|
|
|
if (issue.state > 1) { |
|
|
|
let maintenancePersonIndex = focusPerson.findIndex(f => f.id == issue.repairPerson.id) |
|
|
|
console.log(maintenancePersonIndex, issue.startTime, moment(issue.startTime).format('YYYY-MM-DD HH:mm:ss')); |
|
|
|
this.setData({ |
|
|
|
maintenancePersonIndex: maintenancePersonIndex, |
|
|
|
maintenancePersonDepartmentShow: maintenancePersonIndex >= 0 ? focusPerson[maintenancePersonIndex].department.name : '', |
|
|
@ -143,7 +140,6 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
onMaintenancePersonPopupChange (e) { |
|
|
|
console.log(e); |
|
|
|
if (e.target.dataset.type == 'zhijian') { |
|
|
|
this.setData({ |
|
|
|
qualityPersonIndex: e.detail.value |
|
|
@ -165,7 +161,6 @@ Page({ |
|
|
|
|
|
|
|
closePlanStartTimePopup (e) { |
|
|
|
this.setData({ planStartTimePopupShow: false }) |
|
|
|
console.log(e.target, this.data.planStartTime); |
|
|
|
if (e.target.dataset.option == 'cancel') { |
|
|
|
// this.setData({ planStartTime: '' })
|
|
|
|
} else if (e.target.dataset.option == 'confirmed') { |
|
|
@ -176,7 +171,6 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
onPlanStartTimeChange (event) { |
|
|
|
console.log(event); |
|
|
|
this.setData({ |
|
|
|
planStartTime: event.detail, |
|
|
|
}) |
|
|
@ -204,7 +198,6 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
onInputChange (e) { |
|
|
|
console.log(e); |
|
|
|
this.setData({ |
|
|
|
[e.target.dataset.type]: e.detail.value |
|
|
|
}) |
|
|
@ -212,7 +205,6 @@ Page({ |
|
|
|
|
|
|
|
// 预览图片
|
|
|
|
previewImg: function (e) { |
|
|
|
console.log(e); |
|
|
|
const { index, itemindex, type } = e.currentTarget.dataset |
|
|
|
const imgs = type == 'point' ? this.data.data.PatrolRecord.points.inspectContent[itemindex].imgs : this.data[type]; |
|
|
|
const newImgs = imgs.map(i => this.data.imgServer + i); |
|
|
@ -281,10 +273,8 @@ Page({ |
|
|
|
success: (resp) => { |
|
|
|
wx.hideLoading(); |
|
|
|
success++; |
|
|
|
console.log(resp); |
|
|
|
let str = JSON.parse(resp.data) // 返回的结果,可能不同项目结果不一样
|
|
|
|
str = str.uploaded |
|
|
|
console.log(str); |
|
|
|
if (imgs.length >= 20) { |
|
|
|
return false; |
|
|
|
} else { |
|
|
@ -316,7 +306,6 @@ Page({ |
|
|
|
|
|
|
|
// 删除图片
|
|
|
|
deleteImg: function (e) { |
|
|
|
console.log(e); |
|
|
|
const { type, index } = e.currentTarget.dataset |
|
|
|
const imgs = this.data[type] |
|
|
|
imgs.splice(index, 1); |
|
|
@ -326,12 +315,11 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
confirm (e) { |
|
|
|
console.log(e); |
|
|
|
const { approve } = e.target.dataset |
|
|
|
const { state } = this.data.data |
|
|
|
const { |
|
|
|
shootingid, focusPerson, |
|
|
|
maintenancePersonIndex, maintenancePersonDepartmentShow, qualityPersonIndex, planStartTime, planEndTime, maintenanceRequirement, |
|
|
|
maintenancePersonIndex, maintenancePersonDepartmentShow, qualityPersonIndex, planStartTime, planEndTime, planStartTimeShow, planEndTimeShow, maintenanceRequirement, |
|
|
|
userInfo, planApproval, |
|
|
|
repair, repairImgs, |
|
|
|
checkDesc, checkImgs |
|
|
@ -350,6 +338,14 @@ Page({ |
|
|
|
endTime: moment(planEndTime).format(), |
|
|
|
repairAsk: maintenanceRequirement, |
|
|
|
} |
|
|
|
if (!this.mustInput({ |
|
|
|
repairPerson: focusPerson[maintenancePersonIndex], |
|
|
|
checkPerson: focusPerson[qualityPersonIndex], |
|
|
|
startTime: planStartTimeShow, |
|
|
|
endTime: planStartTimeShow, |
|
|
|
})) { |
|
|
|
return |
|
|
|
} |
|
|
|
successMsg = '制定完成' |
|
|
|
} else if (state == 2) { |
|
|
|
confirmData = { |
|
|
@ -401,6 +397,26 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
mustInput (field) { |
|
|
|
let fieldMap = { |
|
|
|
repairPerson: '维修人', |
|
|
|
checkPerson: '质检人', |
|
|
|
startTime: '计划开始时间', |
|
|
|
endTime: '计划结束时间', |
|
|
|
} |
|
|
|
let fieldKeys = Object.keys(field) |
|
|
|
for (let k of fieldKeys) { |
|
|
|
if (!field[k]) { |
|
|
|
wx.showToast({ |
|
|
|
title: `请填写/选择 ${fieldMap[k]}`, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
return true |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
*/ |
|
|
|