This commit is contained in:
2026-08-15 11:15:00 +08:00
parent 4573b3df1c
commit e000f8bed2
4 changed files with 23 additions and 29 deletions
@@ -48,10 +48,10 @@ const partner: PlatformPartnerResource = {
id: '19001',
tenantId: 0,
dataScopeId: 0,
partnerCode: 'CUS-001',
partnerCode: 'SHP-001',
partnerName: '深圳示例贸易有限公司',
partnerType: 'CUSTOMER',
types: ['CUSTOMER', 'SHIPPER'],
partnerType: 'SHIPPER',
types: ['SHIPPER'],
contactName: '张三',
contactPhone: '13800138000',
contactEmail: 'contact@example.com',
@@ -152,6 +152,11 @@ describe('PartnersView real API integration', () => {
expect(document.body.textContent).toContain('新增往来单位')
expect(document.body.textContent).not.toContain('请先在筛选条件中选择所属企业')
expect(document.body.textContent).toContain('船公司')
expect(document.body.textContent).toContain('发货单位')
expect(document.body.textContent).toContain('收货单位')
expect(document.body.textContent).not.toContain('报关行')
expect(document.body.textContent).not.toContain('供应商')
})
it('renders a padded detail layout without an empty data-scope cell', async () => {
@@ -24,7 +24,6 @@ import {
updatePlatformPartner,
type PlatformPartnerResource,
type PlatformPartnerStatus,
type PlatformPartnerLegacyType,
type PlatformPartnerType,
type SavePlatformPartnerRequest,
} from '@/modules/master-data/counterparties/api/platformPartners'
@@ -68,10 +67,7 @@ const queryFields = computed<QueryField[]>(() => [
label: '单位类型',
placeholder: '全部类型',
options: [
{ label: '客户', value: 'CUSTOMER' },
{ label: '供应商', value: 'SUPPLIER' },
{ label: '承运商', value: 'CARRIER' },
{ label: '报关行', value: 'CUSTOMS_BROKER' },
{ label: '船公司', value: 'CARRIER' },
{ label: '发货单位', value: 'SHIPPER' },
{ label: '收货单位', value: 'CONSIGNEE' },
],
@@ -96,8 +92,8 @@ const emptyForm = (): PartnerForm => ({
id: '',
partnerCode: '',
partnerName: '',
partnerType: 'CUSTOMER',
types: ['CUSTOMER'],
partnerType: 'SHIPPER',
types: ['SHIPPER'],
contactName: '',
contactPhone: '',
contactEmail: null,
@@ -138,16 +134,13 @@ const rules: FormRules<PartnerForm> = {
}
const typeLabels: Record<PlatformPartnerType, string> = {
CUSTOMER: '客户',
SUPPLIER: '供应商',
CARRIER: '承运商',
CUSTOMS_BROKER: '报关行',
CARRIER: '船公司',
SHIPPER: '发货单位',
CONSIGNEE: '收货单位',
}
const typeOptions = Object.entries(typeLabels).map(([value, label]) => ({ value: value as PlatformPartnerType, label }))
function partnerTypeLabel(type: PlatformPartnerLegacyType) {
return type === 'BOTH' ? '客户 / 供应商' : typeLabels[type]
function partnerTypeLabel(type: PlatformPartnerType) {
return typeLabels[type]
}
const partnerColumns: DataTableColumn[] = [
{ key: 'actions', label: '操作', width: 250, fixed: 'left', slotName: 'actions' },