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); + } + }); + }