|
@ -55,7 +55,7 @@ |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:model:add"> |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:model:add"> |
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
</a> |
|
|
</a> |
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:model:export"> |
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:model:export"> |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
</a> |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
@ -123,6 +123,61 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//导出 |
|
|
|
|
|
function exportExcel(formId) { |
|
|
|
|
|
// $.table.set(); |
|
|
|
|
|
var pcodeData = []; |
|
|
|
|
|
var selections = $("#bootstrap-table").bootstrapTable("getSelections"); |
|
|
|
|
|
if(selections.length === 0){ |
|
|
|
|
|
$.modal.confirm("确定导出所有产品型号管理吗?", function() { |
|
|
|
|
|
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; |
|
|
|
|
|
var params = $("#bootstrap-table").bootstrapTable('getOptions'); |
|
|
|
|
|
var dataParam = $("#" + currentId).serializeArray(); |
|
|
|
|
|
dataParam.push({ "name": "orderByColumn", "value": params.sortName }); |
|
|
|
|
|
dataParam.push({ "name": "isAsc", "value": params.sortOrder }); |
|
|
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
|
|
$.post(prefix + '/exportAll', dataParam, function(result) { |
|
|
|
|
|
if (result.code == web_status.SUCCESS) { |
|
|
|
|
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; |
|
|
|
|
|
} else if (result.code == web_status.WARNING) { |
|
|
|
|
|
$.modal.alertWarning(result.msg) |
|
|
|
|
|
} else { |
|
|
|
|
|
$.modal.alertError(result.msg); |
|
|
|
|
|
} |
|
|
|
|
|
$.modal.closeLoading(); |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}else { |
|
|
|
|
|
$.modal.confirm("确定导出选中的所有产品型号管理吗?", function () { |
|
|
|
|
|
//·拼接单号 |
|
|
|
|
|
for(let i=0;i<selections.length;i++){ |
|
|
|
|
|
pcodeData.push(selections[i].pcode); |
|
|
|
|
|
} |
|
|
|
|
|
var pcodes = JSON.stringify(pcodeData); |
|
|
|
|
|
// console.log(bomNos); |
|
|
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
|
|
var config = { |
|
|
|
|
|
url: prefix + '/export', |
|
|
|
|
|
type: "post", |
|
|
|
|
|
dataType: "json", |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: pcodes, |
|
|
|
|
|
success: function(result) { |
|
|
|
|
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; |
|
|
|
|
|
$.modal.alertSuccess("导出成功!") |
|
|
|
|
|
$.modal.closeLoading(); |
|
|
|
|
|
}, |
|
|
|
|
|
error: function (result){ |
|
|
|
|
|
$.modal.alertError(result.msg); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
$.ajax(config) |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询工程员 |
|
|
//查询工程员 |
|
|
function engineer(){ |
|
|
function engineer(){ |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|