This commit is contained in:
2026-10-26 13:43:20 +08:00
parent 3ffa706b89
commit fe6d925e7c
5 changed files with 52 additions and 19 deletions
@@ -1,9 +1,10 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { ProcurementDetail, ProcurementFee } from '../api/procurement'
import { dateTime, feePurposes, feeStatus, feeTone, feeTotals, measurement, money, productHref, text } from '../procurementPresentation'
import { directionLabel, regionText, dateTime, feePurposes, feeStatus, feeTone, feeTotals, measurement, money, productHref, text } from '../procurementPresentation'
const props = defineProps<{ detail: ProcurementDetail }>()
const t = (text: string) => regionText(text, props.detail.order.procurementDirection)
const totals = computed(() => feeTotals(props.detail.fees))
const progress = computed(() => props.detail.progress.filter(step => step.key !== 'closed_at' || step.completedAt))
const ended = computed(() => ['REJECTED', 'CANCELLED', 'EXCEPTION_CLOSED', 'SHIPPED_TO_CUSTOMER'].includes(props.detail.order.status))
@@ -22,7 +23,7 @@ const hasPending = computed(() => props.detail.fees.some(f => f.walletStatus?.en
</section>
<section class="procurement-section" aria-label="商品与收件信息">
<h3>商品与收件信息</h3>
<dl class="procurement-grid">
<dl class="procurement-grid"><div><dt>采购方向</dt><dd>{{ directionLabel(detail.order.procurementDirection) }}</dd></div>
<div><dt>采购品类</dt><dd>{{ detail.order.purchaseCategory }}</dd></div>
<div><dt>商品名称</dt><dd>{{ detail.order.productName }}</dd></div>
<div><dt>商品规格</dt><dd>{{ text(detail.order.productSpecification) }}</dd></div>
@@ -30,16 +31,16 @@ const hasPending = computed(() => props.detail.fees.some(f => f.walletStatus?.en
<div><dt>下单预算单价</dt><dd>{{ money(detail.order.budgetUnitPrice, detail.order.currency) }}</dd></div>
<div><dt>货款预算总上限</dt><dd>{{ money(detail.budget.totalAmount, detail.budget.currency) }}</dd></div>
<div><dt>预算核验时间</dt><dd>{{ dateTime(detail.budget.authorizedAt) }}</dd></div>
<div><dt>预计到海外仓</dt><dd>{{ dateTime(detail.order.estimatedArrivalAt) }}</dd></div>
<div><dt>{{ t('预计到海外仓') }}</dt><dd>{{ dateTime(detail.order.estimatedArrivalAt) }}</dd></div>
<div><dt>收件人</dt><dd>{{ detail.order.contactName }}</dd></div>
<div><dt>联系电话</dt><dd>{{ detail.order.contactPhone }}</dd></div>
<div class="wide"><dt>下单收货地址</dt><dd>{{ detail.order.receivingAddress }}</dd></div>
<div class="wide"><dt>实际海外仓</dt><dd>{{ text(detail.order.actualWarehouseName) }}<span v-if="detail.order.actualWarehouseCode">({{ detail.order.actualWarehouseCode }})</span></dd></div>
<div class="wide"><dt>{{ t('实际海外仓') }}</dt><dd>{{ text(detail.order.actualWarehouseName) }}<span v-if="detail.order.actualWarehouseCode">({{ detail.order.actualWarehouseCode }})</span></dd></div>
<div class="wide"><dt>商品链接</dt><dd><a v-if="productHref(detail.order.productUrl)" :href="productHref(detail.order.productUrl)" target="_blank" rel="noopener noreferrer">{{ detail.order.productUrl }}</a><span v-else>{{ text(detail.order.productUrl) }}</span></dd></div>
</dl>
</section>
<section class="procurement-section" aria-label="已确认海外装箱清单">
<h3>已确认海外装箱清单</h3>
<section class="procurement-section" :aria-label="t('已确认海外装箱清单')">
<h3>{{ t('已确认海外装箱清单') }}</h3>
<el-table :data="detail.boxes" border stripe empty-text="尚无已确认的装箱清单" row-key="cartonNo">
<el-table-column prop="cartonNo" label="箱号" min-width="170" />
<el-table-column label="箱内商品" min-width="200"><template #default>{{ detail.order.productName }}</template></el-table-column>
@@ -52,7 +53,7 @@ const hasPending = computed(() => props.detail.fees.some(f => f.walletStatus?.en
<section class="procurement-section" aria-label="两段实际运输">
<h3>两段实际运输</h3>
<el-table :data="detail.shipments" border stripe empty-text="尚无实际交寄记录">
<el-table-column label="运输段" width="150"><template #default="{ row }">{{ row.leg === 'OVERSEAS' ? '国际段 · 海外交寄' : '国内段 · 寄客户' }}</template></el-table-column>
<el-table-column label="运输段" width="150"><template #default="{ row }">{{ t(row.leg === 'OVERSEAS' ? '国际段 · 海外交寄' : '国内段 · 寄客户') }}</template></el-table-column>
<el-table-column prop="shipmentNo" label="交寄编号" min-width="270" />
<el-table-column prop="cartonNo" label="原箱号" min-width="150" />
<el-table-column prop="quantity" label="实际件数" width="110" />
@@ -73,7 +74,7 @@ const hasPending = computed(() => props.detail.fees.some(f => f.walletStatus?.en
<p class="procurement-note">预算上限仅包含样品货款。预估国际运费只冻结、不直接扣款,最终以实际费用结算;表内保留原费用、追加及退款记录。</p>
<el-table :data="detail.fees" border stripe empty-text="尚无已核定费用" row-key="feeNo">
<el-table-column prop="feeNo" label="费用编号" min-width="270" />
<el-table-column label="费用用途" min-width="145"><template #default="{ row }">{{ feePurposes[row.purpose] || '待核定' }}</template></el-table-column>
<el-table-column label="费用用途" min-width="145"><template #default="{ row }">{{ t(feePurposes[row.purpose] || '待核定') }}</template></el-table-column>
<el-table-column prop="name" label="费用名称" min-width="145" />
<el-table-column label="原币金额" min-width="130"><template #default="{ row }">{{ money(row.originalAmount, row.originalCurrency) }}</template></el-table-column>
<el-table-column label="汇率 / 月份" min-width="150"><template #default="{ row }">{{ measurement(row.exchangeRate, 6) }}<br /><small>{{ text(row.exchangeRateMonth) }}</small></template></el-table-column>