main
fanfan 3 months ago
parent 7a8f18e924
commit 2d33dae53b
  1. 16
      src/components/Modal/GoodsModal/GoodsModal.vue
  2. 25
      src/views/goods/modules/MultiSpec.vue

@ -52,6 +52,11 @@
/> />
</template> </template>
<!-- 商品状态 --> <!-- 商品状态 -->
<span slot="spec_type" slot-scope="text">
<p class="twoline-hide" style="width: 40px">
{{ text == 10 ? '单规格' : '多规格' }}
</p>
</span>
<span slot="status" slot-scope="text"> <span slot="status" slot-scope="text">
<a-tag :color="text == 10 ? 'green' : 'red'">{{ text == 10 ? '上架' : '下架' }}</a-tag> <a-tag :color="text == 10 ? 'green' : 'red'">{{ text == 10 ? '上架' : '下架' }}</a-tag>
</span> </span>
@ -77,6 +82,11 @@ const columns = [
width: '335px', width: '335px',
scopedSlots: { customRender: 'item' }, scopedSlots: { customRender: 'item' },
}, },
{
title: '规格类型',
dataIndex: 'spec_type',
scopedSlots: { customRender: 'spec_type' },
},
{ {
title: '商品价格', title: '商品价格',
dataIndex: 'goods_price_min', dataIndex: 'goods_price_min',
@ -120,8 +130,8 @@ export default {
searchForm: this.$form.createForm(this), searchForm: this.$form.createForm(this),
// //
queryParam: {}, queryParam: {},
queryNew:{ queryNew: {
channel: 'zy', channel: 'zy',
status: 10, status: 10,
}, },
// table // table
@ -129,7 +139,7 @@ export default {
// Promise // Promise
loadData: (param) => { loadData: (param) => {
this.queryNew = this.source == 1 ? this.queryNew : {} this.queryNew = this.source == 1 ? this.queryNew : {}
return GoodsApi.list({ ...param, ...this.queryParam,...this.queryNew }).then((response) => { return GoodsApi.list({ ...param, ...this.queryParam, ...this.queryNew }).then((response) => {
return response.data.list return response.data.list
}) })
}, },

@ -121,9 +121,11 @@
</template> </template>
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="text, item"> <template slot="action" slot-scope="text, item">
<router-link v-if="item.goods_id" :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }" <!-- <router-link v-if="item.goods_id" :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }"
>去修改</router-link >去修改</router-link
> > -->
<a @click="handleEdit(index, item)" v-if="item.goods_id" style="margin-left: 10px">去修改</a>
<a @click="handleCancel(index, item)" v-if="item.goods_id" style="margin-left: 10px">取消选择</a>
</template> </template>
</a-table> </a-table>
</a-form-item> </a-form-item>
@ -183,6 +185,25 @@ export default {
this.getData() this.getData()
}, },
methods: { methods: {
handleEdit(item) {
const routeData = this.$router.resolve({
path: '/goods/update',
query: {
goodsId: item.goods_id,
},
})
window.open(routeData.href, '_blank')
},
handleCancel(index, item) {
for (let key in this.multiSpecData.skuList[index]) {
if (this.multiSpecData.skuList[index].hasOwnProperty(key)) {
this.multiSpecData.skuList[index][key] = ''
}
}
this.multiSpecData.skuList[index].spec_value_0 = item.spec_value_0
this.multiSpecData.skuList[index].tempId = item.tempId
this.multiSpecData.skuList[index].skuKeys = item.skuKeys
},
// SKU() // SKU()
getData() { getData() {
const { defaultSpecList, defaultSkuList } = this const { defaultSpecList, defaultSkuList } = this

Loading…
Cancel
Save