From f4bd8442c6c442d115a54e21bc0419ac2c99e589 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 14 Jun 2024 20:40:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E5=AE=A1=E6=89=B9=E4=B8=BA?= =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E6=B3=A8=E8=A7=A3@Transactional=20=E5=8A=A0?= =?UTF-8?q?=E5=88=B0insertSysCustomerQuote=E6=96=B9=E6=B3=95=E4=B8=8A?= =?UTF-8?q?=E9=9D=A2=20=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E6=8A=A5=E4=BB=B7=E7=9A=84=E6=97=B6=E5=80=99=20?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AE=A2=E6=88=B7=E7=BC=96=E5=8F=B7=20?= =?UTF-8?q?=EF=BC=8C=E5=AE=A2=E6=88=B7=E5=90=8D=E7=A7=B0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AF=B9=E5=BA=94=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SysCustomerQuoteServiceImpl.java | 2 +- .../templates/system/customerQuote/add.html | 158 ++++++++---------- 2 files changed, 68 insertions(+), 92 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java index 4399a55d..e91024df 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java @@ -129,6 +129,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { @Override + @Transactional public int insertSysCustomerQuote(SysCustomerQuote sysCustomerQuote) { String loginName = ShiroUtils.getLoginName(); sysCustomerQuote.setCreateBy(loginName); @@ -275,7 +276,6 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { * @return */ @Override - @Transactional(rollbackFor = Exception.class) public ProcessInstance submitApply(SysCustomerQuote sysCustomerQuote) { SysUser user = ShiroUtils.getSysUser(); sysCustomerQuote.setApplyUser(user.getLoginName()); diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html index 6a619602..125ffe60 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html @@ -25,22 +25,20 @@
- +
- +
-
+
- - +
+
@@ -169,93 +167,71 @@ } } } - //获取客户信息 - $(function(){ - $("#customerCode").select2({ - theme: "bootstrap", - allowClear: true, - placeholder: "请选择客户", - ajax:{ - type: "post", - url:ctx + "system/customer/customerList", - dataType:"json", - delay:250, - cache:true, - processResults: function (res, params) { - var resultList = res.rows; - console.log("传输的数值"); - console.log(resultList); - var options = []; - for(var i= 0, len=resultList.length;i请选择客户编号'); + + // 遍历返回的数据,添加为下拉框的选项 + $.each(data, function(index, item) { + // 假设item有id和name两个属性,分别代表客户ID和客户编号 + selectElement.append(''); + }); + $('#customerCode').val(customerId); + } else { + $.modal.errMsg("数据为空"); } - return {results: options,} }, - escapeMarkup: function (markup) {return markup;}, - } - }); - }) - $('#customerCode').on('select2:select', function (e) { - var data = e.params.data; - console.log("data",data); - $("input[name='customerName']").val(data.enterpriseName); - $("select[name='commonCurrency']").val(data.commonCurrency).trigger('change'); - $("input[name='customerFax']").val(data.customerFax); - $("input[name='rmbTax']").val(data.taxRate); - $("input[name='confirmFax']").val(data.confirmTax); - $("#commonCurrency_add").val(data.commonCurrency).trigger('change'); - commonCurrency = $("#commonCurrency_add option:selected").val(); - console.log("commonCurrency",commonCurrency); - }); - $('#customerName').on('select2:select', function (e) { - var data = e.params.data; - console.log("data",data); - $("input[name='customerCode']").val(data.enterpriseName); - $("select[name='commonCurrency']").val(data.commonCurrency).trigger('change'); - $("input[name='customerFax']").val(data.customerFax); - $("input[name='rmbTax']").val(data.taxRate); - $("input[name='confirmFax']").val(data.confirmTax); - $("#commonCurrency_add").val(data.commonCurrency).trigger('change'); - commonCurrency = $("#commonCurrency_add option:selected").val(); - console.log("commonCurrency",commonCurrency); - }); + error: function(jqXHR, textStatus, errorThrown) { + console.error('Failed to fetch customer IDs: ' + textStatus + ', ' + errorThrown); + } + }); + }