feat: 完成服务页面

This commit is contained in:
苟川东 2025-04-19 21:53:42 +08:00
parent 6e9c8f59ff
commit 9373d8aa30
2 changed files with 39 additions and 1 deletions

View File

@ -79,6 +79,12 @@ class Api {
let url = `${config.host}/worker/order_dispatch/arrivedOnSite`;
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

View File

@ -164,7 +164,33 @@ const submit = throttle(() => {
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)
@ -217,6 +243,7 @@ const selectOfflineTotalType = () => {
});
}
//
const validate = () => {
if (submitData.complete_images.length === 0) {
helpers.showToast('请上传完成图片')
@ -228,6 +255,11 @@ const validate = () => {
return false
}
if (submitData.final_payment_method === 1 && submitData.offline_total_type === null) {
helpers.showToast('请选择尾款收款方')
return false
}
if (submitData.amount === '') {
helpers.showToast('请输入收款金额')
return false