1
This commit is contained in:
@@ -65,6 +65,15 @@ describe('InboundTaskList measurement scope', () => {
|
||||
expect(queryFieldsSource).not.toContain('客户编码')
|
||||
})
|
||||
|
||||
it('clears date conditions safely and uses explicit select placeholders', () => {
|
||||
const source = readFileSync(resolve('src/modules/inbounds/components/InboundTaskList.vue'), 'utf8')
|
||||
const queryFieldsSource = source.slice(source.indexOf('const queryFields'), source.indexOf('const columns'))
|
||||
|
||||
expect(source).toContain('Array.isArray(filters.value.expectedArrivalRange)')
|
||||
expect(queryFieldsSource).toContain("placeholder: customerLoadError.value ? '客户列表加载失败' : '请选择客户'")
|
||||
expect(queryFieldsSource).toContain("placeholder: '请选择仓库'")
|
||||
})
|
||||
|
||||
it('requests every active-customer page and merges name-only options', async () => {
|
||||
const calls: Array<{ page: number; size: number; status: 'ACTIVE' }> = []
|
||||
const records = await loadAllActiveCustomers(async (query) => {
|
||||
|
||||
@@ -65,14 +65,14 @@ const queryFields = computed<QueryField[]>(() => [
|
||||
type: 'select',
|
||||
label: '客户',
|
||||
width: 260,
|
||||
placeholder: customerLoadError.value ? '客户列表加载失败' : '全部客户',
|
||||
placeholder: customerLoadError.value ? '客户列表加载失败' : '请选择客户',
|
||||
options: customers.value.map((customer) => ({
|
||||
value: String(customer.id),
|
||||
label: customer.legalName?.trim() || customer.tenantName,
|
||||
})),
|
||||
props: { filterable: true, disabled: Boolean(customerLoadError.value) },
|
||||
},
|
||||
{ key: 'warehouseId', type: 'select', label: '定位仓库', width: 220, placeholder: '全部仓库', options: warehouseOptions.value, props: { filterable: true } },
|
||||
{ key: 'warehouseId', type: 'select', label: '定位仓库', width: 220, placeholder: '请选择仓库', options: warehouseOptions.value, props: { filterable: true } },
|
||||
{ key: 'inboundCode', type: 'input', label: '入仓码', width: 220, placeholder: '请输入入仓码' },
|
||||
{ key: 'expectedArrivalRange', type: 'daterange', label: '预计到达时间', width: 320, placeholder: '请选择日期范围' },
|
||||
])
|
||||
@@ -164,7 +164,10 @@ async function loadTasks() {
|
||||
}
|
||||
|
||||
function applyFilters() {
|
||||
appliedFilters.value = { ...filters.value, expectedArrivalRange: [...filters.value.expectedArrivalRange] }
|
||||
appliedFilters.value = {
|
||||
...filters.value,
|
||||
expectedArrivalRange: Array.isArray(filters.value.expectedArrivalRange) ? [...filters.value.expectedArrivalRange] : [],
|
||||
}
|
||||
if (page.value === 1) void loadTasks()
|
||||
else page.value = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user