You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
315 lines
10 KiB
315 lines
10 KiB
<!DOCTYPE html>
|
|
<html xmlns:th="http://www.w3.org/1999/XSL/Transform">
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc." />
|
|
<meta name="author" content="Coderthemes" />
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<title>角色管理列表</title>
|
|
|
|
<link rel="stylesheet" href="/html/common/layui/css/layui.css">
|
|
<link rel="stylesheet" href="/html/common/css/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="layui-fluid">
|
|
<div class="layui-card" id="cz">
|
|
<form class="layui-form">
|
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="app-forum-list" style="min-height: 40px;height: auto">
|
|
<div class="layui-row layui-form-item">
|
|
<div class="layui-block">
|
|
<label class="layui-form-label">景区名称</label>
|
|
<div class="layui-input-block">
|
|
<input id="mname" name="mname" type="text" placeholder="请输入" autocomplete="off" value="" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-block">
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-forum-list" type="button" data-type="reload" id="sou">
|
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-forum-list" type="button" id="reset">
|
|
<i class="layui-icon layui-icon-refresh layuiadmin-button-btn"></i>重置
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="layui-card-body">
|
|
<div style="padding-bottom: 1px;">
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-forum-list" id="add">
|
|
<i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>新增
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<table id="datatable" lay-filter="tablefilter"></table>
|
|
</div>
|
|
</body>
|
|
<script src="/html/common/js/jquery-3.6.0.js"></script>
|
|
<script src="/html/common/layui/layui.all.js"></script>
|
|
<script src="/html/common/js/initParam.js"></script>
|
|
<script src="/html/common/js/cjy_common.js"></script>
|
|
<script type="text/html" id="barDemo">
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>修改</a>
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
|
<!--<a class="layui-btn layui-btn-xs" lay-event="xiangq" id="upda"><i class="layui-icon layui-icon-form"></i>绑定</a>
|
|
<a class="layui-btn layui-btn-xs" lay-event="scenicTicket"><i class="layui-icon layui-icon-set-fill"></i>门票</a>
|
|
<a class="layui-btn layui-btn-xs" lay-event="bindUser"><i class="layui-icon layui-icon-set-fill"></i>检票员</a>
|
|
<a class="layui-btn layui-btn-xs" lay-event="appointLook"><i class="layui-icon layui-icon-set-fill"></i>预约</a>-->
|
|
</script>
|
|
<script>
|
|
var tablehight = tableHight();
|
|
|
|
layui.use('table', function() {
|
|
var table = layui.table;
|
|
table.render({
|
|
elem : '#datatable',
|
|
even : true, //隔行换色
|
|
url : ctx + '/scenicInfo/getListData.do', //数据接口
|
|
cols : [ [ //表头
|
|
{field: 'ssort',title: '排序',width: '6%',templet: function(d) {return '<input id = "sort'+ (d.guid || ' ') +'" onblur="updateSort(\''+d.guid+'\')" value="' + (d.ssort || ' ') +'" type="text" style="width:25px"></input>'}},
|
|
{field : 'xh',title : '序号',width : '2%',type : 'numbers'},
|
|
{field:'sname', title:'景区名称', width:'14%', align:'center'},
|
|
{field:'isrecommend', title:'是否推荐', width:'8%', align:'center',templet: function(d){
|
|
var ischecked = d.isrecommend != 'YES' ? '' : 'checked';
|
|
return '<input type="checkbox" name="isrecommend" lay-filter="isrecommend" lay-skin="switch" lay-text="是|否" '+ ischecked +' value="'+d.guid+'">'
|
|
}},
|
|
{field:'areaname', title:'所属地区', width:'10%', align:'center'},
|
|
{field:'saddress', title:'景区地址', width:'19%', align:'center'},
|
|
{title:'操作', width:'41%', align:'center', toolbar:'#barDemo'},
|
|
{fixed:'fid',hide:true}
|
|
] ],
|
|
id : 'tableId',
|
|
page : true, //开启分页
|
|
height : tablehight
|
|
});
|
|
|
|
//搜索
|
|
var $ = layui.$, active = {
|
|
reload : function() {
|
|
table.reload('tableId', {
|
|
page : {curr : 1},
|
|
where : {
|
|
mtitle : $('#mtitle').val(),
|
|
mname : $('#mname').val()
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
//点击搜索按钮
|
|
$('#sou').on('click', function() {
|
|
var type = $(this).data('type');
|
|
active[type] ? active[type].call(this) : '';
|
|
});
|
|
|
|
//点击重置按钮
|
|
$('#reset').on('click', function() {
|
|
var form = layui.form;
|
|
$("#mname").val("");
|
|
form.render('select');
|
|
var type = $(this).data('type');
|
|
active[type] ? active[type].call(this) : '';
|
|
table.reload('tableId', {
|
|
page : {curr : 1},
|
|
where : {
|
|
mname : $('#mname').val()
|
|
}
|
|
});
|
|
});
|
|
|
|
//监听添加按钮
|
|
$('#add').on('click', function() {
|
|
layer.open({
|
|
type : 2,
|
|
title : '新增',
|
|
area : ['90%','90%'],
|
|
maxmin : true,
|
|
content : "/html/back/scenicBasic/scenicBasicInfoAdd.html",
|
|
success: function (index, layero) {
|
|
$(':focus').blur();//让按钮失去焦点
|
|
},
|
|
/*end: function(index, layero){
|
|
table.reload('tableId', {page : {curr : 1}});
|
|
}*/
|
|
});
|
|
});
|
|
|
|
//监听导入按钮
|
|
$('#daoru').on('click', function() {
|
|
layer.open({
|
|
type : 2,
|
|
title : '数据导入',
|
|
area : [ '60%', '50%' ],
|
|
maxmin : true,
|
|
content : ctx + '/scenicInfo/daoru.do?',
|
|
success: function (index, layero) {
|
|
$(':focus').blur();//让按钮失去焦点
|
|
},
|
|
/*end: function(index, layero){
|
|
table.reload('tableId', {page : {curr : 1}});
|
|
}*/
|
|
});
|
|
});
|
|
|
|
//监听模板下载按钮
|
|
$('#mobanxiazai').on('click', function() {
|
|
window.location.href = ctx + "/doc/materialsmodel.xls";
|
|
});
|
|
|
|
//监听行工具事件
|
|
table.on('tool(tablefilter)', function(obj) {
|
|
var data = obj.data;
|
|
window.localStorage.setItem("bydata", JSON.stringify(data));
|
|
if (obj.event === 'del') {
|
|
layer.confirm('确定要删除【'+data['sname']+'】吗?', function(index) {
|
|
var sid = data.guid;
|
|
deldevicelease(sid);
|
|
obj.del();
|
|
layer.close(index);
|
|
});
|
|
} else if (obj.event === 'edit') {
|
|
layer.open({
|
|
type : 2,
|
|
title : '编辑',
|
|
area : ['90%','90%'],
|
|
maxmin : true,
|
|
content : '/html/back/scenicBasic/scenicBasicInfoAdd.html?guid='+data['guid'],
|
|
success : function(layero, index) {
|
|
// 获取子页面的iframe
|
|
var iframe = window['layui-layer-iframe' + index];
|
|
// 向子页面的全局函数child传参
|
|
//iframe.showData(data);
|
|
}/*,
|
|
end: function(index, layero){
|
|
table.reload('tableId',{page:{curr:1}});
|
|
}*/
|
|
});
|
|
} else if (obj.event === 'xiangq') {
|
|
layer.open({
|
|
type : 2,
|
|
title : '绑定管理',
|
|
area : ['70%','90%'],
|
|
maxmin : true,
|
|
content : "/html/back/scenicBasic/scenicBasicInfoBand.html?guid="+data['guid'],
|
|
success : function(layero, index) {
|
|
// 获取子页面的iframe
|
|
var iframe = window['layui-layer-iframe' + index];
|
|
// 向子页面的全局函数child传参
|
|
iframe.showData(data);
|
|
}/*,
|
|
end: function(index, layero){
|
|
table.reload('tableId',{page:{curr:1}});
|
|
}*/
|
|
});
|
|
}else if (obj.event === 'scenicTicket') {
|
|
layer.open({
|
|
type : 2,
|
|
title : '门票管理',
|
|
area : ['90%','90%'],
|
|
maxmin : true,
|
|
content : "/html/back/scenicTicket/list_scenicTicket.html?sid="+data['guid'],
|
|
});
|
|
}else if (obj.event === 'bindUser') {
|
|
layer.open({
|
|
type : 2,
|
|
title : data['sname']+"管理员",
|
|
area : ['60%','90%'],
|
|
maxmin : true,
|
|
content : "/html/back/ybsjScenicBindUser/list_scenicBindUser.html?sid="+data['guid'] + "&sname=" + data['sname'],
|
|
});
|
|
}else if (obj.event === 'appointLook') {
|
|
layer.open({
|
|
type : 2,
|
|
title : data['sname']+"预约列表",
|
|
area : ['90%','90%'],
|
|
maxmin : true,
|
|
content : "/html/back/ybsjReserve/list_reserve.html?sid="+data['guid'] + "&sname=" + data['sname'],
|
|
});
|
|
}
|
|
|
|
});
|
|
|
|
function deldevicelease(sid){
|
|
$.ajax({
|
|
url : ctx + "/scenicInfo/delScenicInfo.do",
|
|
data : {guid : sid},
|
|
type : "post",
|
|
dataType : "json",
|
|
xhrFields: {
|
|
withCredentials: true // 这里设置了withCredentials
|
|
},
|
|
async: false,
|
|
success : function(data) {
|
|
if (data) {
|
|
$(".layui-laypage-btn")[0].click(); //刷新
|
|
layer.msg("删除成功");
|
|
} else {
|
|
$(".layui-laypage-btn")[0].click(); //刷新
|
|
layer.msg("删除失败");
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
});
|
|
|
|
//格式化日期
|
|
function formatDate(date){
|
|
var ru = "";
|
|
if(!isEmpty(date)){
|
|
var time = new Date(date);
|
|
var mon = time.getMonth() + 1;//月
|
|
var day = time.getDate();//日
|
|
ru = time.getFullYear() + "-" + (mon<10?"0"+mon:mon) + "-" +(day<10?"0"+day:day);
|
|
}
|
|
return ru;
|
|
}
|
|
|
|
//修改排序
|
|
function updateSort(guid){
|
|
var sortValue = $("#sort"+guid).val();
|
|
$.ajax({
|
|
url: ctx + '/scenicInfo/updateSort.do',
|
|
data: {guid: guid, ssort: sortValue},
|
|
type: 'post',
|
|
datatype: 'json',
|
|
xhrFields: {
|
|
withCredentials: true // 这里设置了withCredentials
|
|
},
|
|
async: false,
|
|
success: function(json){
|
|
json = eval('(' + json + ')');
|
|
if(json.data){
|
|
layer.msg("修改成功!");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
//是否推荐
|
|
layui.form.on('switch(isrecommend)', function(data){
|
|
$.ajax({
|
|
url: ctx + '/scenicInfo/recommendScenic.do',
|
|
type: 'post',
|
|
datatype: 'json',
|
|
xhrFields: {
|
|
withCredentials: true // 这里设置了withCredentials
|
|
},
|
|
async: false,
|
|
data: {guid: data.elem.value, isrecommend: data.elem.checked},
|
|
success: function(json){
|
|
json = eval('(' + json + ')');
|
|
if(json.data){
|
|
if(data.elem.checked){
|
|
layer.msg("推荐成功!");
|
|
}else{
|
|
layer.msg("取消推荐成功!");
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</html>
|
|
|