feat(wms): 统一数量金额精度并清理 schema 脱钩
后端: - 新增 sql/mysql/wms/20260515_wms_amount_precision.sql 11 张表金额字段统一升到 decimal(16,2),覆盖 SKU 单价、单据主表/明细 总金额/行金额、盘库实际金额、库存流水单价/行金额 - 新增 sql/mysql/wms/20260515_wms_sku_dimension_precision.sql SKU 长宽高对齐 lite 改为 decimal(10,1)、毛/净重改为 decimal(10,3) - 测试 SQL create_tables.sql 全量同步生产 MySQL:数量 (20,2)、 金额 (16,2)、长度 (10,1)、重量 (10,3),修复"测试 schema 与生产 脱钩"导致单测假阳性的隐患 - WmsWarehouseServiceImpl.validateWarehouseCodeUnique 去掉 StrUtil.isBlank 提前 return,因 code 已由 VO 层 @NotBlank 强制非空 - WmsWarehouseServiceImplTest 同步调整 前端: - ReceiptOrderForm / ReceiptOrderDetail 合计行去掉"单价合计"派生展示, 单价不能跨行相加;保留数量合计与行金额合计 文档: - review-opus.md 收口至仅剩 F10 (SQL 导出,用户认领) - 新增 fix-plan.md 与 精度调整-codex讨论.md,沉淀本轮决策依据pull/878/head
parent
c81116678a
commit
50cfbfe58b
|
|
@ -100,7 +100,6 @@
|
||||||
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.price) }}
|
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumQuantity(printRows, (detail) => detail.checkQuantity) }}
|
{{ formatSumQuantity(printRows, (detail) => detail.checkQuantity) }}
|
||||||
|
|
|
||||||
|
|
@ -120,9 +120,6 @@ function getSummaries({ columns, data }: { columns: any[]; data: DetailRow[] })
|
||||||
if (column.property === 'quantity') {
|
if (column.property === 'quantity') {
|
||||||
return formatSumQuantity(data, (detail) => detail.quantity)
|
return formatSumQuantity(data, (detail) => detail.quantity)
|
||||||
}
|
}
|
||||||
if (column.property === 'price') {
|
|
||||||
return formatSumPrice(data, (detail) => detail.price)
|
|
||||||
}
|
|
||||||
if (column.property === 'totalPrice') {
|
if (column.property === 'totalPrice') {
|
||||||
return formatSumPrice(data, (detail) => detail.totalPrice)
|
return formatSumPrice(data, (detail) => detail.totalPrice)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,14 +200,12 @@ import WarehouseSelect from '@/views/wms/md/warehouse/components/WarehouseSelect
|
||||||
import { OrderStatusEnum, OrderUpdateStatusList } from '@/views/wms/utils/constants'
|
import { OrderStatusEnum, OrderUpdateStatusList } from '@/views/wms/utils/constants'
|
||||||
import {
|
import {
|
||||||
dividePrice,
|
dividePrice,
|
||||||
formatPrice,
|
|
||||||
formatQuantity,
|
formatQuantity,
|
||||||
formatSumPrice,
|
formatSumPrice,
|
||||||
formatSumQuantity,
|
formatSumQuantity,
|
||||||
multiplyPrice,
|
multiplyPrice,
|
||||||
PRICE_PRECISION,
|
PRICE_PRECISION,
|
||||||
QUANTITY_PRECISION,
|
QUANTITY_PRECISION
|
||||||
sumPrice
|
|
||||||
} from '@/views/wms/utils/format'
|
} from '@/views/wms/utils/format'
|
||||||
import { generateOrderNo } from '@/views/wms/utils/order'
|
import { generateOrderNo } from '@/views/wms/utils/order'
|
||||||
|
|
||||||
|
|
@ -241,9 +239,6 @@ const formRules = reactive<FormRules>({
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const inventorySelectRef = ref()
|
const inventorySelectRef = ref()
|
||||||
|
|
||||||
const detailPriceSum = computed(() =>
|
|
||||||
sumPrice(formData.value.details || [], (detail) => detail.price)
|
|
||||||
)
|
|
||||||
const isPrepareOrder = computed(
|
const isPrepareOrder = computed(
|
||||||
() =>
|
() =>
|
||||||
!formData.value.id ||
|
!formData.value.id ||
|
||||||
|
|
@ -383,9 +378,6 @@ function getDetailSummaries({
|
||||||
if (column.property === 'quantity') {
|
if (column.property === 'quantity') {
|
||||||
return formatSumQuantity(data, (detail) => detail.quantity)
|
return formatSumQuantity(data, (detail) => detail.quantity)
|
||||||
}
|
}
|
||||||
if (column.property === 'price') {
|
|
||||||
return formatPrice(detailPriceSum.value)
|
|
||||||
}
|
|
||||||
if (column.property === 'totalPrice') {
|
if (column.property === 'totalPrice') {
|
||||||
return formatSumPrice(data, (detail) => detail.totalPrice)
|
return formatSumPrice(data, (detail) => detail.totalPrice)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@
|
||||||
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.price) }}
|
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.totalPrice) }}
|
{{ formatSumPrice(printRows, (detail) => detail.totalPrice) }}
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,6 @@ function getSummaries({ columns, data }: { columns: any[]; data: DetailRow[] })
|
||||||
if (column.property === 'quantity') {
|
if (column.property === 'quantity') {
|
||||||
return formatSumQuantity(data, (detail) => detail.quantity)
|
return formatSumQuantity(data, (detail) => detail.quantity)
|
||||||
}
|
}
|
||||||
if (column.property === 'price') {
|
|
||||||
return formatSumPrice(data, (detail) => detail.price)
|
|
||||||
}
|
|
||||||
if (column.property === 'totalPrice') {
|
if (column.property === 'totalPrice') {
|
||||||
return formatSumPrice(data, (detail) => detail.totalPrice)
|
return formatSumPrice(data, (detail) => detail.totalPrice)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,13 +201,11 @@ import WarehouseSelect from '@/views/wms/md/warehouse/components/WarehouseSelect
|
||||||
import { OrderStatusEnum, OrderUpdateStatusList } from '@/views/wms/utils/constants'
|
import { OrderStatusEnum, OrderUpdateStatusList } from '@/views/wms/utils/constants'
|
||||||
import {
|
import {
|
||||||
dividePrice,
|
dividePrice,
|
||||||
formatPrice,
|
|
||||||
formatSumPrice,
|
formatSumPrice,
|
||||||
formatSumQuantity,
|
formatSumQuantity,
|
||||||
multiplyPrice,
|
multiplyPrice,
|
||||||
PRICE_PRECISION,
|
PRICE_PRECISION,
|
||||||
QUANTITY_PRECISION,
|
QUANTITY_PRECISION
|
||||||
sumPrice
|
|
||||||
} from '@/views/wms/utils/format'
|
} from '@/views/wms/utils/format'
|
||||||
import { generateOrderNo } from '@/views/wms/utils/order'
|
import { generateOrderNo } from '@/views/wms/utils/order'
|
||||||
|
|
||||||
|
|
@ -243,9 +241,6 @@ const formRules = reactive<FormRules>({
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const skuSelectRef = ref() // 商品 SKU 选择弹窗 Ref
|
const skuSelectRef = ref() // 商品 SKU 选择弹窗 Ref
|
||||||
|
|
||||||
const detailPriceSum = computed(() =>
|
|
||||||
sumPrice(formData.value.details || [], (detail) => detail.price)
|
|
||||||
)
|
|
||||||
const isPrepareOrder = computed(
|
const isPrepareOrder = computed(
|
||||||
() =>
|
() =>
|
||||||
!formData.value.id ||
|
!formData.value.id ||
|
||||||
|
|
@ -366,9 +361,6 @@ function getDetailSummaries({ columns, data }: { columns: any[]; data: ReceiptOr
|
||||||
if (column.property === 'quantity') {
|
if (column.property === 'quantity') {
|
||||||
return formatSumQuantity(data, (detail) => detail.quantity)
|
return formatSumQuantity(data, (detail) => detail.quantity)
|
||||||
}
|
}
|
||||||
if (column.property === 'price') {
|
|
||||||
return formatPrice(detailPriceSum.value)
|
|
||||||
}
|
|
||||||
if (column.property === 'totalPrice') {
|
if (column.property === 'totalPrice') {
|
||||||
return formatSumPrice(data, (detail) => detail.totalPrice)
|
return formatSumPrice(data, (detail) => detail.totalPrice)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@
|
||||||
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.price) }}
|
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.totalPrice) }}
|
{{ formatSumPrice(printRows, (detail) => detail.totalPrice) }}
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,6 @@ function getSummaries({ columns, data }: { columns: any[]; data: DetailRow[] })
|
||||||
if (column.property === 'quantity') {
|
if (column.property === 'quantity') {
|
||||||
return formatSumQuantity(data, (detail) => detail.quantity)
|
return formatSumQuantity(data, (detail) => detail.quantity)
|
||||||
}
|
}
|
||||||
if (column.property === 'price') {
|
|
||||||
return formatSumPrice(data, (detail) => detail.price)
|
|
||||||
}
|
|
||||||
if (column.property === 'totalPrice') {
|
if (column.property === 'totalPrice') {
|
||||||
return formatSumPrice(data, (detail) => detail.totalPrice)
|
return formatSumPrice(data, (detail) => detail.totalPrice)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -211,14 +211,12 @@ import WarehouseSelect from '@/views/wms/md/warehouse/components/WarehouseSelect
|
||||||
import { OrderStatusEnum, OrderUpdateStatusList } from '@/views/wms/utils/constants'
|
import { OrderStatusEnum, OrderUpdateStatusList } from '@/views/wms/utils/constants'
|
||||||
import {
|
import {
|
||||||
dividePrice,
|
dividePrice,
|
||||||
formatPrice,
|
|
||||||
formatQuantity,
|
formatQuantity,
|
||||||
formatSumPrice,
|
formatSumPrice,
|
||||||
formatSumQuantity,
|
formatSumQuantity,
|
||||||
multiplyPrice,
|
multiplyPrice,
|
||||||
PRICE_PRECISION,
|
PRICE_PRECISION,
|
||||||
QUANTITY_PRECISION,
|
QUANTITY_PRECISION
|
||||||
sumPrice
|
|
||||||
} from '@/views/wms/utils/format'
|
} from '@/views/wms/utils/format'
|
||||||
import { generateOrderNo } from '@/views/wms/utils/order'
|
import { generateOrderNo } from '@/views/wms/utils/order'
|
||||||
|
|
||||||
|
|
@ -254,9 +252,6 @@ const formRules = reactive<FormRules>({
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const inventorySelectRef = ref() // 库存选择弹窗 Ref
|
const inventorySelectRef = ref() // 库存选择弹窗 Ref
|
||||||
|
|
||||||
const detailPriceSum = computed(() =>
|
|
||||||
sumPrice(formData.value.details || [], (detail) => detail.price)
|
|
||||||
)
|
|
||||||
const isPrepareOrder = computed(
|
const isPrepareOrder = computed(
|
||||||
() =>
|
() =>
|
||||||
!formData.value.id ||
|
!formData.value.id ||
|
||||||
|
|
@ -383,9 +378,6 @@ function getDetailSummaries({ columns, data }: { columns: any[]; data: ShipmentO
|
||||||
if (column.property === 'quantity') {
|
if (column.property === 'quantity') {
|
||||||
return formatSumQuantity(data, (detail) => detail.quantity)
|
return formatSumQuantity(data, (detail) => detail.quantity)
|
||||||
}
|
}
|
||||||
if (column.property === 'price') {
|
|
||||||
return formatPrice(detailPriceSum.value)
|
|
||||||
}
|
|
||||||
if (column.property === 'totalPrice') {
|
if (column.property === 'totalPrice') {
|
||||||
return formatSumPrice(data, (detail) => detail.totalPrice)
|
return formatSumPrice(data, (detail) => detail.totalPrice)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@
|
||||||
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
{{ formatSumQuantity(printRows, (detail) => detail.quantity) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.price) }}
|
|
||||||
</td>
|
</td>
|
||||||
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
<td class="border border-solid border-#dcdfe6 bg-#f5f7fa p-8px text-right">
|
||||||
{{ formatSumPrice(printRows, (detail) => detail.totalPrice) }}
|
{{ formatSumPrice(printRows, (detail) => detail.totalPrice) }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue