|
|
@ -56,7 +56,7 @@ |
|
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:materialReturnInspection:add"> |
|
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
|
</a> |
|
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:materialReturnInspection:export"> |
|
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="erp:materialReturnInspection:export"> |
|
|
|
<i class="fa fa-download"></i> 导出 |
|
|
|
</a> |
|
|
|
</div> |
|
|
@ -128,7 +128,6 @@ |
|
|
|
formatter: function(value, row, index) { |
|
|
|
var actions = []; |
|
|
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
|
|
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); |
|
|
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> '); |
|
|
|
|
|
|
|
return actions.join(''); |
|
|
@ -144,6 +143,59 @@ |
|
|
|
$.modal.open("物料退检单详情",url); |
|
|
|
} |
|
|
|
|
|
|
|
// 导出 |
|
|
|
function exportExcel(formId) { |
|
|
|
// $.table.set(); |
|
|
|
var returnInspectionNoData = []; |
|
|
|
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++){ |
|
|
|
returnInspectionNoData.push(selections[i].returnInspectionNo); |
|
|
|
} |
|
|
|
var returnInspectionNos = JSON.stringify(returnInspectionNoData); |
|
|
|
// console.log(bomNos); |
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
var config = { |
|
|
|
url: prefix + '/export', |
|
|
|
type: "post", |
|
|
|
dataType: "json", |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
data: returnInspectionNos, |
|
|
|
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) |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |