diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java index 3b512cf2..f2742678 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java @@ -37,6 +37,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -228,6 +229,7 @@ public class SysSalesOrderController extends BaseController @Log(title = "销售订单", businessType = BusinessType.DELETE) @RequestMapping( "/removeSelected") @ResponseBody + @Transactional(rollbackFor = Exception.class) public String removeSelected(@RequestParam(value = "ids") String ids) { System.out.println(ids); String[] idsStr = ids.split(","); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml index 6d3f5be0..62132cdc 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerOperMapper.xml @@ -16,7 +16,9 @@ - select id,purser,enterprise_name,enterprise_code,opertion,create_time,oper_user,oper_status from sys_customer_oper + select id,purser,enterprise_name,enterprise_code,opertion, + create_time, + oper_user,oper_status from sys_customer_oper - and enterprise_code like concat('%', #{enterpriseCode}, '%') + and enterprise_code = concat(#{enterpriseCode}, '%') and enterprise_name like concat('%', #{enterpriseName}, '%') and customer_name like concat('%', #{customerName}, '%') and delivery_address like concat('%', #{deliveryAddress}, '%') diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/edit.html b/ruoyi-admin/src/main/resources/templates/system/customer/edit.html index 2461c474..1d0f29e7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/edit.html @@ -75,9 +75,9 @@
- +
- +
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 4ba67a3a..e674ceb9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html @@ -253,29 +253,68 @@ { title: '美元汇率',field: 'usdTax', align: 'center',editable: true, }, - {field: 'materialNum',align: 'center',title: '物料的数量',editable: true, + {field: 'materialNum',align: 'center',title: '物料的数量', + editable:{ + type : 'number', + mode: 'inline', + title : '物料的数量', + validate : function(value) { + if (!value) { + return '用量不能为空'; + } + if (isNaN(value)) { + return '用量必须为数字'; + } + } + }, }, { title: '物料的不含税单价(RMB)', field: 'materialNoRmb', align: 'center', - editable: function(value, row, index) { - commonCurrency = $("#commonCurrency_add option:selected").val(); - if (commonCurrency == 1){ - return true; - }else{ - return false; + editable:{ + type: 'text', // 使用'text'类型,因为我们需自定义验证小数 + mode: 'inline', + title: '物料的不含税单价(RMB)', + validate: function(value) { + // 验证是否为空 + if (!value) { + return '金额不能为空'; + } + // 尝试转换为浮点数并检查是否成功 + var num = parseFloat(value); + if (isNaN(num)) { + return '请输入有效的数字'; + } + // 检查小数点后是否有超过两位的数字 + var decimalPart = num.toString().split('.')[1]; // 获取小数部分 + if (decimalPart && decimalPart.length > 2) { + return '请输入精确到小数点后两位的数字'; + } } } }, {title: '物料的不含税单价(美元)', field: 'materialNoUsd', align: 'center', - editable: function(value, row, index) { - commonCurrency = $("#commonCurrency_add option:selected").val(); - if (commonCurrency == 2){ - return true; - }else{ - return false; + editable: { + type: 'text', // 使用'text'类型,因为我们需自定义验证小数 + mode: 'inline', + title: '物料的不含税单价(RMB)', + validate: function(value) { + // 验证是否为空 + if (!value) { + return '金额不能为空'; + } + // 尝试转换为浮点数并检查是否成功 + var num = parseFloat(value); + if (isNaN(num)) { + return '请输入有效的数字'; + } + // 检查小数点后是否有超过两位的数字 + var decimalPart = num.toString().split('.')[1]; // 获取小数部分 + if (decimalPart && decimalPart.length > 2) { + return '请输入精确到小数点后两位的数字'; + } } } }, @@ -494,7 +533,7 @@ minView: "month", autoclose: true }); - //计算 + //计算金额 function getTotalAmount(){ // $("#addFinishbomTable").bootstrapTable('refresh'); let getData = $("#bootstrap-sub-table-quoteChild").bootstrapTable('getData', true); @@ -502,16 +541,16 @@ let rmb = 0;let noRmbSum = 0;let rmbSum = 0;let noUsd = 0; let usd = 0;let noUsdSum = 0; let usdSum = 0; for(let i=0;i \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html index 90438237..46aee8aa 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html @@ -288,16 +288,16 @@ let rmb = 0;let noRmbSum = 0;let rmbSum = 0;let noUsd = 0; let usd = 0;let noUsdSum = 0; let usdSum = 0; for(let i=0;i
- + +
@@ -100,9 +102,12 @@
- +
- +
@@ -124,9 +129,11 @@
- +
- +
@@ -471,20 +478,41 @@ $.table.init(options); }); $(function(){ + /*业务员列表*/ + $.ajax({ + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', + success: function (res) { + console.log(res) + if (res.rows.length > 0) { + var usertData = res.rows; + for (let i in usertData) { + $("select[name='businessMembers']").append( + ""); + } + } else { + $.modal.msgError(res.msg); + } + } + }); + //客户信息填写 $.ajax({ type: "post", - url:ctx + "system/customer/customerList", + url:ctx + "system/contacts/list", dataType:"json", delay:250, cache:true, + data:{ + enterpriseCode:sysSalesOrder.enterpriseCode, + }, success: function (res, params) { if (res.rows.length > 0) { var result = res.rows; + $("#form-salesOrder-edit select[name='customerContact']").empty(); for (let i in result) { - $("#form-salesOrder-edit select[name='enterpriseCode']").append( - ""); + $("#form-salesOrder-edit select[name='customerContact']").append( + ""); } - $("#form-salesOrder-edit select[name='enterpriseCode']").val(sysSalesOrder.enterpriseCode).trigger("change"); } else { $.modal.msgError(res.msg); } @@ -502,17 +530,21 @@ success: function (res, params) { if (res.rows.length > 0) { var result = res.rows; + $("#form-salesOrder-edit select[name='customerDelivery']").empty(); for (let i in result) { $("#form-salesOrder-edit select[name='customerDelivery']").append( ""); } - $("#form-salesOrder-edit select[name='customerDelivery']").val(sysSalesOrder.customerDelivery).trigger() } } }); + + }); + $('#customerContact_edit').on('select2:select', function (e) { + var data = e.params.data; $.ajax({ type: "post", - url:ctx + "system/contacts/list", + url:ctx + "system/shippingaddress/list", dataType:"json", delay:250, cache:true, @@ -522,56 +554,14 @@ success: function (res, params) { if (res.rows.length > 0) { var result = res.rows; + $("#form-salesOrder-edit select[name='customerDelivery']").empty(); for (let i in result) { - $("#form-salesOrder-edit select[name='customerContact']").append( + $("#form-salesOrder-edit select[name='customerDelivery']").append( ""); } - $("#form-salesOrder-edit select[name='customerContact']").val(sysSalesOrder.customerContact).trigger("change"); - } else { - $.modal.msgError(res.msg); - } - }, - }); - /*业务员列表*/ - $.ajax({ - url: ctx + 'system/salesOrder/getBinessMembers', - type: 'get', - success: function (res) { - console.log(res) - if (res.rows.length > 0) { - var usertData = res.rows; - for (let i in usertData) { - $("select[name='businessMembers']").append( - ""); - } - } else { - $.modal.msgError(res.msg); } } }); - $("#enterprise_edit").val(sysSalesOrder.enterprise); - $("#enterpriseSum_edit").val(Number(sysSalesOrder.enterpriseSum)); - $("#noRmb_edit").val(Number(sysSalesOrder.noRmb).toFixed(2)); - $("#rmb_edit").val(Number(sysSalesOrder.rmb).toFixed(2)); - $("#noRmbSum_edit").val(Number(sysSalesOrder.noRmbSum).toFixed(2)); - $("#rmbTax_edit").val(Number(sysSalesOrder.rmbSum).toFixed(2)); - $("#noUsd_edit").val(Number(sysSalesOrder.noUsd).toFixed(2)); - $("#usd_edit").val(Number(sysSalesOrder.usd).toFixed(2)); - $("#noUsdSum_edit").val(Number(sysSalesOrder.noUsdSum).toFixed(2)); - $("#usdSum_edit").val(Number(sysSalesOrder.usdSum).toFixed(2)); - }) - $('#enterpriseCode_edit').on('select2:select', function (e) { - var data = e.params.data; - $("input[name='enterpriseName']").val(data.enterpriseName); - $("input[name='customerPurser']").val(data.customerPurser); - $("input[name='taxRate']").val(data.taxRate); - $("input[name='confirmFax']").val(data.confirmTax); - $("#commonCurrency_add").val(data.commonCurrency).trigger('change'); - commonCurrency = $("#commonCurrency_edit option:selected").val(); - console.log("commonCurrency",commonCurrency); - }); - $('#customerContact_edit').on('select2:select', function (e) { - var data = e.params.data; $("input[name='contactPost']").val(data.customerPosition); $("input[name='contactNumber']").val(data.cellPhone); $("input[name='contactEmail']").val(data.commonEmail);