|
|
|
@ -65,7 +65,12 @@ |
|
|
|
|
</a-form> |
|
|
|
|
</a-row> |
|
|
|
|
<!-- 操作板块 --> |
|
|
|
|
<a-modal v-model:visible="visible" width="450px" title="商品分类" @ok="handleUpdateClassify(selectedRowKeys, categoryIds)"> |
|
|
|
|
<a-modal |
|
|
|
|
v-model:visible="visible" |
|
|
|
|
width="450px" |
|
|
|
|
title="商品分类" |
|
|
|
|
@ok="handleUpdateClassify(selectedRowKeys, categoryIds)" |
|
|
|
|
> |
|
|
|
|
<a-tree-select |
|
|
|
|
style="min-width: 400px" |
|
|
|
|
placeholder="请选择商品分类" |
|
|
|
@ -77,7 +82,12 @@ |
|
|
|
|
@change="onChangeCategory" |
|
|
|
|
></a-tree-select> |
|
|
|
|
</a-modal> |
|
|
|
|
<a-modal v-model:visible="saleVisible" width="250px" title="停售类型" @ok="handleUpdateSales(selectedRowKeys, is_sale)"> |
|
|
|
|
<a-modal |
|
|
|
|
v-model:visible="saleVisible" |
|
|
|
|
width="250px" |
|
|
|
|
title="停售类型" |
|
|
|
|
@ok="handleUpdateSales(selectedRowKeys, is_sale)" |
|
|
|
|
> |
|
|
|
|
<a-select @change="getSale" style="width: 200px" placeholder="请选择"> |
|
|
|
|
<a-select-option :value="item.val" v-for="item in saleStatus" :key="item.val"> |
|
|
|
|
{{ item.name }} |
|
|
|
@ -110,9 +120,7 @@ |
|
|
|
|
>移除</a-button |
|
|
|
|
> |
|
|
|
|
<a-button style="background-color: green; color: #fff" @click="visible = true">归类</a-button> |
|
|
|
|
<a-button style="background-color: blue; color: #fff" @click="saleVisible=true" |
|
|
|
|
>停售</a-button |
|
|
|
|
> |
|
|
|
|
<a-button style="background-color: blue; color: #fff" @click="saleVisible = true">停售</a-button> |
|
|
|
|
<a-button icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
|
|
</a-button-group> |
|
|
|
|
</div> |
|
|
|
@ -133,24 +141,24 @@ |
|
|
|
|
<img width="50" height="50" :src="text" alt="商品图片" /> |
|
|
|
|
</a> |
|
|
|
|
</span> |
|
|
|
|
<!-- 商品名称 --> |
|
|
|
|
<span slot="goods_name" slot-scope="text"> |
|
|
|
|
<p class="twoline-hide" style="width: 270px">{{ text }}</p> |
|
|
|
|
<!-- 商品池 --> |
|
|
|
|
<span slot="is_pool" slot-scope="text"> |
|
|
|
|
<p class="twoline-hide" style="width: 40px" :style="{color:text == 0 ? 'red' : text == 1 ? 'green' : 'gray'}"> |
|
|
|
|
{{ text == 0 ? '待处理' : text == 1 ? '已入池' : '未入池' }} |
|
|
|
|
</p> |
|
|
|
|
</span> |
|
|
|
|
<!-- 商品状态 --> |
|
|
|
|
<span slot="status" slot-scope="text, item"> |
|
|
|
|
<a-tag |
|
|
|
|
class="cur-p" |
|
|
|
|
:color="text == 10 ? 'green' : 'red'" |
|
|
|
|
>{{ text == 10 ? '上架' : '下架' }}</a-tag |
|
|
|
|
> |
|
|
|
|
<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 ? '在售' : '无货' |
|
|
|
|
}}</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],1)" v-if="text == 10">上架</a> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id],2)" v-else>下架</a> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_sale == 1">下架</a> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 1)" v-else>上架</a> |
|
|
|
|
<a @click="handleDelete([item.goods_id])">删除</a> |
|
|
|
|
</div> |
|
|
|
|
</s-table> |
|
|
|
@ -207,10 +215,15 @@ const columns = [ |
|
|
|
|
dataIndex: 'stock_total', |
|
|
|
|
sorter: true, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '商品池', |
|
|
|
|
dataIndex: 'is_pool', |
|
|
|
|
scopedSlots: { customRender: 'is_pool' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '状态', |
|
|
|
|
dataIndex: 'status', |
|
|
|
|
scopedSlots: { customRender: 'status' }, |
|
|
|
|
dataIndex: 'is_sale', |
|
|
|
|
scopedSlots: { customRender: 'is_sale' }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '添加时间', |
|
|
|
@ -422,7 +435,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 停售 |
|
|
|
|
handleUpdateSales(goodsIds, is_sale) { |
|
|
|
|
if (!is_sale) { |
|
|
|
|
if (is_sale === '' || is_sale === undefined || is_sale === null) { |
|
|
|
|
this.$message.warn('请选择停售类型', 1.5) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|