|
|
@ -34,7 +34,12 @@ |
|
|
|
<a-radio-button value="sold_out">已售罄</a-radio-button> |
|
|
|
<a-radio-button value="sold_out">已售罄</a-radio-button> |
|
|
|
</a-radio-group> |
|
|
|
</a-radio-group> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<a-button v-if="$auth('/goods/create')" class="fl-l" type="primary" icon="plus" @click="handleCreate()" |
|
|
|
<a-button |
|
|
|
|
|
|
|
v-if="$auth('/goods/create')" |
|
|
|
|
|
|
|
class="fl-l" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
icon="plus" |
|
|
|
|
|
|
|
@click="handleCreate()" |
|
|
|
>创建商品</a-button |
|
|
|
>创建商品</a-button |
|
|
|
> |
|
|
|
> |
|
|
|
<a-button |
|
|
|
<a-button |
|
|
@ -47,7 +52,10 @@ |
|
|
|
<div v-if="selectedRowKeys.length" class="button-group"> |
|
|
|
<div v-if="selectedRowKeys.length" class="button-group"> |
|
|
|
<a-button-group class="ml-10"> |
|
|
|
<a-button-group class="ml-10"> |
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-down" @click="handleUpdateStatus(selectedRowKeys, false)" |
|
|
|
<a-button |
|
|
|
|
|
|
|
v-action:status |
|
|
|
|
|
|
|
icon="arrow-down" |
|
|
|
|
|
|
|
@click="handleUpdateStatus(selectedRowKeys, false)" |
|
|
|
>下架</a-button |
|
|
|
>下架</a-button |
|
|
|
> |
|
|
|
> |
|
|
|
<a-button v-action:delete icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
|
<a-button v-action:delete icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
@ -86,7 +94,9 @@ |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<!-- 操作项 --> |
|
|
|
<!-- 操作项 --> |
|
|
|
<div class="actions" slot="action" slot-scope="text, item"> |
|
|
|
<div class="actions" slot="action" slot-scope="text, item"> |
|
|
|
<router-link v-if="$auth('/goods/update')" :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }" |
|
|
|
<router-link |
|
|
|
|
|
|
|
v-if="$auth('/goods/update')" |
|
|
|
|
|
|
|
:to="{ path: '/goods/update', query: { goodsId: item.goods_id } }" |
|
|
|
>编辑</router-link |
|
|
|
>编辑</router-link |
|
|
|
> |
|
|
|
> |
|
|
|
<router-link |
|
|
|
<router-link |
|
|
@ -109,59 +119,64 @@ import CategoryModel from '@/common/model/Category' |
|
|
|
const columns = [ |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '商品ID', |
|
|
|
title: '商品ID', |
|
|
|
dataIndex: 'goods_id', |
|
|
|
dataIndex: 'goods_id' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '商品图片', |
|
|
|
title: '商品图片', |
|
|
|
dataIndex: 'goods_image', |
|
|
|
dataIndex: 'goods_image', |
|
|
|
scopedSlots: { customRender: 'goods_image' }, |
|
|
|
scopedSlots: { customRender: 'goods_image' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '商品名称', |
|
|
|
title: '商品名称', |
|
|
|
dataIndex: 'goods_name', |
|
|
|
dataIndex: 'goods_name', |
|
|
|
width: '302px', |
|
|
|
width: '302px', |
|
|
|
scopedSlots: { customRender: 'goods_name' }, |
|
|
|
scopedSlots: { customRender: 'goods_name' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '商品价格', |
|
|
|
title: '商品价格', |
|
|
|
dataIndex: 'goods_price_min', |
|
|
|
dataIndex: 'goods_price_min', |
|
|
|
scopedSlots: { customRender: 'goods_price_min' }, |
|
|
|
scopedSlots: { customRender: 'goods_price_min' } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: '成本价', |
|
|
|
|
|
|
|
dataIndex: 'cost_price_min', |
|
|
|
|
|
|
|
scopedSlots: { customRender: 'cost_price_min' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '总销量', |
|
|
|
title: '总销量', |
|
|
|
dataIndex: 'sales_actual', |
|
|
|
dataIndex: 'sales_actual' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '库存总量', |
|
|
|
title: '库存总量', |
|
|
|
dataIndex: 'stock_total', |
|
|
|
dataIndex: 'stock_total' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '状态', |
|
|
|
title: '状态', |
|
|
|
dataIndex: 'status', |
|
|
|
dataIndex: 'status', |
|
|
|
scopedSlots: { customRender: 'status' }, |
|
|
|
scopedSlots: { customRender: 'status' } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '排序', |
|
|
|
title: '排序', |
|
|
|
dataIndex: 'sort', |
|
|
|
dataIndex: 'sort' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '添加时间', |
|
|
|
title: '添加时间', |
|
|
|
width: '180px', |
|
|
|
width: '180px', |
|
|
|
dataIndex: 'create_time', |
|
|
|
dataIndex: 'create_time' |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'action', |
|
|
|
dataIndex: 'action', |
|
|
|
width: '150px', |
|
|
|
width: '150px', |
|
|
|
scopedSlots: { customRender: 'action' }, |
|
|
|
scopedSlots: { customRender: 'action' } |
|
|
|
}, |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'Index', |
|
|
|
name: 'Index', |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
ContentHeader, |
|
|
|
ContentHeader, |
|
|
|
STable, |
|
|
|
STable |
|
|
|
}, |
|
|
|
}, |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -171,7 +186,7 @@ export default { |
|
|
|
categoryListTree: [], |
|
|
|
categoryListTree: [], |
|
|
|
// 查询参数 |
|
|
|
// 查询参数 |
|
|
|
queryParam: { |
|
|
|
queryParam: { |
|
|
|
listType: 'all', |
|
|
|
listType: 'all' |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 正在加载 |
|
|
|
// 正在加载 |
|
|
|
isLoading: false, |
|
|
|
isLoading: false, |
|
|
@ -184,7 +199,7 @@ export default { |
|
|
|
return GoodsApi.list({ ...param, ...this.queryParam }).then((response) => { |
|
|
|
return GoodsApi.list({ ...param, ...this.queryParam }).then((response) => { |
|
|
|
return response.data.list |
|
|
|
return response.data.list |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created () { |
|
|
|
created () { |
|
|
@ -199,9 +214,9 @@ export default { |
|
|
|
rowSelection () { |
|
|
|
rowSelection () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
selectedRowKeys: this.selectedRowKeys, |
|
|
|
selectedRowKeys: this.selectedRowKeys, |
|
|
|
onChange: this.onSelectChange, |
|
|
|
onChange: this.onSelectChange |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 选中项发生变化时的回调 |
|
|
|
// 选中项发生变化时的回调 |
|
|
@ -271,7 +286,7 @@ export default { |
|
|
|
app.handleRefresh() |
|
|
|
app.handleRefresh() |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally((result) => modal.destroy()) |
|
|
|
.finally((result) => modal.destroy()) |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -292,8 +307,8 @@ export default { |
|
|
|
handleRefresh (bool = false) { |
|
|
|
handleRefresh (bool = false) { |
|
|
|
this.selectedRowKeys = [] |
|
|
|
this.selectedRowKeys = [] |
|
|
|
this.$refs.table.refresh(bool) |
|
|
|
this.$refs.table.refresh(bool) |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
<style lang="less" scoped> |
|
|
|