优化
This commit is contained in:
@@ -10,7 +10,6 @@ import OverseasReadOnlyDetail from '../components/OverseasReadOnlyDetail.vue'
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const palletId = computed(() => String(route.params.palletId || '—'))
|
||||
const customerId = computed(() => String(route.query.customerId || ''))
|
||||
const warehouseId = computed(() => String(route.query.warehouseId || ''))
|
||||
const detail = ref<PalletDto | null>(null)
|
||||
const warehouseName = ref('—')
|
||||
@@ -22,15 +21,15 @@ const groups = [
|
||||
]
|
||||
const values = computed(() => ({
|
||||
托盘编码: detail.value?.palletCode || '—', 托盘类型: detail.value?.palletType || '—', 仓库: warehouseName.value,
|
||||
'容积(m³)': detail.value?.capacityCbm ?? '—', 采购价格: detail.value?.unitPrice ?? '—', 所属FBA仓: '—', 状态: detail.value?.status || '—',
|
||||
'容积(m³)': detail.value?.capacityCbm ?? '—', 采购价格: detail.value?.unitPrice ?? '—', 所属FBA仓: detail.value?.fbaWarehouseCode || '—', 状态: detail.value?.status || '—',
|
||||
库位ID: detail.value?.locationId || '—', 创建时间: detail.value?.createdAt || '—', 更新时间: detail.value?.updatedAt || '—', 备注: detail.value?.remark || '—',
|
||||
}))
|
||||
|
||||
async function load() {
|
||||
if (!customerId.value || !warehouseId.value || palletId.value === '—') { loadError.value = getApiErrorDetails(new Error('托盘详情缺少客户或仓库参数')); return }
|
||||
if (!warehouseId.value || palletId.value === '—') { loadError.value = getApiErrorDetails(new Error('托盘详情缺少仓库参数')); return }
|
||||
loading.value = true; loadError.value = null
|
||||
try {
|
||||
const [pallet, warehouses] = await Promise.all([getPallet(customerId.value, warehouseId.value, palletId.value), listCustomerWarehouses(customerId.value)])
|
||||
const [pallet, warehouses] = await Promise.all([getPallet(warehouseId.value, palletId.value), listCustomerWarehouses()])
|
||||
detail.value = pallet
|
||||
const warehouse = warehouses.records.find((item) => String(item.id) === warehouseId.value)
|
||||
warehouseName.value = warehouse ? `${warehouse.warehouseName}(${warehouse.warehouseCode})` : warehouseId.value
|
||||
|
||||
Reference in New Issue
Block a user