From a04dab13a601a1ccf847c278ebcbaa202a6466ab Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 15 Jul 2024 16:04:57 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=A7=94=E5=A4=96=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=A7=94=E5=A4=96=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E5=A2=9E=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=A7=94=E5=A4=96=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E7=9A=84=E6=96=B0=E5=A2=9E=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OutsourceQuoteController.java | 2 +- .../templates/system/outsource_quote/add.html | 60 ++++++++++++------- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java index e86dd45c..c6eaebaa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java @@ -106,7 +106,7 @@ public class OutsourceQuoteController extends BaseController @Log(title = "委外报价", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(OutsourceQuoteVO childVO) + public AjaxResult addSave(@RequestBody OutsourceQuoteVO childVO) { System.out.println(childVO); return toAjax(outsourceQuoteService.insertOutsourceQuote(childVO)); diff --git a/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html b/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html index 82d06124..df6423d3 100644 --- a/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/outsource_quote/add.html @@ -118,7 +118,7 @@ WWBJ002"> }, {}); outsourceQuote = { outsourceQuoteCode: outsourceQuoteData.outsourceQuoteCode, - supplierQuoteCode: outsourceQuoteData.supplierCode, + supplierQuoteCode: outsourceQuoteData.supplierQuoteCode, supplierName: outsourceQuoteData.supplierName, pricingDate: outsourceQuoteData.pricingDate, taxRate: outsourceQuoteData.taxRate, @@ -126,8 +126,6 @@ WWBJ002"> processAmount: 0, outsourceQuoteChildList: [] } - console.log(outsourceQuote); - // console.log(outsourceQuoteData); // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 var rows = $('#bootstrap-table-process').bootstrapTable('getData'); // 检查表格数据是否为空 @@ -136,28 +134,24 @@ WWBJ002"> return; }else{ outsourceQuote.processAmount = rows.length; - console.log(rows); + var unit = getUnit(); + var noRmb = getNoRmb(); + var rmb = getRmb(); for(var i=0;i // 获取当前下拉框的值 var selectedValue = $(this).val(); unit.push(selectedValue); - // 执行你想要的操作,比如记录值或更新其他地方的数据 - console.log("Selected charge unit value:", selectedValue); - }); return unit; } - + function getNoRmb(){ + var selectElements = $('#bootstrap-table-process').find('input[id="materialNormb"]'); + // 遍历每个下拉框 + var noRmb = []; + selectElements.each(function() { + // 获取当前下拉框的值 + var selectedValue = $(this).val(); + noRmb.push(selectedValue); + }); + console.log(noRmb); + return noRmb; + }; + function getRmb(){ + var selectElements = $('#bootstrap-table-process').find('input[id="materialRmb"]'); + // 遍历每个输入框 + var rmb = []; + selectElements.each(function() { + // 获取当前输入框的值 + var selectedValue = $(this).val(); + rmb.push(selectedValue); + }); + console.log(rmb); + return rmb; + }; $(function() { var options = { id: "bootstrap-table-process",