feat:订单下载导出列表提交测试

This commit is contained in:
Apple 2023-01-04 17:51:27 +08:00
parent 12457e6569
commit 5bd4201b2d
2 changed files with 34 additions and 9 deletions

View File

@ -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) => {

View File

@ -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 {
<Ipt
labelWidth={0}
onClearItem={(e) => {
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}