车型与套餐
This commit is contained in:
@ -7,24 +7,26 @@
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-carModel-edit" th:object="${zcCarModel}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
|
||||
<input type="hidden" id="rentCarRuleIds" name="rentCarRuleIds">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">品牌名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="col-sm-2 control-label is-required">品牌名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="brandName" th:field="*{brandName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">车型名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="col-sm-2 control-label is-required">车型名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="modelName" th:field="*{modelName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
|
||||
|
||||
<h4 class="form-header h4">关联套餐</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -32,11 +34,111 @@
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "operation/carModel";
|
||||
$("#form-carModel-edit").validate({
|
||||
var rentCarRuleList = [[${rentCarRuleList}]]
|
||||
var rentalTypeDatas = [[${@dict.getType('key_rent_type')}]];
|
||||
var overdueTypeDatas = [[${@dict.getType('key_rent_overdue_type')}]];
|
||||
var depositFreeDatas = [[${@dict.getType('key_rent_deposit_free')}]];
|
||||
var autoDeductDatas = [[${@dict.getType('key_rent_auto_deduct')}]];
|
||||
$("#form-carModel-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: rentCarRuleList,
|
||||
sidePagination: "client",
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
clickToSelect: true,
|
||||
maintainSelected: true,
|
||||
columns: [{
|
||||
checkbox: true,
|
||||
formatter:function (value, row, index) {
|
||||
if($.common.isEmpty(value)) {
|
||||
return { checked: row.flag };
|
||||
} else {
|
||||
return { checked: value }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '规则ID',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'ruleName',
|
||||
title: '套餐名称'
|
||||
},
|
||||
{
|
||||
field: 'ruleCode',
|
||||
title: '套餐编码',
|
||||
formatter: function(value, row, index) {
|
||||
return '<a href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\', 900, 700)">' + value + '</a>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'rentalType',
|
||||
title: '租赁类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(rentalTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'rentalDays',
|
||||
title: '租赁天数'
|
||||
},
|
||||
{
|
||||
field: 'rentalPrice',
|
||||
title: '租车价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'depositPrice',
|
||||
title: '押金价格(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueFee',
|
||||
title: '逾期金额(元)'
|
||||
},
|
||||
{
|
||||
field: 'overdueType',
|
||||
title: '逾期计费类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(overdueTypeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'depositFree',
|
||||
title: '是否支持免押',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(depositFreeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'autoDeduct',
|
||||
title: '是否支持代扣',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(autoDeductDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '关联电池套餐'
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '操作时间',
|
||||
sortable: true
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
var rows = $.table.selectFirstColumns();
|
||||
$("#rentCarRuleIds").val(rows.join())
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-carModel-edit').serialize());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user