Commit a9f986e4 authored by mengwenhao's avatar mengwenhao

fix:解决部分输入框bug

parent fe769961
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
type="textarea" type="textarea"
:readonly="true" :readonly="true"
:autosize="{ minRows: 4 }"
v-model="goodsObj.introduce" v-model="goodsObj.introduce"
></el-input> ></el-input>
<span v-else>{{ goodsObj.introduce }}</span> <span v-else>{{ goodsObj.introduce }}</span>
...@@ -299,7 +300,11 @@ ...@@ -299,7 +300,11 @@
:model="shopForm" :model="shopForm"
> >
<el-form-item label="门店名称:"> <el-form-item label="门店名称:">
<el-input v-model="shopForm.shop_name"></el-input> <el-input
v-model="shopForm.shop_name"
maxlength="20"
show-word-limit
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系电话:"> <el-form-item label="联系电话:">
<el-input v-model="shopForm.connect_phone"></el-input> <el-input v-model="shopForm.connect_phone"></el-input>
...@@ -324,6 +329,7 @@ ...@@ -324,6 +329,7 @@
type="primary" type="primary"
@click="addShop" @click="addShop"
>保存</el-button> >保存</el-button>
<el-button @click="addShopShow = false">取消</el-button>
</section> </section>
</el-popover> </el-popover>
</el-popover> </el-popover>
...@@ -362,6 +368,7 @@ ...@@ -362,6 +368,7 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
v-model="goodsObj.inventory_rest" v-model="goodsObj.inventory_rest"
:min="0" :min="0"
@blur="hasNumber"
></el-input-number> ></el-input-number>
<span v-else>{{ goodsObj.inventory_rest }}</span> <span v-else>{{ goodsObj.inventory_rest }}</span>
</el-form-item> </el-form-item>
...@@ -469,6 +476,7 @@ ...@@ -469,6 +476,7 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
type="textarea" type="textarea"
maxlength="100" maxlength="100"
:autosize="{ minRows: 4 }"
show-word-limit show-word-limit
v-model="goodsObj.rule_desc" v-model="goodsObj.rule_desc"
></el-input> ></el-input>
...@@ -563,10 +571,7 @@ ...@@ -563,10 +571,7 @@
@click="saveDetailMessage" @click="saveDetailMessage"
>保存 >保存
</el-button> </el-button>
<el-button <el-button @click="backToDetail">返回</el-button>
type="primary"
@click="backToDetail"
>返回 </el-button>
</section> </section>
</el-card> </el-card>
<!-- 展示缩略图 --> <!-- 展示缩略图 -->
...@@ -944,7 +949,6 @@ export default { ...@@ -944,7 +949,6 @@ export default {
this.isGoodsNameRepeat = true; this.isGoodsNameRepeat = true;
} else { } else {
this.isGoodsNameRepeat = false; this.isGoodsNameRepeat = false;
return this.$message.error("商品名称被占用");
} }
}, },
...@@ -971,6 +975,13 @@ export default { ...@@ -971,6 +975,13 @@ export default {
this.isShowPopver = true; this.isShowPopver = true;
}, },
// 剩余库存量更改
hasNumber () {
if (!this.goodsObj.inventory_rest || this.goodsObj.inventory_rest < 0) {
this.goodsObj.inventory_rest = 0
};
},
// 选择时间 // 选择时间
pickerTime (time) { pickerTime (time) {
let startHours = time[0].getHours() + ""; let startHours = time[0].getHours() + "";
...@@ -1043,14 +1054,17 @@ export default { ...@@ -1043,14 +1054,17 @@ export default {
// 更改售价 // 更改售价
salePrice () { salePrice () {
if (this.goodsObj.price.length === 0) return (this.goodsObj.price = 0); if (this.goodsObj.price.length === 0) {
this.goodsObj.price = 0
};
this.goodsObj.price = parseFloat(this.goodsObj.price).toFixed(2); this.goodsObj.price = parseFloat(this.goodsObj.price).toFixed(2);
}, },
// 更改原价 // 更改原价
perPrice () { perPrice () {
if (this.goodsObj.original_price === 0) if (this.goodsObj.original_price.length === 0) {
return (this.goodsObj.original_price = 0); this.goodsObj.original_price = 0
};
this.goodsObj.original_price = parseFloat( this.goodsObj.original_price = parseFloat(
this.goodsObj.original_price this.goodsObj.original_price
).toFixed(2); ).toFixed(2);
...@@ -1133,7 +1147,7 @@ export default { ...@@ -1133,7 +1147,7 @@ export default {
if (!query.rule_refund) { if (!query.rule_refund) {
return this.$message.error("请填写退款规则"); return this.$message.error("请填写退款规则");
}; };
if (!query.inventory_add) { if (!query.inventory_add.length === 0) {
return this.$message.error("请填写库存剩余量"); return this.$message.error("请填写库存剩余量");
}; };
if (!query.original_price) { if (!query.original_price) {
......
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