diff --git a/src/common/model/goods/MultiSpec.js b/src/common/model/goods/MultiSpec.js
index 3c5c747..b6d8e49 100644
--- a/src/common/model/goods/MultiSpec.js
+++ b/src/common/model/goods/MultiSpec.js
@@ -4,11 +4,23 @@ import { debounce, isEmpty } from '@/utils/util'
// 默认的sku字段属性
const defaultColumns = [
- {
+ /* {
title: '预览图',
dataIndex: 'image',
width: 90,
scopedSlots: { customRender: 'image' }
+ }, */
+ {
+ title: '选择商品',
+ dataIndex: 'select_goods',
+ width: 120,
+ scopedSlots: { customRender: 'select_goods' }
+ },
+ {
+ title: '商品名称',
+ dataIndex: 'goods_name',
+ width: 120,
+ scopedSlots: { customRender: 'goods_name' }
},
{
title: '商品价格',
@@ -22,6 +34,12 @@ const defaultColumns = [
width: 120,
scopedSlots: { customRender: 'cost_price' }
},
+ /* {
+ title: '划线价格',
+ dataIndex: 'line_price',
+ width: 120,
+ scopedSlots: { customRender: 'line_price' }
+ }, */
{
title: '库存数量',
dataIndex: 'stock_num',
@@ -39,6 +57,13 @@ const defaultColumns = [
dataIndex: 'goods_sku_no',
width: 140,
scopedSlots: { customRender: 'goods_sku_no' }
+ },
+
+ {
+ title: '操作',
+ dataIndex: 'action',
+ width: 140,
+ scopedSlots: { customRender: 'action' }
}
]
@@ -47,8 +72,11 @@ const defaultSkuItemData = {
image_id: 0,
image: {},
// imageList: [],
+ goods_id: '',
+ goods_name: '',
goods_price: '',
line_price: '',
+ cost_price: '',
stock_num: '',
goods_weight: '',
goods_sku_no: ''
diff --git a/src/views/goods/modules/MultiSpec.vue b/src/views/goods/modules/MultiSpec.vue
index 821709a..8a9eb3b 100644
--- a/src/views/goods/modules/MultiSpec.vue
+++ b/src/views/goods/modules/MultiSpec.vue
@@ -19,7 +19,8 @@
class="group-item-delete"
href="javascript:;"
@click="handleDeleteSpecGroup(index)"
- >删除规格组
+ >删除规格组
@@ -53,14 +50,10 @@
class="spec-group-add-btn"
icon="plus"
@click="handleAddSpecGroup"
- >添加规格组
+ >添加规格组
-
+
批量设置:
@@ -76,6 +69,12 @@
:min="0"
:precision="2"
/>
+
立即设置
+
-
-
-
+
+
+
+
+
+ {{ item.goods_name }}
-
+ {{ item.goods_price }}
-
+
-
+ {{ item.cost_price }}
-
+ {{ item.stock_num }}
-
+
+ {{ item.goods_weight }}
-
+
+ {{ item.goods_sku_no }}
+
+
+
+ 去修改
@@ -137,10 +146,13 @@
import PropTypes from 'ant-design-vue/es/_util/vue-types'
import MultiSpecModel from '@/common/model/goods/MultiSpec'
import { SelectImage } from '@/components'
+import SelectGoods from '@/components/SelectGoods/SelectGoods.vue'
+import * as GoodsApi from '@/api/goods'
export default {
components: {
- SelectImage
+ SelectImage,
+ SelectGoods
},
props: {
// 默认的规格列表
@@ -148,7 +160,8 @@ export default {
// 默认的SKU列表
defaultSkuList: PropTypes.array.def([]),
// 商品规格是否锁定(锁定状态下不允许编辑规格)
- isSpecLocked: PropTypes.bool.def(false)
+ isSpecLocked: PropTypes.bool.def(false),
+ checkList: PropTypes.array.def([])
},
data () {
return {
@@ -164,7 +177,8 @@ export default {
specList: [],
// SKU列表
skuList: []
- }
+ },
+ visible: false
}
},
watch: {
@@ -180,7 +194,6 @@ export default {
this.getData()
},
methods: {
-
// 获取规格及SKU信息(展示)
getData () {
const { defaultSpecList, defaultSkuList } = this
@@ -270,11 +283,37 @@ export default {
return false
}
return true
- }
+ },
+ showModal () {
+ this.visible = true
+ },
+ async handleSelectGoods (goodsId, item) {
+ console.log(goodsId, item)
+ this.getGoodsDetail(goodsId).then(res => {
+ const sku = res.skuList[0]
+ item.goods_price = sku.goods_price
+ item.cost_price = sku.cost_price
+ item.stock_num = sku.stock_num
+ item.goods_weight = sku.goods_weight
+ item.goods_sku_no = sku.goods_sku_no
+ 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)
+ })
+ })
+ }
}
}
-