|
@ -59,7 +59,7 @@ |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="aftersales:complaintNotice:add"> |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="aftersales:complaintNotice: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="aftersales:complaintNotice:export"> |
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="aftersales:complaintNotice:export"> |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
</a> |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
@ -166,6 +166,57 @@ |
|
|
$.modal.open("客诉通知单详情",url); |
|
|
$.modal.open("客诉通知单详情",url); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function exportExcel(formId) { |
|
|
|
|
|
var complaintNoticeCodes = []; |
|
|
|
|
|
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 { |
|
|
|
|
|
//·拼接单号 |
|
|
|
|
|
for(let i=0;i<selections.length;i++){ |
|
|
|
|
|
complaintNoticeCodes.push(selections[i].complaintNoticeCode); |
|
|
|
|
|
} |
|
|
|
|
|
$.modal.confirm("确定导出" + complaintNoticeCodes + "吗?", function () { |
|
|
|
|
|
var noticeCodes = JSON.stringify(complaintNoticeCodes); |
|
|
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
|
|
var config = { |
|
|
|
|
|
url: prefix + '/export', |
|
|
|
|
|
type: "post", |
|
|
|
|
|
dataType: "json", |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: noticeCodes, |
|
|
|
|
|
success: function(result) { |
|
|
|
|
|
console.log(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> |
|
|
</script> |
|
|
</body> |
|
|
</body> |
|
|
</html> |
|
|
</html> |