Commit cc19e96f authored by lihui's avatar lihui

fix: 时间选择格式+限制不能为0+提示

parent 80f84ebc
......@@ -53,15 +53,17 @@
<el-table-column prop="inventory_rest" label="剩余库存"></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template #default="scope">
<el-button
type="text"
size="small"
@click="commodity('update', scope.row)"
>修改</el-button
>
<el-button type="text" size="small" @click="removeCom(scope.row)"
>移除</el-button
>
<div class="buttons_actions">
<el-button
type="text"
size="small"
@click="commodity('update', scope.row)"
>修改</el-button
>
<el-button type="text" size="small" @click="removeCom(scope.row)"
>移除</el-button
>
</div>
</template>
</el-table-column>
</el-table>
......@@ -181,7 +183,7 @@
}
]"
>
<el-input-number
<el-input
v-model="commodityForm.num_limit"
:disabled="
commodityForm.checkedRadio === '' ||
......@@ -192,7 +194,7 @@
"
:min="0"
:controls="false"
></el-input-number>
></el-input>
</el-form-item>
<el-form-item
label="商家:"
......@@ -306,8 +308,11 @@ import {
} from "../../../../service/Activity/index";
// 当选择(每人最多买时 添加验证(非空))
let checkPurseLimit = (rule, value, callback) => {
let str = /^[1-9]\d*$/;
if (value === "" || value === undefined || value === 0) {
return callback(new Error("请添加限制购买数量"));
} else if (!str.test(value)) {
return callback(new Error("请输入正确的购买数量"));
} else {
callback();
}
......@@ -350,7 +355,7 @@ var addProduct = {
inventory_total: "",
total_amount_order: "",
business1: "",
num_limit: 0, // 购买限制数量
num_limit: "", // 购买限制数量
checkedRadio: "" // 购买限制radio
},
picStr: "",
......@@ -462,7 +467,10 @@ var addProduct = {
this.inventoryRest = res.result.goods_info.inventory_rest;
this.inventoryTotal = res.result.goods_info.inventory_total;
this.commodityForm = res.result.goods_info;
this.commodityForm.num_limit = res.result.goods_info.rule_limit; // 购买限制的数量
this.commodityForm.num_limit =
res.result.goods_info.rule_limit === 0
? ""
: res.result.goods_info.rule_limit; // 购买限制的数量
this.commodityForm.checkedRadio =
res.result.goods_info.rule_limit === 0 ||
res.result.goods_info.rule_limit === undefined
......@@ -719,7 +727,11 @@ export default addProduct;
width: 90%;
margin: 0 auto;
}
.buttons_actions {
display: flex;
justify-content: space-around;
align-items: center;
}
.btnGroup {
margin-bottom: 15px;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment