@@ -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('');
}
}]