From bbb5a30997b957f6315aedb2707e6f3f78defb15 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 4 Sep 2024 15:41:07 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE=E4=BC=B0=E8=AE=A1=E7=9A=84?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E6=B7=BB=E5=8A=A0=E7=89=A9=E6=96=99=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E=E7=89=A9?= =?UTF-8?q?=E6=96=99=E7=9A=84=E5=89=8D=E7=AB=AF=E6=96=B9=E6=B3=95=EF=BC=9A?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E9=80=89=E7=89=A9=E6=96=99=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=EF=BC=8C=E6=96=B0=E5=A2=9E=E9=80=89=E6=8B=A9=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=89=A9=E6=96=99=E7=9A=84=E6=97=B6=E5=80=99=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=88=97=E8=A1=A8=E5=B7=B2=E7=BB=8F=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E6=96=99=E5=8F=B7=E7=9A=84=E7=89=A9=E6=96=99?= =?UTF-8?q?=EF=BC=8C=E8=BF=9B=E8=A1=8C=E6=8F=90=E7=A4=BA=E5=B9=B6=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=9B=B8=E5=90=8C=E6=96=99=E5=8F=B7=E7=9A=84=E7=89=A9?= =?UTF-8?q?=E6=96=99=20=E5=8E=BB=E6=8E=89=E7=89=A9=E6=96=99=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B5=E9=9D=A2=E9=99=90=E5=88=B6=E4=B8=BA=E5=8D=95?= =?UTF-8?q?=E9=80=89=E7=9A=84=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/sales/estimate/add.html | 71 ++++++++++++------- .../estimate/estimateMaterialSelect.html | 1 - 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/sales/estimate/add.html b/ruoyi-admin/src/main/resources/templates/sales/estimate/add.html index 79e49c74..75f79d04 100644 --- a/ruoyi-admin/src/main/resources/templates/sales/estimate/add.html +++ b/ruoyi-admin/src/main/resources/templates/sales/estimate/add.html @@ -356,39 +356,62 @@ $.table.init(options); }); - - function estimateDoSubmit(index, layero,uniqueId){ + //逻辑新增一行物料数据 + function estimateDoSubmit(index, layero, uniqueId) { console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-estimateMaterialSelect-table').bootstrapTable('getSelections')[0]; + var selectedRows = iframeWin.$('#bootstrap-estimateMaterialSelect-table').bootstrapTable('getSelections'); + + if (selectedRows.length === 0) { + $.modal.alertError("请选择至少一条物料信息"); + return; + } + + var existingData = $("#bootstrap-table").bootstrapTable('getData'); - //判断是否重复 - var rows = $("#bootstrap-table").bootstrapTable('getData').length; - for(var i=0;i 0) { + $("#bootstrap-table").bootstrapTable('insertRow', { index: 1, row: newRows[0] }); + for (var k = 1; k < newRows.length; k++) { + $("#bootstrap-table").bootstrapTable('insertRow', { index: 1, row: newRows[k] }); } - }) + } + getTotalAmount(); layer.close(index); } diff --git a/ruoyi-admin/src/main/resources/templates/sales/estimate/estimateMaterialSelect.html b/ruoyi-admin/src/main/resources/templates/sales/estimate/estimateMaterialSelect.html index 1074978f..cf4050eb 100644 --- a/ruoyi-admin/src/main/resources/templates/sales/estimate/estimateMaterialSelect.html +++ b/ruoyi-admin/src/main/resources/templates/sales/estimate/estimateMaterialSelect.html @@ -42,7 +42,6 @@ showRefresh: false, showToggle: false, clickToSelect: true, // 点击选中行 - singleSelect: true, // 单选 url: prefix + "/getEstimateMaterialList", modalName: "物料信息", columns: [{