作者 xudada

舱单统计导出execl

... ... @@ -23,6 +23,17 @@ export default {
}
});
},
getStream(url, params) {
return axios({
method: 'GET',
url: url,
responseType: 'arraybuffer',
params: params,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
},
put(url, params){
return axios({
method: 'PUT',
... ...
import http from './http.js'
let baseUrl = '/statistics/selectDevList'
export const QueryData=params=>{return http.getStream(`${baseUrl}`, params);};
... ...
... ... @@ -49,6 +49,7 @@ import Page7 from './views/nav3/Page7.vue'
import importFFMMsg from './views/airRadioMsg/importFFMMsg.vue'
import importFHLMsg from './views/airRadioMsg/importFHLMsg.vue'
import importFWBMsg from './views/airRadioMsg/importFWBMsg.vue'
import statis from './views/nmms_import/statistics'
... ... @@ -337,6 +338,7 @@ let routes = [
{path:'/tallymaster',component:TallyMster,name:'进港理货舱单'},
{path:'/importallocation',component:Importallocation,name:'进港分拨'},
{path:'/allocatearrive',component:Allocatearrive,name:'分拨运抵'},
{path:'/statis',component:statis,name:'进港舱单统计'}
]
},
// 货运系统--航班预配
... ...
<template>
<el-container>
<el-main>
<el-row class="row-bg">
<el-col :span="24"><div class="grid-content content co">进港舱单统计</div></el-col>
</el-row>
<el-row style="display: block;background-color: white">
<el-row>
<el-col :span="5">
<span>
航班号:
</span>
<el-input placeholder="" v-model="defaultQuery.flightno" style="width: 150px">
</el-input>
</el-col>
<el-col :span="5">
<span>
航班开始日期:
</span>
<el-date-picker
v-model="defaultQuery.subTime"
type="date"
value-format="yyyy-MM-dd" style="width: 150px"
placeholder="航班开始日期">
</el-date-picker>
</el-col>
<el-col :span="5">
<span>
航班结束日期:
</span>
<el-date-picker
v-model="defaultQuery.nowTime"
type="date"
value-format="yyyy-MM-dd" style="width: 150px"
placeholder="航班结束日期">
</el-date-picker>
</el-col>
<el-col :span="2">
<el-col :span="8" style="margin-right: 0px">
<el-button type="primary" v-on:click="QueryData">导出EXCEL</el-button>
</el-col>
</el-col>
</el-row>
</el-row>
</el-main>
</el-container>
</template>
<script>
import{QueryData} from "../../api/statictis";
export default {
data() {
return{
defaultQuery:{
flightno:'',
subTime:'2018-06-06',
nowTime:'2018-06-07'
},
tableData:[],
tableloading:false
}
},
methods:{
QueryData(){
this.tableData=[];
if(!this.defaultQuery.subTime=="" && !this.defaultQuery.nowTime==""){
let params={carrier:this.defaultQuery.flightno,
subTime:this.defaultQuery.subTime,nowTime:this.defaultQuery.nowTime};
this.tableloading=true;
window.open('/api/statistics/selectDevList?nowTime='+this.defaultQuery.nowTime+'&subTime='+this.defaultQuery.subTime,'_blank');
QueryData(params).then(res =>{
/*if(res.byteLength!==0){
fileDownload(res,'sss.xls');
}else{
Message.error("无法找到对应的文件!!!");
}*/
this.tableloading = false;
});
}else{
this.$message.error('航班开始结束日期必须选择!');
}
}
}
}
</script>
... ...