提交 9a895044 authored 作者: 王天霸's avatar 王天霸

bug

上级 7ebad944
......@@ -263,18 +263,18 @@
<el-table :data="speList" class="hot-edit-goods-table" border v-if="speList.length">
<el-table-column label="规格项" prop="spe" align="center">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.objArr">
<span v-for="(item, index) in scope.row.objArr" :key="index">
{{ `${item.name}: ${item.spec_values}` }}
</span>
</template>
</el-table-column>
<el-table-column label="库存量" width="160px" prop="stock" align="center">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.stock" />
<el-input v-model="scope.row.stock" />
</template>
</el-table-column>
</el-table>
<el-table :data="[1]" class="hot-edit-goods-table" border v-else>
<el-table :data="speListone" class="hot-edit-goods-table" border v-else>
<el-table-column label="规格项" prop="spe" align="center">
<template slot-scope="scope">
默认
......@@ -375,6 +375,7 @@
},
freightOptions: [],
speList: [],
speListone:[],
stock: 0,
rowInfo: null
};
......@@ -697,6 +698,7 @@
// 规格组合
this.speList = []
this.speListone = []
if (res.data.specs && res.data.specs_group) {
let nameArr = []
res.data.specs.map(item => {
......@@ -722,9 +724,15 @@
}
this.speList[i].objArr = arr
}
}else{
debugger
this.speListone.push({
stock:res.data.stock
})
}
}
});
console.log(this.speList)
},
/** 保存 不下架 编辑商品 */
saveHotEditGoods() {
......@@ -742,7 +750,7 @@
aftersale_time: this.hotEditGoodsForm.aftersale_time,
freight_id: this.hotEditGoodsForm.freight_id,
specs_group: this.speList.length ? groupArr : undefined,
stock: this.speList.length ? undefined : this.stock
stock: this.speList.length ? undefined : this.speListone[0].stock
}
saveHotEditGoodsData(data).then(res=> {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论