|
|
|
@ -101,11 +101,11 @@ |
|
|
|
|
</a-modal> |
|
|
|
|
<div class="row-item-tab clearfix"> |
|
|
|
|
<div class="tab-list fl-l"> |
|
|
|
|
<a-radio-group :defaultValue="queryParam.listType" @change="handleTabs"> |
|
|
|
|
<a-radio-button value="all">全部</a-radio-button> |
|
|
|
|
<a-radio-button value="on_sale">出售中</a-radio-button> |
|
|
|
|
<a-radio-button value="off_sale">已下架</a-radio-button> |
|
|
|
|
<a-radio-button value="sold_out">已售罄</a-radio-button> |
|
|
|
|
<a-radio-group :defaultValue="queryParam.is_sale" @change="handleTabs"> |
|
|
|
|
<a-radio-button value="">全部</a-radio-button> |
|
|
|
|
<a-radio-button value="0">在售</a-radio-button> |
|
|
|
|
<a-radio-button value="1">停售</a-radio-button> |
|
|
|
|
<a-radio-button value="2">无货</a-radio-button> |
|
|
|
|
</a-radio-group> |
|
|
|
|
</div> |
|
|
|
|
<a-button class="fl-l" type="primary" icon="plus" @click="handleCreate()">创建商品</a-button> |
|
|
|
@ -146,6 +146,11 @@ |
|
|
|
|
<img width="50" height="50" :src="text" alt="商品图片" /> |
|
|
|
|
</a> |
|
|
|
|
</span> |
|
|
|
|
<!-- 商品名称 --> |
|
|
|
|
<span slot="goods_name" slot-scope="text, item"> |
|
|
|
|
<a v-if="item.link" :href="item.link" target="_blank">{{ text }}</a> |
|
|
|
|
<p v-else>{{ text }}</p> |
|
|
|
|
</span> |
|
|
|
|
<!-- 商品池 --> |
|
|
|
|
<span slot="is_pool" slot-scope="text"> |
|
|
|
|
<p |
|
|
|
@ -159,15 +164,16 @@ |
|
|
|
|
<!-- 商品状态 --> |
|
|
|
|
<span slot="is_sale" slot-scope="text, item"> |
|
|
|
|
<a-tag class="cur-p" :color="text == 0 ? 'red' : text == 1 ? 'green' : 'gray'">{{ |
|
|
|
|
text == 0 ? '已下架' : text == 1 ? '出售中' : '已售罄' |
|
|
|
|
text == 0 ? '停售' : text == 1 ? '在售' : '无货' |
|
|
|
|
}}</a-tag> |
|
|
|
|
</span> |
|
|
|
|
<!-- 操作项 --> |
|
|
|
|
<div class="actions" style="width: 140px" slot="action" slot-scope="text, item"> |
|
|
|
|
<router-link :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }">编辑</router-link> |
|
|
|
|
<router-link :to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }">复制</router-link> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_sale == 1">下架</a> |
|
|
|
|
<!-- <router-link :to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }">复制</router-link> --> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_pool == 1">下架</a> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 1)" v-else>上架</a> |
|
|
|
|
<a @click="handleCopy(item.unicode)">复制</a> |
|
|
|
|
<a @click="handleDelete([item.goods_id])">删除</a> |
|
|
|
|
</div> |
|
|
|
|
</s-table> |
|
|
|
@ -200,7 +206,7 @@ const columns = [ |
|
|
|
|
{ |
|
|
|
|
title: '商品名称', |
|
|
|
|
dataIndex: 'goods_name', |
|
|
|
|
width: '270px', |
|
|
|
|
width: '250px', |
|
|
|
|
scopedSlots: { customRender: 'goods_name' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
@ -236,7 +242,7 @@ const columns = [ |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '添加时间', |
|
|
|
|
width: '180px', |
|
|
|
|
width: '150px', |
|
|
|
|
dataIndex: 'create_time', |
|
|
|
|
sorter: true, |
|
|
|
|
}, |
|
|
|
@ -262,7 +268,7 @@ export default { |
|
|
|
|
categoryListTree: [], |
|
|
|
|
// 查询参数 |
|
|
|
|
queryParam: { |
|
|
|
|
listType: 'all', |
|
|
|
|
is_sale: '', |
|
|
|
|
channel: '', |
|
|
|
|
is_self: '', |
|
|
|
|
is_pool: '', |
|
|
|
@ -321,7 +327,7 @@ export default { |
|
|
|
|
{ name: '在售', val: 1 }, |
|
|
|
|
// { name: '无货', val: 2 }, |
|
|
|
|
], |
|
|
|
|
is_sale:0, |
|
|
|
|
is_sale: 0, |
|
|
|
|
categoryIds: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -330,7 +336,7 @@ export default { |
|
|
|
|
|
|
|
|
|
// 默认的查询参数 |
|
|
|
|
if (this.$route.query.listType) { |
|
|
|
|
this.queryParam.listType = this.$route.query.listType |
|
|
|
|
this.queryParam.is_sale = '' |
|
|
|
|
} |
|
|
|
|
// 获取商品分类列表 |
|
|
|
|
this.getCategoryList() |
|
|
|
@ -344,6 +350,22 @@ export default { |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 复制 |
|
|
|
|
handleCopy(val) { |
|
|
|
|
let that = this |
|
|
|
|
if (val) { |
|
|
|
|
that.$copyText(val).then( |
|
|
|
|
function (e) { |
|
|
|
|
that.$message.success('复制成功', 1.5) |
|
|
|
|
}, |
|
|
|
|
function (e) { |
|
|
|
|
that.$message.fail('复制失败', 1.5) |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} else { |
|
|
|
|
that.$message.warn('没有商品编码', 1.5) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 选中项发生变化时的回调 |
|
|
|
|
onSelectChange(selectedRowKeys) { |
|
|
|
|
this.selectedRowKeys = selectedRowKeys |
|
|
|
@ -351,7 +373,7 @@ export default { |
|
|
|
|
|
|
|
|
|
// 切换tab |
|
|
|
|
handleTabs(e) { |
|
|
|
|
this.queryParam.listType = e.target.value |
|
|
|
|
this.queryParam.is_sale = e.target.value |
|
|
|
|
this.handleRefresh(true) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -400,7 +422,7 @@ export default { |
|
|
|
|
list.forEach((item) => { |
|
|
|
|
categoryId.push(item.value) |
|
|
|
|
}) |
|
|
|
|
this.queryParam.categoryId=categoryId.join(',') |
|
|
|
|
this.queryParam.categoryId = categoryId.join(',') |
|
|
|
|
}, |
|
|
|
|
// 获取分类列表 |
|
|
|
|
getCategoryList() { |
|
|
|
@ -502,16 +524,16 @@ export default { |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="less" scoped> |
|
|
|
|
.ant-card-body { |
|
|
|
|
padding: 22px 29px 25px; |
|
|
|
|
/deep/.ant-card-body { |
|
|
|
|
padding: 22px 18px; |
|
|
|
|
} |
|
|
|
|
// 筛选tab |
|
|
|
|
.tab-list { |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
/deep/.ant-table-body{ |
|
|
|
|
/deep/.ant-table-body { |
|
|
|
|
overflow-x: scroll; |
|
|
|
|
max-width: 1180px; |
|
|
|
|
max-width: 1300px; |
|
|
|
|
} |
|
|
|
|
// 列表页-操作按钮组 |
|
|
|
|
.row-item-tab { |
|
|
|
|