【功能优化】优化限时满减的金额数据库保存为分
parent
0ca860f662
commit
1553c31e0b
|
|
@ -45,7 +45,7 @@ import { cloneDeep } from 'lodash-es'
|
|||
import * as DiscountActivityApi from '@/api/mall/promotion/discount/discountActivity'
|
||||
import * as ProductSpuApi from '@/api/mall/product/spu'
|
||||
import { getPropertyList, RuleConfig } from '@/views/mall/product/spu/components'
|
||||
import { formatToFraction } from '@/utils'
|
||||
import { yuanToFen, fenToYuan } from '@/utils'
|
||||
|
||||
defineOptions({ name: 'PromotionDiscountActivityForm' })
|
||||
|
||||
|
|
@ -105,6 +105,9 @@ const getSpuDetails = async (
|
|||
}
|
||||
if (typeof products !== 'undefined') {
|
||||
const product = products.find((item) => item.skuId === sku.id)
|
||||
if(product?.discountPrice){
|
||||
product.discountPrice = Number(fenToYuan(product.discountPrice))
|
||||
}
|
||||
config = product || config
|
||||
}
|
||||
sku.productConfig = config
|
||||
|
|
@ -174,6 +177,7 @@ const submitForm = async () => {
|
|||
} else {
|
||||
discountInvalid = true
|
||||
}
|
||||
item.discountPrice = yuanToFen(item.discountPrice)
|
||||
})
|
||||
if (discountInvalid) {
|
||||
message.error('优惠金额和折扣百分比需要填写一个')
|
||||
|
|
|
|||
Loading…
Reference in New Issue