Commit 7acfef98 by wusiyi

feat: podus代发货添加完成发货按钮

parent 292ff35d
......@@ -543,3 +543,13 @@ export function statusPushApi(params: (string | number)[]) {
params,
)
}
// 完成发货
export function completeDeliveryApi(params: {
orderIdList: (string | number)[]
}) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderUs/completeDelivery`,
params,
)
}
......@@ -404,6 +404,11 @@
转至待排单
</ElButton>
</span>
<span v-if="status === 'WAIT_SHIPMENT'" class="item">
<ElButton type="primary" @click="completeDelivery()"
>完成发货</ElButton
>
</span>
<span
v-if="status === 'WAIT_SHIPMENT' || status === 'CREATE_LOGISTICS'"
class="item"
......@@ -2278,6 +2283,7 @@ import {
interceptUpdateApi,
rejectToApi,
statusPushApi,
completeDeliveryApi,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
......@@ -4829,6 +4835,58 @@ const statusPush = async () => {
}
}
// 完成发货
const completeDelivery = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择订单')
}
try {
await ElMessageBox.confirm('确定完成发货吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
} catch (e) {
return
}
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await completeDeliveryApi({
orderIdList: selection.value.map((item) => item.id),
})
if (res.code !== 200) return
resultInfo.value =
(res.data as {
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}[]) || []
if (
Array.isArray(res.data) &&
(res.data as { status: boolean }[]).some((item) => !item.status)
) {
resultRefs.value?.showDialog()
} else {
search()
loadTabData()
}
ElMessage.success('操作成功')
// search()
// loadTabData()
} catch (e) {
resultInfo.value = []
console.error(e)
} finally {
loading.close()
}
}
const tempChinaLogs = ref<LogListData[]>([])
function changeChinaTime(zone: string) {
logList.value = tempChinaLogs.value.map((el) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment