Commit 7b84d767 authored by pengyunqian's avatar pengyunqian

Merge branch 'dev' of https://git.yidian-inc.com:8021/bp/op-web-service into pyq_goods

parents a19bdf93 acb0f866
...@@ -390,12 +390,12 @@ ...@@ -390,12 +390,12 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
v-model="inventoryAdd" v-model="inventoryAdd"
@change="hasNumberChange" @change="hasNumberChange"
@blur="hasNumberChange" :precision="0"
></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>
<el-form-item label="已下单量:"> <el-form-item label="已下单量:">
<span>{{ goodsObj.total_amount_sold }}</span> <span>{{ goodsObj.total_amount_order }}</span>
</el-form-item> </el-form-item>
<el-form-item label="已卖出总数:"> <el-form-item label="已卖出总数:">
<span>{{ goodsObj.total_amount_sold }}</span> <span>{{ goodsObj.total_amount_sold }}</span>
...@@ -647,7 +647,7 @@ export default { ...@@ -647,7 +647,7 @@ export default {
} }
}, },
mounted () { created () {
this.getOptions(); this.getOptions();
this.getGoodsDetailList(this.$route.params.spuId); this.getGoodsDetailList(this.$route.params.spuId);
}, },
...@@ -686,7 +686,7 @@ export default { ...@@ -686,7 +686,7 @@ export default {
if (!val) { if (!val) {
this.rejectReason.reason = ""; this.rejectReason.reason = "";
} }
} },
}, },
data () { data () {
...@@ -723,6 +723,7 @@ export default { ...@@ -723,6 +723,7 @@ export default {
introduceUploadList: [], // 上传详情图片列表 introduceUploadList: [], // 上传详情图片列表
inventoryNumber: 0, // 库存数量 inventoryNumber: 0, // 库存数量
isAllowStockChange: true, // 是否允许更改库存
// 使用规则表单 // 使用规则表单
rulesForm: { rulesForm: {
...@@ -1059,13 +1060,14 @@ export default { ...@@ -1059,13 +1060,14 @@ export default {
this.inventoryAdd = 0; this.inventoryAdd = 0;
}); });
} }
if (this.inventoryAdd + this.goodsObj.inventory_rest < 0) { if (this.inventoryAdd + this.goodsObj.inventory_rest < 1) {
this.$nextTick(() => { this.$nextTick(() => {
this.inventoryAdd = 0; this.isAllowStockChange = false;
}); });
this.$message.error("库存增减不得超出剩余库存范围"); return this.$message.error("剩余库存量不得小于1");
} else {
this.isAllowStockChange = true;
} }
console.log(this.inventoryAdd);
}, },
// 单人可购买上限的修改 // 单人可购买上限的修改
...@@ -1242,6 +1244,12 @@ export default { ...@@ -1242,6 +1244,12 @@ export default {
if (!this.isGoodsNameRepeat) { if (!this.isGoodsNameRepeat) {
return this.$message.error("商品名称被占用,请重新更换商品名称"); return this.$message.error("商品名称被占用,请重新更换商品名称");
} }
console.log(this.isAllowStockChange);
if (!this.isAllowStockChange) {
return this.$message.error("剩余库存量不得小于1");
}
if (!query.expiration_time) { if (!query.expiration_time) {
return this.$message.error("过期时间未填写,请填写后再提交"); return this.$message.error("过期时间未填写,请填写后再提交");
} }
......
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