All checks were successful
Build and Deploy Front / deploy (push) Successful in 5m40s
Co-authored-by: Cursor <cursoragent@cursor.com>
212 lines
12 KiB
TypeScript
212 lines
12 KiB
TypeScript
/**
|
||
* 运单管理列表字段配置
|
||
* 覆盖 OrderOutput 接口标量字段 + 前端展平/别名字段,并支持接口行动态发现
|
||
*/
|
||
import type { OrderListColumnDef } from '../myOrders/columnConfig';
|
||
import { MY_ORDERS_COLUMN_CATALOG } from '../myOrders/columnConfig';
|
||
import { getOrderColumnLabelZh } from '../orderColumnLabelsZh';
|
||
|
||
export const WAYBILL_MANAGE_COLUMN_STORAGE_KEY = 'oms.order.waybillManage.columnSchemes';
|
||
|
||
const L = (key: string) => `order.waybillManage.table.${key}`;
|
||
const M = (key: string) => `order.myOrders.table.${key}`;
|
||
|
||
/** OrderOutput 及列表展平后可选列(不含嵌套集合) */
|
||
export const WAYBILL_MANAGE_COLUMN_CATALOG: OrderListColumnDef[] = [
|
||
// 管理端常用别名(优先排前,便于默认方案)
|
||
{ key: 'customerName', labelKey: M('customerName'), width: 120 },
|
||
{ key: 'customerCode', labelKey: M('customerCode'), width: 110 },
|
||
{ key: 'waybillNo', labelKey: M('waybillNo'), width: 200 },
|
||
{ key: 'customerOrderNo', labelKey: M('customerOrderNo'), width: 150 },
|
||
{ key: 'trackingNo', labelKey: M('trackingNo'), width: 160 },
|
||
{ key: 'downstreamServiceNo', labelKey: M('downstreamServiceNo'), width: 180 },
|
||
{ key: 'shippingMethod', labelKey: M('shippingMethod'), width: 120 },
|
||
{ key: 'serviceChannel', labelKey: M('serviceChannel'), width: 120 },
|
||
{ key: 'consignee', labelKey: M('consignee'), width: 90 },
|
||
{ key: 'consigneePhone', labelKey: M('consigneePhone'), width: 110 },
|
||
{ key: 'consigneeCity', labelKey: M('consigneeCity'), width: 90 },
|
||
{ key: 'consigneeAddress', labelKey: M('consigneeAddress'), width: 180 },
|
||
{ key: 'consigneePostcode', labelKey: M('consigneePostcode'), width: 110 },
|
||
{ key: 'consigneeState', labelKey: M('consigneeState'), width: 100 },
|
||
{ key: 'ioss', labelKey: M('ioss'), width: 100 },
|
||
{ key: 'eori', labelKey: M('eori'), width: 100 },
|
||
|
||
// OrderOutput 标量
|
||
{ key: 'id', labelKey: L('id'), width: 80 },
|
||
{ key: 'clientNo', labelKey: M('customerOrderNo'), width: 150 },
|
||
{ key: 'trackNo', labelKey: M('trackingNo'), width: 160 },
|
||
{ key: 'serviceNo', labelKey: M('waybillNo'), width: 200 },
|
||
{ key: 'downstreamServiceNo', labelKey: M('downstreamServiceNo'), width: 180 },
|
||
{ key: 'productCode', labelKey: L('productCode'), width: 110 },
|
||
{ key: 'productName', labelKey: M('shippingMethod'), width: 120 },
|
||
{ key: 'channelCode', labelKey: L('channelCode'), width: 110 },
|
||
{ key: 'channelName', labelKey: M('serviceChannel'), width: 120 },
|
||
{ key: 'downstreamSupplierName', labelKey: L('downstreamSupplierName'), width: 140 },
|
||
{ key: 'downstreamSupplierCode', labelKey: L('downstreamSupplierCode'), width: 140 },
|
||
{ key: 'downstreamAppKey', labelKey: L('downstreamAppKey'), width: 140 },
|
||
{ key: 'downstreamAppId', labelKey: L('downstreamAppId'), width: 110 },
|
||
{ key: 'channelForecastCode', labelKey: L('channelForecastCode'), width: 130 },
|
||
{ key: 'maxTimeliness', labelKey: L('maxTimeliness'), width: 100 },
|
||
{ key: 'salesProductRulesVersion', labelKey: L('salesProductRulesVersion'), width: 150 },
|
||
{ key: 'salesProductPriceVersion', labelKey: L('salesProductPriceVersion'), width: 150 },
|
||
{ key: 'forecastReceivableAmount', labelKey: L('forecastReceivableAmount'), width: 120 },
|
||
{ key: 'forecastPayableAmount', labelKey: L('forecastPayableAmount'), width: 120 },
|
||
{ key: 'hasInsurance', labelKey: L('hasInsurance'), width: 90 },
|
||
{ key: 'hasAllocationTrace', labelKey: L('hasAllocationTrace'), width: 110 },
|
||
{ key: 'allocationScheme', labelKey: L('allocationScheme'), width: 120 },
|
||
{ key: 'exportQualificationId', labelKey: L('exportQualificationId'), width: 120 },
|
||
{ key: 'pickupOrderId', labelKey: L('pickupOrderId'), width: 110 },
|
||
{ key: 'stockBindLineCount', labelKey: L('stockBindLineCount'), width: 100 },
|
||
{ key: 'primarySkuCodes', labelKey: L('primarySkuCodes'), width: 140 },
|
||
{ key: 'consigneeCountry', labelKey: M('consigneeCountry'), width: 110 },
|
||
{ key: 'consigneeCountryName', labelKey: L('consigneeCountryName'), width: 120 },
|
||
{ key: 'cargoAttribute', labelKey: M('cargoAttribute'), width: 100 },
|
||
{ key: 'warehouseId', labelKey: L('warehouseId'), width: 90 },
|
||
{ key: 'warehouse', labelKey: M('warehouse'), width: 90 },
|
||
{ key: 'customerId', labelKey: L('customerId'), width: 90 },
|
||
{ key: 'orderSource', labelKey: L('orderSource'), width: 100 },
|
||
{ key: 'pickupTime', labelKey: L('pickupTime'), width: 150 },
|
||
{ key: 'carrierWaybillNo', labelKey: M('carrierWaybillNo'), width: 160 },
|
||
{ key: 'pickupNo', labelKey: M('pickupNo'), width: 150 },
|
||
{ key: 'inboundMethod', labelKey: M('inboundMethod'), width: 110 },
|
||
{ key: 'fulfillmentType', labelKey: 'order.waybillManage.table.fulfillmentType', width: 90 },
|
||
{ key: 'fulfillProgress', labelKey: 'order.myOrders.table.fulfillProgress', width: 120 },
|
||
{ key: 'stockBindStatus', labelKey: 'order.myOrders.table.stockBindStatus', width: 100 },
|
||
{ key: 'domesticTrackingNos', labelKey: 'order.myOrders.table.domesticTrackingNos', width: 180 },
|
||
{ key: 'stockBindQtyTotal', labelKey: 'order.myOrders.table.stockBindQtyTotal', width: 90 },
|
||
{ key: 'primaryBinCode', labelKey: 'order.myOrders.table.primaryBinCode', width: 100 },
|
||
{ key: 'customerSenderAddressId', labelKey: L('customerSenderAddressId'), width: 130 },
|
||
{ key: 'requestId', labelKey: L('requestId'), width: 140 },
|
||
{ key: 'exportCustomsMode', labelKey: L('exportCustomsMode'), width: 120 },
|
||
{ key: 'predeclareFailReason', labelKey: M('predeclareFailReason'), width: 180 },
|
||
{ key: 'allocationPendingReason', labelKey: M('allocationPendingReason'), width: 180 },
|
||
{ key: 'declaredCurrency', labelKey: L('declaredCurrency'), width: 100 },
|
||
{ key: 'declaredSum', labelKey: L('declaredSum'), width: 100 },
|
||
{ key: 'quantity', labelKey: L('quantity'), width: 80 },
|
||
{ key: 'isCod', labelKey: L('isCod'), width: 80 },
|
||
{ key: 'codCurrency', labelKey: L('codCurrency'), width: 90 },
|
||
{ key: 'codSum', labelKey: L('codSum'), width: 90 },
|
||
{ key: 'orderStatus', labelKey: M('orderStatus'), width: 130 },
|
||
{ key: 'status', labelKey: L('status'), width: 100 },
|
||
{ key: 'handleStatus', labelKey: L('handleStatus'), width: 100 },
|
||
{ key: 'handleStatusName', labelKey: L('handleStatusName'), width: 100 },
|
||
{ key: 'issueType', labelKey: L('issueType'), width: 100 },
|
||
{ key: 'issueTypeName', labelKey: L('issueTypeName'), width: 100 },
|
||
{ key: 'issueTitle', labelKey: L('issueTitle'), width: 140 },
|
||
{ key: 'issueContent', labelKey: L('issueContent'), width: 180 },
|
||
{ key: 'issueTemplateId', labelKey: L('issueTemplateId'), width: 110 },
|
||
{ key: 'issueRemark', labelKey: L('issueRemark'), width: 140 },
|
||
{ key: 'issueTime', labelKey: L('issueTime'), width: 150 },
|
||
{ key: 'claimType', labelKey: L('claimType'), width: 100 },
|
||
{ key: 'claimTypeName', labelKey: L('claimTypeName'), width: 100 },
|
||
{ key: 'claimAmount', labelKey: L('claimAmount'), width: 100 },
|
||
{ key: 'claimCurrency', labelKey: L('claimCurrency'), width: 90 },
|
||
{ key: 'claimReason', labelKey: L('claimReason'), width: 140 },
|
||
{ key: 'claimTime', labelKey: L('claimTime'), width: 150 },
|
||
{ key: 'previousOrderStatus', labelKey: L('previousOrderStatus'), width: 120 },
|
||
{ key: 'receiveTime', labelKey: M('receiveTime'), width: 150 },
|
||
{ key: 'shipTime', labelKey: M('shipTime'), width: 150 },
|
||
{ key: 'payTime', labelKey: M('payTime'), width: 150 },
|
||
{ key: 'isPaid', labelKey: M('isPaid'), width: 80 },
|
||
{ key: 'signTime', labelKey: M('signTime'), width: 150 },
|
||
{ key: 'isIntercept', labelKey: L('isIntercept'), width: 80 },
|
||
{ key: 'isRemote', labelKey: L('isRemote'), width: 80 },
|
||
{ key: 'createTime', labelKey: M('createTime'), width: 150 },
|
||
{ key: 'createBy', labelKey: L('createBy'), width: 100 },
|
||
{ key: 'updateTime', labelKey: L('updateTime'), width: 150 },
|
||
{ key: 'updateBy', labelKey: L('updateBy'), width: 100 },
|
||
{ key: 'chargeableWeight', labelKey: M('chargeableWeight'), width: 90 },
|
||
{ key: 'receivableAmount', labelKey: M('receivableAmount'), width: 95 },
|
||
{ key: 'inboundTime', labelKey: M('inboundTime'), width: 150 },
|
||
{ key: 'outboundTime', labelKey: M('outboundTime'), width: 150 },
|
||
|
||
// 寄件人展平
|
||
{ key: 'senderName', labelKey: L('senderName'), width: 100 },
|
||
{ key: 'senderCompany', labelKey: L('senderCompany'), width: 120 },
|
||
{ key: 'senderPhone', labelKey: L('senderPhone'), width: 110 },
|
||
{ key: 'senderTelePhone', labelKey: L('senderTelePhone'), width: 110 },
|
||
{ key: 'senderEmail', labelKey: L('senderEmail'), width: 140 },
|
||
{ key: 'senderCountryCode', labelKey: L('senderCountryCode'), width: 100 },
|
||
{ key: 'senderProvince', labelKey: L('senderProvince'), width: 100 },
|
||
{ key: 'senderCity', labelKey: L('senderCity'), width: 100 },
|
||
{ key: 'senderZipCode', labelKey: L('senderZipCode'), width: 100 },
|
||
{ key: 'senderStreetAddress1', labelKey: L('senderStreetAddress1'), width: 160 },
|
||
{ key: 'senderStreetAddress2', labelKey: L('senderStreetAddress2'), width: 160 },
|
||
{ key: 'senderStreetAddress3', labelKey: L('senderStreetAddress3'), width: 160 },
|
||
{ key: 'senderHouseNumber', labelKey: L('senderHouseNumber'), width: 100 },
|
||
|
||
// 收件人展平(原始字段,便于对照接口)
|
||
{ key: 'receiverRecipientsName', labelKey: L('receiverRecipientsName'), width: 100 },
|
||
{ key: 'receiverCompanyName', labelKey: L('receiverCompanyName'), width: 120 },
|
||
{ key: 'receiverPhone', labelKey: L('receiverPhone'), width: 110 },
|
||
{ key: 'receiverTelePhone', labelKey: L('receiverTelePhone'), width: 110 },
|
||
{ key: 'receiverEmail', labelKey: L('receiverEmail'), width: 140 },
|
||
{ key: 'receiverCountryCode', labelKey: L('receiverCountryCode'), width: 100 },
|
||
{ key: 'receiverProvince', labelKey: L('receiverProvince'), width: 100 },
|
||
{ key: 'receiverCity', labelKey: L('receiverCity'), width: 100 },
|
||
{ key: 'receiverStreetNumber', labelKey: L('receiverStreetNumber'), width: 100 },
|
||
{ key: 'receiverStreetAddress1', labelKey: L('receiverStreetAddress1'), width: 160 },
|
||
{ key: 'receiverStreetAddress2', labelKey: L('receiverStreetAddress2'), width: 160 },
|
||
{ key: 'receiverStreetAddress3', labelKey: L('receiverStreetAddress3'), width: 160 },
|
||
{ key: 'receiverZipCode', labelKey: L('receiverZipCode'), width: 100 },
|
||
{ key: 'receiverTaxType', labelKey: L('receiverTaxType'), width: 90 },
|
||
{ key: 'receiverTaxNo', labelKey: L('receiverTaxNo'), width: 120 },
|
||
{ key: 'receiverCertificateType', labelKey: L('receiverCertificateType'), width: 100 },
|
||
{ key: 'receiverCertificateNo', labelKey: L('receiverCertificateNo'), width: 120 },
|
||
{ key: 'receiverEori', labelKey: L('receiverEori'), width: 100 },
|
||
{ key: 'receiverVat', labelKey: L('receiverVat'), width: 100 },
|
||
];
|
||
|
||
/** 与改造前运单管理默认列一致 */
|
||
export const WAYBILL_MANAGE_DEFAULT_KEYS: string[] = [
|
||
'customerName',
|
||
'customerCode',
|
||
'waybillNo',
|
||
'customerOrderNo',
|
||
'trackingNo',
|
||
'carrierWaybillNo',
|
||
'downstreamServiceNo',
|
||
'orderStatus',
|
||
'shippingMethod',
|
||
'serviceChannel',
|
||
'isPaid',
|
||
'consigneeCountry',
|
||
'consignee',
|
||
'consigneePhone',
|
||
'consigneeCity',
|
||
'chargeableWeight',
|
||
'receivableAmount',
|
||
'warehouse',
|
||
'fulfillmentType',
|
||
'fulfillProgress',
|
||
'stockBindStatus',
|
||
'domesticTrackingNos',
|
||
'predeclareFailReason',
|
||
'createTime',
|
||
'shipTime',
|
||
'payTime',
|
||
];
|
||
|
||
/** 去重合并目录(按 key 保留先出现的定义) */
|
||
export function dedupeCatalog(list: OrderListColumnDef[]): OrderListColumnDef[] {
|
||
const map = new Map<string, OrderListColumnDef>();
|
||
for (const col of list) {
|
||
if (!map.has(col.key)) map.set(col.key, col);
|
||
}
|
||
return Array.from(map.values());
|
||
}
|
||
|
||
function withZhLabels(list: OrderListColumnDef[]): OrderListColumnDef[] {
|
||
return list.map((col) => ({
|
||
...col,
|
||
label: col.label && col.label !== col.key ? col.label : getOrderColumnLabelZh(col.key),
|
||
}));
|
||
}
|
||
|
||
/** 基础目录 = 运单全量 + 我的订单目录中可能遗漏的项(带中文 label) */
|
||
export function getWaybillBaseCatalog(): OrderListColumnDef[] {
|
||
return withZhLabels(
|
||
dedupeCatalog([...WAYBILL_MANAGE_COLUMN_CATALOG, ...MY_ORDERS_COLUMN_CATALOG]),
|
||
);
|
||
}
|