| | |
| | | }); |
| | | } |
| | | break; |
| | | // 导出 |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', function(){ |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true,}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | |
| | | url: baseUrl+"/matCode/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | // dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | 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) |
| | | } |
| | | // 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) |
| | | // } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | // 导入 |
| | | case 'intoData': |
| | | layer.open({ |
| | | type: 1, |
| | |
| | | content: $('#importDataDiv'), |
| | | success: function(layero, index){ |
| | | uploader.reload(); |
| | | }, |
| | | end: function () { |
| | | $('#uploadDesc').show(); |
| | | $('#uploadDemoView').hide(); |
| | | $('#fileMame').html(""); |
| | | } |
| | | }); |
| | | break; |