|
@ -148,7 +148,7 @@ Page({ |
|
|
onLoadOptions(e) { |
|
|
onLoadOptions(e) { |
|
|
console.log('onLoadOptions', e.detail) |
|
|
console.log('onLoadOptions', e.detail) |
|
|
const { value } = e.detail |
|
|
const { value } = e.detail |
|
|
wx.showLoading({ mask: true }) |
|
|
wx.showLoading({ mask: true, title: "加载中..." }) |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
pid: value[value.length - 1], |
|
|
pid: value[value.length - 1], |
|
|
}) |
|
|
}) |
|
@ -156,7 +156,7 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
onLoadComeAddress(e) { |
|
|
onLoadComeAddress(e) { |
|
|
const { value } = e.detail |
|
|
const { value } = e.detail |
|
|
wx.showLoading({ mask: true }) |
|
|
wx.showLoading({ mask: true, title: "加载中..." }) |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
pid: value[value.length - 1], |
|
|
pid: value[value.length - 1], |
|
|
}) |
|
|
}) |
|
@ -251,58 +251,57 @@ Page({ |
|
|
this.showToast('来到本地时间不能为空') |
|
|
this.showToast('来到本地时间不能为空') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.setData({ |
|
|
// this.setData({
|
|
|
lock: true, |
|
|
// nowAddress: this.data.nowAddress.split('-'),
|
|
|
}) |
|
|
// comeFromAddress: this.data.comeFromAddress.split('-'),
|
|
|
this.setData({ |
|
|
// })
|
|
|
nowAddress: this.data.nowAddress.split('-'), |
|
|
|
|
|
comeFromAddress: this.data.comeFromAddress.split('-'), |
|
|
|
|
|
}) |
|
|
|
|
|
let params = { |
|
|
let params = { |
|
|
name: this.data.name.trim(''), |
|
|
name: this.data.name.trim(''), |
|
|
mobile: this.data.phone.trim(''), |
|
|
mobile: this.data.phone.trim(''), |
|
|
idCard: this.data.card.trim(''), |
|
|
idCard: this.data.card.trim(''), |
|
|
nowAddressCode: this.data.nowAddressValue.join(','), |
|
|
nowAddressCode: this.data.nowAddressValue.join(','), |
|
|
nowAddressName: this.data.nowAddress.join('-'), |
|
|
nowAddressName: this.data.nowAddress, |
|
|
nowAddressDetail: this.data.detailAddress, |
|
|
nowAddressDetail: this.data.detailAddress, |
|
|
comeAddressCode: this.data.comeFromAddressValue.join(','), |
|
|
comeAddressCode: this.data.comeFromAddressValue.join(','), |
|
|
comeAddressName: this.data.comeFromAddress.join('-'), |
|
|
comeAddressName: this.data.comeFromAddress, |
|
|
comeDate: this.data.localTime, |
|
|
comeDate: this.data.localTime, |
|
|
backDate: this.data.backTime, |
|
|
backDate: this.data.backTime, |
|
|
note: this.data.actContent.trim(''), |
|
|
note: this.data.actContent.trim(''), |
|
|
} |
|
|
} |
|
|
|
|
|
const _this = this |
|
|
wx.showModal({ |
|
|
wx.showModal({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
|
content: '是否要上报行程', |
|
|
content: '是否要上报行程', |
|
|
success(res) { |
|
|
success(res) { |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
|
|
|
_this.data.lock = true |
|
|
|
|
|
wx.showLoading({ |
|
|
|
|
|
title: '提交中...' |
|
|
|
|
|
}) |
|
|
saveTripInfo(params) |
|
|
saveTripInfo(params) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
if (res.code == 0 && res.msg == 'success') { |
|
|
if (res.code == 0 && res.msg == 'success') { |
|
|
this.showToast('提交成功') |
|
|
_this.showToast('提交成功') |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
this.setData({ |
|
|
_this.data.lock = false |
|
|
lock: false, |
|
|
|
|
|
}) |
|
|
|
|
|
wx.switchTab({ |
|
|
wx.switchTab({ |
|
|
url: '/pages/index/index', |
|
|
url: '/pages/index/index', |
|
|
}) |
|
|
}) |
|
|
}, 1000) |
|
|
}, 1000) |
|
|
} else { |
|
|
} else { |
|
|
this.setData({ |
|
|
_this.data.lock = false |
|
|
lock: false, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}).catch(() => { |
|
|
.catch((err) => { |
|
|
_this.data.lock = false |
|
|
this.setData({ |
|
|
|
|
|
lock: false, |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}) |
|
|
} else if (res.cancel) { |
|
|
} else if (res.cancel) { |
|
|
console.log('用户点击取消') |
|
|
console.log('用户点击取消') |
|
|
|
|
|
_this.data.lock = false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
fail() { |
|
|
|
|
|
_this.data.lock = false |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
onInputValue(e) { |
|
|
onInputValue(e) { |
|
|