|
|
@ -67,7 +67,7 @@ |
|
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customerQuote:add"> |
|
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
|
</a> |
|
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:customerQuote:export"> |
|
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:customerQuote:export"> |
|
|
|
<i class="fa fa-download"></i> 导出 |
|
|
|
</a> |
|
|
|
<a class="btn btn-warning" onclick="exportCustomerQuoteOne()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteOne"> |
|
|
@ -83,7 +83,6 @@ |
|
|
|
<a class="btn btn-warning" onclick="exportCustomerQuoteFour()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteFour"> |
|
|
|
<i class="fa fa-download"></i> 导出客户报价4 |
|
|
|
</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-table" style="white-space:nowrap"></table> |
|
|
@ -131,7 +130,6 @@ |
|
|
|
restoreUrl: prefix + "/restore/{id}", |
|
|
|
detailUrl: prefix + "/detail/{id}", |
|
|
|
exportUrl: prefix + "/export", |
|
|
|
pageList: [5, 10, 25, 50], |
|
|
|
modalName: "客户报价表", |
|
|
|
fixedColumns:true, |
|
|
|
fixedRightNumber:1, |
|
|
@ -223,6 +221,61 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导出 |
|
|
|
function exportExcel(formId) { |
|
|
|
// $.table.set(); |
|
|
|
var supplierCodeData = []; |
|
|
|
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++){ |
|
|
|
supplierCodeData.push(selections[i].supplierCode); |
|
|
|
} |
|
|
|
var supplierCodes = JSON.stringify(supplierCodeData); |
|
|
|
// console.log(bomNos); |
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
var config = { |
|
|
|
url: prefix + '/export', |
|
|
|
type: "post", |
|
|
|
dataType: "json", |
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
data: supplierCodes, |
|
|
|
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) |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导出客户报价模板1 |
|
|
|
function exportCustomerQuoteOne(){ |
|
|
|