From 6750d99ba80dfe2ea73f2703b89b17cad0d73d57 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Thu, 25 Nov 2021 19:32:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/commodity/commodity.js | 12 +- src/pages/exchangecode/list/list.js | 4 +- src/pages/exchangepage/main/main.js | 12 +- src/pages/exchangepage/mytemplate/main.js | 14 +- src/pages/plan/key/list.js | 311 ++++-------------- src/pages/plan/list/list.js | 5 +- 6 files changed, 103 insertions(+), 255 deletions(-) diff --git a/src/pages/exchangecode/commodity/commodity.js b/src/pages/exchangecode/commodity/commodity.js index 2722da64..26851000 100644 --- a/src/pages/exchangecode/commodity/commodity.js +++ b/src/pages/exchangecode/commodity/commodity.js @@ -211,7 +211,15 @@ export default class commoditylist extends React.Component{ sessionStorage.setItem("dataInfo",rowData.product_id) sessionStorage.setItem('breaknav',JSON.stringify(activerou)); } - + //敲回车查询 + sureFn(){ + let data = { + code_batch_id:sessionStorage.getItem("code_id"), + page:this.state.page, + limit:this.state.limit + } + this.getTableList(data);//更新列表 + } render(){ const { current, pageSize } = this.state; @@ -225,7 +233,7 @@ export default class commoditylist extends React.Component{ {/* */} - + this.setState({key_word:e})} wordSearch={this.sureFn.bind(this)} alignment={'left'}/>

