This commit is contained in:
2026-08-14 14:27:03 +08:00
parent 724848feb6
commit a81af4a664
64 changed files with 961 additions and 176 deletions
@@ -110,6 +110,9 @@ describe('InboundOrdersView', () => {
expect(vi.mocked(listPlatformInbounds).mock.calls).toHaveLength(requestsBeforeCustomerChange + 1)
expect(listPlatformInbounds).toHaveBeenLastCalledWith('10001', expect.objectContaining({ page: 1, size: 20 }))
expect(listPlatformTenants).toHaveBeenCalledWith({ page: 1, size: 200, status: 'ACTIVE' })
const customerQueryField = (toolbar.props('fields') as Array<{ key: string; type?: string; props?: Record<string, unknown> }>).find((field) => field.key === 'customerId')
expect(customerQueryField?.type).toBe('select')
expect(customerQueryField?.props?.filterable).toBe(true)
expect(document.body.textContent).toContain('RK-001')
expect(document.body.textContent).toContain('查看')
expect(document.body.textContent).toContain('示例企业有限公司')
@@ -117,6 +120,18 @@ describe('InboundOrdersView', () => {
expect(wrapper.find('.inbound-tabs .is-active').text()).toContain('全部')
})
it('keeps the customer filter name-only and does not add a customer-code input', () => {
const source = readFileSync(resolve(process.cwd(), 'src/modules/inbounds/pages/InboundOrdersView.vue'), 'utf8')
const queryFieldsSource = source.slice(source.indexOf('const allQueryFields'), source.indexOf('const columns'))
expect(queryFieldsSource).toContain("key: 'customerId'")
expect(queryFieldsSource).toContain("type: 'select'")
expect(queryFieldsSource).toContain('filterable: true')
expect(queryFieldsSource).toContain('legalName?.trim() || customer.tenantName')
expect(queryFieldsSource).not.toContain('tenantCode')
expect(queryFieldsSource).not.toContain('客户编码')
})
it('uses backend-supported warehouse IDs from tenant-scoped options without coercing Long IDs', async () => {
const wrapper = mountPage()
const toolbar = await selectCustomer(wrapper)
@@ -65,7 +65,7 @@ const tabs: Array<{ value: InboundListTab | ''; label: string; description: stri
{ value: 'WAIT_MEASURE', label: '待测量', description: '等待测量或补正' },
{ value: 'WAIT_REVIEW', label: '待审核', description: '等待测量审核' },
{ value: 'WAIT_FEE_SEND', label: '待费用/入库', description: '等待费用编排完成' },
{ value: 'WAIT_SPLIT', label: '待分柜', description: '费用已发布并完成入库,等待分柜' },
{ value: 'WAIT_SPLIT', label: '待分柜', description: '测量审核完成,等待分柜;费用可继续维护' },
]
const advancedFilterKeys = new Set(['orderStatus', 'feeReviewStatus', 'customerName', 'destinationCode', 'holdFlag'])