fix(wms): 完善单据状态保护与金额精度处理
- 后端补充商品、往来企业唯一性校验 - 单据更新改为按草稿状态条件更新,避免覆盖已完成单据 - 补充 WMS 金额、规格精度迁移 SQL 与测试表结构 - 前端统一明细金额兜底计算,优化完成/作废取消处理wms
parent
50cfbfe58b
commit
b3bb1114ba
|
|
@ -628,6 +628,8 @@ const handleComplete = async () => {
|
|||
message.success('盘库成功')
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
} catch {
|
||||
// 用户点击确认框取消按钮、或网络异常时跳过
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -642,6 +644,8 @@ const handleCancel = async () => {
|
|||
message.success('作废成功')
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
} catch {
|
||||
// 用户点击确认框取消按钮、或网络异常时跳过
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ import {
|
|||
formatPrice,
|
||||
formatQuantity,
|
||||
formatSumPrice,
|
||||
formatSumQuantity
|
||||
formatSumQuantity,
|
||||
multiplyPrice
|
||||
} from '@/views/wms/utils/format'
|
||||
|
||||
/** WMS 移库单详情 */
|
||||
|
|
@ -103,11 +104,7 @@ interface DetailRow extends MovementOrderDetailVO {
|
|||
const detailRows = computed<DetailRow[]>(() =>
|
||||
(detailData.value.details || []).map((detail) => ({
|
||||
...detail,
|
||||
totalPrice:
|
||||
detail.totalPrice ??
|
||||
(detail.price != null && detail.quantity
|
||||
? Number(detail.price) * Number(detail.quantity)
|
||||
: undefined)
|
||||
totalPrice: detail.totalPrice ?? multiplyPrice(detail.quantity, detail.price)
|
||||
}))
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -466,6 +466,8 @@ const handleComplete = async () => {
|
|||
message.success('移库成功')
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
} catch {
|
||||
// 用户点击确认框取消按钮、或网络异常时跳过
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
@ -480,6 +482,8 @@ const handleCancel = async () => {
|
|||
message.success('作废成功')
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
} catch {
|
||||
// 用户点击确认框取消按钮、或网络异常时跳过
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -367,6 +367,7 @@ import {
|
|||
import {
|
||||
formatPrice,
|
||||
formatQuantity,
|
||||
multiplyPrice,
|
||||
PRICE_PRECISION,
|
||||
QUANTITY_PRECISION
|
||||
} from '@/views/wms/utils/format'
|
||||
|
|
@ -502,10 +503,7 @@ const getDetailTotalPrice = (detail: MovementOrderDetailVO) => {
|
|||
if (detail.totalPrice !== undefined && detail.totalPrice !== null) {
|
||||
return detail.totalPrice
|
||||
}
|
||||
if (!detail.quantity || detail.price === undefined || detail.price === null) {
|
||||
return undefined
|
||||
}
|
||||
return Number(detail.quantity) * Number(detail.price)
|
||||
return multiplyPrice(detail.quantity, detail.price)
|
||||
}
|
||||
|
||||
/** 展开明细 */
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ import {
|
|||
formatPrice,
|
||||
formatQuantity,
|
||||
formatSumPrice,
|
||||
formatSumQuantity
|
||||
formatSumQuantity,
|
||||
multiplyPrice
|
||||
} from '@/views/wms/utils/format'
|
||||
|
||||
/** WMS 入库单详情 */
|
||||
|
|
@ -120,11 +121,7 @@ const detailData = ref<ReceiptOrderVO>({}) // 详情数据
|
|||
const detailRows = computed<DetailRow[]>(() =>
|
||||
(detailData.value.details || []).map((detail) => ({
|
||||
...detail,
|
||||
totalPrice:
|
||||
detail.totalPrice ??
|
||||
(detail.price != null && detail.quantity
|
||||
? Number(detail.price) * Number(detail.quantity)
|
||||
: undefined)
|
||||
totalPrice: detail.totalPrice ?? multiplyPrice(detail.quantity, detail.price)
|
||||
}))
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ import {
|
|||
formatPrice,
|
||||
formatQuantity,
|
||||
formatSumPrice,
|
||||
formatSumQuantity
|
||||
formatSumQuantity,
|
||||
multiplyPrice
|
||||
} from '@/views/wms/utils/format'
|
||||
import Barcode from '@/views/mes/wm/barcode/components/Barcode.vue'
|
||||
import { BarcodeFormatEnum } from '@/views/mes/utils/constants'
|
||||
|
|
@ -129,11 +130,7 @@ interface PrintRow extends ReceiptOrderDetailVO {
|
|||
const printRows = computed<PrintRow[]>(() =>
|
||||
(printData.value.details || []).map((detail) => ({
|
||||
...detail,
|
||||
totalPrice:
|
||||
detail.totalPrice ??
|
||||
(detail.price != null && detail.quantity
|
||||
? Number((Number(detail.price) * Number(detail.quantity)).toFixed(2))
|
||||
: undefined)
|
||||
totalPrice: detail.totalPrice ?? multiplyPrice(detail.quantity, detail.price)
|
||||
}))
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ import {
|
|||
import {
|
||||
formatPrice,
|
||||
formatQuantity,
|
||||
multiplyPrice,
|
||||
PRICE_PRECISION,
|
||||
QUANTITY_PRECISION
|
||||
} from '@/views/wms/utils/format'
|
||||
|
|
@ -559,10 +560,7 @@ const getDetailTotalPrice = (detail: ReceiptOrderDetailVO) => {
|
|||
if (detail.totalPrice !== undefined && detail.totalPrice !== null) {
|
||||
return detail.totalPrice
|
||||
}
|
||||
if (!detail.quantity || detail.price === undefined || detail.price === null) {
|
||||
return undefined
|
||||
}
|
||||
return Number(detail.quantity) * Number(detail.price)
|
||||
return multiplyPrice(detail.quantity, detail.price)
|
||||
}
|
||||
|
||||
/** 展开明细 */
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ import {
|
|||
formatPrice,
|
||||
formatQuantity,
|
||||
formatSumPrice,
|
||||
formatSumQuantity
|
||||
formatSumQuantity,
|
||||
multiplyPrice
|
||||
} from '@/views/wms/utils/format'
|
||||
|
||||
/** WMS 出库单详情 */
|
||||
|
|
@ -120,11 +121,7 @@ const detailData = ref<ShipmentOrderVO>({}) // 详情数据
|
|||
const detailRows = computed<DetailRow[]>(() =>
|
||||
(detailData.value.details || []).map((detail) => ({
|
||||
...detail,
|
||||
totalPrice:
|
||||
detail.totalPrice ??
|
||||
(detail.price != null && detail.quantity
|
||||
? Number(detail.price) * Number(detail.quantity)
|
||||
: undefined)
|
||||
totalPrice: detail.totalPrice ?? multiplyPrice(detail.quantity, detail.price)
|
||||
}))
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ import {
|
|||
formatPrice,
|
||||
formatQuantity,
|
||||
formatSumPrice,
|
||||
formatSumQuantity
|
||||
formatSumQuantity,
|
||||
multiplyPrice
|
||||
} from '@/views/wms/utils/format'
|
||||
import Barcode from '@/views/mes/wm/barcode/components/Barcode.vue'
|
||||
import { BarcodeFormatEnum } from '@/views/mes/utils/constants'
|
||||
|
|
@ -129,11 +130,7 @@ interface PrintRow extends ShipmentOrderDetailVO {
|
|||
const printRows = computed<PrintRow[]>(() =>
|
||||
(printData.value.details || []).map((detail) => ({
|
||||
...detail,
|
||||
totalPrice:
|
||||
detail.totalPrice ??
|
||||
(detail.price != null && detail.quantity
|
||||
? Number((Number(detail.price) * Number(detail.quantity)).toFixed(2))
|
||||
: undefined)
|
||||
totalPrice: detail.totalPrice ?? multiplyPrice(detail.quantity, detail.price)
|
||||
}))
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -414,6 +414,7 @@ import {
|
|||
import {
|
||||
formatPrice,
|
||||
formatQuantity,
|
||||
multiplyPrice,
|
||||
PRICE_PRECISION,
|
||||
QUANTITY_PRECISION
|
||||
} from '@/views/wms/utils/format'
|
||||
|
|
@ -559,10 +560,7 @@ const getDetailTotalPrice = (detail: ShipmentOrderDetailVO) => {
|
|||
if (detail.totalPrice !== undefined && detail.totalPrice !== null) {
|
||||
return detail.totalPrice
|
||||
}
|
||||
if (!detail.quantity || detail.price === undefined || detail.price === null) {
|
||||
return undefined
|
||||
}
|
||||
return Number(detail.quantity) * Number(detail.price)
|
||||
return multiplyPrice(detail.quantity, detail.price)
|
||||
}
|
||||
|
||||
/** 展开明细 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue