优化砍价逻辑,以及修改劵活动Bug

master
lemon橪 2021-10-12 18:06:52 +08:00
parent e80316d43d
commit 6fa3fa7822
3 changed files with 11 additions and 38 deletions

View File

@ -221,6 +221,7 @@ export default {
if (res.success) {
this.$Message.success("优惠券活动已停止");
this.getDataList();
this.$Modal.remove()
}
}).catch(() => {});
},

View File

@ -19,22 +19,18 @@
</template>
<template slot-scope="{ index }" slot="settlementPrice">
<Input type="number" v-model="form.promotionGoodsList[index].settlementPrice" />
<InputNumber :min="0" v-model="form.promotionGoodsList[index].settlementPrice" />
</template>
<template slot-scope="{ index }" slot="lowestPrice">
<Input type="number" v-model="form.promotionGoodsList[index].lowestPrice" />
<InputNumber :min="0" v-model="form.promotionGoodsList[index].lowestPrice" />
</template>
<template slot-scope="{ index }" slot="highestPrice">
<Input type="number" v-model="form.promotionGoodsList[index].highestPrice" />
<InputNumber :min="0" v-model="form.promotionGoodsList[index].highestPrice" />
</template>
<template slot-scope="{ index }" slot="purchasePrice">
<Input type="number" v-model="form.promotionGoodsList[index].purchasePrice" />
</template>
<template slot-scope="{ index }" slot="stock">
<Input type="number" v-model="form.promotionGoodsList[index].stock" />
<InputNumber :min="0" v-model="form.promotionGoodsList[index].stock" />
</template>
</Table>
</FormItem>
@ -122,12 +118,6 @@ export default {
slot: "highestPrice",
width: 110,
},
{
title: "最低购买金额",
slot: "purchasePrice",
width: 110,
},
{
title: "活动库存",
slot: "stock",
@ -209,11 +199,7 @@ export default {
this.$Message.error("活动库存不能为0且不能超过商品库存");
return;
}
//
if (!regular.money.test(res.purchasePrice)) {
checkResult = false;
this.$Message.error("最低购买金额格式不正确");
}
//
if (!regular.money.test(res.settlementPrice)) {
checkResult = false;
@ -324,7 +310,7 @@ export default {
item.forEach((e) => {
list.push({
settlementPrice: e.settlementPrice || 0,
purchasePrice: e.purchasePrice || 0,
purchasePrice: 0,
lowestPrice: e.lowestPrice || 0,
highestPrice: e.highestPrice || 0,
stock: e.stock || 0,

View File

@ -30,16 +30,7 @@
style="width: 260px"
/>
</FormItem>
<FormItem label="最低购买金额" prop="purchasePrice">
<Input
:disabled="onlyView"
type="number"
v-model="form.purchasePrice"
placeholder="请填写最低购买金额"
clearable
style="width: 260px"
/>
</FormItem>
<FormItem label="最低可砍" prop="lowestPrice">
<Input
:disabled="onlyView"
@ -156,6 +147,7 @@
return {
modalType: 0, //
form: {
purchasePrice:0,
goodsSku: {},
},
id: this.$route.query.id, // id
@ -166,10 +158,7 @@
{required: true, message: "请输入结算金额"},
{validator: checkSettlementPrice},
],
purchasePrice: [
{required: true, message: "请输入最低购买金额"},
{validator: checkPurchasePrice},
],
lowestPrice: [
{required: true, message: "请输入最低可砍金额"},
{validator: checkLowestPrice},
@ -227,10 +216,7 @@
this.$Message.error("活动库存不能为0且不能超过商品库存");
return
}
//
if (!regular.money.test(params.purchasePrice)) {
this.$Message.error("最低购买金额格式不正确");
}
//
if (!regular.money.test(params.settlementPrice)) {
this.$Message.error("结算价格金额格式不正确");