@ -284,7 +284,15 @@ export default {
this.$message.error('一个商品只能选择一次', 2)
return false
}
if (!goodsId) {
item.goods_price = '';
item.cost_price = '';
item.stock_num = '';
item.goods_weight = '';
item.goods_sku_no = '';
item.goods_id = '';
return false;
this.getGoodsDetail(goodsId).then((res) => {
const queryGoodsId = this.$route.query.goodsId
if (res.spec_type === 20 && queryGoodsId !== goodsId) {
@ -301,11 +309,11 @@ export default {
// item.goods_name = res.goods_name
item.goods_id = res.goods_id
})
},
// 获取商品详情
getGoodsDetail(goodsId = null) {
if (!goodsId) return false
return new Promise((resolve, reject) => {
GoodsApi.detail({ goodsId }).then((result) => {
resolve(result.data.goodsInfo)