|
|
@ -76,7 +76,7 @@ |
|
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:bom:add"> |
|
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
|
</a> |
|
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:bom:export"> |
|
|
|
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="erp:bom:export"> |
|
|
|
<i class="fa fa-download"></i> 导出 |
|
|
|
</a> |
|
|
|
<a class="btn btn-info" onclick="$.table.importExcel()"> |
|
|
@ -130,6 +130,7 @@ |
|
|
|
rightFixedColumns:1, |
|
|
|
fixedRightNumber: 1, // 冻结右列个数 |
|
|
|
height: $(window).height() - 100, |
|
|
|
width: $(window).width() - 100, |
|
|
|
//指定父id列 |
|
|
|
onExpandRow : function(index, row, $detail) { |
|
|
|
$detail.html('<h4>一阶</h4><table class="table-container" id="one_level_table_'+row.id+'"></table>' + |
|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
<!-- 导入区域 --> |
|
|
@ -756,5 +792,6 @@ |
|
|
|
</font> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
|
|
|
|
</script> |
|
|
|
</html> |