修正 【订单列表】选择查询日期后,前端的page应该传1

This commit is contained in:
wangsongsole 2022-08-12 18:01:05 +08:00
parent a25166197f
commit 1ade133568
1 changed files with 43 additions and 36 deletions

View File

@ -1,14 +1,11 @@
import ReactDOM from 'react-dom' import React from 'react'
import React, { Component } from 'react'
import { Link } from 'react-router-dom'
import { import {
Button, Button,
Notify, Notify,
Select, Select,
Alert, Alert,
CombinedDateRangePicker, CombinedDateRangePicker,
Sweetalert, Sweetalert
Icon
} from 'zent' } from 'zent'
import './list.less' import './list.less'
import '../../../assets/comm.css' import '../../../assets/comm.css'
@ -49,7 +46,6 @@ const options = [
key: '5', key: '5',
text: '平台批次号' text: '平台批次号'
} }
] ]
const Column = [ const Column = [
{ {
@ -184,7 +180,7 @@ export default class orderlist extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
orderType:'', orderType: '',
tabList: [{ title: '订单列表' }], tabList: [{ title: '订单列表' }],
orderList: [], orderList: [],
filterList: [ filterList: [
@ -281,10 +277,11 @@ export default class orderlist extends React.Component {
//导出订单 //导出订单
exportFn() { exportFn() {
let _self = this let _self = this
let { key_word, key, status, option,orderType } = _self.state let { key_word, key, status, option, orderType } = _self.state
let data = {} let data = {}
if(orderType){//区分立减金和商品 if (orderType) {
data.type=orderType; //区分立减金和商品
data.type = orderType
} }
if (this.state.combinedValue && this.state.combinedValue[0]) { if (this.state.combinedValue && this.state.combinedValue[0]) {
data.begin_time = this.state.combinedValue[0] data.begin_time = this.state.combinedValue[0]
@ -477,8 +474,10 @@ export default class orderlist extends React.Component {
//选择时间 //选择时间
onChangeCombinedDate(e) { onChangeCombinedDate(e) {
this.setState({ combinedValue: e }) this.setState({ combinedValue: e, page: 1, limit: 10, selectiondata: [] })
this.getOrderFn(e) setTimeout(() => {
this.getOrderFn()
}, 0)
} }
//page //page
pageChange(e) { pageChange(e) {
@ -508,16 +507,17 @@ export default class orderlist extends React.Component {
let data = {} let data = {}
data[prop] = null data[prop] = null
this.setState(data) this.setState(data)
this.setState({orderType:null}); this.setState({ orderType: null })
} }
//获取订单列表 //获取订单列表
getOrderFn(time = {}) { getOrderFn(time = {}) {
let _self = this let _self = this
let { page, limit, option, key_word, status,orderType} = _self.state let { page, limit, option, key_word, status, orderType } = _self.state
let data = { page, limit } let data = { page, limit }
if(orderType){//区分立减金和商品 if (orderType) {
data.type=orderType; //区分立减金和商品
data.type = orderType
} }
if (this.state.combinedValue && this.state.combinedValue[0]) { if (this.state.combinedValue && this.state.combinedValue[0]) {
data.begin_time = this.state.combinedValue[0] data.begin_time = this.state.combinedValue[0]
@ -560,7 +560,6 @@ export default class orderlist extends React.Component {
} }
} }
getOrderList(data) getOrderList(data)
.then((res) => { .then((res) => {
handelResponse( handelResponse(
@ -594,8 +593,8 @@ export default class orderlist extends React.Component {
placeholder = '请输入兑换码批次ID搜索' placeholder = '请输入兑换码批次ID搜索'
break break
case 5: case 5:
placeholder = '请输入平台批次号' placeholder = '请输入平台批次号'
break break
default: default:
placeholder = '请输入key搜索' placeholder = '请输入key搜索'
break break
@ -612,22 +611,24 @@ export default class orderlist extends React.Component {
//状态筛选 //状态筛选
selectedId(e, prop) { selectedId(e, prop) {
let data = {} let data = {}
let orderType=1; let orderType = 1
data[prop] = e data[prop] = e
if (e == 999) { if (e == 999) {
data[prop] = null data[prop] = null
}if (e == 111) {
data[prop] = 1
orderType=2;
} if (e == 222) {
data[prop] = 2
orderType=2;
} }
if(e==5){ if (e == 111) {
orderType=2; data[prop] = 1
orderType = 2
}
if (e == 222) {
data[prop] = 2
orderType = 2
}
if (e == 5) {
orderType = 2
} }
this.setState(data) this.setState(data)
this.setState({orderType}); this.setState({ orderType })
} }
// 监听组件内部状态的变化: // 监听组件内部状态的变化:
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
@ -779,17 +780,23 @@ export default class orderlist extends React.Component {
if (com === 'type_text') { if (com === 'type_text') {
return <span>{rowData.type === 1 ? '商品' : '立减金'}</span> return <span>{rowData.type === 1 ? '商品' : '立减金'}</span>
} }
if(com=='channel_activity_id'){ if (com == 'channel_activity_id') {
return <span>{rowData.channel_activity_id?rowData.channel_activity_id : '-'}</span> return (
<span>
{rowData.channel_activity_id
? rowData.channel_activity_id
: '-'}
</span>
)
} }
if (com == 'opearo') { if (com == 'opearo') {
return ( return (
<div> <div>
<span <span
className='grid-link' className='grid-link'
onClick={(e) => this.moreFn(e, rowData)}> onClick={(e) => this.moreFn(e, rowData)}>
详情 详情
</span> </span>
{rowData.status == 1 ? ( {rowData.status == 1 ? (
<span <span
className='grid-link' className='grid-link'