继续完善居家服务模块
This commit is contained in:
@@ -60,7 +60,7 @@ import { computed, ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import type { DeliveryOrderType, DeliveryServiceItemType, DeliveryServiceRecordType } from '@/types/delivery.uts'
|
||||
import { getServiceOrderDetail, submitServiceRecord } from '@/services/deliveryService.uts'
|
||||
import { completeServiceOrder, getServiceOrderDetail, startServiceOrder, submitServiceRecord } from '@/services/deliveryService.uts'
|
||||
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
import { getDeliveryRouteParam } from '@/utils/deliveryRoute.uts'
|
||||
|
||||
@@ -145,6 +145,9 @@ async function submitRecordAction() {
|
||||
if (!validateRecord()) {
|
||||
return
|
||||
}
|
||||
if (order.value != null && order.value.status != 'in_service' && order.value.status != 'serving') {
|
||||
await startServiceOrder(orderId.value)
|
||||
}
|
||||
const record = {
|
||||
id: 'record-' + orderId.value,
|
||||
orderId: orderId.value,
|
||||
@@ -176,7 +179,8 @@ async function submitRecordAction() {
|
||||
updatedAt: new Date().toISOString().replace('T', ' ').substring(0, 19)
|
||||
} as DeliveryServiceRecordType
|
||||
await submitServiceRecord(orderId.value, record)
|
||||
uni.showToast({ title: '服务记录已提交', icon: 'success' })
|
||||
await completeServiceOrder(orderId.value)
|
||||
uni.showToast({ title: '服务记录已提交,等待验收', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({ url: '/pages/mall/delivery/orders/detail?id=' + orderId.value })
|
||||
}, 300)
|
||||
|
||||
Reference in New Issue
Block a user