From d0d188731cf7e0824e82ecd09f501042a7e57d33 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 19 Sep 2024 08:58:29 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9bom=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=89=A9=E6=96=99=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E6=94=AF=E6=8C=81=E8=83=BD=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=A4=9A=E4=B8=AA=E7=89=A9=E6=96=99=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=EF=BC=8C=E5=B9=B6=E4=B8=94=E6=B7=BB=E5=8A=A0=E6=88=90?= =?UTF-8?q?=E5=8A=9F=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=9C=89=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E8=BF=87=E6=BB=A4=E6=8E=89=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/templates/erp/bom/add.html | 85 ++++++++++++------- 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/add.html b/ruoyi-admin/src/main/resources/templates/erp/bom/add.html index c60cf95f..3436c983 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/add.html @@ -464,46 +464,73 @@ } } } - function doSubmit(index, layero,uniqueId){ + function doSubmit(index, layero, uniqueId) { console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; + var selectedRows = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); - if($("#materialNo").val()==rowData.materialNo){ - $.modal.alertError("不能选择与主体bom相同的料号"); + if (selectedRows.length === 0) { + $.modal.alertError("请选择至少一条物料信息"); return; } - //判断是否重复 - var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; - for(var i=0;i 0) { + // 插入第一行 + $("#bootstrap-sub-table-1").bootstrapTable('insertRow', { index: 1, row: newRows[0] }); + + // 插入剩余行 + for (var k = 1; k < newRows.length; k++) { + $("#bootstrap-sub-table-1").bootstrapTable('insertRow', { index: 1, row: newRows[k] }); } - }) + } + layer.close(index); } + + /* 新增表格行 */ function insertRow(){ var url = ctx + "erp/material/select";