7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
186 lines
6.3 KiB
HTML
186 lines
6.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<title>短消息管理-e订通后台</title>
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
<style type="text/css">
|
|
.layui-table-cell {
|
|
height: auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<blockquote class="layui-elem-quote" style="line-height:44px;padding:8px;">
|
|
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_add">新增</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_del">删除</a></div>
|
|
<form class="layui-form" id="form1_search" action="msg.htm">
|
|
<span id="search_dz_select"></span>
|
|
<div class="layui-input-inline" style="width:60px;" id="search_from_cid"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_to_cid"></div>
|
|
<button id="form1_submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="form1_submit"> 搜 索 </button>
|
|
</form>
|
|
</blockquote>
|
|
<form class="layui-form">
|
|
<table id="layui_table" lay-filter="layui_table" style="">
|
|
</table>
|
|
</form>
|
|
</div>
|
|
<!--操作-->
|
|
<script type="text/html" id="caozuo">
|
|
<a href="javascript:;" lay-event="edit">{{d.from}}</a>
|
|
</script>
|
|
<script>
|
|
var tableIns={};
|
|
layui.use(['form','layer','laydate','table','laytpl'],function(){
|
|
var form = layui.form,
|
|
layer = layui.layer,
|
|
$=layui.jquery,
|
|
laydate = layui.laydate,
|
|
laytpl = layui.laytpl,
|
|
table = layui.table;
|
|
//取得url传递参数
|
|
var query_str=location.search.substring(1);
|
|
if(query_str)
|
|
query_str="&"+query_str;
|
|
//---------------------------------------------数据表格
|
|
var url='./?_m=msg'+query_str;
|
|
//alert(url);
|
|
//var cols=[];
|
|
//cols[0]={type: "checkbox", fixed:"left",width:50,style:"height:150px;"};
|
|
//cols[1]={field: 'xh', title: '圆牌号', width:90,align:"center",templet:'#tpl_xh',sort: true};
|
|
//cols[2]={field: 'detail', title: '款式明细',align:'left',templet:'#tpl_detail'};
|
|
tableIns = table.render({
|
|
even:false,
|
|
elem: '#layui_table',
|
|
url : url,
|
|
cellMinWidth:80,
|
|
page : true,
|
|
height : "full-140",
|
|
limit : 50,
|
|
limits : [10,20,30,50,100],
|
|
id : "ListTable",
|
|
cols : [[
|
|
{type: "checkbox", fixed:"left",width:50},
|
|
{field: 'xh', title: '序号', width:90,align:"center"},
|
|
{field: 'is_read', title: '已读', align:"center"},
|
|
{field: 'from', title: '来自', align:"center", templet:'#caozuo'},
|
|
{field: 'to', title: '送往', align:"center"},
|
|
{field: 'text', title: '内容', align:"center"},
|
|
{field: 'add_date', title: '发送时间', align:"center"}
|
|
]],
|
|
done: function(res, curr, count){
|
|
//---------------------------------------------设置搜索框
|
|
//alert(res.count);
|
|
//var lang_spk=res.lang_spk;
|
|
//var lang_xh=res.lang_xh;
|
|
//根据url取得搜索条件的默认值
|
|
var s_from_cid=s_to_cid=is_read=s_khd=s_server_ip="";
|
|
/*for(var i=0;i<res.select_dz.length;i++){
|
|
eval("var s_"+res.select_dz[i].no+"='';");
|
|
}
|
|
var pairs=query_str.split("&");//在逗号处断开
|
|
for(var i=0;i<pairs.length;i++){
|
|
var pos=pairs[i].indexOf('=');//查找name=value
|
|
if(pos>=0){
|
|
var argname=pairs[i].substring(0,pos);
|
|
var value=pairs[i].substring(pos+1);
|
|
//alert(argname+"|"+unescape(value));
|
|
if(argname && value)
|
|
eval("var "+argname+"=\""+unescape(value)+"\";");
|
|
}
|
|
}*/
|
|
//来自
|
|
html1='<input id="s_from_cid" name="s_from_cid" type="text" class="layui-input searchVal" placeholder="来自" value="'+s_from_cid+'" />';
|
|
$("#search_from_cid").html(html1);
|
|
|
|
//送往
|
|
html1='<input id="s_to_cid" name="s_to_cid" type="text" class="layui-input searchVal" placeholder="送往" value="'+s_to_cid+'" />';
|
|
$("#search_to_cid").html(html1);
|
|
|
|
//alert(html_search_username);
|
|
//自定义选项
|
|
var html1="";
|
|
for(var i=0;i<res.select_dz.length;i++){
|
|
html1+='<div class="layui-inline" style="width:80px;"><select name="s_'+res.select_dz[i].no+'"><option value="">-'+res.select_dz[i].title+'-</option>';
|
|
var op=res.select_dz[i].op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==res.select_dz[i].value)
|
|
html1+='selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select></div>';
|
|
}
|
|
//alert(html1);
|
|
$("#search_dz_select").html(html1);
|
|
form.render();
|
|
}
|
|
});
|
|
//新增、编辑
|
|
function add(id){
|
|
var t1=(id>0)?"编辑":"新增";
|
|
var index = layui.layer.open({
|
|
title : t1+"款号",
|
|
type : 2,
|
|
content : "msg_add.htm?id="+id,
|
|
success : function(layero, index){
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_add").click(function(){
|
|
add(0);
|
|
})
|
|
//批量删除
|
|
$(".btn_del").click(function(){
|
|
var checkStatus = table.checkStatus('ListTable'),
|
|
data = checkStatus.data,
|
|
check_id = [];
|
|
if(data.length>0) {
|
|
for (var i in data) {
|
|
check_id.push(data[i].id);
|
|
}
|
|
layer.confirm('确定删除吗?', {icon: 3, title: '提示信息'}, function (index) {
|
|
$.get("./?_m=msg&_a=del",{id:check_id},function(data){
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择需要删除的记录");
|
|
}
|
|
})
|
|
//列表操作
|
|
table.on('tool(layui_table)', function(obj){
|
|
var layEvent = obj.event,
|
|
data = obj.data;
|
|
if(layEvent === 'edit'){
|
|
//清空
|
|
add(data.id);
|
|
} else if(layEvent === 'kickout'){
|
|
//提出
|
|
layer.confirm('确定踢出吗?',{icon:3, title:'提示信息'},function(index){
|
|
$.get("./?_m=msg&_a=kickout",{id:data.id},function(data){
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
})
|
|
});
|
|
}
|
|
});
|
|
//
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |