7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
417 lines
14 KiB
HTML
417 lines
14 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;">
|
|
<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-normal btn_copy">复制</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_set_spk" style="display:none">设置饰品款</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">纠错检查</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-warm btn_cache_pic">缓存细节图</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-warm btn_cmmx">尺码明细</a></div>
|
|
<form class="layui-form" id="form1_search" action="kh.htm" method="get">
|
|
<div class="layui-input-inline" style="width:60px;" id="search_xh"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_kh"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_is_sp"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_in_ph"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_ka"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_ka_color"></div>
|
|
<span id="search_dz_select"></span>
|
|
<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_xh">
|
|
<div class="yph">{{d.xh}}</div>
|
|
</script>
|
|
<script type="text/html" id="tpl_detail">
|
|
<div style="float:left;width:130px;height:130px;line-height:130px;" align="center"><a href="javascript:;" class="pic" lay-event="edit"><img src="{{d.pic_src}}" width="{{d.pic_w}}" height="{{d.pic_h}}" border=0></a></div>
|
|
<div style="float:left;height:130px;padding:4px;line-height:25px;">
|
|
{{#
|
|
var khstr="";
|
|
if(d.ka=="y"){
|
|
khstr+="<font color='red'><strong>"+d.kh+"</strong></font>";
|
|
}else{
|
|
khstr+=d.kh;
|
|
}
|
|
}}
|
|
{{khstr}}
|
|
<span class="layui-badge">{{d.price}}</span><br>
|
|
{{#
|
|
var arr_color=d.color.split(",");
|
|
var str_color="";
|
|
var cl1="";
|
|
for(var i=0;i<arr_color.length;i++){
|
|
var arr_color1=arr_color[i].split("|");
|
|
if(arr_color1[2]=="y"){
|
|
cl1="layui-badge";
|
|
}else{
|
|
cl1="layui-badge-rim";
|
|
}
|
|
str_color+="<span class='"+cl1+"'>";
|
|
str_color+=arr_color1[0]+"-"+arr_color1[1]+"</span> ";
|
|
}
|
|
}}
|
|
{{str_color}}
|
|
{{#
|
|
var str1="";
|
|
for(var i=0;i<d.arr_select.length;i++){
|
|
if(d.arr_select[i].v!="")
|
|
str1+='<span class="layui-badge-rim">'+d.arr_select[i].v+'</span> ';
|
|
}
|
|
if(d.is_sp!="")
|
|
str1+='<span class="layui-badge-rim layui-bg-blue">'+d.is_sp+'</span> ';
|
|
}}
|
|
<br>{{str1}}</div>
|
|
</script>
|
|
<script>
|
|
var tableIns={};
|
|
var kh_index = 0;
|
|
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;
|
|
kh_index = layer.getFrameIndex(window.name);
|
|
//取得url传递参数
|
|
var query_str=location.search.substring(1);
|
|
if(query_str)
|
|
query_str="&"+query_str;
|
|
//---------------------------------------------数据表格
|
|
var index = layer.load();
|
|
var url='./?_m=kh'+query_str;
|
|
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'};
|
|
var table_heaight=(document.documentElement.clientHeight>300)?document.documentElement.clientHeight-$('#search_top').outerHeight(true)-150:"500";
|
|
tableIns = table.render({
|
|
even:false,
|
|
elem: '#layui_table',
|
|
url : url,
|
|
cellMinWidth:80,
|
|
page :true,
|
|
height : table_heaight,
|
|
limit : 10,
|
|
limits : [10,20,30,50,100],
|
|
id : "ListTable",
|
|
cols : [cols],
|
|
done: function(res, curr, count){
|
|
var curr = curr;
|
|
//---------------------------------------------设置搜索框
|
|
//alert(res.count);
|
|
var lang_spk=res.lang_spk;
|
|
var lang_xh=res.lang_xh;
|
|
//根据url取得搜索条件的默认值
|
|
var s_xh=s_no=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_no" name="s_no" type="text" class="layui-input searchVal" placeholder="款号" value="'+s_no+'" />';
|
|
$("#search_kh").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();
|
|
layer.close(index);
|
|
}
|
|
});
|
|
//导入
|
|
function import_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导入款号资料",
|
|
type : 2,
|
|
content : "import_excel.htm?m=kh",
|
|
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 export_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导出款号资料",
|
|
type : 2,
|
|
content : "kh_export.htm",
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
function size_mx(){
|
|
var index = layui.layer.open({
|
|
title : "尺码明细表",
|
|
type : 2,
|
|
content : "kh_size_report.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 : "kh_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=kh&_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("请选择需要删除的记录");
|
|
}
|
|
})
|
|
//复制
|
|
$(".btn_copy").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);
|
|
}
|
|
if(check_id.length==1){
|
|
layer.confirm('确定复制吗?', {icon: 3, title: '提示信息'}, function (index) {
|
|
$.get("./?_m=kh&_a=copy",{id:check_id[0]},function(data){
|
|
if(data.code=="1"){
|
|
//alert(data.id);
|
|
//tableIns.reload();
|
|
layer.close(index);
|
|
add(data.id);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择1条需要复制的记录");
|
|
}
|
|
}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=kh&_a=del",{id:data.id},function(data){
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
})
|
|
});
|
|
}
|
|
});
|
|
//纠错检查
|
|
$(".btn_check").click(function(){
|
|
var index = layer.open({
|
|
title : "纠错检查",
|
|
type : 2,
|
|
area: ['400px', '600px'],
|
|
content : "kh_check.htm",
|
|
success : function(layero, index){
|
|
//
|
|
|
|
}
|
|
})
|
|
})
|
|
//尺码明细表
|
|
$(".btn_cmmx").click(function(){
|
|
size_mx();
|
|
})
|
|
//设置饰品款
|
|
$(".btn_set_spk").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=kh&_a=set_spk",{id:check_id},function(data){
|
|
if(data.code=="1"){
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择需要操作的记录");
|
|
}
|
|
})
|
|
//缓存细节图
|
|
$(".btn_cache_pic").click(function(){
|
|
$.get("./?_m=kh&_a=chache_pic_detail",{},function(data){
|
|
layer.msg(data.msg);
|
|
},"json")
|
|
})
|
|
//搜索
|
|
form.on("submit(form1_submit)",function(data){
|
|
//弹出loading
|
|
return true;
|
|
})
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |