|
|
|
@ -0,0 +1,315 @@
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<title></title>
|
|
|
|
|
<link rel="stylesheet" href="../layui/css/layui.css" />
|
|
|
|
|
<style>
|
|
|
|
|
.weadmin-nav {
|
|
|
|
|
padding: 0 20px;
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 99;
|
|
|
|
|
border-bottom: 1px solid #e5e5e5;
|
|
|
|
|
line-height: 39px;
|
|
|
|
|
height: 39px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.weadmin-body {
|
|
|
|
|
padding: 15px 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.require-star {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 3px;
|
|
|
|
|
height: 14px;
|
|
|
|
|
background-color: #ea4335;
|
|
|
|
|
top: 12px;
|
|
|
|
|
right: 8px;
|
|
|
|
|
border-radius: 1.5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input-width {
|
|
|
|
|
width: 350px
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.label-width {
|
|
|
|
|
width: 128px
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mainBox {
|
|
|
|
|
width: 100%;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0px;
|
|
|
|
|
left: 0px;
|
|
|
|
|
bottom: 50px;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.main-container {
|
|
|
|
|
margin: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.button-container {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 15px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<div class="weadmin-nav">
|
|
|
|
|
<span class="layui-breadcrumb">
|
|
|
|
|
<a href="">首页</a>
|
|
|
|
|
<a href="">业务管理</a>
|
|
|
|
|
<a> <cite>占位费设置</cite></a>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="weadmin-body">
|
|
|
|
|
|
|
|
|
|
<div class="main-container">
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label label-width"><span class="require-star"></span>每小时收费金额(元)</label>
|
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
|
|
<input type="text" id="money" autocomplete="off" placeholder="请输入每小时收费金额"
|
|
|
|
|
class="layui-input input-width">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
|
|
<button type="button" class="layui-btn layui-btn-sm" id="saveMoney">
|
|
|
|
|
<i class="layui-icon layui-icon-ok"></i>
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label label-width"><span class="require-star"></span>免费时长(分钟)</label>
|
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
|
|
<input type="text" id="freeTime" autocomplete="off" placeholder="请输入免费时长"
|
|
|
|
|
class="layui-input input-width">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
|
|
<button type="button" class="layui-btn layui-btn-sm" id="saveFreeTime">
|
|
|
|
|
<i class="layui-icon layui-icon-ok"></i>
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<label class="layui-form-label label-width"><span class="require-star"></span>设置场地</label>
|
|
|
|
|
<div class="layui-form-item layui-inline" id="ID-transfer-demo-showSearch"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script src="../layui/layui.js"></script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
layui.use(function () {
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var $ = layui.jquery;
|
|
|
|
|
var laytpl = layui.laytpl;
|
|
|
|
|
|
|
|
|
|
var transfer = layui.transfer;
|
|
|
|
|
|
|
|
|
|
var selectedStation = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取每小时收费金额
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/ZhuQue/hurryQuit/getOneHourMoney",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
$("#money").val(res.data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//获取免费时长
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/ZhuQue/hurryQuit/getFreeDuration",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
$("#freeTime").val(res.data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#saveMoney").click(function () {
|
|
|
|
|
var money = $("#money").val();
|
|
|
|
|
if (!money) {
|
|
|
|
|
layer.msg('请输入每小时收费金额!', {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 2000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var regex = /^\d+(\.\d+)?$/;
|
|
|
|
|
if (!regex.test(money)) {
|
|
|
|
|
layer.msg('只允许请输入不小于0的数字!', {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 2000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/ZhuQue/hurryQuit/setOneHourMoney",
|
|
|
|
|
data: { money: money },
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
layer.msg('保存成功!', {
|
|
|
|
|
icon: 1,
|
|
|
|
|
time: 1000
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg(res.msg, {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 1000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#saveFreeTime").click(function () {
|
|
|
|
|
var freeTime = $("#freeTime").val();
|
|
|
|
|
if (!freeTime) {
|
|
|
|
|
layer.msg('请输入每小时收费金额!', {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 1000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var regex = /^\d+(\.\d+)?$/;
|
|
|
|
|
if (!regex.test(freeTime)) {
|
|
|
|
|
layer.msg('只允许请输入不小于0的数字!', {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 2000
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/ZhuQue/hurryQuit/setFreeDuration",
|
|
|
|
|
data: { duration: freeTime },
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
layer.msg('保存成功!', {
|
|
|
|
|
icon: 1,
|
|
|
|
|
time: 1000
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg(res.msg, {
|
|
|
|
|
icon: 2,
|
|
|
|
|
time: 1000
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//获取已配置数据
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
async: false,
|
|
|
|
|
url: "/ZhuQue/hurryQuit/pageHurryQuitList?pageNum=1&pageSize=9999",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.data.totalRow > 0) {
|
|
|
|
|
selectedStation = res.data.list.map(item => item.station_id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "GET",
|
|
|
|
|
async: false,
|
|
|
|
|
url: "/dsBase/dataAuthority/getResourceListByTypeCode?resource_type_code=STATION",
|
|
|
|
|
success: function (res) {
|
|
|
|
|
transfer.render({
|
|
|
|
|
elem: '#ID-transfer-demo-showSearch',
|
|
|
|
|
data: res.data,
|
|
|
|
|
value: selectedStation,
|
|
|
|
|
title: ['未配置', '已配置'],
|
|
|
|
|
height: 500,
|
|
|
|
|
width: 300,
|
|
|
|
|
showSearch: true,
|
|
|
|
|
onchange: function (data, index) {
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
turnRight(data);
|
|
|
|
|
} else {
|
|
|
|
|
turnLeft(data);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
parseData: function (res) { // 解析成规定的 data 格式
|
|
|
|
|
return {
|
|
|
|
|
"value": res.resource_id,
|
|
|
|
|
"title": res.resource_name
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function turnRight(ids) {
|
|
|
|
|
|
|
|
|
|
var resIds = ids.map(item => item.value).join(',');
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/ZhuQue/hurryQuit/addStation",
|
|
|
|
|
data: {
|
|
|
|
|
"station_ids": resIds
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function turnLeft(ids) {
|
|
|
|
|
var resIds = ids.map(item => item.value).join(',');
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
async: false,
|
|
|
|
|
dataType: "json",
|
|
|
|
|
url: "/ZhuQue/hurryQuit/delStation",
|
|
|
|
|
data: {
|
|
|
|
|
"station_ids": resIds
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
</html>
|