Update list.js

This commit is contained in:
姜棚 2021-11-25 10:32:30 +08:00
parent 1ef9701d80
commit 6d594a9592
1 changed files with 54 additions and 4 deletions

View File

@ -28,7 +28,9 @@ export default class acclist extends React.Component{
], ],
menuList:[{id:0,name:"状态",check:false}], menuList:[{id:0,name:"状态",check:false}],
email:"", email:"",
phone:"" phone:"",
search:""
} }
} }
clickFn(){ clickFn(){
@ -42,6 +44,8 @@ export default class acclist extends React.Component{
let data = { let data = {
page:e, page:e,
limit:this.state.limit, limit:this.state.limit,
status:this.state.status,
key_word:this.state.key_word
} }
this.getPlanList(data); this.getPlanList(data);
@ -66,7 +70,13 @@ export default class acclist extends React.Component{
} }
getPlanList(data){ getPlanList(data){
getPlanList(data).then((res)=>{
let queryParams = _.omitBy(data, (value) => {
return _.isNaN(value) || _.isNil(value) || '' == value
})
getPlanList(queryParams).then((res)=>{
handelResponse(res,(req,msg)=>{ handelResponse(res,(req,msg)=>{
this.setState({distdata:req.data}) this.setState({distdata:req.data})
this.setState({dataCount:req.total}) this.setState({dataCount:req.total})
@ -80,6 +90,8 @@ export default class acclist extends React.Component{
let data = { let data = {
page:1, page:1,
limit:e, limit:e,
status:this.state.status,
key_word:this.state.key_word
} }
this.getPlanList(data); this.getPlanList(data);
} }
@ -263,6 +275,18 @@ export default class acclist extends React.Component{
} }
onFilter(e){ onFilter(e){
console.log(e) console.log(e)
this.setState({page:1})
this.setState({limit:10})
this.setState({status:e})
let data = {
page:1,
limit:10,
status:e,
key_word:this.state.key_word
}
this.getPlanList(data)
} }
phoneChange=(e)=> phoneChange=(e)=>
{ {
@ -277,6 +301,23 @@ export default class acclist extends React.Component{
} }
iptsureFn(e){
this.setState({page:1})
this.setState({limit:10})
console.log("查询关键字")
console.log(e)
let data = {
page:1,
limit:10,
status:this.state.status,
key_word: this.state.search
}
this.getPlanList(data)
}
render(){ render(){
const { current, pageSize } = this.state; const { current, pageSize } = this.state;
const Column = [ const Column = [
@ -373,8 +414,17 @@ export default class acclist extends React.Component{
<p className="distable dflexj"> <p className="distable dflexj">
<Button type="primary" icon="plus" onClick={this.clickFn.bind(this)}>新建营销计划</Button> <Button type="primary" icon="plus" onClick={this.clickFn.bind(this)}>新建营销计划</Button>
{/* <Button type="info">批量操作</Button> */} {/* <Button type="info">批量操作</Button> */}
<Ipt onChange={(e)=>this.setState({search:e})} value={this.state.search} wordSearch={this.iptsureFn.bind(this)} icon="search" placeholder={"请输入营销计划名称、分销商名称查询"} countShow={false} height={'36px'} width={'260px'} onClearItem={(e)=>{
this.setState({search:''})
let data ={
page:1,
limit:10,
}
this.getPlanList(data)
}} alignment={'left'}/>
</p> </p>
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList} onSelect={(e)=>{this.onFilter(e)}}></Filterbar> <Filterbar filterList={this.state.filterList} menuList={this.state.menuList} selectFn={(e)=>{this.onFilter(e)}}></Filterbar>
<div> <div>
<Grid <Grid
spliteColor={'#fff'} spliteColor={'#fff'}
@ -410,7 +460,7 @@ export default class acclist extends React.Component{
} }
if(com == "status") if(com == "status")
{ {
console.log(rowData.status)
return <p className="dflexa" ><span><font className="icon" style={{background:menu.planStatusBg(parseInt(rowData.status))}}></font>{menu.planStatus(parseInt(rowData.status))}</span></p> return <p className="dflexa" ><span><font className="icon" style={{background:menu.planStatusBg(parseInt(rowData.status))}}></font>{menu.planStatus(parseInt(rowData.status))}</span></p>
} }
if(com == "opearo") if(com == "opearo")