Merge remote-tracking branch 'refs/remotes/update/dev' into develop-mall

This commit is contained in:
痴货 2024-09-15 20:40:30 +08:00
commit f069f809c2
2 changed files with 18 additions and 1 deletions

View File

@ -120,6 +120,9 @@ const open = async (type: string, id?: number) => {
data.rules?.forEach((item: any) => {
item.limit = fenToYuan(item.limit || 0)
item.discountPrice = fenToYuan(item.discountPrice || 0)
if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) {
item.limit = fenToYuan(item.limit || 0)
}
})
formData.value = data
//
@ -153,6 +156,9 @@ const submitForm = async () => {
data.rules.forEach((item) => {
item.limit = yuanToFen(item.limit || 0)
item.discountPrice = yuanToFen(item.discountPrice || 0)
if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) {
item.limit = yuanToFen(item.limit || 0)
}
})
//
setProductScopeValues(data)

View File

@ -10,14 +10,25 @@
<el-form ref="formRef" :model="rule">
<el-form-item label="优惠门槛:" label-width="100px" prop="limit">
<el-input-number
v-if="PromotionConditionTypeEnum.PRICE.type === formData.conditionType"
v-model="rule.limit"
:min="0"
:precision="2"
:step="0.1"
class="w-150px! p-x-20px!"
placeholder=""
type="number"
controls-position="right"
/>
<el-input
v-else
v-model="rule.limit"
:min="0"
class="w-150px! p-x-20px!"
placeholder=""
type="number"
/>
<!-- TODO @puhui999走字典数据 -->
{{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }}
</el-form-item>
<el-form-item label="优惠内容:" label-width="100px">