租车套餐
This commit is contained in:
@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
||||||
<if test="isDefault != null and isDefault != ''"> and a.is_default = #{isDefault}</if>
|
<if test="isDefault != null and isDefault != ''"> and a.is_default = #{isDefault}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by a.update_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZcRentCarRuleById" parameterType="Long" resultMap="ZcRentCarRuleResult">
|
<select id="selectZcRentCarRuleById" parameterType="Long" resultMap="ZcRentCarRuleResult">
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label is-required">套餐名称:</label>
|
<label class="col-sm-3 control-label is-required">套餐名称:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input name="ruleName" class="form-control" type="text" required>
|
<input name="ruleName" class="form-control" type="text" maxlength="20" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -114,12 +114,16 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// 初始隐藏租赁天数
|
// 初始隐藏租赁天数
|
||||||
var $rentalDaysGroup = $('input[name="rentalDays"]').closest('.form-group').hide();
|
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();
|
var currentRentalType = $('input[name="rentalType"]:checked').val();
|
||||||
|
|
||||||
// 检查初始选中项
|
// 检查初始选中项
|
||||||
if(currentRentalType === '3') {
|
if(currentRentalType === '1') {
|
||||||
|
$overdueFeeGroup.hide().find('input').val('');
|
||||||
|
}else if(currentRentalType === '3') {
|
||||||
$rentalDaysGroup.show();
|
$rentalDaysGroup.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,6 +139,12 @@
|
|||||||
// 更新当前值
|
// 更新当前值
|
||||||
currentRentalType = newRentalType;
|
currentRentalType = newRentalType;
|
||||||
|
|
||||||
|
// 处理逾期金额显示/隐藏
|
||||||
|
if(newRentalType === '1') {
|
||||||
|
$overdueFeeGroup.hide().find('input').val('');
|
||||||
|
} else {
|
||||||
|
$overdueFeeGroup.show();
|
||||||
|
}
|
||||||
// 处理租赁天数显示/隐藏
|
// 处理租赁天数显示/隐藏
|
||||||
if(newRentalType === '3') {
|
if(newRentalType === '3') {
|
||||||
$rentalDaysGroup.show();
|
$rentalDaysGroup.show();
|
||||||
@ -149,6 +159,9 @@
|
|||||||
if(newRentalType) {
|
if(newRentalType) {
|
||||||
$.get(prefix2 + '/list/byLeaseType', { leaseType: newRentalType }, function(data) {
|
$.get(prefix2 + '/list/byLeaseType', { leaseType: newRentalType }, function(data) {
|
||||||
var html = '';
|
var html = '';
|
||||||
|
if(data.length === 0){
|
||||||
|
$.modal.alert("未找到与租赁类型相同的租电套餐");
|
||||||
|
}
|
||||||
data.forEach(function(rule) {
|
data.forEach(function(rule) {
|
||||||
html += `<div class="checkbox"><label><input type="checkbox" id="batteryRules" name="batteryRules" value="${rule.id}"> ${rule.title}</label></div>`;
|
html += `<div class="checkbox"><label><input type="checkbox" id="batteryRules" name="batteryRules" value="${rule.id}"> ${rule.title}</label></div>`;
|
||||||
});
|
});
|
||||||
@ -158,6 +171,10 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
function submitHandler() {
|
function submitHandler() {
|
||||||
|
if($('input[name="batteryRules"]:checked').length === 0){
|
||||||
|
$.modal.alert("请选择租电套餐");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ($.validate.form()) {
|
if ($.validate.form()) {
|
||||||
$.operate.save(prefix + "/add", $('#form-rentCarRule-add').serialize());
|
$.operate.save(prefix + "/add", $('#form-rentCarRule-add').serialize());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,13 +118,20 @@
|
|||||||
|
|
||||||
// 初始隐藏租赁天数
|
// 初始隐藏租赁天数
|
||||||
$('input[name="rentalDays"]').closest('.form-group').hide();
|
$('input[name="rentalDays"]').closest('.form-group').hide();
|
||||||
|
// 初始显示逾期金额
|
||||||
|
var $overdueFeeGroup = $('input[name="overdueFee"]').closest('.form-group');
|
||||||
|
|
||||||
// 检查初始选中项
|
// 检查初始选中项
|
||||||
if($('input[name="rentalType"]:checked').val() === '3') {
|
if($('input[name="rentalType"]:checked').val() === '3') {
|
||||||
$('input[name="rentalDays"]').closest('.form-group').show();
|
$('input[name="rentalDays"]').closest('.form-group').show();
|
||||||
}
|
}
|
||||||
var currentRentalType = $('input[name="rentalType"]:checked').val();
|
var currentRentalType = $('input[name="rentalType"]:checked').val();
|
||||||
|
// 检查初始选中项
|
||||||
|
if(currentRentalType === '1') {
|
||||||
|
$overdueFeeGroup.hide().find('input').val('');
|
||||||
|
}else if(currentRentalType === '3') {
|
||||||
|
$rentalDaysGroup.show();
|
||||||
|
}
|
||||||
// 加载租电规则并回显已选中的项
|
// 加载租电规则并回显已选中的项
|
||||||
loadBatteryRules(currentRentalType, /* 回显已选中 */ true);
|
loadBatteryRules(currentRentalType, /* 回显已选中 */ true);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -115,7 +115,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'ruleCode',
|
field: 'ruleCode',
|
||||||
title: '套餐编码'
|
title: '套餐编码',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
return '<a href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\', 900, 700)">' + value + '</a>';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'rentalType',
|
field: 'rentalType',
|
||||||
@ -172,19 +175,23 @@
|
|||||||
field: 'operatingCompanyName',
|
field: 'operatingCompanyName',
|
||||||
title: '所属运营商'
|
title: '所属运营商'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '操作时间',
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
|
||||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
if (row.status == 1) {
|
if (row.status == 1) {
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="enable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>启用</a> ');
|
||||||
} else {
|
} else {
|
||||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>停用</a> ');
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="disable(\'' + row.id + '\',\'' + row.phone + '\')"><i class="fa fa-edit"></i>停用</a> ');
|
||||||
}
|
}
|
||||||
actions.push('<a class="btn btn-primary btn-xs btnOption" href="javascript:void(0)" onClick="$.operate.detail(\''+row.id+'\', 900, 700)"><i class="fa fa-sticky-note-o"></i> 查看</a>');
|
// actions.push('<a class="btn btn-primary btn-xs btnOption" href="javascript:void(0)" onClick="$.operate.detail(\''+row.id+'\', 900, 700)"><i class="fa fa-sticky-note-o"></i> 查看</a>');
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|||||||
Reference in New Issue
Block a user