上下架及商品池

main
fanfan 9 months ago
parent aebdb7cdc4
commit 72a012fe58
  1. 69
      src/views/dataCenter/goods/Index.vue

@ -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,12 +82,17 @@
@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 }}
</a-select-option>
</a-select>
<a-select-option :value="item.val" v-for="item in saleStatus" :key="item.val">
{{ item.name }}
</a-select-option>
</a-select>
</a-modal>
<div class="row-item-tab clearfix">
<div class="tab-list fl-l">
@ -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: '添加时间',
@ -277,8 +290,8 @@ export default {
checkList: [],
visible: false,
saleVisible:false,
is_sale:'',
saleVisible: false,
is_sale: '',
goodsType: [
{ name: '自营', val: 1 },
{ name: 'POP', val: 2 },
@ -369,7 +382,7 @@ export default {
getGoodsStarus(val) {
this.queryParam.is_pool = val
},
getSale(val){
getSale(val) {
this.is_sale = val
},
//
@ -412,7 +425,7 @@ export default {
GoodsApi.category({ goodsIds, categoryIds })
.then((result) => {
//
this.visible=false
this.visible = false
this.$message.success(result.message, 1.5)
this.handleRefresh()
})
@ -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
}
@ -430,7 +443,7 @@ export default {
GoodsApi.sale({ goodsIds, is_sale })
.then((result) => {
//
this.saleVisible=false
this.saleVisible = false
this.$message.success(result.message, 1.5)
this.handleRefresh()
})

Loading…
Cancel
Save