fix: 统一计划产品计量单位并兼容历史吨单位,避免保存时关联校验失败。

This commit is contained in:
wuzilong committed 2026-10-29 16:16:25 +08:00
1 parent 75d7da3d3d
commit 6f4d4d2c59
10 files changed
+16078 -36329

No files matched your search

@@ -731,6 +731,7 @@
prepareLineAliasAndBrandForSubmit,
resolveLineProductName
} from '@/utils/crm-product-brand'
import { normalizeProductUnitValue } from '@/utils/crm-product-display'
import { formatPlVehiclePlateOptionLabel } from '@/utils/pl-display'
import {
buildMissingHazardCertReadyMessage,
@@ -2208,7 +2209,7 @@
productName: String(product.productName || ''),
model: product.model as string | undefined,
categoryName: product.categoryName as string | undefined,
unit: String(product.unit || '吨'),
unit: normalizeProductUnitValue(product.unit),
quantity: 1,
actualQty: 0,
packageSpec: resolveDefaultPackageSpec(productId),
@@ -2316,7 +2317,7 @@
productNo: String(line.productNo || productId),
productName: String(line.productName || ''),
model: (line.model as string) || undefined,
unit: String(line.unit || '吨'),
unit: normalizeProductUnitValue(line.unit),
quantity: 1,
actualQty: 0,
packageSpec,
@@ -2388,7 +2389,7 @@
brandName: item.brandName || undefined,
model: item.model,
categoryName: item.categoryName,
unit: item.unit || '吨',
unit: normalizeProductUnitValue(item.unit),
quantity: Number(item.quantity || item.inboundEstimateQty || item.outboundEstimateQty || 0),
actualQty: 0,
packageSpec: item.packageSpec,
@@ -2432,7 +2433,7 @@
brandId: item.brandMode === 'required' ? item.brandId || undefined : undefined,
brandName: item.brandMode === 'required' ? item.brandName || undefined : undefined,
model: item.model,
unit: item.unit,
unit: normalizeProductUnitValue(item.unit),
categoryName: item.categoryName,
packageSpec: item.packageSpec,
deliveryMethod: item.deliveryMethod,