diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
index af806cde..e9a48b32 100644
--- a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
+++ b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
@@ -76,7 +76,7 @@
添加
-
+
导出
@@ -130,6 +130,7 @@
rightFixedColumns:1,
fixedRightNumber: 1, // 冻结右列个数
height: $(window).height() - 100,
+ width: $(window).width() - 100,
//指定父id列
onExpandRow : function(index, row, $detail) {
$detail.html('一阶
' +
@@ -191,11 +192,7 @@
return $.table.selectDictLabel(levelDatas, value);
}
},
- {
- field: 'sortNo',
- title: '排序',
- visible: false
- },
+ {field: 'sortNo',title: '排序',visible: false},
{
title: '操作',
align: 'center',
@@ -740,6 +737,45 @@
}
});
}
+ function exportExcel() {
+ table.set();
+ console.log(table);
+ const $table = $('#' + table.options.id);
+ const rows = $table.bootstrapTable('getSelections');
+ if (rows.length > 0) {
+ const ids = rows.map(row => row.id);
+ confirmExport(ids, 'selected', rows.length);
+ } else {
+ confirmExport(null, 'all');
+ }
+ }
+ function confirmExport(ids, type, count) {
+ const message = type === 'selected'
+ ? `确认要导出选中的${count}条数据吗?`
+ : `确定导出所有bom信息吗?`;
+ //通过模态框确认
+ $.modal.confirm(message, function() {
+ $.modal.loading("正在导出数据,请稍后...");
+ //导出
+ if (type === 'selected') {
+ $.post(table.options.exportUrl, {'exportType': 'selected','ids': ids}, handleExportResponse);
+ $.modal.closeLoading();
+ } else {
+ $.post(table.options.exportUrl, {'exportType': 'all'}, handleExportResponse);
+ $.modal.closeLoading();
+ }
+ });
+ }
+ function handleExportResponse(result) {
+ $.modal.closeLoading();
+ 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);
+ }
+ }