diff --git a/src/assets/api.js b/src/assets/api.js index 0dc3e997..c843dfac 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -4,7 +4,7 @@ import { Notify } from "zent" // const Version = "v1.3.0"; // window.baseurl = 'http://pre.marketapi.1688sup.com' let baseurl = "" -let download_url='http://192.168.6.193:8091' +let download_url='https://ewm.83323.cn' if (process.env.NODE_ENV == "test" || process.env.NODE_ENV == "development") { // 测试环境 baseurl = "http://192.168.6.75" @@ -976,8 +976,8 @@ export const handlerRefund = (orderNumber, data) => { // } //订单下载列表-列表 -export const getdownloadList = (id) => { - return req("get", download_url + `/export/excel/marketOrder/record`) +export const getdownloadList = (data) => { + return req("get", download_url + `/export/excel/marketOrder/record`,data) } //订单下载列表-数据下载 export const exportDownload = (md5) => { diff --git a/src/pages/order/downloadList/list.js b/src/pages/order/downloadList/list.js index 8ac6065d..1779c0f8 100644 --- a/src/pages/order/downloadList/list.js +++ b/src/pages/order/downloadList/list.js @@ -31,6 +31,7 @@ const Column=[ width:'20%' } ] +let getprocess; export default class downloadlist extends React.Component { constructor(props) { super(props) @@ -40,6 +41,7 @@ export default class downloadlist extends React.Component { tableHeight: 500, page: 1, limit: 10, + file_name:"", key_word: "", total:3 } @@ -49,6 +51,12 @@ export default class downloadlist extends React.Component { } componentDidMount(){ this.getDownloadList(); + getprocess=setInterval(()=>{ + this.getDownloadList(); + },1000); + } + componentWillUnmount(){ + clearInterval(getprocess); } //删除 deleteFn(e, row) { @@ -79,14 +87,23 @@ export default class downloadlist extends React.Component { //page pageChange(e) { this.setState({ page: e }) + setTimeout(()=>{ + this.getDownloadList(); + },0); } //limit countChange(e) { this.setState({ page: 1, limit: e }) + setTimeout(()=>{ + this.getDownloadList(); + },0); } //敲回车查询 sureFn() { this.setState({ page: 1 }) + setTimeout(()=>{ + this.getDownloadList(); + },0); } exportFn(e,rowData){ exportDownload(rowData.filter_md5) @@ -112,14 +129,18 @@ export default class downloadlist extends React.Component { .catch(err => {}) } getDownloadList(){ - let {page,limit}=this.state; + let {page,limit,file_name}=this.state; let data={ page, - limit + limit, + file_name } - getdownloadList().then(res=>{ + getdownloadList(data).then(res=>{ handelResponse(res,(response,msg)=>{ this.setState({total:response.total,orderList:response.data}); + if(response.generate<1){ + clearInterval(getprocess); + } },(err)=>{ Notify.error(err) }) @@ -150,11 +171,15 @@ export default class downloadlist extends React.Component { { - this.setState({ key_word: "" }) + this.setState({ file_name: "",page:1 }) + setTimeout(()=>{ + this.getDownloadList(); + },0); + }} wordSearch={this.sureFn.bind(this)} - onChange={(e) => this.setState({ key_word: e })} - value={this.state.key_word} + onChange={(e) => this.setState({ file_name: e })} + value={this.state.file_name} icon='search' placeholder={'请输入订单文件名称搜索'} countShow={false}