7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
293 lines
9.3 KiB
HTML
293 lines
9.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;
|
|
|
|
}
|
|
.layui-table-cell{
|
|
overflow:visible;
|
|
text-overflow:inherit;
|
|
white-space:normal;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<blockquote class="layui-elem-quote" style="line-height:44px;padding:8px;" id="search_top">
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_import">导入</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_export">导出</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_set_zsh">批量设置展示号</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_add">新增</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_del">删除</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-warm btn_check_kh">检查错误</a></div>
|
|
<div class="layui-inline"><a class="layui-btn btn_showall">显示全部</a></div>
|
|
|
|
<form class="layui-form" id="form1_search" action="kh_cc.htm">
|
|
<div class="layui-input-inline" style="width:100px;" id=search_zsh></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_kh"></div>
|
|
<button id="form1_submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="form1_submit"> 搜 索 </button>
|
|
</form>
|
|
</blockquote>
|
|
<div style="width:99%;">
|
|
<form class="layui-form">
|
|
<table id="layui_table" lay-filter="layui_table" style="">
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script type="text/html" id="tplImg">
|
|
<a style="color:blue;" lay-event="edit"><img src="{{d.pic_src}}" width="{{d.pic_w}}" height="{{d.pic_h}}" border=0></a>
|
|
</script>
|
|
<script type="text/html" id="tplcch">
|
|
<a style="color:blue;" lay-event="edit">{{d.cch}}</a>
|
|
</script>
|
|
<script type="text/html" id="tplks">
|
|
{{#
|
|
var arr_khcolor=d.kh.split("|");
|
|
var str_khcolor="";
|
|
for(var i=0;i<arr_khcolor.length;i++){
|
|
var x=i+1;
|
|
var arr_khcolor1=arr_khcolor[i].split(",");
|
|
}}
|
|
<span>{{x}}.</span> <span class="layui-badge-rim" onmouseover="show_kh_pic('{{arr_khcolor1[0]+" "+arr_khcolor1[1]}}','{{arr_khcolor1[4]}}')">{{arr_khcolor1[0]}}</span> <span class="layui-badge">{{arr_khcolor1[1]+'-'+arr_khcolor1[2]}}</span>
|
|
{{#
|
|
if(arr_khcolor1[3]!=""){
|
|
}}
|
|
<span class="layui-badge layui-bg-blue">{{arr_khcolor1[3]}}</span>
|
|
{{#
|
|
}
|
|
}}
|
|
<br>
|
|
{{#
|
|
}
|
|
}}
|
|
{{str_khcolor}}
|
|
</script>
|
|
<script>
|
|
function show_kh_pic(kh,pic){
|
|
var obj_div=document.getElementById("div_kh_pic");
|
|
var e=e||window.event;
|
|
var st=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
|
|
if(e){
|
|
var t1=e.clientY+st;
|
|
var l1=e.clientX+40;
|
|
t1=e.clientY>350?t1-230:t1;
|
|
}
|
|
t1=t1>0?t1:0;
|
|
l1=l1>0?l1:0;
|
|
obj_div.style.top=t1+"px";
|
|
obj_div.style.left=l1+"px";
|
|
obj_div.innerHTML="<table border='0' cellspacing='0' cellpadding='0' bgcolor='#CCCCCC' style='border:1px solid #000000'><tr><td align='center' height='18'><b>"+kh+"</b></td></tr><tr><td bgcolor='#FFFFFF'><img src=\""+pic+"\"></td></tr><tr><td bgcolor='#FFFFFF' align='center'><a href=\"#\" onmouseover=\"close_div('div_kh_pic')\">关闭</a></td></tr></table>";
|
|
obj_div.style.display="";
|
|
}
|
|
function close_div(div){
|
|
var obj_div=document.getElementById(div);
|
|
obj_div.style.display="none";
|
|
}
|
|
var tableIns={};
|
|
layui.use(['form','layer','table','laytpl'],function(){
|
|
var form = layui.form,
|
|
layer = layui.layer,
|
|
$=layui.jquery,
|
|
laytpl = layui.laytpl,
|
|
table = layui.table;
|
|
|
|
//取得url传递参数
|
|
var query_str=location.search.substring(1);
|
|
if(query_str)
|
|
query_str="&"+query_str;
|
|
//---------------------------------------------数据表格
|
|
var url='./?_m=kh_cc'+query_str;
|
|
|
|
var cols=[];
|
|
cols[0]={type: "checkbox", width:50};
|
|
cols[1]={field: 'zsh', title: '展示号', width:100,align:"center",sort: true};
|
|
cols[2]={field: 'cch', title: '名称', width:100,align:"center",templet:'#tplcch'};
|
|
cols[3]={field: 'pic_src', title: '图片',align:'center',width:200,templet:'#tplImg'};
|
|
cols[4]={field: 'kh', title: '款色',width:250,align:'left',templet:'#tplks'};
|
|
cols[5]={field: 'ccjs', title: '橱窗介绍',align:'left'};
|
|
var table_heaight=(document.documentElement.clientHeight>300)?document.documentElement.clientHeight-$('#search_top').outerHeight(true)-40:"500";
|
|
|
|
tableIns = table.render({
|
|
even:false,
|
|
elem: '#layui_table',
|
|
url : url,
|
|
cellMinWidth:80,
|
|
page : true,
|
|
height : table_heaight,
|
|
limit : 20,
|
|
limits : [10,20,30,50,100],
|
|
id : "kh_ccTable",
|
|
cols : [cols],
|
|
done: function(res, curr, count){
|
|
var lang_kh=res.lang_kh;
|
|
var lang_zsh=res.lang_zsh;
|
|
|
|
var s_kh=s_zsh="";
|
|
|
|
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_zsh" name="s_zsh" type="text" class="layui-input searchVal" placeholder="'+lang_zsh+'" value="'+s_zsh+'" />';
|
|
$("#search_zsh").html(html1);
|
|
|
|
//款号
|
|
html1='<input id="s_kh" name="s_kh" type="text" class="layui-input searchVal" placeholder="'+lang_kh+'" value="'+s_kh+'" />';
|
|
$("#search_kh").html(html1);
|
|
|
|
form.render();
|
|
}
|
|
});
|
|
//显示全部
|
|
$(".btn_showall").click(function(){
|
|
tableIns.reload({url:'./?_m=kh_cc'});
|
|
})
|
|
//检查错误
|
|
$(".btn_check_kh").click(function(){
|
|
var index = layui.layer.open({
|
|
title : "检查错误",
|
|
type : 2,
|
|
shade: 0,
|
|
offset: 'r',
|
|
area: ['400px', '500px'],
|
|
content : "kh_cc_check.htm",
|
|
success : function(layero, index){
|
|
//
|
|
}
|
|
})
|
|
})
|
|
|
|
//导出
|
|
function export_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导出资料",
|
|
type : 2,
|
|
content : "kh_cc_export.htm",
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_export").click(function(){
|
|
export_excel();
|
|
})
|
|
|
|
//导入
|
|
function import_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导入资料",
|
|
type : 2,
|
|
content : "import_excel.htm?m=kh_cc",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_import").click(function(){
|
|
import_excel();
|
|
})
|
|
|
|
//批量设置展示号
|
|
function set_zshpl(){
|
|
var index = layui.layer.open({
|
|
title : "批量设置展示号",
|
|
type : 2,
|
|
content : "kh_cc_zshpl.htm",
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_set_zsh").click(function(){
|
|
set_zshpl();
|
|
})
|
|
|
|
//批量删除
|
|
$(".btn_del").click(function(){
|
|
var checkStatus = table.checkStatus('kh_ccTable'),
|
|
data = checkStatus.data,
|
|
check_id = [];
|
|
if(data.length>0) {
|
|
for (var i in data) {
|
|
check_id.push(data[i].zsh);
|
|
}
|
|
layer.confirm('确定删除吗?', {icon: 3, title: '提示信息'}, function (index) {
|
|
$.get("./?_m=kh_cc&_a=del",{id:check_id},function(data){
|
|
if(data.code=="1"){
|
|
layer.msg("删除成功!");
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择需要删除的记录");
|
|
}
|
|
})
|
|
|
|
//新增、编辑
|
|
function add(zsh){
|
|
|
|
var t1=(zsh>0)?"编辑":"新增";
|
|
var index = layui.layer.open({
|
|
title : t1+"橱窗",
|
|
type : 2,
|
|
content : "kh_cc_add.htm?zsh="+zsh,
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_add").click(function(){
|
|
add(0);
|
|
})
|
|
|
|
//列表操作
|
|
table.on('tool(layui_table)', function(obj){
|
|
var layEvent = obj.event,
|
|
data = obj.data;
|
|
if(layEvent === 'edit'){
|
|
//编辑
|
|
add(data.zsh);
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<div id="div_kh_pic" style="display:none;position:absolute;top:10px;left:10px;"></div>
|
|
</body>
|
|
</html> |