7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
279 lines
9.8 KiB
HTML
279 lines
9.8 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;">
|
|
<form class="layui-form" id="form1_search" action="size_pm.htm">
|
|
<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_add">新增</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_del">删除</a></div>
|
|
|
|
<div class="layui-input-inline" style="width:100px;" id="search_username"></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="tpl_kh">
|
|
<div style="float:left;width:130px;" align="center"><a href="javascript:;" lay-event="edit">{{d.mc}}</a></div>
|
|
</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=size_pm'+query_str;
|
|
|
|
//alert(url);
|
|
//var cols=[];
|
|
//cols[0]={type: "checkbox", fixed:"left",width:50,style:"height:150px;"};
|
|
//cols[1]={field: 'list', 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 : 10,
|
|
limits : [10,20,30,50,100],
|
|
id : "ListTable",
|
|
cols : [[
|
|
{type: "checkbox", fixed:"left",width:50},
|
|
{field: 'xh', title: '序号', width:90,align:"center"},
|
|
{field: 'qy', title: '区域', align:"center"},
|
|
{field: 'dl', title: '代理', align:"center"},
|
|
{field: 'dp', title: '店铺', align:"center"},
|
|
{field: 'pm_dj', title: '配码等级', align:"center"},
|
|
{field: 'mc', title: '名称', align:"left",templet:'#tpl_kh'},
|
|
{field: 'gz', title: '规则', align:"left"}
|
|
]],
|
|
done: function(res, curr, count){
|
|
//---------------------------------------------设置搜索框
|
|
//alert(res.count);
|
|
//var lang_spk=res.lang_spk;
|
|
//var lang_xh=res.lang_xh;
|
|
//根据url取得搜索条件的默认值
|
|
var s_xh=s_username=s_is_sp=s_in_ph=s_ka=s_ka_color="";
|
|
//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)+"\";");
|
|
}
|
|
}
|
|
//是否显示设置饰品款的按钮
|
|
//if(res.is_spk=="y"){
|
|
//$(".btn_set_spk").show();
|
|
//}
|
|
//圆牌号
|
|
//html1='<input id="s_xh" name="s_xh" type="text" class="layui-input searchVal" placeholder="'+lang_xh+'" value="'+s_xh+'" />';
|
|
//$("#search_xh").html(html1);
|
|
//款号
|
|
html1='<input id="s_username" name="s_username" type="text" class="layui-input searchVal" placeholder="店铺代码" value="'+s_username+'" width="100px" />';
|
|
$("#search_username").html(html1);
|
|
//alert(html_search_username);
|
|
//饰品款
|
|
/*var arr_key=["y","n"];
|
|
var arr_val=["是","否"];
|
|
html_search_live='<select id="s_is_sp" name="s_is_sp" lay-filter="s_is_sp"><option value="">-'+lang_spk+'-</option>';
|
|
for(var j=0;j<arr_key.length;j++){
|
|
html_search_live+='<option value="'+arr_key[j]+'"';
|
|
if(arr_key[j]==s_is_sp)
|
|
html_search_live+=' selected';
|
|
html_search_live+='>'+arr_val[j]+'</option>';
|
|
}
|
|
html_search_live+='</select>';
|
|
$("#search_is_sp").html(html_search_live);
|
|
//参与排行
|
|
var arr_key=["y","n"];
|
|
var arr_val=["是","否"];
|
|
html_search_live='<select id="s_in_ph" name="s_in_ph" lay-filter="s_in_ph"><option value="">-参与排行-</option>';
|
|
for(var j=0;j<arr_key.length;j++){
|
|
html_search_live+='<option value="'+arr_key[j]+'"';
|
|
if(arr_key[j]==s_in_ph)
|
|
html_search_live+=' selected';
|
|
html_search_live+='>'+arr_val[j]+'</option>';
|
|
}
|
|
html_search_live+='</select>';
|
|
$("#search_in_ph").html(html_search_live);
|
|
//删除款
|
|
var arr_key=["n","y"];
|
|
var arr_val=["不显示删除款","显示删除款"];
|
|
html_search_live='<select id="s_ka" name="s_ka" lay-filter="s_ka"><option value="">-删除款过滤-</option>';
|
|
for(var j=0;j<arr_key.length;j++){
|
|
html_search_live+='<option value="'+arr_key[j]+'"';
|
|
if(arr_key[j]==s_ka)
|
|
html_search_live+=' selected';
|
|
html_search_live+='>'+arr_val[j]+'</option>';
|
|
}
|
|
html_search_live+='</select>';
|
|
$("#search_ka").html(html_search_live);
|
|
//删除色
|
|
var arr_key=["y"];
|
|
var arr_val=["显示删除色"];
|
|
html_search_live='<select id="s_ka_color" name="s_ka_color" lay-filter="s_ka_color"><option value="">-删除色过滤-</option>';
|
|
for(var j=0;j<arr_key.length;j++){
|
|
html_search_live+='<option value="'+arr_key[j]+'"';
|
|
if(arr_key[j]==s_ka_color)
|
|
html_search_live+=' selected';
|
|
html_search_live+='>'+arr_val[j]+'</option>';
|
|
}
|
|
html_search_live+='</select>';
|
|
$("#search_ka_color").html(html_search_live);
|
|
//自定义选项
|
|
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 import_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导入配码设置资料",
|
|
type : 2,
|
|
content : "import_excel.htm?m=size_pm",
|
|
success : function(layero, index){
|
|
var body = layui.layer.getChildFrame('body', index);
|
|
body.find("#m").val("size_pm");
|
|
form.render();
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_import").click(function(){
|
|
import_excel();
|
|
})
|
|
//导出
|
|
function export_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导出配码设置资料",
|
|
type : 2,
|
|
content : "size_pm_export.htm",
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_export").click(function(){
|
|
export_excel();
|
|
})
|
|
//新增、编辑
|
|
function add(id){
|
|
var t1=(id>0)?"编辑":"新增";
|
|
var index = layui.layer.open({
|
|
title : t1+"款号",
|
|
type : 2,
|
|
content : "size_pm_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=size_pm&_a=del",{id:check_id},function(data){
|
|
if(data.code=="1"){
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"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 === 'del'){
|
|
//删除
|
|
layer.confirm('确定删除吗?',{icon:3, title:'提示信息'},function(index){
|
|
$.get("./?_m=size_pm&_a=del",{id:data.id},function(data){
|
|
alert(data.id);
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
})
|
|
});
|
|
}
|
|
});
|
|
//
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |