From 5bbf431c3f0997245a680d032758dd9c972a85a3 Mon Sep 17 00:00:00 2001 From: 19173159168 Date: Wed, 9 Jul 2025 23:36:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E8=BD=A6=E5=A5=97=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/operation/ZcRentCarRuleMapper.xml | 1 + .../templates/operation/rentCarRule/add.html | 21 +++++++++++++++++-- .../operation/rentCarRule/detail.html | 9 +++++++- .../operation/rentCarRule/rentCarRule.html | 13 +++++++++--- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleMapper.xml b/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleMapper.xml index 2b3f525..a25472e 100644 --- a/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/operation/ZcRentCarRuleMapper.xml @@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.status = #{status} and a.is_default = #{isDefault} + order by a.update_time desc +
@@ -114,12 +114,16 @@ $(document).ready(function() { // 初始隐藏租赁天数 var $rentalDaysGroup = $('input[name="rentalDays"]').closest('.form-group').hide(); + // 初始隐藏逾期金额 + var $overdueFeeGroup = $('input[name="overdueFee"]').closest('.form-group').show(); // 保存当前选中的值 var currentRentalType = $('input[name="rentalType"]:checked').val(); // 检查初始选中项 - if(currentRentalType === '3') { + if(currentRentalType === '1') { + $overdueFeeGroup.hide().find('input').val(''); + }else if(currentRentalType === '3') { $rentalDaysGroup.show(); } @@ -135,6 +139,12 @@ // 更新当前值 currentRentalType = newRentalType; + // 处理逾期金额显示/隐藏 + if(newRentalType === '1') { + $overdueFeeGroup.hide().find('input').val(''); + } else { + $overdueFeeGroup.show(); + } // 处理租赁天数显示/隐藏 if(newRentalType === '3') { $rentalDaysGroup.show(); @@ -149,6 +159,9 @@ if(newRentalType) { $.get(prefix2 + '/list/byLeaseType', { leaseType: newRentalType }, function(data) { var html = ''; + if(data.length === 0){ + $.modal.alert("未找到与租赁类型相同的租电套餐"); + } data.forEach(function(rule) { html += `
`; }); @@ -158,6 +171,10 @@ }); }); function submitHandler() { + if($('input[name="batteryRules"]:checked').length === 0){ + $.modal.alert("请选择租电套餐"); + return; + } if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-rentCarRule-add').serialize()); } diff --git a/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/detail.html b/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/detail.html index c353359..7a99ec7 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/detail.html +++ b/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/detail.html @@ -118,13 +118,20 @@ // 初始隐藏租赁天数 $('input[name="rentalDays"]').closest('.form-group').hide(); + // 初始显示逾期金额 + var $overdueFeeGroup = $('input[name="overdueFee"]').closest('.form-group'); // 检查初始选中项 if($('input[name="rentalType"]:checked').val() === '3') { $('input[name="rentalDays"]').closest('.form-group').show(); } var currentRentalType = $('input[name="rentalType"]:checked').val(); - + // 检查初始选中项 + if(currentRentalType === '1') { + $overdueFeeGroup.hide().find('input').val(''); + }else if(currentRentalType === '3') { + $rentalDaysGroup.show(); + } // 加载租电规则并回显已选中的项 loadBatteryRules(currentRentalType, /* 回显已选中 */ true); }); diff --git a/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html b/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html index b1354d2..d1e007b 100644 --- a/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html +++ b/ruoyi-admin/src/main/resources/templates/operation/rentCarRule/rentCarRule.html @@ -115,7 +115,10 @@ }, { field: 'ruleCode', - title: '套餐编码' + title: '套餐编码', + formatter: function(value, row, index) { + return '' + value + ''; + } }, { field: 'rentalType', @@ -172,19 +175,23 @@ field: 'operatingCompanyName', title: '所属运营商' }, + { + field: 'updateTime', + title: '操作时间', + sortable: true + }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); actions.push('删除'); if (row.status == 1) { actions.push('启用 '); } else { actions.push('停用 '); } - actions.push(' 查看'); + // actions.push(' 查看'); return actions.join(''); } }]