订单列表接口更新
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() {
|
render() {
|
||||||
|
@ -81,7 +82,7 @@ import FilterSelect from "../filterSelect/main.js"
|
||||||
data={this.state.menuList}
|
data={this.state.menuList}
|
||||||
multiple={true}
|
multiple={true}
|
||||||
visible={this.state.menuShow}
|
visible={this.state.menuShow}
|
||||||
onClose = {()=>{this.hideMenu()}}
|
onClose = {(e,id)=>{this.hideMenu(e,id)}}
|
||||||
>
|
>
|
||||||
</Menu>
|
</Menu>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -39,12 +39,10 @@ const Column = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '分销商',
|
title: '分销商',
|
||||||
name: 'stock22',
|
name: 'reseller_name',
|
||||||
type: "normal",
|
type: "normal",
|
||||||
prop:'name',
|
prop:'reseller_name',
|
||||||
defaultText: 0,
|
|
||||||
width:'auto',
|
width:'auto',
|
||||||
type: "normal",
|
|
||||||
},{
|
},{
|
||||||
title: '归属营销计划',
|
title: '归属营销计划',
|
||||||
name: 'plan_title',
|
name: 'plan_title',
|
||||||
|
@ -54,15 +52,14 @@ const Column = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '购买数量',
|
title: '购买数量',
|
||||||
name: 'stock22',
|
name: 'num',
|
||||||
type: "normal",
|
type: "normal",
|
||||||
prop:'name',
|
prop:'num',
|
||||||
width:'auto',
|
width:'auto',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
name: 'statusDom',
|
name: 'statusDom',
|
||||||
|
|
||||||
prop:'statusDom',
|
prop:'statusDom',
|
||||||
type: "slot",
|
type: "slot",
|
||||||
width:'auto',
|
width:'auto',
|
||||||
|
@ -89,22 +86,22 @@ const Column = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '折扣',
|
title: '折扣',
|
||||||
name: 'stock22',
|
name: 'discount',
|
||||||
type: "normal",
|
type: "normal",
|
||||||
prop:'name',
|
prop:'discount',
|
||||||
width:'auto',
|
width:'auto',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '结算',
|
title: '结算',
|
||||||
name: 'stock22',
|
name: 'total',
|
||||||
prop:'name',
|
prop:'total',
|
||||||
width:'auto',
|
width:'auto',
|
||||||
type: "normal",
|
type: "normal",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'key',
|
title: 'key',
|
||||||
name: 'stock22',
|
name: 'key_batch_id',
|
||||||
prop:'name',
|
prop:'key_batch_id',
|
||||||
width:'auto',
|
width:'auto',
|
||||||
type: "normal",
|
type: "normal",
|
||||||
},{
|
},{
|
||||||
|
@ -122,7 +119,7 @@ export default class orderlist extends React.Component{
|
||||||
this.state={
|
this.state={
|
||||||
tabList:[{title:"订单列表"}],
|
tabList:[{title:"订单列表"}],
|
||||||
orderList:[],
|
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:"正常"}]}],
|
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:[],
|
selectiondata:[],
|
||||||
menuList:[{id:0,name:"订单状态",check:false},{id:1,name:"订单类型",check:false}]
|
menuList:[{id:0,name:"订单状态",check:false},{id:1,name:"订单类型",check:false}]
|
||||||
,allcheck:false,
|
,allcheck:false,
|
||||||
|
@ -130,7 +127,8 @@ export default class orderlist extends React.Component{
|
||||||
combinedValue:[],
|
combinedValue:[],
|
||||||
tableHeight:500,
|
tableHeight:500,
|
||||||
page:1,
|
page:1,
|
||||||
limit:10
|
limit:10,
|
||||||
|
key_word:''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//选中表格的选框
|
//选中表格的选框
|
||||||
|
@ -237,24 +235,22 @@ export default class orderlist extends React.Component{
|
||||||
//page
|
//page
|
||||||
pageChange(e){
|
pageChange(e){
|
||||||
this.setState({page:e});
|
this.setState({page:e});
|
||||||
let data={
|
this.getOrderFn();
|
||||||
page:e,
|
|
||||||
limit:this.state.limit
|
|
||||||
}
|
|
||||||
this.getOrderFn(data);
|
|
||||||
}
|
}
|
||||||
//limit
|
//limit
|
||||||
countChange(e){
|
countChange(e){
|
||||||
this.setState({page:1,limit:e});
|
this.setState({page:1,limit:e});
|
||||||
let data={
|
this.getOrderFn();
|
||||||
page:1,
|
|
||||||
limit:e
|
|
||||||
}
|
}
|
||||||
this.getOrderFn(data);
|
//敲回车查询
|
||||||
|
sureFn(){
|
||||||
|
this.getOrderFn();
|
||||||
}
|
}
|
||||||
//获取订单列表
|
//获取订单列表
|
||||||
getOrderFn(data,time={}){
|
getOrderFn(time={}){
|
||||||
let _self=this;
|
let _self=this;
|
||||||
|
let {page,limit,key_word}=_self.state;
|
||||||
|
let data={page,limit}
|
||||||
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];
|
||||||
data.end_time=this.state.combinedValue[1];
|
data.end_time=this.state.combinedValue[1];
|
||||||
|
@ -263,12 +259,16 @@ export default class orderlist extends React.Component{
|
||||||
data.begin_time=time[0];
|
data.begin_time=time[0];
|
||||||
data.end_time=time[1];
|
data.end_time=time[1];
|
||||||
}
|
}
|
||||||
|
if(key_word){
|
||||||
|
data.key_word=key_word;
|
||||||
|
}
|
||||||
if(time&&time[0]==null&&time.length>1){
|
if(time&&time[0]==null&&time.length>1){
|
||||||
if( data.begin_time){
|
if( data.begin_time){
|
||||||
delete data.begin_time;
|
delete data.begin_time;
|
||||||
delete data.end_time;
|
delete data.end_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrderList(data).then(res=>{
|
getOrderList(data).then(res=>{
|
||||||
handelResponse(res,(response,msg)=>{
|
handelResponse(res,(response,msg)=>{
|
||||||
const orderList_data=response.data;
|
const orderList_data=response.data;
|
||||||
|
@ -284,6 +284,13 @@ export default class orderlist extends React.Component{
|
||||||
}
|
}
|
||||||
componentWillMount(){
|
componentWillMount(){
|
||||||
this.getOrderFn();
|
this.getOrderFn();
|
||||||
|
}
|
||||||
|
// 监听组件内部状态的变化:
|
||||||
|
componentDidUpdate(prevProps,prevState){
|
||||||
|
// 参数分别为改变之前的数据状态对象
|
||||||
|
if(prevState.key_word!=this.state.key_word &&!this.state.key_word){
|
||||||
|
this.getOrderFn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//过滤表格枚举状态
|
//过滤表格枚举状态
|
||||||
render(){
|
render(){
|
||||||
|
@ -310,7 +317,7 @@ export default class orderlist extends React.Component{
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* <Button type="info">批量操作</Button> */}
|
{/* <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>
|
</p>
|
||||||
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList}></Filterbar>
|
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList}></Filterbar>
|
||||||
<div>
|
<div>
|
||||||
|
@ -342,7 +349,6 @@ export default class orderlist extends React.Component{
|
||||||
}
|
}
|
||||||
checkChange ={this.selection.bind(this)}
|
checkChange ={this.selection.bind(this)}
|
||||||
ComponentHandler={(com,rowData)=>{
|
ComponentHandler={(com,rowData)=>{
|
||||||
|
|
||||||
if(com == "cost")
|
if(com == "cost")
|
||||||
{
|
{
|
||||||
return <span>{rowData.contract_price}({rowData.cost_price})</span>
|
return <span>{rowData.contract_price}({rowData.cost_price})</span>
|
||||||
|
|
Loading…
Reference in New Issue