| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'ioTime$', align: 'center', title: '出库日期', width: 200}, |
| | | {field: 'io_time', align: 'center', title: '出库日期', width: 200}, |
| | | {field: 'order_no', align: 'center', title: '单据编号', width: 200} |
| | | ,{field: 'loc_no', align: 'center',title: '库位号'} |
| | | ,{field: 'crn_str_time', align: 'center',title: '堆垛机启动时间'} |
| | | ,{field: 'crn_end_time', align: 'center',title: '堆垛机停止时间'} |
| | | {field: 'ioTime$', align: 'center', title: '出库日期', width: 200} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'crnStrTime', align: 'center',title: '堆垛机启动时间'} |
| | | ,{field: 'crnEndTime', align: 'center',title: '堆垛机停止时间'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | |
| | | data: JSON.stringify(param), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | xhrFields: { |
| | | responseType: "blob" // 设置响应类型为二进制数据 |
| | | }, |
| | | success: function (res) { |
| | | // 创建一个临时的下载链接 |
| | | const url = window.URL.createObjectURL(res); |
| | | // 创建一个隐藏的 <a> 元素并设置下载链接 |
| | | const a = document.createElement("a"); |
| | | a.style.display = "none"; |
| | | a.href = url; |
| | | a.download = "export.xlsx"; // 指定下载的文件名 |
| | | document.body.appendChild(a); |
| | | |
| | | // 触发点击事件以开始下载 |
| | | a.click(); |
| | | |
| | | // 清理临时资源 |
| | | setTimeout(function () { |
| | | window.URL.revokeObjectURL(url); |
| | | document.body.removeChild(a); |
| | | layer.closeAll(); |
| | | }, 100); |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | }, |
| | | fail: function (){ |
| | | layer.msg('导出失败', {icon: 2}) |