feat(admin): filter booking agents by carrier
This commit is contained in:
@@ -49,21 +49,40 @@ describe('OceanBookingDetailView draft and release contract', () => {
|
||||
expect(source).toContain('function releaseValidationError()')
|
||||
expect(source).toContain('预计到港时间不能早于预计开船时间')
|
||||
expect(source).toContain("[form.data.customerId, '客户']")
|
||||
expect(source).toContain("if (!form.data.carrierCode) return '放舱前请重新选择船公司,所选船公司必须配置标准编码'")
|
||||
expect(source).toContain("return '船公司标准编码尚未保存,请先保存草稿后再放舱'")
|
||||
expect(source).toContain('放舱前请填写${missing[1]}')
|
||||
expect(source).toContain('放舱后资料将同步到关联货柜,不能修改、不能删除;填写错误只能由管理员处理数据库,请确认资料无误。')
|
||||
expect(source).toContain('releaseOceanBooking(id.value, { expectedVersion: detail.value.version })')
|
||||
expect(source).not.toContain('releaseReason')
|
||||
})
|
||||
|
||||
it('keeps warehouse-scoped channel and customer/supplier selectors accessible', () => {
|
||||
it('freezes the selected carrier standard code into the booking draft', () => {
|
||||
expect(source).toContain('form.data.carrierCode = partner?.carrierCode ?? null')
|
||||
expect(source).toContain('carrierCode: value.carrierCode ?? selectedCarrier?.carrierCode ?? null')
|
||||
expect(source).toContain('form.data.shippingCompanyId && !form.data.carrierCode')
|
||||
expect(source).toContain('form.data.carrierCode = selected?.carrierCode ?? null')
|
||||
})
|
||||
|
||||
it('keeps warehouse-scoped channel and server-filtered booking-agent selectors accessible', () => {
|
||||
expect(source).toContain("warehouseType: 'DOMESTIC', status: 'ACTIVE'")
|
||||
expect(source).toContain('listWarehouseLogisticsChannels')
|
||||
expect(source).toContain('placeholder="草稿可暂不选择"')
|
||||
expect(source).toContain('暂无启用的订舱代理')
|
||||
expect(source).toContain('当前船公司暂无可用订舱代理')
|
||||
expect(source).toContain(':label="supplier.name"')
|
||||
expect(source).toContain('filterable clearable')
|
||||
})
|
||||
|
||||
it('loads booking agents from the carrier-filtered backend contract and clears an invalid selection', () => {
|
||||
expect(source).toContain('listOceanBookingAgents(carrierCode)')
|
||||
expect(source).toContain('shouldClearBookingAgent(form.data.bookingAgentId, options)')
|
||||
expect(source).toContain('clearBookingAgent()')
|
||||
expect(source).toContain("form.data.carrierCode ? '请选择订舱代理' : '请先选择船公司'")
|
||||
expect(source).toContain('<ApiErrorMeta :details="bookingAgentsError" />')
|
||||
expect(source).not.toContain('listSuppliers(')
|
||||
expect(source).not.toContain('isActiveBookingAgent')
|
||||
})
|
||||
|
||||
it('keeps dense layout, operation feedback and narrow-screen behavior', () => {
|
||||
expect(source).toContain('<OperationErrorToast :details="actionError" />')
|
||||
expect(source).toContain('LoadErrorState')
|
||||
|
||||
Reference in New Issue
Block a user