发布采购、拼车、预约及匹配端侧修复至灰度 #19
@@ -76,7 +76,7 @@ const domesticWarehouse: PlatformWarehouseSummaryResource = {
|
||||
warehouseName: '义乌收货仓',
|
||||
warehouseType: 'DOMESTIC',
|
||||
countryCode: 'CN',
|
||||
timezone: 'UTC+8',
|
||||
timezone: 'Asia/Shanghai',
|
||||
contactName: '仓库客服',
|
||||
contactPhone: '0579-12345678',
|
||||
contactEmail: 'warehouse@example.com',
|
||||
@@ -111,7 +111,7 @@ const fbaWarehouse: PlatformWarehouseSummaryResource = {
|
||||
warehouseName: 'AKR1',
|
||||
warehouseType: 'FBA',
|
||||
countryCode: 'US',
|
||||
timezone: 'UTC-5',
|
||||
timezone: 'America/New_York',
|
||||
contactName: null,
|
||||
contactPhone: null,
|
||||
contactEmail: null,
|
||||
@@ -234,14 +234,14 @@ describe('WarehousesView', () => {
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('浙江省义乌市北苑街道 1 号库')
|
||||
expect(wrapper.text()).toContain('国内收货仓')
|
||||
expect(wrapper.text()).toContain('中国 CN')
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('UTC+8')
|
||||
expect(wrapper.find('.data-table').text()).not.toContain('Asia/Shanghai')
|
||||
expect(wrapper.text()).toContain('共 1 个公共仓库')
|
||||
expect(wrapper.find('.data-table').exists()).toBe(true)
|
||||
const editButton = wrapper.findAll('.table-actions button').find((button) => button.text().trim() === '编辑')
|
||||
await editButton?.trigger('click')
|
||||
await flushPromises()
|
||||
expect((wrapper.find('textarea[placeholder*="街道"]').element as HTMLTextAreaElement).value).toBe('真实物流园 1 号库')
|
||||
expect(document.body.textContent).toContain('UTC+8')
|
||||
expect(document.body.textContent).toContain('Asia/Shanghai')
|
||||
})
|
||||
|
||||
it('submits filters and pagination to the API instead of filtering rows locally', async () => {
|
||||
@@ -356,12 +356,12 @@ describe('WarehousesView', () => {
|
||||
city: 'Long Beach',
|
||||
postalCode: '90802',
|
||||
addressLine1: '2400 E Spring St',
|
||||
timezone: 'UTC-8',
|
||||
timezone: 'America/Los_Angeles',
|
||||
})
|
||||
expect(createPlatformWarehouse).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('hides domestic country, timezone and type inputs while submitting fixed CN and UTC+8 defaults', async () => {
|
||||
it('hides domestic country, timezone and type inputs while submitting fixed CN and Asia/Shanghai defaults', async () => {
|
||||
const wrapper = await mountView()
|
||||
|
||||
wrapper.findComponent({ name: 'ElDropdown' }).vm.$emit('command', 'DOMESTIC')
|
||||
@@ -387,7 +387,7 @@ describe('WarehousesView', () => {
|
||||
warehouseName: '义乌新仓',
|
||||
warehouseType: 'DOMESTIC',
|
||||
countryCode: 'CN',
|
||||
timezone: 'UTC+8',
|
||||
timezone: 'Asia/Shanghai',
|
||||
address: expect.objectContaining({ countryCode: 'CN', city: '义乌市' }),
|
||||
})
|
||||
})
|
||||
@@ -409,7 +409,7 @@ describe('WarehousesView', () => {
|
||||
const timezoneSelect = wrapper.findAllComponents({ name: 'ElSelect' })
|
||||
.find((select) => select.props('placeholder') === '请选择时区')
|
||||
expect(timezoneSelect).toBeDefined()
|
||||
expect(wrapper.findAllComponents({ name: 'ElOption' }).some((option) => option.props('value') === 'UTC-8')).toBe(true)
|
||||
expect(wrapper.findAllComponents({ name: 'ElOption' }).some((option) => option.props('value') === 'America/Los_Angeles')).toBe(true)
|
||||
|
||||
setField('input[placeholder="请输入仓库名称"]', '洛杉矶海外仓')
|
||||
stateSelect!.vm.$emit('update:modelValue', 'CA')
|
||||
@@ -427,7 +427,7 @@ describe('WarehousesView', () => {
|
||||
warehouseName: '洛杉矶海外仓',
|
||||
warehouseType: 'OVERSEAS',
|
||||
countryCode: 'US',
|
||||
timezone: 'UTC-8',
|
||||
timezone: 'America/Los_Angeles',
|
||||
address: expect.objectContaining({ stateProvince: 'CA' }),
|
||||
})
|
||||
})
|
||||
@@ -470,7 +470,7 @@ describe('WarehousesView', () => {
|
||||
warehouseName: '洛杉矶合作仓',
|
||||
warehouseType: 'OVERSEAS_PARTNER',
|
||||
countryCode: 'US',
|
||||
timezone: 'UTC-8',
|
||||
timezone: 'America/Los_Angeles',
|
||||
address: expect.objectContaining({ stateProvince: 'CA', city: 'Los Angeles' }),
|
||||
}))
|
||||
})
|
||||
@@ -508,7 +508,7 @@ describe('WarehousesView', () => {
|
||||
const dialogText = document.querySelector('.warehouse-editor-dialog')?.textContent || ''
|
||||
expect(dialogText).toContain('编辑FBA 地址')
|
||||
expect(dialogText).not.toContain('例如 US')
|
||||
expect(dialogText).not.toContain('例如 UTC-8')
|
||||
expect(dialogText).not.toContain('例如 America/Los_Angeles')
|
||||
|
||||
const countrySelect = wrapper.findAllComponents({ name: 'ElSelect' })
|
||||
.find((select) => select.props('placeholder') === '请选择国家或地区')
|
||||
@@ -518,7 +518,7 @@ describe('WarehousesView', () => {
|
||||
.find((select) => select.props('placeholder') === '请选择时区')
|
||||
expect(countrySelect?.props('modelValue')).toBe('US')
|
||||
expect(stateSelect?.props('modelValue')).toBe('OH')
|
||||
expect(timezoneSelect?.props('modelValue')).toBe('UTC-5')
|
||||
expect(timezoneSelect?.props('modelValue')).toBe('America/New_York')
|
||||
expect(countrySelect).toBeDefined()
|
||||
expect((wrapper.find('input[placeholder="例如 154 或 CADF"]').element as HTMLInputElement).value).toBe('154')
|
||||
|
||||
@@ -533,7 +533,7 @@ describe('WarehousesView', () => {
|
||||
warehouseType: 'FBA',
|
||||
internalCode: '154',
|
||||
countryCode: 'US',
|
||||
timezone: 'UTC-5',
|
||||
timezone: 'America/New_York',
|
||||
address: expect.objectContaining({ stateProvince: 'OH' }),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -38,10 +38,13 @@ const warehouseTypeLabels: Record<WarehouseType, string> = {
|
||||
OVERSEAS_PARTNER: '海外仓合作仓',
|
||||
}
|
||||
const timezoneOptions = [
|
||||
'UTC-12', 'UTC-11', 'UTC-10', 'UTC-9', 'UTC-8', 'UTC-7', 'UTC-6', 'UTC-5', 'UTC-4', 'UTC-3',
|
||||
'UTC-2', 'UTC-1', 'UTC+0', 'UTC+1', 'UTC+2', 'UTC+3', 'UTC+4', 'UTC+5', 'UTC+6', 'UTC+7',
|
||||
'UTC+8', 'UTC+9', 'UTC+10', 'UTC+11', 'UTC+12', 'UTC+13', 'UTC+14',
|
||||
'Asia/Shanghai', 'America/New_York', 'America/Chicago', 'America/Denver',
|
||||
'America/Los_Angeles', 'America/Phoenix', 'America/Anchorage', 'America/Adak', 'Pacific/Honolulu',
|
||||
'America/Toronto', 'America/Vancouver', 'America/Edmonton', 'America/Winnipeg', 'America/Halifax',
|
||||
'Europe/London', 'Europe/Berlin', 'Europe/Paris', 'Europe/Rome', 'Europe/Madrid',
|
||||
'Asia/Tokyo', 'Australia/Sydney', 'Australia/Brisbane', 'Australia/Adelaide', 'Australia/Perth',
|
||||
]
|
||||
|
||||
const countryOptions = [
|
||||
{ label: '美国 US', value: 'US' },
|
||||
{ label: '加拿大 CA', value: 'CA' },
|
||||
@@ -66,55 +69,55 @@ const countryDisplayLabels: Record<string, string> = {
|
||||
AU: '澳大利亚',
|
||||
}
|
||||
const usStateOptions = [
|
||||
{ label: 'AL Alabama', value: 'AL', timezone: 'UTC-6' },
|
||||
{ label: 'AK Alaska', value: 'AK', timezone: 'UTC-9' },
|
||||
{ label: 'AZ Arizona', value: 'AZ', timezone: 'UTC-7' },
|
||||
{ label: 'AR Arkansas', value: 'AR', timezone: 'UTC-6' },
|
||||
{ label: 'CA California', value: 'CA', timezone: 'UTC-8' },
|
||||
{ label: 'CO Colorado', value: 'CO', timezone: 'UTC-7' },
|
||||
{ label: 'CT Connecticut', value: 'CT', timezone: 'UTC-5' },
|
||||
{ label: 'DE Delaware', value: 'DE', timezone: 'UTC-5' },
|
||||
{ label: 'AL Alabama', value: 'AL', timezone: 'America/Chicago' },
|
||||
{ label: 'AK Alaska', value: 'AK', timezone: null },
|
||||
{ label: 'AZ Arizona', value: 'AZ', timezone: null },
|
||||
{ label: 'AR Arkansas', value: 'AR', timezone: 'America/Chicago' },
|
||||
{ label: 'CA California', value: 'CA', timezone: 'America/Los_Angeles' },
|
||||
{ label: 'CO Colorado', value: 'CO', timezone: 'America/Denver' },
|
||||
{ label: 'CT Connecticut', value: 'CT', timezone: 'America/New_York' },
|
||||
{ label: 'DE Delaware', value: 'DE', timezone: 'America/New_York' },
|
||||
{ label: 'FL Florida', value: 'FL', timezone: null },
|
||||
{ label: 'GA Georgia', value: 'GA', timezone: 'UTC-5' },
|
||||
{ label: 'HI Hawaii', value: 'HI', timezone: 'UTC-10' },
|
||||
{ label: 'IA Iowa', value: 'IA', timezone: 'UTC-6' },
|
||||
{ label: 'GA Georgia', value: 'GA', timezone: 'America/New_York' },
|
||||
{ label: 'HI Hawaii', value: 'HI', timezone: 'Pacific/Honolulu' },
|
||||
{ label: 'IA Iowa', value: 'IA', timezone: 'America/Chicago' },
|
||||
{ label: 'ID Idaho', value: 'ID', timezone: null },
|
||||
{ label: 'IL Illinois', value: 'IL', timezone: 'UTC-6' },
|
||||
{ label: 'IL Illinois', value: 'IL', timezone: 'America/Chicago' },
|
||||
{ label: 'IN Indiana', value: 'IN', timezone: null },
|
||||
{ label: 'KS Kansas', value: 'KS', timezone: null },
|
||||
{ label: 'KY Kentucky', value: 'KY', timezone: null },
|
||||
{ label: 'LA Louisiana', value: 'LA', timezone: 'UTC-6' },
|
||||
{ label: 'MA Massachusetts', value: 'MA', timezone: 'UTC-5' },
|
||||
{ label: 'MD Maryland', value: 'MD', timezone: 'UTC-5' },
|
||||
{ label: 'ME Maine', value: 'ME', timezone: 'UTC-5' },
|
||||
{ label: 'LA Louisiana', value: 'LA', timezone: 'America/Chicago' },
|
||||
{ label: 'MA Massachusetts', value: 'MA', timezone: 'America/New_York' },
|
||||
{ label: 'MD Maryland', value: 'MD', timezone: 'America/New_York' },
|
||||
{ label: 'ME Maine', value: 'ME', timezone: 'America/New_York' },
|
||||
{ label: 'MI Michigan', value: 'MI', timezone: null },
|
||||
{ label: 'MN Minnesota', value: 'MN', timezone: 'UTC-6' },
|
||||
{ label: 'MO Missouri', value: 'MO', timezone: 'UTC-6' },
|
||||
{ label: 'MS Mississippi', value: 'MS', timezone: 'UTC-6' },
|
||||
{ label: 'MT Montana', value: 'MT', timezone: 'UTC-7' },
|
||||
{ label: 'NC North Carolina', value: 'NC', timezone: 'UTC-5' },
|
||||
{ label: 'MN Minnesota', value: 'MN', timezone: 'America/Chicago' },
|
||||
{ label: 'MO Missouri', value: 'MO', timezone: 'America/Chicago' },
|
||||
{ label: 'MS Mississippi', value: 'MS', timezone: 'America/Chicago' },
|
||||
{ label: 'MT Montana', value: 'MT', timezone: 'America/Denver' },
|
||||
{ label: 'NC North Carolina', value: 'NC', timezone: 'America/New_York' },
|
||||
{ label: 'ND North Dakota', value: 'ND', timezone: null },
|
||||
{ label: 'NE Nebraska', value: 'NE', timezone: null },
|
||||
{ label: 'NH New Hampshire', value: 'NH', timezone: 'UTC-5' },
|
||||
{ label: 'NJ New Jersey', value: 'NJ', timezone: 'UTC-5' },
|
||||
{ label: 'NM New Mexico', value: 'NM', timezone: 'UTC-7' },
|
||||
{ label: 'NV Nevada', value: 'NV', timezone: 'UTC-8' },
|
||||
{ label: 'NY New York', value: 'NY', timezone: 'UTC-5' },
|
||||
{ label: 'OH Ohio', value: 'OH', timezone: 'UTC-5' },
|
||||
{ label: 'OK Oklahoma', value: 'OK', timezone: 'UTC-6' },
|
||||
{ label: 'NH New Hampshire', value: 'NH', timezone: 'America/New_York' },
|
||||
{ label: 'NJ New Jersey', value: 'NJ', timezone: 'America/New_York' },
|
||||
{ label: 'NM New Mexico', value: 'NM', timezone: 'America/Denver' },
|
||||
{ label: 'NV Nevada', value: 'NV', timezone: null },
|
||||
{ label: 'NY New York', value: 'NY', timezone: 'America/New_York' },
|
||||
{ label: 'OH Ohio', value: 'OH', timezone: 'America/New_York' },
|
||||
{ label: 'OK Oklahoma', value: 'OK', timezone: 'America/Chicago' },
|
||||
{ label: 'OR Oregon', value: 'OR', timezone: null },
|
||||
{ label: 'PA Pennsylvania', value: 'PA', timezone: 'UTC-5' },
|
||||
{ label: 'RI Rhode Island', value: 'RI', timezone: 'UTC-5' },
|
||||
{ label: 'SC South Carolina', value: 'SC', timezone: 'UTC-5' },
|
||||
{ label: 'PA Pennsylvania', value: 'PA', timezone: 'America/New_York' },
|
||||
{ label: 'RI Rhode Island', value: 'RI', timezone: 'America/New_York' },
|
||||
{ label: 'SC South Carolina', value: 'SC', timezone: 'America/New_York' },
|
||||
{ label: 'SD South Dakota', value: 'SD', timezone: null },
|
||||
{ label: 'TN Tennessee', value: 'TN', timezone: null },
|
||||
{ label: 'TX Texas', value: 'TX', timezone: null },
|
||||
{ label: 'VA Virginia', value: 'VA', timezone: 'UTC-5' },
|
||||
{ label: 'VT Vermont', value: 'VT', timezone: 'UTC-5' },
|
||||
{ label: 'WA Washington', value: 'WA', timezone: 'UTC-8' },
|
||||
{ label: 'WI Wisconsin', value: 'WI', timezone: 'UTC-6' },
|
||||
{ label: 'WV West Virginia', value: 'WV', timezone: 'UTC-5' },
|
||||
{ label: 'WY Wyoming', value: 'WY', timezone: 'UTC-7' },
|
||||
{ label: 'VA Virginia', value: 'VA', timezone: 'America/New_York' },
|
||||
{ label: 'VT Vermont', value: 'VT', timezone: 'America/New_York' },
|
||||
{ label: 'WA Washington', value: 'WA', timezone: 'America/Los_Angeles' },
|
||||
{ label: 'WI Wisconsin', value: 'WI', timezone: 'America/Chicago' },
|
||||
{ label: 'WV West Virginia', value: 'WV', timezone: 'America/New_York' },
|
||||
{ label: 'WY Wyoming', value: 'WY', timezone: 'America/Denver' },
|
||||
]
|
||||
|
||||
const access = useAccessPreviewStore()
|
||||
@@ -213,7 +216,7 @@ const emptyForm = (type: WarehouseType = 'FBA'): WarehouseForm => ({
|
||||
businessHours: '',
|
||||
warehouseType: type,
|
||||
countryCode: type === 'DOMESTIC' ? 'CN' : 'US',
|
||||
timezone: type === 'DOMESTIC' ? 'UTC+8' : '',
|
||||
timezone: type === 'DOMESTIC' ? 'Asia/Shanghai' : '',
|
||||
receivingCutoffTime: type === 'FBA' ? '' : '18:00:00',
|
||||
status: 'ACTIVE',
|
||||
remark: '',
|
||||
@@ -290,7 +293,7 @@ watch(importMode, () => { importResult.value = null })
|
||||
watch(activeWarehouseType, (type) => {
|
||||
if (type === 'DOMESTIC') {
|
||||
form.countryCode = 'CN'
|
||||
form.timezone = 'UTC+8'
|
||||
form.timezone = 'Asia/Shanghai'
|
||||
} else if (form.countryCode === 'CN') {
|
||||
form.countryCode = 'US'
|
||||
form.province = ''
|
||||
@@ -500,7 +503,7 @@ function buildSaveRequest(): SavePlatformWarehouseRequest {
|
||||
const warehouse = existing?.warehouse
|
||||
const currentAddress = existing?.addresses[0]
|
||||
const countryCode = isDomesticForm.value ? 'CN' : form.countryCode.trim().toUpperCase()
|
||||
const timezone = isDomesticForm.value ? 'UTC+8' : form.timezone.trim()
|
||||
const timezone = isDomesticForm.value ? 'Asia/Shanghai' : form.timezone.trim()
|
||||
const capabilities = (existing?.capabilities || []).map((capability) => ({
|
||||
capabilityCode: capability.capabilityCode,
|
||||
capabilityName: capability.capabilityName,
|
||||
@@ -777,7 +780,7 @@ onMounted(() => void loadWarehouses())
|
||||
<p v-if="formErrors.countryCode" class="field-error" role="alert">{{ formErrors.countryCode }}</p>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="!isDomesticCreate" label="时区" required :class="{ 'has-field-error': formErrors.timezone }">
|
||||
<el-select v-if="isDomesticForm" v-model="form.timezone" disabled placeholder="UTC+8"><el-option label="UTC+8" value="UTC+8" /></el-select>
|
||||
<el-select v-if="isDomesticForm" v-model="form.timezone" disabled placeholder="Asia/Shanghai"><el-option label="Asia/Shanghai" value="Asia/Shanghai" /></el-select>
|
||||
<el-select v-else v-model="form.timezone" filterable placeholder="请选择时区" @change="clearFieldError('timezone')"><el-option v-for="timezone in timezoneOptions" :key="timezone" :label="timezone" :value="timezone" /></el-select>
|
||||
<p v-if="formErrors.timezone" class="field-error" role="alert">{{ formErrors.timezone }}</p>
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user