This commit is contained in:
2026-08-06 13:56:04 +08:00
parent 6736893128
commit a813426588
35 changed files with 2822 additions and 489 deletions
@@ -0,0 +1,61 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import { getPlatformUnifiedOrder, type UnifiedOrderDetailResource } from '@/modules/unified-orders/api/unifiedOrders'
import { getApiErrorDetails, type ApiErrorDetails } from '@/shared/api/http'
import ApiErrorMeta from '@/shared/components/ApiErrorMeta.vue'
import LoadErrorState from '@/shared/components/LoadErrorState.vue'
import UnifiedOrderWorkflowPanel from '@/modules/unified-orders/workflows/components/UnifiedOrderWorkflowPanel.vue'
const route = useRoute()
const detail = ref<UnifiedOrderDetailResource | null>(null)
const loading = ref(false)
const error = ref<ApiErrorDetails | null>(null)
const orderId = computed(() => String(route.params.orderId || ''))
const tenantId = computed(() => typeof route.query.tenantId === 'string' ? route.query.tenantId : '')
const summary = computed(() => detail.value?.summary || null)
async function load() {
if (!orderId.value || !tenantId.value) {
error.value = { message: '订单作业上下文缺少订单号或客户标识' }
return
}
loading.value = true
error.value = null
try {
detail.value = await getPlatformUnifiedOrder(tenantId.value, orderId.value)
} catch (cause) {
detail.value = null
error.value = getApiErrorDetails(cause, '订单作业上下文加载失败')
} finally {
loading.value = false
}
}
onMounted(() => { void load() })
</script>
<template>
<section class="workflow-page">
<LoadErrorState v-if="error" title="后半程作业暂时无法加载" :message="error.message" :loading="loading" @retry="load">
<template #details><ApiErrorMeta :details="error" /></template>
</LoadErrorState>
<UnifiedOrderWorkflowPanel
v-else-if="summary && summary.inboundId"
:tenant-id="tenantId"
:inbound-id="summary.inboundId"
:main-status="summary.mainStatus"
:inbound-version="summary.inboundVersion"
:picking-version="summary.loading?.pickingVersion"
:delivery-tracking-no="summary.delivery?.trackingNo"
@updated="load"
/>
<el-empty v-else-if="!loading" description="该订单尚未生成入库作业,暂无后半程操作" />
<el-skeleton v-else :rows="5" animated />
</section>
</template>
<style scoped>
.workflow-page { display: grid; gap: 16px; }
</style>