diff --git a/src/pages/exchangecode/list/list.js b/src/pages/exchangecode/list/list.js index 43e40efc..55292905 100644 --- a/src/pages/exchangecode/list/list.js +++ b/src/pages/exchangecode/list/list.js @@ -170,8 +170,8 @@ export default class acclist extends React.Component{ sessionStorage.setItem('breaknav',JSON.stringify(activerou)); } tabFn(index){ - this.setState({tabIndex:index}) - this.setState({page:1}) + this.setState({tabIndex:index,key_word:''}) + this.setState({page:1,limit:10}) setTimeout(() => { this.getCodeListFn({},index); }, 10); diff --git a/src/pages/exchangepage/main/main.js b/src/pages/exchangepage/main/main.js index c48a2acd..ae8c5039 100644 --- a/src/pages/exchangepage/main/main.js +++ b/src/pages/exchangepage/main/main.js @@ -44,8 +44,8 @@ const Column = [{ name: 'thumb', prop: 'thumb', className: 'name', - type: "normal", - width: '200px' + type: "slot", + width: '10%' }, { title: '标题', prop: 'title', @@ -239,7 +239,7 @@ export default class acclist extends React.Component { tabChange(e) { this.setState({page:1}) this.setState({limit:10}) - + this.setState({key_word:''}); let data={ page: 1, limit:10, @@ -391,6 +391,12 @@ export default class acclist extends React.Component { } ComponentHandler = { (com, rowData) => { + if(com=='thumb'){ + return }> + + + + } if (com == "name") { return { + if(com=='thumb'){ + return }> + + + + } if (com == "client") { return < font className = "icon" style = { diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index cfe65422..e9a1a8ed 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -116,7 +116,8 @@ export default class acclist extends React.Component{ distdata3:[], distdata11:[], tableHeight:600, - email:"", + email:"", + key_word:'', phone:"", } } @@ -146,7 +147,6 @@ export default class acclist extends React.Component{ this.getKeyList(data); } componentDidMount(e){ - console.log(7777) let data = { page:1, limit:10, @@ -190,12 +190,40 @@ export default class acclist extends React.Component{ } tabFn(index){ - this.setState({activepage:index}); - if(index==0){ - - } - if(index==1){ + this.setState({activepage:index,key_word:''}); + if(index==1||index==2){ + this.setState({distdata:[]}); + }else{ + if(index==3){ + this.setState({activepage:4}); + + } + if(index==4){ + this.setState({activepage:5}); + } + if(index==5){ + this.setState({activepage:6}); + } + if(index==6){ + this.setState({activepage:7}); + } + this.setState({page:1,limit:10}) + setTimeout(() => { + let data = { + page:1, + limit:10, + status:this.state.activepage, + plan_id: sessionStorage.getItem("key_plan_id") + } + + if(index==0){ + delete data.status; + } + this.getKeyList(data); + }, 10); + } + } //作废 delFn(){ @@ -279,7 +307,15 @@ onEditRow(status,row){ //敲回车查询 iptsureFn(){ - this.getKeyList(); + let data = { + page:1, + limit:10, + key_word:this.state.key_word, + plan_id: sessionStorage.getItem("key_plan_id")} + if(this.state.activepage){ + data.status=this.state.activepage; + } + this.getKeyList(data); } componentWillMount(){ @@ -440,7 +476,14 @@ phoneChange=(e)=> cancelKey(row.id).then(res=>{ handelResponse(res,(response,msg)=>{ Notify.clear(); - Notify.success("作废成功"); + Notify.success(msg); + let data = { + page:1, + limit:10, + plan_id: sessionStorage.getItem("key_plan_id") + } + console.log(57777777); + self.getKeyList(data); },(err)=>{ @@ -455,7 +498,21 @@ phoneChange=(e)=> } } + // 监听组件内部状态的变化: + componentDidUpdate(prevProps,prevState){ + // 参数分别为改变之前的数据状态对象 + if(prevState.key_word!=this.state.key_word &&!this.state.key_word){ + let data = { + page:1, + limit:10, + plan_id: sessionStorage.getItem("key_plan_id")} + if(this.state.activepage){ + data.status=this.state.activepage; + } + this.getKeyList(data); + } +} render(){ const date =

{/* */} - + this.setState({key_word:e})} value={this.state.key_word} wordSearch={this.iptsureFn.bind(this)} countShow={false} height={'36px'} width={'260px'} onClearItem={(e)=>{this.setState({key_word:''})}} alignment={'left'} />

- { - this.state.activepage==0? countbarVisible={false} isSwitch={false} isMultiple={false} + page={this.state.page} dataCount={this.state.dataCount} pageChange={(e)=>{ this.pageChange(e) @@ -498,7 +555,6 @@ phoneChange=(e)=> if(com == "status") { - console.log(112121) return

{menu.keysStatus(rowData.status)}

} if(com == "edit") @@ -522,234 +578,7 @@ phoneChange=(e)=> } }} - />:null - } - { - this.state.activepage==1? { - this.pageChange(e) - }} - checkChange ={(selection)=>{ - console.log(selection) - }} - ComponentHandler={(com,rowData)=>{ - - console.log(78979898) - - if(com == "codename") - { - return this.aboutFn(e,rowData)}>{rowData.name}; - } - if(com == "name") - { - return this.changestatus(e,rowData)}>; - } - if(com == "status") - { - console.log(112121) - return

{menu.keysStatus(rowData.status)}

- } - if(com == "opearo") - { - return
- { - rowData.status!=2|| rowData.status!=3?this.editinfo(e,rowData)}>编辑:null - } - { - rowData.status!=2|| rowData.status!=3? this.delFn(e,rowData)} >作废:null - } - 复制 -
- } - }} - />:null - } - {/* 进行 */} - { - this.state.activepage==2? { - this.pageChange(e) - }} - checkChange ={(selection)=>{ - console.log(selection) - }} - ComponentHandler={(com,rowData)=>{ - if(com == "codename") - { - return this.aboutFn(e,rowData)}>{rowData.name}; - } - if(com == "name") - { - return this.changestatus(e,rowData)}>; - } - if(com == "status") - { - console.log(66666) - return

{menu.keysStatus(rowData.status)}

- } - if(com == "opearo") - { - return
- { - rowData.status!=2|| rowData.status!=3?this.editinfo(e,rowData)}>编辑:null - } - { - rowData.status!=2|| rowData.status!=3? this.delFn(e,rowData)} >作废:null - } - 复制 -
- } - }} - />:null - } - {/* 暂停 */} - { - this.state.activepage==3? { - this.pageChange(e) - }} - checkChange ={(selection)=>{ - console.log(selection) - }} - ComponentHandler={(com,rowData)=>{ - if(com == "codename") - { - return this.aboutFn(e,rowData)}>{rowData.name}; - } - if(com == "name") - { - return this.changestatus(e,rowData)}>; - } - if(com == "status") - { - console.log(789789798) - return

{menu.keysStatus(rowData.status)}

- } - if(com == "opearo") - { - return
- { - rowData.status!=2|| rowData.status!=3?this.editinfo(e,rowData)}>编辑:null - } - { - rowData.status!=2|| rowData.status!=3? this.delFn(e,rowData)} >作废:null - } - 复制 -
- } - }} - />:null - } - {/* 一结束 */} - { - this.state.activepage==4? { - this.pageChange(e) - }} - checkChange ={(selection)=>{ - console.log(selection) - }} - ComponentHandler={(com,rowData)=>{ - if(com == "codename") - { - return this.aboutFn(e,rowData)}>{rowData.name}; - } - if(com == "name") - { - return this.changestatus(e,rowData)}>; - } - if(com == "status") - { - return

{menu.keysStatus(rowData.status)}

- } - if(com == "opearo") - { - return
- { - rowData.status!=2|| rowData.status!=3?this.editinfo(e,rowData)}>编辑:null - } - { - rowData.status!=2|| rowData.status!=3? this.delFn(e,rowData)} >作废:null - } - 复制 -
- } - }} - />:null - } - {/* 已作废 */} - { - this.state.activepage==5? { - this.pageChange(e) - }} - checkChange ={(selection)=>{ - console.log(selection) - }} - ComponentHandler={(com,rowData)=>{ - if(com == "codename") - { - return this.aboutFn(e,rowData)}>{rowData.name}; - } - if(com == "name") - { - return this.changestatus(e,rowData)}>; - } - if(com == "status") - { - return

{menu.keysStatus(rowData.status)}

- } - if(com == "opearo") - { - return
- { - rowData.status!=2|| rowData.status!=3?this.editinfo(e,rowData)}>编辑:null - } - { - rowData.status!=2|| rowData.status!=3? this.delFn(e,rowData)} >作废:null - } - 复制 -
- } - }} - />:null - } - + />
diff --git a/src/pages/plan/list/list.js b/src/pages/plan/list/list.js index 0e5a32bf..84e67b09 100644 --- a/src/pages/plan/list/list.js +++ b/src/pages/plan/list/list.js @@ -66,10 +66,10 @@ export default class acclist extends React.Component{ getPlanList(data){ let queryParams = _.omitBy(data, (value) => { - return _.isNaN(value) || _.isNil(value) || '' == value + return _.isNaN(value) || _.isNil(value) || 0 == value }) - + console.log(72,queryParams); getPlanList(queryParams).then((res)=>{ handelResponse(res,(req,msg)=>{ this.setState({distdata:req.data}) @@ -288,7 +288,6 @@ export default class acclist extends React.Component{ limit:10, status:e, key_word:this.state.key_word - } this.getPlanList(data)