订单列表完善

This commit is contained in:
19173159168
2025-08-08 22:37:52 +08:00
parent 0677ca3ede
commit 9018d8eef1
11 changed files with 316 additions and 114 deletions

View File

@ -38,7 +38,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBatteryRuleIdsByCarRuleId" resultType="long">
SELECT battery_rule_id FROM zc_rent_car_rule_battery WHERE car_rule_id = #{carRuleId}
</select>
<select id="selectModelRuleByCarRuleId" resultType="String">
SELECT b.rule_name FROM zc_rent_car_rule_battery a left join zc_rent_car_rule b on a.battery_rule_id = b.id WHERE a.car_rule_id = #{carRuleId}
</select>
<insert id="insertZcRentCarRuleBattery" parameterType="ZcRentCarRuleBattery" useGeneratedKeys="true" keyProperty="id">
insert into zc_rent_car_rule_battery
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -11,23 +11,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="operatorId" column="operator_id" />
<result property="storeId" column="store_id" />
<result property="vehicleId" column="vehicle_id" />
<result property="carModelId" column="car_model_id" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="customerPhone" column="customer_phone" />
<result property="batteryType" column="battery_type" />
<result property="rentalType" column="rental_type" />
<result property="rentalDays" column="rental_days" />
<result property="rentalPrice" column="rental_price" />
<result property="depositPrice" column="deposit_price" />
<result property="overdueFee" column="overdue_fee" />
<result property="overdueType" column="overdue_type" />
<result property="isDepositFree" column="is_deposit_free" />
<result property="isAutoDeduct" column="is_auto_deduct" />
<result property="firstOrderTime" column="first_order_time" />
<result property="pickCarTime" column="pick_car_time" />
<result property="startRentTime" column="start_rent_time" />
<result property="endRentTime" column="end_rent_time" />
<result property="reqEndRentTime" column="req_end_rent_time" />
<result property="actEndRentTime" column="act_end_rent_time" />
<result property="overdueDays" column="overdue_days" />
<result property="renewalTimes" column="renewal_times" />
<result property="chargeTimes" column="charge_times" />
<result property="rentCarRuleId" column="rent_car_rule_id" />
<result property="rentBatteyRuleId" column="rent_battey_rule_id" />
<result property="orderAmount" column="order_amount" />
<result property="endOrderTime" column="end_order_time" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
@ -58,11 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectZcOrderMainVo">
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, customer_id, customer_name, customer_phone, rental_type, rental_days, rental_price, deposit_price, overdue_fee, is_deposit_free, is_auto_deduct, first_order_time, start_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, del_flag, create_time, update_time from zc_order_main
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, order_amount, end_order_time, del_flag, create_time, update_time from zc_order_main
</sql>
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.customer_id, a.customer_name, a.customer_phone, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.start_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.del_flag, a.create_time, a.update_time,
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.order_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
from zc_order_main a
left join zc_company c on c.id = a.operator_id
@ -98,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.customer_id, a.customer_name, a.customer_phone, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.start_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.del_flag, a.create_time, a.update_time,
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.order_amount, a.end_order_time, a.del_flag, a.create_time, a.update_time,
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
from zc_order_main a

View File

