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"; // const Version = "v1.3.0";
// window.baseurl = 'http://pre.marketapi.1688sup.com' // window.baseurl = 'http://pre.marketapi.1688sup.com'
let baseurl = "" 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") { if (process.env.NODE_ENV == "test" || process.env.NODE_ENV == "development") {
// 测试环境 // 测试环境
baseurl = "http://192.168.6.75" baseurl = "http://192.168.6.75"
@ -976,8 +976,8 @@ export const handlerRefund = (orderNumber, data) => {
// } // }
//订单下载列表-列表 //订单下载列表-列表
export const getdownloadList = (id) => { export const getdownloadList = (data) => {
return req("get", download_url + `/export/excel/marketOrder/record`) return req("get", download_url + `/export/excel/marketOrder/record`,data)
} }
//订单下载列表-数据下载 //订单下载列表-数据下载
export const exportDownload = (md5) => { export const exportDownload = (md5) => {

View File

@ -31,6 +31,7 @@ const Column=[
width:'20%' width:'20%'
} }
] ]
let getprocess;
export default class downloadlist extends React.Component { export default class downloadlist extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -40,6 +41,7 @@ export default class downloadlist extends React.Component {
tableHeight: 500, tableHeight: 500,
page: 1, page: 1,
limit: 10, limit: 10,
file_name:"",
key_word: "", key_word: "",
total:3 total:3
} }
@ -49,6 +51,12 @@ export default class downloadlist extends React.Component {
} }
componentDidMount(){ componentDidMount(){
this.getDownloadList(); this.getDownloadList();
getprocess=setInterval(()=>{
this.getDownloadList();
},1000);
}
componentWillUnmount(){
clearInterval(getprocess);
} }
//删除 //删除
deleteFn(e, row) { deleteFn(e, row) {
@ -79,14 +87,23 @@ export default class downloadlist extends React.Component {
//page //page
pageChange(e) { pageChange(e) {
this.setState({ page: e }) this.setState({ page: e })
setTimeout(()=>{
this.getDownloadList();
},0);
} }
//limit //limit
countChange(e) { countChange(e) {
this.setState({ page: 1, limit: e }) this.setState({ page: 1, limit: e })
setTimeout(()=>{
this.getDownloadList();
},0);
} }
//敲回车查询 //敲回车查询
sureFn() { sureFn() {
this.setState({ page: 1 }) this.setState({ page: 1 })
setTimeout(()=>{
this.getDownloadList();
},0);
} }
exportFn(e,rowData){ exportFn(e,rowData){
exportDownload(rowData.filter_md5) exportDownload(rowData.filter_md5)
@ -112,14 +129,18 @@ export default class downloadlist extends React.Component {
.catch(err => {}) .catch(err => {})
} }
getDownloadList(){ getDownloadList(){
let {page,limit}=this.state; let {page,limit,file_name}=this.state;
let data={ let data={
page, page,
limit limit,
file_name
} }
getdownloadList().then(res=>{ getdownloadList(data).then(res=>{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
this.setState({total:response.total,orderList:response.data}); this.setState({total:response.total,orderList:response.data});
if(response.generate<1){
clearInterval(getprocess);
}
},(err)=>{ },(err)=>{
Notify.error(err) Notify.error(err)
}) })
@ -150,11 +171,15 @@ export default class downloadlist extends React.Component {
<Ipt <Ipt
labelWidth={0} labelWidth={0}
onClearItem={(e) => { onClearItem={(e) => {
this.setState({ key_word: "" }) this.setState({ file_name: "",page:1 })
setTimeout(()=>{
this.getDownloadList();
},0);
}} }}
wordSearch={this.sureFn.bind(this)} wordSearch={this.sureFn.bind(this)}
onChange={(e) => this.setState({ key_word: e })} onChange={(e) => this.setState({ file_name: e })}
value={this.state.key_word} value={this.state.file_name}
icon='search' icon='search'
placeholder={'请输入订单文件名称搜索'} placeholder={'请输入订单文件名称搜索'}
countShow={false} countShow={false}