更新
This commit is contained in:
@@ -403,6 +403,11 @@ export function prescriptionOrderLogisticsTrace(params: {
|
||||
return request.get({ url: '/tcm.prescriptionOrder/logisticsTrace', params })
|
||||
}
|
||||
|
||||
/** 直接调用京东官方物流接口刷新轨迹并落库(绕过快递100缓存) */
|
||||
export function prescriptionOrderLogisticsJdUpdate(params: { id: number }) {
|
||||
return request.post({ url: '/tcm.prescriptionOrder/logisticsJdUpdate', params })
|
||||
}
|
||||
|
||||
export function prescriptionOrderDetail(params: { id: number }) {
|
||||
return request.get({ url: '/tcm.prescriptionOrder/detail', params })
|
||||
}
|
||||
|
||||
@@ -1353,6 +1353,17 @@
|
||||
<template #icon><el-icon><Refresh /></el-icon></template>
|
||||
刷新轨迹
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['tcm.prescriptionOrder/logisticsTrace']"
|
||||
type="warning"
|
||||
plain
|
||||
size="default"
|
||||
:loading="jdLogisticsUpdating"
|
||||
@click="updateJdLogistics"
|
||||
>
|
||||
<template #icon><el-icon><Van /></el-icon></template>
|
||||
京东接口更新
|
||||
</el-button>
|
||||
<div class="ml-2 flex items-center gap-4 border-l pl-4 border-gray-200">
|
||||
<el-link :href="detailOfficialUrls.sf" target="_blank" type="primary" :underline="false" class="text-[13px]">顺丰官网</el-link>
|
||||
<el-link :href="detailOfficialUrls.jd" target="_blank" type="primary" :underline="false" class="text-[13px]">京东物流</el-link>
|
||||
@@ -2870,7 +2881,7 @@
|
||||
<script lang="ts" setup name="prescriptionOrderList">
|
||||
import { computed, onMounted, reactive, ref, nextTick, watch, defineAsyncComponent } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { Refresh, Loading, ArrowDown, InfoFilled, QuestionFilled, Search, Calendar, Document, Link as LinkIcon, Wallet } from '@element-plus/icons-vue'
|
||||
import { Refresh, Loading, ArrowDown, InfoFilled, QuestionFilled, Search, Calendar, Document, Link as LinkIcon, Wallet, Van } from '@element-plus/icons-vue'
|
||||
import ListTimeFilter from '@/components/list-time-filter/index.vue'
|
||||
import { useListTimeFilter } from '@/hooks/useListTimeFilter'
|
||||
import {
|
||||
@@ -2883,6 +2894,7 @@ import {
|
||||
prescriptionOrderPaidPayOrders,
|
||||
prescriptionOrderWithdraw,
|
||||
prescriptionOrderLogisticsTrace,
|
||||
prescriptionOrderLogisticsJdUpdate,
|
||||
prescriptionOrderShip,
|
||||
prescriptionOrderLogs,
|
||||
prescriptionOrderUpdateAmount,
|
||||
@@ -4181,6 +4193,7 @@ function formatOrderTime(v: unknown) {
|
||||
|
||||
const detailLogisticsExpress = ref<string>('auto')
|
||||
const logisticsTraceLoading = ref(false)
|
||||
const jdLogisticsUpdating = ref(false)
|
||||
const logisticsTracePayload = ref<Record<string, any> | null>(null)
|
||||
/** 顺丰/快递100:与运单一致的收件手机后四位(可覆盖订单收货手机) */
|
||||
const logisticsTracePhoneTail = ref('')
|
||||
@@ -4414,6 +4427,26 @@ async function fetchLogisticsTrace() {
|
||||
}
|
||||
}
|
||||
|
||||
// 直接请求京东官方物流接口,刷新并落库轨迹后重新读取展示
|
||||
async function updateJdLogistics() {
|
||||
const orderId = Number(detailData.value?.id)
|
||||
const trackingNumber = String(detailData.value?.tracking_number || '').trim()
|
||||
if (!orderId || !trackingNumber) {
|
||||
feedback.msgWarning('当前订单未填写快递单号')
|
||||
return
|
||||
}
|
||||
jdLogisticsUpdating.value = true
|
||||
try {
|
||||
const res: any = await prescriptionOrderLogisticsJdUpdate({ id: orderId })
|
||||
feedback.msgSuccess(res?.message || '京东物流轨迹已更新')
|
||||
await fetchLogisticsTrace()
|
||||
} catch (e: any) {
|
||||
feedback.msgError(e?.message || '京东物流更新失败')
|
||||
} finally {
|
||||
jdLogisticsUpdating.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const patchRxPatientVisible = ref(false)
|
||||
const patchRxPatientSaving = ref(false)
|
||||
const patchRxPatientFormRef = ref<FormInstance>()
|
||||
|
||||
Reference in New Issue
Block a user