7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
595 lines
19 KiB
HTML
595 lines
19 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>
|
|
<!-- 自动完成 -->
|
|
<script src="js/autocomplete/jquery-1.4.4.min.js"></script>
|
|
<script src="js/autocomplete/jquery.autocomplete.js"></script>
|
|
<link rel="stylesheet" href="js/autocomplete/jquery.autocomplete.css">
|
|
<!-- /自动完成 -->
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$('#s_path_t').autocomplete("./?_m=ajax_autocomplete&_a=paths", {
|
|
dataType: "json",//数据格式
|
|
max: 100, //列表里的条目数
|
|
minChars: 0, //自动完成激活之前填入的最小字符
|
|
width: 300, //提示的宽度,溢出隐藏
|
|
scrollHeight: 300, //提示的高度,溢出显示滚动条
|
|
matchContains: true, //包含匹配,就是data参数里的数据,是否只要包含文本框里的数据就显示
|
|
autoFill: false, //自动填充
|
|
parse: function (data) {
|
|
if (!data || data == null || data == "") {
|
|
alert("无数据");
|
|
return {};
|
|
}else{
|
|
return $.map(data.data, function (row) {
|
|
return {
|
|
data:row,value:row.t,result:row.t
|
|
};
|
|
});
|
|
}
|
|
},
|
|
formatItem: function(row,i,max) {
|
|
//提示的显示内容及格式设置
|
|
return row.t;
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.t;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.t;
|
|
}
|
|
}).result(function(event,row,formatted){
|
|
$('#s_path_t').value=row.t;
|
|
document.getElementById('s_path').value=row.p;
|
|
});
|
|
});
|
|
</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">
|
|
<form class="layui-form" id="form1_search" action="client.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-primary btn_ewm">二维码</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_available">启用</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_disavailable">禁用</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 btn_qjqx">区经权限导入</a></div>
|
|
<div class="layui-inline" id="check_zk"></div>
|
|
<div class="layui-inline" id="client_zk"></div>
|
|
<div class="layui-inline"><a class="layui-btn btn_showall">显示全部</a></div><br>
|
|
|
|
<div class="layui-input-inline" style="width:100px;" id="search_keyword"></div>
|
|
<div class="layui-input-inline" style="width:200px;">
|
|
<input type=text name="s_path_t" id="s_path_t" class="layui-input searchVal" onfocus="this.select()" value="">
|
|
<input type="hidden" name="s_path" id="s_path" value="">
|
|
</div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_face"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_available"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_in_ph"></div>
|
|
<div class="layui-input-inline" style="width:100px;" id="search_is_checked"></div>
|
|
<div class="layui-input-inline" id="search_dpsx"></div>
|
|
<div class="layui-input-inline" id="search_dj"></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="tplzb">
|
|
{{#
|
|
var str_zb="";
|
|
if(d.zb_type=="js"){
|
|
str_zb+='件数:<span class="layui-badge">'+d.zb_js+'</span>';
|
|
}else if(d.zb_type=="je"){
|
|
str_zb+='金额:<span class="layui-badge">'+d.zb+'万元</span>';
|
|
}else{
|
|
str_zb+='件数:<span class="layui-badge">'+d.zb_js+'</span><br>';
|
|
str_zb+='金额:<span class="layui-badge">'+d.zb+'万元</span>';
|
|
}
|
|
|
|
}}
|
|
{{str_zb}}
|
|
</script>
|
|
<script type="text/html" id="tplstate">
|
|
{{#
|
|
var str_state="";
|
|
if(d.dpsx!=""){
|
|
str_state+='<span class="layui-badge">'+d.dpsx+'</span><br>';
|
|
}
|
|
if(d.dj!=""){
|
|
str_state+='<span class="layui-badge layui-bg-blue">'+d.dj+'</span>'
|
|
}
|
|
}}
|
|
{{str_state}}
|
|
</script>
|
|
<script type="text/html" id="tpltitle">
|
|
{{#
|
|
var str_title="";
|
|
if(d.available=="y"){
|
|
str_title+='<a lay-event="edit" style="color:blue;">'+d.title+'</a>';
|
|
}else{
|
|
str_title+='<a lay-event="edit" style="color:#ccc;">'+d.title+'</a>';
|
|
}
|
|
if(d.faceid=="2"){
|
|
str_title+='<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="set_priv_2">设置权限</a>';
|
|
}else if(d.faceid=="4" || d.faceid=="3"){
|
|
if(d.is_jd=='y' || d.is_checked=='y'){
|
|
str_title+='<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="cancel_jd">退回订单</a>';
|
|
}
|
|
}
|
|
if(d.is_jy=="y"){
|
|
str_title+='<span class="layui-badge">禁言</span>';
|
|
}
|
|
}}
|
|
{{str_title}}
|
|
</script>
|
|
<script type="text/html" id="tplsetzk">
|
|
{{#
|
|
var str_setzk="";
|
|
if(d.zk_type=="client"){
|
|
if(d.faceid=="4" || d.faceid=="3"){
|
|
str_setzk+=d.zk;
|
|
}
|
|
}else{
|
|
if(d.is_zk=="y"){
|
|
if(d.faceid=="4" || d.faceid=="3"){
|
|
if(d.is_zknum>0){
|
|
str_setzk+='<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="view_zk">查看折扣</a>';
|
|
}else{
|
|
str_setzk+='<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="set_zk">请设置折扣</a>';
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}}
|
|
{{str_setzk}}
|
|
</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=client'+query_str;
|
|
|
|
var cols=[];
|
|
cols[0]={type: "checkbox"};
|
|
cols[1]={field: 'face', width:100,title: '登陆角色',align:"center",sort: true};
|
|
cols[2]={field: 'dpstate',width:90, title: '属性/等级',align:"left",templet:'#tplstate'};
|
|
cols[3]={field: 'title', title: '客户名称',align:'left',templet:'#tpltitle'};
|
|
cols[4]={field: 'zb',width:200, title: '指标',align:'left',templet:'#tplzb'};
|
|
cols[5]={field: 'zk',width:90, title: '折扣',align:'left',templet:'#tplsetzk'};
|
|
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 : "ClientTable",
|
|
cols : [cols],
|
|
done: function(res, curr, count){
|
|
//---------------------------------------------设置搜索框
|
|
var lang_keyword=res.lang_keyword;
|
|
var s_keyword=s_face=s_available=s_in_ph=s_is_checked="";
|
|
//关键字
|
|
html1='<input id="s_keyword" name="s_keyword" type="text" class="layui-input searchVal" placeholder="'+lang_keyword+'" value="'+res.s_keyword+'" />';
|
|
$("#search_keyword").html(html1);
|
|
//登入角色
|
|
//alert(res.select_face.title);
|
|
html1='<select name="s_face"><option value="">-'+res.select_face.title+'-</option>';
|
|
var op=res.select_face.op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==res.select_face.value)
|
|
html1+='selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select>';
|
|
$("#search_face").html(html1);
|
|
|
|
//是否启用
|
|
var arr_key=["y","n"];
|
|
var arr_val=["是","否"];
|
|
html_search_live='<select id="s_available" name="s_available" lay-filter="s_available"><option value="">-是否启用-</option>';
|
|
for(var j=0;j<arr_key.length;j++){
|
|
html_search_live+='<option value="'+arr_key[j]+'"';
|
|
if(arr_key[j]==res.s_available)
|
|
html_search_live+=' selected';
|
|
html_search_live+='>'+arr_val[j]+'</option>';
|
|
}
|
|
html_search_live+='</select>';
|
|
$("#search_available").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]==res.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=["y","n"];
|
|
var arr_val=["是","否"];
|
|
html_search_live='<select id="s_is_checked" name="s_is_checked" lay-filter="s_is_checked"><option value="">-是否确认-</option>';
|
|
for(var j=0;j<arr_key.length;j++){
|
|
html_search_live+='<option value="'+arr_key[j]+'"';
|
|
if(arr_key[j]==res.s_is_checked)
|
|
html_search_live+=' selected';
|
|
html_search_live+='>'+arr_val[j]+'</option>';
|
|
}
|
|
html_search_live+='</select>';
|
|
$("#search_is_checked").html(html_search_live);
|
|
var html1='';
|
|
if(res.zk_type=="client"){
|
|
//
|
|
}else{
|
|
if(res.is_zk=='y'){
|
|
html1+='<a class="layui-btn layui-btn-warm btn_check_zk">未设折扣检查</a>';
|
|
$("#check_zk").html(html1);
|
|
html1='';
|
|
html1+='<a class="layui-btn layui-btn-warm btn_client_zk">设置折扣</a>';
|
|
$("#client_zk").html(html1);
|
|
}
|
|
}
|
|
//店铺属性
|
|
if(res.show_dpsx=='y'){
|
|
html1='<select name="s_dpsx"><option value="">-'+res.select_dpsx.title+'-</option>';
|
|
var op=res.select_dpsx.op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==res.select_dpsx.value)
|
|
html1+='selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select>';
|
|
$("#search_dpsx").html(html1);
|
|
$("#search_dpsx").css("width","100px");
|
|
}
|
|
|
|
//店铺等级
|
|
if(res.show_dj=='y'){
|
|
html1='<select name="s_dj"><option value="">-'+res.select_dj.title+'-</option>';
|
|
var op=res.select_dj.op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==res.select_dj.value)
|
|
html1+='selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select>';
|
|
$("#search_dj").html(html1);
|
|
$("#search_dj").css("width","100px");
|
|
}
|
|
|
|
$("#s_path_t").val(res.s_path_t);
|
|
$("#s_path").val(res.s_path);
|
|
if(res.is_zk=='y'){
|
|
$(".btn_client_zk").click(function(){
|
|
var t1="设置折扣";
|
|
var index = layui.layer.open({
|
|
title : t1,
|
|
type : 2,
|
|
content : "client_zk.htm",
|
|
success : function(layero, index){
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
})
|
|
$(".btn_check_zk").click(function(){
|
|
var index = layui.layer.open({
|
|
title : "未设折扣",
|
|
type : 2,
|
|
shade: 0,
|
|
offset: 'r',
|
|
area: ['400px', '500px'],
|
|
content : "client_checkzk.htm",
|
|
success : function(layero, index){
|
|
//
|
|
}
|
|
})
|
|
})
|
|
}
|
|
form.render();
|
|
}
|
|
});
|
|
//显示全部
|
|
$(".btn_showall").click(function(){
|
|
tableIns.reload({url:'./?_m=client'});
|
|
})
|
|
|
|
//二维码
|
|
$(".btn_ewm").click(function(){
|
|
var t1="客户二维码";
|
|
var index = layui.layer.open({
|
|
title : t1,
|
|
type : 2,
|
|
content : "client_ewm.htm",
|
|
success : function(layero, index){
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
})
|
|
|
|
|
|
//批量禁用
|
|
$(".btn_disavailable").click(function(){
|
|
var checkStatus = table.checkStatus('ClientTable'),
|
|
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=client&_a=dis_available",{id:check_id},function(data){
|
|
if(data.code=="1"){
|
|
layer.msg("禁用ok!");
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择需要禁用的记录");
|
|
}
|
|
})
|
|
|
|
//批量启用
|
|
$(".btn_available").click(function(){
|
|
var checkStatus = table.checkStatus('ClientTable'),
|
|
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=client&_a=available",{id:check_id},function(data){
|
|
if(data.code=="1"){
|
|
layer.msg("启用ok!");
|
|
tableIns.reload();
|
|
layer.close(index);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择需要启用的记录");
|
|
}
|
|
})
|
|
|
|
//批量删除
|
|
$(".btn_del").click(function(){
|
|
var checkStatus = table.checkStatus('ClientTable'),
|
|
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=client&_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 import_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导入客户资料",
|
|
type : 2,
|
|
content : "import_excel.htm?m=client",
|
|
success : function(layero, index){
|
|
var body = layui.layer.getChildFrame('body', index);
|
|
body.find("#m").val("client");
|
|
form.render();
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_import").click(function(){
|
|
import_excel();
|
|
})
|
|
|
|
//区经权限导入
|
|
function qjqx_import_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导入区经权限资料",
|
|
type : 2,
|
|
content : "import_excel.htm?m=client_import_qjqx",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_qjqx").click(function(){
|
|
qjqx_import_excel();
|
|
})
|
|
|
|
//导出
|
|
function export_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导出客户资料",
|
|
type : 2,
|
|
content : "client_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 : "client_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);
|
|
})
|
|
|
|
//列表操作
|
|
table.on('tool(layui_table)', function(obj){
|
|
var layEvent = obj.event,
|
|
data = obj.data;
|
|
if(layEvent === 'edit'){
|
|
//编辑
|
|
add(data.id);
|
|
}else if(layEvent==='cancel_jd'){
|
|
$.ajax(
|
|
{
|
|
url:"./?_m=client&_a=cancel_jd&id="+data.id,
|
|
contentType: "application/json",
|
|
method: 'POST',
|
|
success: function (res) {
|
|
var res=$.parseJSON(res);
|
|
if(res.code=="1"){
|
|
layer.msg("退回成功!");
|
|
tableIns.reload('ClientTable');
|
|
}else{
|
|
layer.msg("退回失败!("+json_data.msg+")");
|
|
}
|
|
},
|
|
error: function () {
|
|
layui.layer.msg("与服务器通信失败!");
|
|
}
|
|
});
|
|
}else if(layEvent==='set_priv_2'){
|
|
var index =layui.layer.open({
|
|
title : "修改区域经理权限",
|
|
type : 2,
|
|
shade: 0.7,
|
|
offset: 'r',
|
|
area: ['500px', '500px'],
|
|
content : "client_winqx.htm?id="+data.id,
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
}else if(layEvent==="view_zk"){
|
|
var t1="设置折扣";
|
|
var index = layui.layer.open({
|
|
title : t1,
|
|
type : 2,
|
|
content : "client_zk.htm?s_username="+data.usertitle,
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}else if(layEvent==="set_zk"){
|
|
var t1="按客户复制折扣";
|
|
var index = layui.layer.open({
|
|
title : t1,
|
|
type : 2,
|
|
content : "client_zk_copyzk_client.htm?client_to="+data.usertitle,
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |