From 6d3f59b9683b479ecb8013f3f9f02d3c2a159df0 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Thu, 23 May 2024 19:47:42 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86:?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=B5=84=E6=96=99=E4=B8=AD=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=B3=95=E4=BA=BA=E5=BF=85=E5=A1=AB=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F,=E6=94=B9=E4=B8=BA=E9=80=89=E5=A1=AB=E9=A1=B9?= =?UTF-8?q?=E3=80=82=E5=81=9A=E6=8A=A5=E4=BB=B7=E5=8D=95=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=96=87=E5=AD=97=E6=94=B9=E4=B8=BA=E5=9C=A8?= =?UTF-8?q?=E8=A1=8C=E5=86=85=E8=BE=93=E5=85=A5=E5=86=85=E5=AE=B9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=82=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=90=88=E8=AE=A1=E9=87=91=E9=A2=9D=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=EF=BC=8C=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=81=94=E7=B3=BB=E4=BA=BA=E3=80=81=E6=94=B6=E8=B4=A7=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=8F=96=E6=B6=88=E5=BF=85=E5=A1=AB=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=80=89=E5=A1=AB=EF=BC=8C=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=B6=EF=BC=8C=E9=80=89=E6=8B=A9=E5=AE=A2?= =?UTF-8?q?=E6=88=B7N12=EF=BC=8C=E9=80=89=E6=8B=A9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E5=9C=B0=E5=9D=80=E6=97=B6=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E9=80=89N12=E7=9A=84=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E4=BA=BA=EF=BC=8C=E5=B7=B2=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=94=B6=E8=B4=A7=E4=BA=BA=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysSalesOrderController.java | 2 + .../mapper/system/SysCustomerOperMapper.xml | 32 ++-- .../system/SysShippingAddressMapper.xml | 2 +- .../templates/system/customer/edit.html | 4 +- .../templates/system/customerQuote/add.html | 142 +++++++++++++++--- .../system/customerQuote/detail.html | 20 +-- .../templates/system/customerQuote/edit.html | 20 +-- .../system/customerQuote/taskModifyApply.html | 20 +-- .../system/customerQuote/taskYwgzVerify.html | 20 +-- .../system/customerQuote/taskYwjlVerify.html | 20 +-- .../system/customerQuote/taskZozjVerify.html | 20 +-- .../templates/system/salesOrder/add.html | 1 + .../templates/system/salesOrder/edit.html | 100 ++++++------ 13 files changed, 245 insertions(+), 158 deletions(-) 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);