|
@@ -17,6 +17,7 @@ class AccountDetails extends React.Component {
|
|
|
super(props)
|
|
|
this.state = {
|
|
|
pageIndex: 1,
|
|
|
+ currentPage: 1,
|
|
|
dataList: [],
|
|
|
id: '', //账户id
|
|
|
userRoleName: '', //用户名
|
|
@@ -192,25 +193,25 @@ class AccountDetails extends React.Component {
|
|
|
}
|
|
|
|
|
|
//数据列表
|
|
|
- loadDataList() {
|
|
|
+ loadDataList(page) {
|
|
|
request({
|
|
|
url: ymallAPI + '/ymall/accountIncome/getPriceList',
|
|
|
method: 'post',
|
|
|
data: {
|
|
|
pageSize: 10,
|
|
|
- pageIndex: this.state.pageIndex,
|
|
|
+ pageIndex: page ? page : 1,
|
|
|
filters: this.state.filters.concat([{ field:"id", operate: "equal",value: this.state.id }])
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log(res)
|
|
|
if(!!res.success) {
|
|
|
this.setState({
|
|
|
- dataList: this.state.dataList.concat(res.items),
|
|
|
- pageIndex: this.state.pageIndex++
|
|
|
+ dataList: res.items,
|
|
|
+ total: res.totalCount
|
|
|
}, () => {
|
|
|
- if(this.state.dataList.length < res.totalCount) {
|
|
|
- this.loadDataList()
|
|
|
- }
|
|
|
+ // if(this.state.dataList.length < res.totalCount) {
|
|
|
+ // this.loadDataList()
|
|
|
+ // }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -434,62 +435,7 @@ class AccountDetails extends React.Component {
|
|
|
|
|
|
|
|
|
render() {
|
|
|
- // let { id } = this.state
|
|
|
- // let gridOption = {
|
|
|
- // title: "账户明细",
|
|
|
- // url: {
|
|
|
- // read: ymallAPI + '/ymall/accountIncome/getPriceList'
|
|
|
- // },
|
|
|
- // pageSize: 20,
|
|
|
- // checkable: false,
|
|
|
- // sortField: "",
|
|
|
- // columns:[
|
|
|
- // { title: '开始日期', data: 'beginDate', type: 'datetime', query: true, hide: true },
|
|
|
- // { title: '结束日期', data: 'endDate', type: 'datetime', query: true, hide: true },
|
|
|
- // { title: '时间', data: 'updateTime', type: 'text', query: false, render: (data) => {
|
|
|
- // return(<div>{this.gettime(data)}</div>)
|
|
|
- // }},
|
|
|
- // { title: '场景', data: 'type', type: 'dropdown', editor: {},
|
|
|
- // query: true, source: {
|
|
|
- // data: [
|
|
|
- // {"label": "在线问诊", "value": "1"},
|
|
|
- // {"label": "处方购药", "value": "2"},
|
|
|
- // {"label": "下级收益", "value": "3"},
|
|
|
- // {"label": "销售额达标", "value": "4"}
|
|
|
- // ]
|
|
|
- // }
|
|
|
- // },
|
|
|
- // { title: '场景业务单号', data: 'orderId', type: 'text', query: false },
|
|
|
- // { title: '余额变动值', data: 'priceStr', type: 'text', query: false },
|
|
|
- // { title: '计算公式', data: 'calculationFormula', type: 'text', query: false },
|
|
|
- // { title: '状态', data: 'status', type: 'dropdown', source: {
|
|
|
- // data: [
|
|
|
- // {'label': "已入账", value: '1'},
|
|
|
- // {'label': "待入账", value: '2'},
|
|
|
- // {'label': "已取消", value: '3'},
|
|
|
- // {'label': "已提现", value: '4'},
|
|
|
- // {'label': "提现中", value: '5'},
|
|
|
- // {'label': "已扣除", value: '6'},
|
|
|
- // ]
|
|
|
- // },
|
|
|
- // query: true },
|
|
|
- // { title: '操作', type: 'command', actions: [
|
|
|
- // {name: '项目明细', onClick: (data) => {
|
|
|
- // console.log('项目明细', data)
|
|
|
- // this.loadDetails(data.type, data.orderId, data.id)
|
|
|
- // this.setState({
|
|
|
- // type: data.type,
|
|
|
- // detailModal: true,
|
|
|
- // orderCode: data.orderCode,
|
|
|
- // calculationFormula: data.calculationFormula,
|
|
|
- // calculationExplain: data.calculationExplain
|
|
|
- // })
|
|
|
- // }}
|
|
|
- // ] },
|
|
|
- // ],
|
|
|
- // customRules: [{field:"id",operate:"equal",value: id}],
|
|
|
- // }
|
|
|
- // setTimeout(() => this.refs.grid.reload(), 2000)
|
|
|
+
|
|
|
return(
|
|
|
<div style={{padding: '30px', backgroundColor: '#fff'}}>
|
|
|
<div style={{lineHeight: '40px'}}>{ this.state.userRoleName } : { this.state.idPhone }</div>
|
|
@@ -618,6 +564,12 @@ class AccountDetails extends React.Component {
|
|
|
columns={this.state.dataColumns}
|
|
|
dataSource={this.state.dataList}
|
|
|
bordered
|
|
|
+ rowKey={ record => record.id }
|
|
|
+ pagination={{
|
|
|
+ page: this.state.currentPage,
|
|
|
+ onChange : (page) => this.loadDataList(page),
|
|
|
+ total: this.state.total,
|
|
|
+ }}
|
|
|
>
|
|
|
|
|
|
</Table>
|