Commit ba3a0cf5 authored by liwenhong's avatar liwenhong

add:库存+去掉图片素材入口

parent 22738111
......@@ -5,9 +5,9 @@
<el-button class="addCommodityBtn" @click="commodity('add', '')"
>添加商品</el-button
>
<el-button class="commodLibraryAdd" @click="commodLibraryAdd"
<!-- <el-button class="commodLibraryAdd" @click="commodLibraryAdd"
>从商品库添加</el-button
>
> -->
</div>
<!-- Tab -->
<el-table :data="comTableData" border style="width: 100%">
......@@ -119,7 +119,7 @@
></el-input-number>
</el-form-item>
<br />
<el-form-item label="新增库存:">
<el-form-item label="库存:">
<el-input
v-model="commodityForm.inventory_total"
placeholder=""
......@@ -130,7 +130,7 @@
已售:<span style="margin-right: 10px">{{
commodityForm.total_amount_sold
}}</span>
剩余库存:<span>{{ inventoryRest }}</span>
剩余库存:<span>{{ commodityForm.inventory_total }}</span>
</div>
<br />
<el-form-item
......@@ -297,6 +297,7 @@ export default {
inventoryTotal: 0, // 总库存
inventoryRest: 0, // 剩余库存
inventory: 0, // 添加库存
};
},
// computed: {
......@@ -337,6 +338,7 @@ export default {
// 库存计算
inventoryIpt(val) {
if(val < 0) return this.commodityForm.inventory_total = 0;
var pattern = /^-?[1-9]\d*$|^0$/g;
if (!pattern.test(this.commodityForm.inventory_total)) {
this.commodityForm.inventory_total = "";
......@@ -395,6 +397,7 @@ export default {
const res = await markGoodsInfo(params);
this.inventoryRest = res.result.goods_info.inventory_rest;
this.inventoryTotal = res.result.goods_info.inventory_total;
this.inventory = res.result.goods_info.inventory_total;
this.commodityForm = res.result.goods_info;
this.commodityForm.business1 = res.result.goods_info.ota_id;
this.picUrlList = [];
......@@ -421,7 +424,7 @@ export default {
goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picStr,
desc: "",
inventory_add: this.commodityForm.inventory_total,
inventory_add: this.commodityForm.inventory_total - this.inventory,
original_price: this.commodityForm.original_price,
price: this.commodityForm.price,
marketing_name: this.editInfo.marketing_name,
......@@ -489,7 +492,7 @@ export default {
goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picStr,
desc: "",
inventory: this.commodityForm.inventory_total,
inventory: this.commodityForm.inventory_total - this.inventory,
original_price: this.commodityForm.original_price,
marketing_type: "4",
price: this.commodityForm.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