fix: 积分商品最小金额0.01
This commit is contained in:
parent
7bb3eb514e
commit
e0d48b59f6
|
@ -124,6 +124,19 @@
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item
|
||||||
|
v-if="configForm.exchangePointsType === 1"
|
||||||
|
label="最低兑换金额(商业支付最少0.01元)"
|
||||||
|
prop="exchangeRequiredAmount"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="configForm.exchangeRequiredAmount"
|
||||||
|
placeholder="请输入优惠购价格"
|
||||||
|
style="width: 200px"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="configForm.exchangePointsType === 2"
|
v-if="configForm.exchangePointsType === 2"
|
||||||
label="优惠购商品价格"
|
label="优惠购商品价格"
|
||||||
|
@ -148,6 +161,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { readonly } from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PointsProductConfig",
|
name: "PointsProductConfig",
|
||||||
data() {
|
data() {
|
||||||
|
@ -164,7 +179,7 @@ export default {
|
||||||
exchangeRequiredPoints: 1,
|
exchangeRequiredPoints: 1,
|
||||||
exchangeInventory: 10,
|
exchangeInventory: 10,
|
||||||
exchangePointsType: 1, // 1: 积分换购, 2: 积分优惠购
|
exchangePointsType: 1, // 1: 积分换购, 2: 积分优惠购
|
||||||
exchangeRequiredAmount: ""
|
exchangeRequiredAmount: 0.01
|
||||||
},
|
},
|
||||||
configRules: {
|
configRules: {
|
||||||
exchangeRequiredPoints: [
|
exchangeRequiredPoints: [
|
||||||
|
@ -210,7 +225,7 @@ export default {
|
||||||
exchangeRequiredPoints: editData.exchangeRequiredPoints || 1,
|
exchangeRequiredPoints: editData.exchangeRequiredPoints || 1,
|
||||||
exchangeInventory: 0, // 编辑模式下默认为0,表示增加库存
|
exchangeInventory: 0, // 编辑模式下默认为0,表示增加库存
|
||||||
exchangePointsType: editData.exchangePointsType || 1,
|
exchangePointsType: editData.exchangePointsType || 1,
|
||||||
exchangeRequiredAmount: editData.exchangeRequiredAmount || ""
|
exchangeRequiredAmount: editData.exchangeRequiredAmount || 0.01
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// 新增模式,使用默认值
|
// 新增模式,使用默认值
|
||||||
|
@ -222,7 +237,7 @@ export default {
|
||||||
exchangeRequiredPoints: 1,
|
exchangeRequiredPoints: 1,
|
||||||
exchangeInventory: 10,
|
exchangeInventory: 10,
|
||||||
exchangePointsType: exchangeType, // 使用传入的积分类型
|
exchangePointsType: exchangeType, // 使用传入的积分类型
|
||||||
exchangeRequiredAmount: ""
|
exchangeRequiredAmount: 0.01
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -240,7 +255,7 @@ export default {
|
||||||
exchangeRequiredPoints: 1,
|
exchangeRequiredPoints: 1,
|
||||||
exchangeInventory: 10,
|
exchangeInventory: 10,
|
||||||
exchangePointsType: 1,
|
exchangePointsType: 1,
|
||||||
exchangeRequiredAmount: ""
|
exchangeRequiredAmount: 0.01
|
||||||
};
|
};
|
||||||
this.isEdit = false;
|
this.isEdit = false;
|
||||||
this.$refs.configForm && this.$refs.configForm.clearValidate();
|
this.$refs.configForm && this.$refs.configForm.clearValidate();
|
||||||
|
@ -275,6 +290,11 @@ export default {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
console.log(submitData);
|
console.log(submitData);
|
||||||
|
if (submitData.exchangeRequiredAmount < 0.01) {
|
||||||
|
this.$message.error("请输入正确的优惠购价格, 不能小于0.01");
|
||||||
|
this.submitting = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据是否编辑模式调用不同的API
|
// 根据是否编辑模式调用不同的API
|
||||||
const apiCall = this.isEdit
|
const apiCall = this.isEdit
|
||||||
|
|
Loading…
Reference in New Issue