|
|
|
@@ -56,6 +56,10 @@ function feeStatusLabel(value: string) { return ({ PENDING_REVIEW: '待审核',
|
|
|
|
|
function isSingleLineBusinessField(field: DetailField) { return field.label === '入仓码' || field.label === '集装箱号' }
|
|
|
|
|
|
|
|
|
|
const referenceValue = computed(() => lastMileOrderReference(detail.value?.order.orderNo, '订单编码待补充'))
|
|
|
|
|
const isReturnOrder = computed(() => detail.value?.order.orderType === 'RETURN_RELABEL')
|
|
|
|
|
const showReturnForecast = computed(() => isReturnOrder.value && (detail.value?.returnReceipt?.order.status
|
|
|
|
|
? detail.value.returnReceipt.order.status !== 'COMPLETED'
|
|
|
|
|
: ['PENDING_REVIEW', 'PENDING_RECEIPT', 'PARTIALLY_RECEIVED', 'REJECTED', 'CANCELLED'].includes(detail.value?.order.currentStatus || '')))
|
|
|
|
|
const orderFields = computed<DetailField[]>(() => {
|
|
|
|
|
const order = detail.value?.order
|
|
|
|
|
const fields: DetailField[] = [
|
|
|
|
@@ -93,7 +97,7 @@ const containerFields = computed<DetailField[]>(() => {
|
|
|
|
|
{ label: '实际到港时间', value: formatOverseasDateTime(order?.actualArrivalAt) },
|
|
|
|
|
{ label: '预计到仓时间', value: formatOverseasDateTime(order?.estimatedWarehouseAt) },
|
|
|
|
|
{ label: '货柜节点', value: containerNodeLabel(order?.containerNode) },
|
|
|
|
|
]
|
|
|
|
|
].filter(field => !isReturnOrder.value || field.label !== '箱数')
|
|
|
|
|
})
|
|
|
|
|
const commercialLink = computed(() => businessOrderLink(detail.value?.order.businessSource?.businessType, detail.value?.order.businessSource?.businessOrderNo, access.can))
|
|
|
|
|
const basicFields = computed(() => [...orderFields.value, ...containerFields.value])
|
|
|
|
@@ -104,7 +108,8 @@ const overviewFields = computed(() => {
|
|
|
|
|
return [
|
|
|
|
|
{ label: '客户', value: text(order?.customerName) },
|
|
|
|
|
{ label: '海外仓', value: text(order?.overseasWarehouseName) },
|
|
|
|
|
{ label: warehouseTransfer ? (hasReceivedPackages ? '实收总箱数' : '客户预报总箱数') : '总箱数', value: (hasReceivedPackages ? order?.receivedPackageCount : order?.packageCount) == null ? '—' : `${hasReceivedPackages ? order?.receivedPackageCount : order?.packageCount} 箱` },
|
|
|
|
|
...(isReturnOrder.value ? [{ label: showReturnForecast.value ? '预报总件数' : '实收总件数', value: `${showReturnForecast.value ? detail.value?.returnReceipt?.order.expectedQuantity ?? order?.productQuantity ?? 0 : detail.value?.returnReceipt?.order.receivedQuantity ?? order?.productQuantity ?? 0} 件` }]
|
|
|
|
|
: [{ label: warehouseTransfer ? (hasReceivedPackages ? '实收总箱数' : '客户预报总箱数') : '总箱数', value: (hasReceivedPackages ? order?.receivedPackageCount : order?.packageCount) == null ? '—' : `${hasReceivedPackages ? order?.receivedPackageCount : order?.packageCount} 箱` }]),
|
|
|
|
|
{ label: '总托数', value: order?.palletCount == null ? '—' : order.palletCount + ' 托' },
|
|
|
|
|
{ label: '货物毛重', value: order?.grossWeightKg == null ? '—' : order.grossWeightKg + ' kg' },
|
|
|
|
|
{ label: '货物净重', value: order?.netWeightKg == null ? '—' : order.netWeightKg + ' kg' },
|
|
|
|
@@ -130,7 +135,10 @@ const documents = computed<DocumentRow[]>(() => {
|
|
|
|
|
.filter((item) => item[1]).map(([type, number]) => ({ type: String(type), number: String(number), createdAt: '—', quote: '—' } as DocumentRow))
|
|
|
|
|
.concat((order.relabelApplications || []).map(application => ({ type: '换标单', number: application.relabelNo, createdAt: formatOverseasDateTime(application.createdAt), quote: '—', status: relabelApplicationStatusLabel(application.status), quantity: application.quantity })))
|
|
|
|
|
})
|
|
|
|
|
const cargo = computed<CargoRow[]>(() => (detail.value?.cargo || []).map((item) => ({
|
|
|
|
|
const cargo = computed<CargoRow[]>(() => showReturnForecast.value && detail.value?.returnReceipt?.items?.length
|
|
|
|
|
? detail.value.returnReceipt.items.map(item => ({ id: item.skuCode, sku: item.skuCode, productName: text(item.productNameZh),
|
|
|
|
|
quantity: item.expectedQuantity, pallets: 0, cartons: 0, weight: 0, volume: 0 }))
|
|
|
|
|
: (detail.value?.cargo || []).map((item) => ({
|
|
|
|
|
id: String(item.id), sku: text(item.skuCode), productName: text(item.productNameZh), pallets: Number(item.palletCount || 0),
|
|
|
|
|
cartons: Number(item.packageCount || 0), quantity: Number(item.productQuantity || 0), weight: Number(item.grossWeightKg || 0), volume: Number(item.volumeCbm || 0),
|
|
|
|
|
})))
|
|
|
|
@@ -149,12 +157,16 @@ const logs = computed<LogRow[]>(() => {
|
|
|
|
|
return [...statusRows, ...operationRows].sort((left, right) => right.sortAt.localeCompare(left.sortAt))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const cargoColumns: DataTableColumn[] = [
|
|
|
|
|
const cargoColumns = computed<DataTableColumn[]>(() => showReturnForecast.value ? [
|
|
|
|
|
{ key: 'sku', prop: 'sku', label: 'SKU', minWidth: 150 },
|
|
|
|
|
{ key: 'productName', prop: 'productName', label: '中文品名', minWidth: 180 },
|
|
|
|
|
{ key: 'quantity', prop: 'quantity', label: '预报件数', width: 120, align: 'right' },
|
|
|
|
|
] : [
|
|
|
|
|
{ key: 'sku', prop: 'sku', label: 'SKU', minWidth: 150 }, { key: 'productName', prop: 'productName', label: '中文品名', minWidth: 180 },
|
|
|
|
|
{ key: 'pallets', prop: 'pallets', label: '托数', width: 100, align: 'right' }, { key: 'cartons', prop: 'cartons', label: '箱数', width: 100, align: 'right' },
|
|
|
|
|
{ key: 'quantity', prop: 'quantity', label: '件数', width: 100, align: 'right' }, { key: 'weight', prop: 'weight', label: '重量(kg)', width: 120, align: 'right' },
|
|
|
|
|
{ key: 'volume', prop: 'volume', label: '体积(m³)', width: 120, align: 'right' },
|
|
|
|
|
]
|
|
|
|
|
])
|
|
|
|
|
const documentColumns: DataTableColumn[] = [
|
|
|
|
|
{ key: 'status', prop: 'status', label: '状态', minWidth: 130 }, { key: 'quantity', prop: 'quantity', label: '换标数量(件)', minWidth: 130 },
|
|
|
|
|
{ key: 'type', prop: 'type', label: '单据类型', minWidth: 150 }, { key: 'number', prop: 'number', label: '单据编号', minWidth: 200 },
|
|
|
|
|