【fix 66424】解决表格数据不显示
This commit is contained in:
@@ -20,16 +20,18 @@
|
||||
<div class="title">退货商品</div>
|
||||
<a-table
|
||||
style="margin-bottom: 24px"
|
||||
:pagination='goodsPagination'
|
||||
:columns="goodsColumns"
|
||||
:data="loadGoodsData">
|
||||
:data-source="goodsData">
|
||||
|
||||
</a-table>
|
||||
|
||||
<div class="title">退货进度</div>
|
||||
<a-table
|
||||
style="margin-bottom: 24px"
|
||||
:pagination='schedulePagination'
|
||||
:columns="scheduleColumns"
|
||||
:data="loadScheduleData">
|
||||
:data-source="scheduleData">
|
||||
|
||||
<template
|
||||
slot="status"
|
||||
@@ -57,6 +59,7 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
goodsPagination: {},
|
||||
goodsColumns: [
|
||||
{
|
||||
title: '商品编号',
|
||||
@@ -92,8 +95,51 @@ export default {
|
||||
align: 'right'
|
||||
}
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadGoodsData: () => {
|
||||
goodsData: [],
|
||||
|
||||
schedulePagination: {},
|
||||
scheduleColumns: [
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'time',
|
||||
key: 'time'
|
||||
},
|
||||
{
|
||||
title: '当前进度',
|
||||
dataIndex: 'rate',
|
||||
key: 'rate'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
scopedSlots: { customRender: 'status' }
|
||||
},
|
||||
{
|
||||
title: '操作员ID',
|
||||
dataIndex: 'operator',
|
||||
key: 'operator'
|
||||
},
|
||||
{
|
||||
title: '耗时',
|
||||
dataIndex: 'cost',
|
||||
key: 'cost'
|
||||
}
|
||||
],
|
||||
scheduleData: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.initPageData()
|
||||
},
|
||||
methods: {
|
||||
// 初始化页面数据
|
||||
initPageData () {
|
||||
this.loadGoodsData()
|
||||
this.loadScheduleData()
|
||||
},
|
||||
// 加载退货商品表格
|
||||
loadGoodsData () {
|
||||
return new Promise(resolve => {
|
||||
resolve({
|
||||
data: [
|
||||
@@ -136,39 +182,12 @@ export default {
|
||||
totalCount: 10
|
||||
})
|
||||
}).then(res => {
|
||||
return res
|
||||
this.goodsData = res.data
|
||||
this.goodsPagination = { ...res, data: undefined }
|
||||
})
|
||||
},
|
||||
|
||||
scheduleColumns: [
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'time',
|
||||
key: 'time'
|
||||
},
|
||||
{
|
||||
title: '当前进度',
|
||||
dataIndex: 'rate',
|
||||
key: 'rate'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
scopedSlots: { customRender: 'status' }
|
||||
},
|
||||
{
|
||||
title: '操作员ID',
|
||||
dataIndex: 'operator',
|
||||
key: 'operator'
|
||||
},
|
||||
{
|
||||
title: '耗时',
|
||||
dataIndex: 'cost',
|
||||
key: 'cost'
|
||||
}
|
||||
],
|
||||
loadScheduleData: () => {
|
||||
// 加载退货进度表格
|
||||
loadScheduleData () {
|
||||
return new Promise(resolve => {
|
||||
resolve({
|
||||
data: [
|
||||
@@ -219,10 +238,10 @@ export default {
|
||||
totalCount: 10
|
||||
})
|
||||
}).then(res => {
|
||||
return res
|
||||
this.scheduleData = res.data
|
||||
this.schedulePagination = { ...res, data: undefined }
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
statusFilter (status) {
|
||||
|
||||
Reference in New Issue
Block a user