@ -10,127 +10,107 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">套餐名称:</label>
<div class="col-sm-8">
<input name="ruleName" th:field="*{ruleName}" class="form-control" type="text" required>
<div class="form-control-static" th:text="*{ruleName}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">租赁类型:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('key_rent_type')}">
<input type="radio" th:id="${'rentalType_' + dict.dictCode}" name="rentalType" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{rentalType}" required>
<label th:for="${'rentalType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<div class="form-control-static" th:text="${@dict.getLabel('key_rent_type', zcRentCarRule.rentalType)}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">租赁天数:</label>
<div class="col-sm-8">
<input name="rentalDays" th:field="*{rentalDays}" class="form-control" type="text">
<div class="form-control-static" th:text="*{rentalDays}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">租车价格(元)</label>
<div class="col-sm-8">
<input name="rentalPrice" th:field="*{rentalPrice}" class="form-control" type="text" required>
<div class="form-control-static" th:text="*{rentalPrice}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">押金价格(元)</label>
<div class="col-sm-8">
<input name="depositPrice" th:field="*{depositPrice}" class="form-control" type="text" required>
<div class="form-control-static" th:text="*{depositPrice}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">逾期金额(元)</label>
<div class="col-sm-8">
<input name="overdueFee" th:field="*{overdueFee}" class="form-control" type="text" required>
<div class="form-control-static" th:text="*{overdueFee}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">逾期计费类型:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('key_rent_overdue_type')}">
<input type="radio" th:id="${'overdueType_' + dict.dictCode}" name="overdueType" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{overdueType}" required>
<label th:for="${'overdueType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<div class="form-control-static" th:text="${@dict.getLabel('key_rent_overdue_type', zcRentCarRule.overdueType)}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否支持免押:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('key_rent_deposit_free')}">
<input type="radio" th:id="${'depositFree_' + dict.dictCode}" name="depositFree" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{depositFree}" required>
<label th:for="${'depositFree_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<div class="form-control-static" th:text="${@dict.getLabel('key_rent_deposit_free', zcRentCarRule.depositFree)}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否支持代扣:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('key_rent_auto_deduct')}">
<input type="radio" th:id="${'autoDeduct_' + dict.dictCode}" name="autoDeduct" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{autoDeduct}" required>
<label th:for="${'autoDeduct_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
<div class="form-control-static" th:text="${@dict.getLabel('key_rent_auto_deduct', zcRentCarRule.autoDeduct)}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">所属运营商:</label>
<div class="col-sm-8">
<select name="operatingCompanyId" id="operatingCompanyId" class="form-control m-b">
<option value="">请选择所属运营商</option>
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}" th:field="*{operatingCompanyId}" ></option>
</select>
<div class="form-control-static" th:text="${company.companyName}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">租电套餐:</label>
<div class="col-sm-8">
<div id="batteryRuleList"></div>
<div class="form-control-static" th:text="${modelRuleNames}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">选择车型:</label>
<div class="col-sm-8">
<select name="operatingCompanyId" id="operatingCompanyId" class="form-control m-b">
<option value="">请选择车型</option>
<option th:each="company : ${companyList}" th:value="${company.id}" th:text="${company.companyName}" th:field="*{operatingCompanyId}" ></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "operation/rentCarRule";
$("#form-rentCarRule-edit").validate({
rules:{
rentalPrice:{
number:true
},
depositPrice:{
number:true
},
overdueFee:{
number:true
}
},
focusCleanup: true
});
$(document).ready(function() {
// 初始隐藏租赁天数
$('input[name="rentalDays"]').closest('.form-group').hide();
// 监听单选按钮变化
$('input[name="rentalType"]').change(function() {
if($(this).val() === '3') {
$('input[name="rentalDays"]').closest('.form-group').show();
} else {
$('input[name="rentalDays"]').closest('.form-group').hide().find('input').val('');
}
});
// 初始显示逾期金额
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();
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-rentCarRule-edit').serialize());

View File

@ -189,13 +189,13 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-primary btn-xs btnOption" href="javascript:void(0)" onClick="$.operate.edit(\''+row.id+'\', 900, 700)"><i class="fa fa-sticky-note-o"></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) {
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 {
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>');
return actions.join('');
}
}]

View File

@ -32,7 +32,7 @@
<div class="form-group">
<label class="col-sm-2 control-label is-required">车辆:</label>
<div class="col-sm-4">
<div class="form-control-static" th:text="*{vehicleId}"></div>
<div class="form-control-static" th:text="*{licensePlate}"></div>
</div>
<label class="col-sm-2 control-label is-required">客户姓名:</label>
<div class="col-sm-4">
@ -69,6 +69,18 @@
<div class="form-control-static" th:text="*{overdueFee}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">租金总额(元)</label>
<div class="col-sm-4">
<div class="form-control-static" th:text="*{orderAmount}"></div>
</div>
<label class="col-sm-2 control-label is-required">租赁周期:</label>
<div class="col-sm-4">
<div class="form-control-static" th:text="${#dates.format(zcOrderMain.startRentTime, 'yyyy-MM-dd HH:mm:ss')}"></div> -
<div class="form-control-static" th:if="*{actEndRentTime} != null" th:text="${#dates.format(zcOrderMain.actEndRentTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
<div class="form-control-static" th:if="*{actEndRentTime} == null" th:text="${#dates.format(zcOrderMain.endRentTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">是否开通免押:</label>
<div class="col-sm-4">
@ -196,7 +208,7 @@
{
field: 'vinBatteryNo',
align: 'center',
title: '车架/电池编号'
title: '车号'
},
{

View File

@ -2,6 +2,18 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('租车订单列表')" />
<style>
.bootstrap-table .fixed-table-container .table {
table-layout: fixed !important;
}
.bootstrap-table .fixed-table-container .table th,
.bootstrap-table .fixed-table-container .table td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
</head>
<body class="gray-bg">
<div class="container-div">
@ -96,53 +108,56 @@
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "租车订单",
tableLayout: 'fixed', // 固定表格布局
columns: [{
checkbox: true
},
{
field: 'orderId',
title: '订单ID',
title: '订单编号',
visible: false
},
{
field: 'operatorName',
title: '所属运营商',
width: '120px'
},
{
field: 'storeName',
title: '所属门店',
width: '120px'
},
{
field: 'orderNo',
title: '订单编号',
width: '220px',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs btnOption" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.orderId + '\',1300,800)">' + value + '</a> ');
return actions.join('');
}
},
{
field: 'orderStatus',
title: '订单状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(orderStatusDatas, value);
}
},
{
field: 'operatorName',
title: '所属运营商'
},
{
field: 'storeName',
title: '所属门店'
},
{
field: 'licensePlate',
title: '车辆'
title: '车架号',
width: '120px'
},
{
field: 'customerName',
title: '客户姓名'
title: '客户姓名',
width: '120px'
},
{
field: 'customerPhone',
title: '联系电话'
title: '联系电话',
width: '120px'
},
{
field: 'rentalType',
title: '租赁类型',
width: '120px',
formatter: function(value, row, index) {
return $.table.selectDictLabel(rentalTypeDatas, value);
}
@ -150,19 +165,48 @@
{
field: 'rentalPrice',
title: '租价格(元)'
title: '租价格(元)',
width: '120px'
},
{
field: 'depositPrice',
title: '押金价格(元)'
title: '支付押金(元)',
width: '120px'
},
{
field: 'overdueFee',
title: '逾期金额(元)'
field: 'rentalDays',
title: '租赁天数',
width: '120px'
},
{
field: 'orderAmount',
title: '租金总额',
width: '120px'
},
{
field: 'startRentTime',
title: '租赁周期',
width: '340px',
formatter: function(value, row, index) {
if(row.actEndRentTime == null){
return row.startRentTime + ' ~ ' + row.endRentTime;
}else{
return row.startRentTime + ' ~ ' + row.actEndRentTime;
}
}
},
{
field: 'orderStatus',
title: '订单状态',
width: '120px',
formatter: function(value, row, index) {
return $.table.selectDictLabel(orderStatusDatas, value);
}
},
{
field: 'isDepositFree',
title: '是否开通免押',
width: '120px',
formatter: function(value, row, index) {
return $.table.selectDictLabel(depositFreeDatas, value);
}
@ -170,21 +214,41 @@
{
field: 'isAutoDeduct',
title: '是否开通代扣',
width: '120px',
formatter: function(value, row, index) {
return $.table.selectDictLabel(autoDeductDatas, value);
}
},
{
field: 'overdueDays',
title: '逾期天数',
width: '120px'
},
{
field: 'renewalTimes',
title: '续租次数',
width: '120px'
},
{
field: 'chargeTimes',
title: '租电次数',
width: '120px'
},
{
field: 'firstOrderTime',
title: '首次下单时间'
title: '首次下单时间',
width: '160px'
},
{
field: 'startRentTime',
title: '开始计费时间'
title: '开始计费时间',
width: '160px'
},
{
title: '操作',
align: 'center',
width: '100px',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.orderId + '\',1300,800)"><i class="fa fa-edit"></i>查看</a> ');