Commit cc19e96f authored by lihui's avatar lihui

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

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