因为做了个导出功能,然后导出需要跳转一下才可以导出
<button class="btn btn-round btn-info" onclick="technologyExport()">导出</button>
function technologyExport(){
var startTime=$("#startTime").val();
var endTime=$("#endTime").val();
var machineNo=$("#machCode :selected").val();
$.ajax({
type:'POST',
url:'/fudaMes/macMachineMqtt/export',
async:false,
data:{"startTime":startTime,"endTime":endTime,"machineNo":machineNo},
success:function(data){
if(data=="success"){
alert("成功");
}else{
alert("失败");
}
}
})
}
最后发现就是无法导出,点击导出无反应
修改后:
function technologyExport(){
var startTime=$("#startTime").val();
var endTime=$("#endTime").val();
var machineNo=$("#machCode :selected").val();
window.location.href='/fudaMes/macMachineMqtt/export?startTime='+startTime+'&endTime='+endTime+'&machineNo='+machineNo+'';
}
效果图: