From 63170f9b73f861093347afc752712345e4526635 Mon Sep 17 00:00:00 2001 From: wujinliang <2318309077@qq.com> Date: Tue, 25 Aug 2026 21:01:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=B4=E7=A8=8B?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=85=A5=E4=BB=93=E7=A0=81=E5=92=8CSKU?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/first-leg/api/unifiedOrders.ts | 1 + src/modules/first-leg/store/firstLegOrders.ts | 3 +++ .../first-leg/views/FirstLegOrdersView.vue | 26 ++++++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/modules/first-leg/api/unifiedOrders.ts b/src/modules/first-leg/api/unifiedOrders.ts index cf09932..48b5ff0 100644 --- a/src/modules/first-leg/api/unifiedOrders.ts +++ b/src/modules/first-leg/api/unifiedOrders.ts @@ -129,6 +129,7 @@ export interface MerchantUnifiedOrderDetail { export interface MerchantUnifiedOrderQuery { keyword?: string + fbaCode?: string orderNo?: string mainStatus?: ApiUnifiedOrderMainStatus receivingWarehouseId?: number | string diff --git a/src/modules/first-leg/store/firstLegOrders.ts b/src/modules/first-leg/store/firstLegOrders.ts index 33ffd63..316dc42 100644 --- a/src/modules/first-leg/store/firstLegOrders.ts +++ b/src/modules/first-leg/store/firstLegOrders.ts @@ -435,6 +435,7 @@ type OrderListReadResult = | { source: 'unified'; records: MerchantUnifiedOrderRow[]; drafts: MerchantFirstLegOrderRow[] } interface ClientOrderReadQuery extends MerchantUnifiedOrderQuery { + fbaCode?: string draftOnly?: boolean includeDrafts?: boolean } @@ -462,6 +463,7 @@ async function getOrdersForClient(query: ClientOrderReadQuery = {}): Promise item.sku), + ].some((value) => String(value ?? '').toLowerCase().includes(normalized)) +} + function uniqueItemValues(order: FirstLegOrder, key: 'sku' | 'shipmentId' | 'referenceId') { if (key === 'sku' && order.skuNos.length) return [...new Set(order.skuNos)].join('、') const values = order.items.map((item) => item[key]?.trim()).filter((value): value is string => Boolean(value)) @@ -1534,7 +1543,7 @@ async function searchOrders(model: QueryModel) { const orderNo = typeof model.orderNo === 'string' ? model.orderNo.trim() : '' const cargoKeyword = typeof model.cargoKeyword === 'string' ? model.cargoKeyword.trim() : '' const range = Array.isArray(createdRange) ? createdRange.filter((value): value is string => typeof value === 'string') : [] - await store.load({ + const query = { keyword: cargoKeyword || undefined, orderNo: orderNo || undefined, receivingWarehouseId: typeof model.receivingWarehouseId === 'string' && model.receivingWarehouseId ? model.receivingWarehouseId : undefined, @@ -1543,7 +1552,12 @@ async function searchOrders(model: QueryModel) { includeDrafts: !statusValue, createdFrom: range[0] ? `${range[0]}T00:00:00` : undefined, createdTo: range[1] ? `${range[1]}T23:59:59` : undefined, - }) + } + await store.load(query) + const cargoMatched = cargoKeyword && store.orders.some((order) => orderMatchesCargoKeyword(order, cargoKeyword)) + if (cargoKeyword && !cargoMatched && statusValue !== 'DRAFT') { + await store.load({ ...query, keyword: undefined, fbaCode: cargoKeyword }) + } selectedOrders.value = [] orderTableVersion.value += 1 } catch { @@ -1755,9 +1769,9 @@ async function searchOrders(model: QueryModel) { - + - + @@ -1770,11 +1784,11 @@ async function searchOrders(model: QueryModel) { - +
#SKU NO.FBA必填中文品名图片英文品名报关 HS CODE清关 HS CODE包装类型SKU NO.SKU必填中文品名图片英文品名报关 HS CODE清关 HS CODE包装类型 箱规长 cm箱规宽 cm箱规高 cm每箱数量箱数总毛重总体积总数量总净重清关申报单价 USD清关申报金额 USD材质用途型号品牌产品规格 长×宽×高危险品货件编号FBA必填跟踪编号FBA必填UPC NO.FBA必填备注操作清关申报单价 USD清关申报金额 USD材质用途型号品牌产品规格 长×宽×高危险品货件编号货件编号必填跟踪编号跟踪编号必填UPC NO.UPC必填备注操作
{{ index + 1 }}
××
删除删除
-
FBA 货物的 SKU NO.、UPC NO. 为必填项亚马逊货物的货件编号和跟踪编号为必填项
+
SKU NO.、货件编号、跟踪编号、UPC NO. 均为必填项
From b12196c7a865ad102220e04120293bd70fc48bba Mon Sep 17 00:00:00 2001 From: wujinliang <2318309077@qq.com> Date: Tue, 25 Aug 2026 22:08:30 +0800 Subject: [PATCH 2/2] 1 --- package.json | 1 + pnpm-lock.yaml | 3 +++ src/main.ts | 1 + src/modules/first-leg/api/unifiedOrders.ts | 1 + .../first-leg/store/firstLegOrders.test.mjs | 1 + src/modules/first-leg/store/firstLegOrders.ts | 1 + .../first-leg/utils/firstLegOrder.test.mjs | 4 ++-- src/modules/first-leg/utils/firstLegOrder.ts | 4 ++-- .../first-leg/views/FirstLegOrdersView.vue | 7 +++--- .../tenant-management/api/merchantIam.ts | 2 +- .../store/tenantAdministration.ts | 23 +++++++++++-------- 11 files changed, 30 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 960bb9f..e2ca4b9 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dependencies": { "@chongchong/shared": "link:./shared", "axios": "^1.18.1", + "dayjs": "^1.11.21", "element-plus": "^2.14.3", "@lucide/vue": "^1.27.0", "pinia": "^4.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9cb2478..54dd71e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: axios: specifier: ^1.18.1 version: 1.18.1(debug@4.4.3) + dayjs: + specifier: ^1.11.21 + version: 1.11.21 element-plus: specifier: ^2.14.3 version: 2.14.3(vue@3.5.40(typescript@5.9.3)) diff --git a/src/main.ts b/src/main.ts index 521b1fb..5837f4c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,6 @@ import { createApp } from 'vue' import { h } from 'vue' +import 'dayjs/locale/zh-cn' import { createPinia } from 'pinia' import { ElConfigProvider } from 'element-plus' import zhCn from 'element-plus/es/locale/lang/zh-cn' diff --git a/src/modules/first-leg/api/unifiedOrders.ts b/src/modules/first-leg/api/unifiedOrders.ts index 48b5ff0..fad19f2 100644 --- a/src/modules/first-leg/api/unifiedOrders.ts +++ b/src/modules/first-leg/api/unifiedOrders.ts @@ -131,6 +131,7 @@ export interface MerchantUnifiedOrderQuery { keyword?: string fbaCode?: string orderNo?: string + inboundCode?: string mainStatus?: ApiUnifiedOrderMainStatus receivingWarehouseId?: number | string destinationWarehouseId?: number | string diff --git a/src/modules/first-leg/store/firstLegOrders.test.mjs b/src/modules/first-leg/store/firstLegOrders.test.mjs index 6ceaded..17fc525 100644 --- a/src/modules/first-leg/store/firstLegOrders.test.mjs +++ b/src/modules/first-leg/store/firstLegOrders.test.mjs @@ -100,6 +100,7 @@ test('routes supported filters to C02 without sending DRAFT as a main status', ( assert.match(storeSource, /interface ClientOrderReadQuery extends MerchantUnifiedOrderQuery/) assert.match(storeSource, /if \(query\.draftOnly\)/) assert.match(storeSource, /const unifiedQuery: MerchantUnifiedOrderQuery/) + assert.match(storeSource, /inboundCode: query\.inboundCode/) assert.match(storeSource, /getMerchantUnifiedOrders\(unifiedQuery\)/) }) diff --git a/src/modules/first-leg/store/firstLegOrders.ts b/src/modules/first-leg/store/firstLegOrders.ts index 316dc42..e6e56de 100644 --- a/src/modules/first-leg/store/firstLegOrders.ts +++ b/src/modules/first-leg/store/firstLegOrders.ts @@ -461,6 +461,7 @@ async function getOrdersForClient(query: ClientOrderReadQuery = {}): Promise { diff --git a/src/modules/first-leg/utils/firstLegOrder.ts b/src/modules/first-leg/utils/firstLegOrder.ts index 59160e5..64db76d 100644 --- a/src/modules/first-leg/utils/firstLegOrder.ts +++ b/src/modules/first-leg/utils/firstLegOrder.ts @@ -123,8 +123,8 @@ export function validateFirstLegOrderDraft(draft: FirstLegOrderDraft) { if (!item.packageType.trim()) errors.push(`${line}缺少包装类型`) if (draft.destinationType === 'FBA' && !item.sku.trim()) errors.push(`${line}缺少客户 SKU`) if (draft.destinationType === 'FBA' && !item.upc.trim()) errors.push(`${line}缺少 UPC`) - if (draft.destinationType === 'FBA' && !item.shipmentId.trim()) errors.push(`${line}缺少 Shipment ID`) - if (draft.destinationType === 'FBA' && !item.referenceId.trim()) errors.push(`${line}缺少 Reference ID`) + if (draft.destinationType === 'FBA' && !item.shipmentId.trim()) errors.push(`${line}缺少货件编号`) + if (draft.destinationType === 'FBA' && !item.referenceId.trim()) errors.push(`${line}缺少跟踪编号`) if (!Number.isInteger(item.pieces) || item.pieces <= 0) errors.push(`${line}件数必须为正整数`) if (!Number.isInteger(item.packageCount) || item.packageCount <= 0) errors.push(`${line}箱数必须为正整数`) if (!Number.isInteger(item.unitsPerPackage) || item.unitsPerPackage <= 0) errors.push(`${line}每箱数量必须为正整数`) diff --git a/src/modules/first-leg/views/FirstLegOrdersView.vue b/src/modules/first-leg/views/FirstLegOrdersView.vue index 57b8327..8f64b5a 100644 --- a/src/modules/first-leg/views/FirstLegOrdersView.vue +++ b/src/modules/first-leg/views/FirstLegOrdersView.vue @@ -1544,7 +1544,8 @@ async function searchOrders(model: QueryModel) { const cargoKeyword = typeof model.cargoKeyword === 'string' ? model.cargoKeyword.trim() : '' const range = Array.isArray(createdRange) ? createdRange.filter((value): value is string => typeof value === 'string') : [] const query = { - keyword: cargoKeyword || undefined, + keyword: undefined, + inboundCode: cargoKeyword || undefined, orderNo: orderNo || undefined, receivingWarehouseId: typeof model.receivingWarehouseId === 'string' && model.receivingWarehouseId ? model.receivingWarehouseId : undefined, mainStatus: statusValue && statusValue !== 'DRAFT' ? statusValue : undefined, @@ -1554,9 +1555,9 @@ async function searchOrders(model: QueryModel) { createdTo: range[1] ? `${range[1]}T23:59:59` : undefined, } await store.load(query) - const cargoMatched = cargoKeyword && store.orders.some((order) => orderMatchesCargoKeyword(order, cargoKeyword)) + const cargoMatched = cargoKeyword && store.orders.some((order) => order.status !== 'DRAFT' && orderMatchesCargoKeyword(order, cargoKeyword)) if (cargoKeyword && !cargoMatched && statusValue !== 'DRAFT') { - await store.load({ ...query, keyword: undefined, fbaCode: cargoKeyword }) + await store.load({ ...query, keyword: undefined, inboundCode: undefined, fbaCode: cargoKeyword }) } selectedOrders.value = [] orderTableVersion.value += 1 diff --git a/src/modules/tenant-management/api/merchantIam.ts b/src/modules/tenant-management/api/merchantIam.ts index f5ec722..399a5ac 100644 --- a/src/modules/tenant-management/api/merchantIam.ts +++ b/src/modules/tenant-management/api/merchantIam.ts @@ -36,7 +36,7 @@ export interface MerchantQualification { tenantId: number | string qualificationType: MerchantQualificationType certificateNo: string | null - documentUrl: string + documentUrl?: string | null validTo: string | null status: QualificationStatus reviewComment: string | null diff --git a/src/modules/tenant-management/store/tenantAdministration.ts b/src/modules/tenant-management/store/tenantAdministration.ts index 401e79a..c1e17e1 100644 --- a/src/modules/tenant-management/store/tenantAdministration.ts +++ b/src/modules/tenant-management/store/tenantAdministration.ts @@ -135,20 +135,23 @@ export const useTenantAdministrationStore = defineStore('tenant-administration', registeredAddress: profile.registeredAddress ?? '', auditStatus: profile.status, } - qualifications.value = qualificationRecords.map((item) => ({ - id: String(item.id), - type: ({ + qualifications.value = qualificationRecords.map((item) => { + const documentUrl = typeof item.documentUrl === 'string' ? item.documentUrl : '' + return { + id: String(item.id), + type: ({ BUSINESS_LICENSE: '营业执照', LEGAL_PERSON_ID: '法人身份证', FREIGHT_FORWARDER_CERTIFICATE: '货代资质证书', BANK_ACCOUNT_LICENSE: '银行开户许可证', - } as const)[item.qualificationType], - fileName: item.documentUrl.split('/').pop() || '资质文件', - status: normalizeQualificationStatus(item.status), - expiresAt: item.validTo || '长期有效', - updatedAt: '-', - documentUrl: item.documentUrl, - })) + } as const)[item.qualificationType] || '企业资质', + fileName: documentUrl.split('/').pop() || '资质文件', + status: normalizeQualificationStatus(item.status), + expiresAt: item.validTo || '长期有效', + updatedAt: '-', + documentUrl, + } + }) } function mapMerchantRole(role: MerchantRole): TenantRole {