|
|
@@ -216,6 +216,45 @@ export default {
|
|
|
|
|
|
const res = await getShippingStatusInquiry(params)
|
|
|
const respData = res && res.data ? res.data.data : null
|
|
|
+
|
|
|
+ // 后端实际返回字段多为 PascalCase + 下划线;表格/搜索字段使用 camelCase
|
|
|
+ // 这里做一层归一化,避免页面列 prop 改动导致搜索参数也被改名。
|
|
|
+ const normalizeShippingStatusRecord = (row) => {
|
|
|
+ if (!row || typeof row !== 'object') return row
|
|
|
+ return {
|
|
|
+ ...row,
|
|
|
+ orgId: row.orgId ?? row.Org_ID,
|
|
|
+ orgCode: row.orgCode ?? row.Org_Code,
|
|
|
+ orgName: row.orgName ?? row.Org_Name,
|
|
|
+ docTypeId: row.docTypeId ?? row.DocType_ID,
|
|
|
+ docTypeCode: row.docTypeCode ?? row.DocType_Code,
|
|
|
+ docTypeName: row.docTypeName ?? row.DocType_Name,
|
|
|
+ docNo: row.docNo ?? row.DocNo,
|
|
|
+ businessDate: row.businessDate ?? row.BusinessDate,
|
|
|
+ customerId: row.customerId ?? row.Customer_ID,
|
|
|
+ customerCode: row.customerCode ?? row.Customer_Code,
|
|
|
+ customerName: row.customerName ?? row.Customer_Name,
|
|
|
+ itemId: row.itemId ?? row.Item_ID,
|
|
|
+ itemCode: row.itemCode ?? row.Item_Code,
|
|
|
+ itemName: row.itemName ?? row.Item_Name,
|
|
|
+ specs: row.specs ?? row.SPECS,
|
|
|
+ qty: row.qty ?? row.Qty,
|
|
|
+ orderPrice: row.orderPrice ?? row.OrderPrice,
|
|
|
+ finallyPrice: row.finallyPrice ?? row.FinallyPrice,
|
|
|
+ totalMoneyTc: row.totalMoneyTc ?? row.TotalMoneyTC,
|
|
|
+ totalNetMoneyTc: row.totalNetMoneyTc ?? row.TotalNetMoneyTC,
|
|
|
+ totalTaxTc: row.totalTaxTc ?? row.TotalTaxTC,
|
|
|
+ whId: row.whId ?? row.WH_ID,
|
|
|
+ whCode: row.whCode ?? row.WH_Code,
|
|
|
+ whName: row.whName ?? row.WH_Name,
|
|
|
+ soDocNo: row.soDocNo ?? row.SoDocNo,
|
|
|
+ soDocLineNo: row.soDocLineNo ?? row.SoDocLineNo,
|
|
|
+ shipAddress: row.shipAddress ?? row.ShipAddress,
|
|
|
+ status: row.status ?? row.Status,
|
|
|
+ lineStatus: row.lineStatus ?? row.LineStatus
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const isPaged =
|
|
|
respData &&
|
|
|
typeof respData === 'object' &&
|
|
|
@@ -225,7 +264,7 @@ export default {
|
|
|
this.serverPaging = Boolean(isPaged)
|
|
|
|
|
|
if (isPaged) {
|
|
|
- const records = respData.records
|
|
|
+ const records = (respData.records || []).map(normalizeShippingStatusRecord)
|
|
|
// 默认按业务日期倒序(无 businessDate 时保持原顺序)
|
|
|
this.data = records.slice().sort((a, b) => {
|
|
|
const at = a && a.businessDate ? new Date(a.businessDate).getTime() : 0
|
|
|
@@ -237,7 +276,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- const list = Array.isArray(respData) ? respData : []
|
|
|
+ const list = (Array.isArray(respData) ? respData : []).map(normalizeShippingStatusRecord)
|
|
|
|
|
|
// 默认按业务日期倒序(无 businessDate 时保持原顺序)
|
|
|
this.rawData = list.slice().sort((a, b) => {
|