处理营销系统立减金【订单列表】筛选立减金和商品状态前端数据请求

This commit is contained in:
Apple 2022-06-21 10:11:54 +08:00
parent f53a2482f7
commit bb3cd38685
1 changed files with 30 additions and 9 deletions

View File

@ -184,6 +184,7 @@ export default class orderlist extends React.Component {
constructor(props) {
super(props)
this.state = {
orderType:'',
tabList: [{ title: '订单列表' }],
orderList: [],
filterList: [
@ -193,10 +194,13 @@ export default class orderlist extends React.Component {
prop: 'status',
menuList: [
{ id: 999, name: '全部' },
{ id: 1, name: '充值中' },
{ id: 2, name: '已完成' },
{ id: 3, name: '充值失败' },
{ id: 4, name: '已取消' }
{ id: 1, name: '商品-充值中' },
{ id: 2, name: '商品-已完成' },
{ id: 3, name: '商品-充值失败' },
{ id: 4, name: '商品-已取消' },
{ id: 111, name: '立减金-待领取' },
{ id: 222, name: '立减金-已领取' },
{ id: 5, name: '立减金-已过期' }
]
}
],
@ -277,8 +281,11 @@ export default class orderlist extends React.Component {
//导出订单
exportFn() {
let _self = this
let { key_word, key, status, option } = _self.state
let { key_word, key, status, option,orderType } = _self.state
let data = {}
if(orderType){//区分立减金和商品
data.order_type=orderType;
}
if (this.state.combinedValue && this.state.combinedValue[0]) {
data.begin_time = this.state.combinedValue[0]
data.end_time = this.state.combinedValue[1]
@ -501,13 +508,17 @@ export default class orderlist extends React.Component {
let data = {}
data[prop] = null
this.setState(data)
this.setState({orderType:null});
}
//获取订单列表
getOrderFn(time = {}) {
let _self = this
let { page, limit, option, key_word, status } = _self.state
let { page, limit, option, key_word, status,orderType} = _self.state
let data = { page, limit }
if(orderType){//区分立减金和商品
data.order_type=orderType;
}
if (this.state.combinedValue && this.state.combinedValue[0]) {
data.begin_time = this.state.combinedValue[0]
data.end_time = this.state.combinedValue[1]
@ -548,6 +559,7 @@ export default class orderlist extends React.Component {
data.channel_activity_id = key_word
}
}
getOrderList(data)
.then((res) => {
@ -600,13 +612,22 @@ export default class orderlist extends React.Component {
//状态筛选
selectedId(e, prop) {
let data = {}
let orderType=1;
data[prop] = e
if (e == 999) {
data[prop] = null
} else {
data[prop] = e
}if (e == 111) {
data[prop] = 1
orderType=2;
} if (e == 222) {
data[prop] = 2
orderType=2;
}
if(e==5){
orderType=2;
}
this.setState(data)
this.setState({orderType});
}
// 监听组件内部状态的变化:
componentDidUpdate(prevProps, prevState) {