商品列表加分页

main
fanfan 11 months ago
parent 02a7a3982c
commit ff6c5b89b7
  1. 6
      src/App.vue
  2. 30
      src/views/dataCenter/goods/Index.vue

@ -22,3 +22,9 @@ export default {
} }
} }
</script> </script>
<style>
.container{
/* overflow-x: scroll; */
width: 100% !important;
}
</style>

@ -173,6 +173,7 @@
:columns="columns" :columns="columns"
:data="loadData" :data="loadData"
:rowSelection="rowSelection" :rowSelection="rowSelection"
:pagination="pagination"
:pageSize="15" :pageSize="15"
> >
<!-- 商品图片 --> <!-- 商品图片 -->
@ -186,6 +187,9 @@
<a v-if="item.link" :href="item.link" target="_blank">{{ text }}</a> <a v-if="item.link" :href="item.link" target="_blank">{{ text }}</a>
<p v-else>{{ text }}</p> <p v-else>{{ text }}</p>
</span> </span>
<span slot="profit_rate" slot-scope="text, item">
<p>{{ text>0?Number(text)+'%':0 }}</p>
</span>
<!-- 商品池 --> <!-- 商品池 -->
<span slot="is_pool" slot-scope="text"> <span slot="is_pool" slot-scope="text">
<p <p
@ -225,6 +229,7 @@ import * as Api from '@/api/store'
const columns = [ const columns = [
{ {
title: '商品ID', title: '商品ID',
width: '100px',
dataIndex: 'goods_id', dataIndex: 'goods_id',
sorter: true, sorter: true,
}, },
@ -235,6 +240,7 @@ const columns = [
}, },
{ {
title: '商品图片', title: '商品图片',
width: '110px',
dataIndex: 'goods_image', dataIndex: 'goods_image',
scopedSlots: { customRender: 'goods_image' }, scopedSlots: { customRender: 'goods_image' },
}, },
@ -244,24 +250,35 @@ const columns = [
width: '250px', width: '250px',
scopedSlots: { customRender: 'goods_name' }, scopedSlots: { customRender: 'goods_name' },
}, },
{
title: '成本价',
width: '100px',
dataIndex: 'cost_price_min',
scopedSlots: { customRender: 'cost_price_min' },
sorter: true,
},
{ {
title: '前台价', title: '前台价',
width: '100px',
dataIndex: 'goods_price_min', dataIndex: 'goods_price_min',
scopedSlots: { customRender: 'goods_price_min' }, scopedSlots: { customRender: 'goods_price_min' },
sorter: true, sorter: true,
}, },
{ {
title: '利润', title: '利润',
width: '80px',
dataIndex: 'profit', dataIndex: 'profit',
sorter: true, sorter: true,
}, },
{ {
title: '利润率', title: '利润率',
width: '110px',
dataIndex: 'profit_rate', dataIndex: 'profit_rate',
sorter: true, scopedSlots: { customRender: 'profit_rate' },
}, },
{ {
title: '库存', title: '库存',
width: '80px',
dataIndex: 'stock_total', dataIndex: 'stock_total',
sorter: true, sorter: true,
}, },
@ -297,6 +314,12 @@ export default {
}, },
data() { data() {
return { return {
pagination: {
total: 0, //
page: 1, //
pageSize: 15, //
showQuickJumper: true, //
},
// //
searchForm: this.$form.createForm(this), searchForm: this.$form.createForm(this),
// //
@ -388,6 +411,9 @@ export default {
}, },
}, },
methods: { methods: {
handleTableChange(e){
console.log(e)
},
validateAmount() { validateAmount() {
let row = this.rate let row = this.rate
console.log(row) console.log(row)
@ -642,7 +668,7 @@ export default {
} }
/deep/.ant-table-body { /deep/.ant-table-body {
overflow-x: scroll; overflow-x: scroll;
max-width: 1300px; max-width: 1350px;
} }
// - // -
.row-item-tab { .row-item-tab {

Loading…
Cancel
Save