feat: 完成服务页面
This commit is contained in:
parent
6e9c8f59ff
commit
9373d8aa30
|
|
@ -79,6 +79,12 @@ class Api {
|
||||||
let url = `${config.host}/worker/order_dispatch/arrivedOnSite`;
|
let url = `${config.host}/worker/order_dispatch/arrivedOnSite`;
|
||||||
return fetch.request('postFrom', url, data, true)
|
return fetch.request('postFrom', url, data, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 完成服务
|
||||||
|
static completeService(data) {
|
||||||
|
let url = `${config.host}/worker/order_dispatch/completeService`;
|
||||||
|
return fetch.request('postFrom', url, data, true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Api
|
export default Api
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,33 @@ const submit = throttle(() => {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(submitData)
|
uni.showModal({
|
||||||
|
title: '提示信息',
|
||||||
|
confirmText: '确认',
|
||||||
|
content: '确认已完成所有服务?',
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '提交中'
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = helpers.deepObj(submitData)
|
||||||
|
data.complete_images = (submitData.complete_images).join(',')
|
||||||
|
data.order_dispatch_id = id.value
|
||||||
|
|
||||||
|
api.completeService(data).then(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({
|
||||||
|
title: '已完成服务',
|
||||||
|
icon: "success"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
helpers.jumpToPage('order-info', `id=${id.value}`, 'redirectTo')
|
||||||
|
}, 1000)
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
const id = ref(null)
|
const id = ref(null)
|
||||||
|
|
@ -217,6 +243,7 @@ const selectOfflineTotalType = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//验证提交数据
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
if (submitData.complete_images.length === 0) {
|
if (submitData.complete_images.length === 0) {
|
||||||
helpers.showToast('请上传完成图片')
|
helpers.showToast('请上传完成图片')
|
||||||
|
|
@ -228,6 +255,11 @@ const validate = () => {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (submitData.final_payment_method === 1 && submitData.offline_total_type === null) {
|
||||||
|
helpers.showToast('请选择尾款收款方')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (submitData.amount === '') {
|
if (submitData.amount === '') {
|
||||||
helpers.showToast('请输入收款金额')
|
helpers.showToast('请输入收款金额')
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user