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 {