订单列表接口更新
This commit is contained in:
parent
fbf5f698e0
commit
a294f8286d
|
@ -54,9 +54,10 @@ import FilterSelect from "../filterSelect/main.js"
|
|||
}
|
||||
|
||||
//隐藏菜单
|
||||
hideMenu = () => {
|
||||
hideMenu = (e,id) => {
|
||||
|
||||
this.setState({menuShow:false})
|
||||
this.setState({menuShow:false})
|
||||
console.log('我关闭',e,id);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -81,7 +82,7 @@ import FilterSelect from "../filterSelect/main.js"
|
|||
data={this.state.menuList}
|
||||
multiple={true}
|
||||
visible={this.state.menuShow}
|
||||
onClose = {()=>{this.hideMenu()}}
|
||||
onClose = {(e,id)=>{this.hideMenu(e,id)}}
|
||||
>
|
||||
</Menu>
|
||||
</div>
|
||||
|
|
|
@ -39,12 +39,10 @@ const Column = [
|
|||
},
|
||||
{
|
||||
title: '分销商',
|
||||
name: 'stock22',
|
||||
name: 'reseller_name',
|
||||
type: "normal",
|
||||
prop:'name',
|
||||
defaultText: 0,
|
||||
prop:'reseller_name',
|
||||
width:'auto',
|
||||
type: "normal",
|
||||
},{
|
||||
title: '归属营销计划',
|
||||
name: 'plan_title',
|
||||
|
@ -54,15 +52,14 @@ const Column = [
|
|||
},
|
||||
{
|
||||
title: '购买数量',
|
||||
name: 'stock22',
|
||||
name: 'num',
|
||||
type: "normal",
|
||||
prop:'name',
|
||||
prop:'num',
|
||||
width:'auto',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
name: 'statusDom',
|
||||
|
||||
prop:'statusDom',
|
||||
type: "slot",
|
||||
width:'auto',
|
||||
|
@ -89,22 +86,22 @@ const Column = [
|
|||
},
|
||||
{
|
||||
title: '折扣',
|
||||
name: 'stock22',
|
||||
name: 'discount',
|
||||
type: "normal",
|
||||
prop:'name',
|
||||
prop:'discount',
|
||||
width:'auto',
|
||||
},
|
||||
{
|
||||
title: '结算',
|
||||
name: 'stock22',
|
||||
prop:'name',
|
||||
name: 'total',
|
||||
prop:'total',
|
||||
width:'auto',
|
||||
type: "normal",
|
||||
},
|
||||
{
|
||||
title: 'key',
|
||||
name: 'stock22',
|
||||
prop:'name',
|
||||
name: 'key_batch_id',
|
||||
prop:'key_batch_id',
|
||||
width:'auto',
|
||||
type: "normal",
|
||||
},{
|
||||
|
@ -120,9 +117,9 @@ export default class orderlist extends React.Component{
|
|||
constructor(props){
|
||||
super(props)
|
||||
this.state={
|
||||
tabList:[{title:"订单列表"}],
|
||||
orderList:[],
|
||||
filterList:[{id:0,label:"订单状态",menuList:[{id:0,name:"待支付"},{id:1,name:"充值中"},{id:2,name:"已完成"},{id:3,name:"充值失败"},{id:4,name:"已取消"}]},{id:1,label:"订单类型",menuList:[{id:0,name:"兑换码"},{id:1,name:"优惠券"},{id:2,name:"立减金"},{id:3,name:"正常"}]}],
|
||||
tabList:[{title:"订单列表"}],
|
||||
orderList:[],
|
||||
filterList:[{id:0,label:"订单状态",menuList:[{id:0,name:"待支付"},{id:1,name:"充值中"},{id:2,name:"已完成"},{id:3,name:"充值失败"},{id:4,name:"已取消"}]},{id:1,label:"订单类型",menuList:[{id:0,name:"兑换码"}]}],
|
||||
selectiondata:[],
|
||||
menuList:[{id:0,name:"订单状态",check:false},{id:1,name:"订单类型",check:false}]
|
||||
,allcheck:false,
|
||||
|
@ -130,7 +127,8 @@ export default class orderlist extends React.Component{
|
|||
combinedValue:[],
|
||||
tableHeight:500,
|
||||
page:1,
|
||||
limit:10
|
||||
limit:10,
|
||||
key_word:''
|
||||
}
|
||||
}
|
||||
//选中表格的选框
|
||||
|
@ -237,24 +235,22 @@ export default class orderlist extends React.Component{
|
|||
//page
|
||||
pageChange(e){
|
||||
this.setState({page:e});
|
||||
let data={
|
||||
page:e,
|
||||
limit:this.state.limit
|
||||
}
|
||||
this.getOrderFn(data);
|
||||
this.getOrderFn();
|
||||
}
|
||||
//limit
|
||||
countChange(e){
|
||||
this.setState({page:1,limit:e});
|
||||
let data={
|
||||
page:1,
|
||||
limit:e
|
||||
}
|
||||
this.getOrderFn(data);
|
||||
this.getOrderFn();
|
||||
}
|
||||
//敲回车查询
|
||||
sureFn(){
|
||||
this.getOrderFn();
|
||||
}
|
||||
//获取订单列表
|
||||
getOrderFn(data,time={}){
|
||||
getOrderFn(time={}){
|
||||
let _self=this;
|
||||
let {page,limit,key_word}=_self.state;
|
||||
let data={page,limit}
|
||||
if(this.state.combinedValue&&this.state.combinedValue[0]){
|
||||
data.begin_time=this.state.combinedValue[0];
|
||||
data.end_time=this.state.combinedValue[1];
|
||||
|
@ -263,12 +259,16 @@ export default class orderlist extends React.Component{
|
|||
data.begin_time=time[0];
|
||||
data.end_time=time[1];
|
||||
}
|
||||
if(key_word){
|
||||
data.key_word=key_word;
|
||||
}
|
||||
if(time&&time[0]==null&&time.length>1){
|
||||
if( data.begin_time){
|
||||
delete data.begin_time;
|
||||
delete data.end_time;
|
||||
}
|
||||
}
|
||||
|
||||
getOrderList(data).then(res=>{
|
||||
handelResponse(res,(response,msg)=>{
|
||||
const orderList_data=response.data;
|
||||
|
@ -285,6 +285,13 @@ export default class orderlist extends React.Component{
|
|||
componentWillMount(){
|
||||
this.getOrderFn();
|
||||
}
|
||||
// 监听组件内部状态的变化:
|
||||
componentDidUpdate(prevProps,prevState){
|
||||
// 参数分别为改变之前的数据状态对象
|
||||
if(prevState.key_word!=this.state.key_word &&!this.state.key_word){
|
||||
this.getOrderFn();
|
||||
}
|
||||
}
|
||||
//过滤表格枚举状态
|
||||
render(){
|
||||
|
||||
|
@ -310,7 +317,7 @@ export default class orderlist extends React.Component{
|
|||
</p>
|
||||
|
||||
{/* <Button type="info">批量操作</Button> */}
|
||||
<Ipt icon="search" placeholder={"请输入充值账号、key、分销商等关键字进行搜索"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>
|
||||
<Ipt onClearItem={(e)=>{this.setState({key_word:''})}} wordSearch={this.sureFn.bind(this)} onChange={(e)=>this.setState({key_word:e})} value={this.state.key_word} icon="search" placeholder={"请输入充值账号、key、分销商等关键字进行搜索"} countShow={false} height={'36px'} width={'260px'} alignment={'left'}/>
|
||||
</p>
|
||||
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList}></Filterbar>
|
||||
<div>
|
||||
|
@ -342,7 +349,6 @@ export default class orderlist extends React.Component{
|
|||
}
|
||||
checkChange ={this.selection.bind(this)}
|
||||
ComponentHandler={(com,rowData)=>{
|
||||
|
||||
if(com == "cost")
|
||||
{
|
||||
return <span>{rowData.contract_price}({rowData.cost_price})</span>
|
||||
|
|
Loading…
Reference in New Issue