7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
380 lines
12 KiB
HTML
380 lines
12 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_username').autocomplete("./?_m=ajax_autocomplete&_a=client2", {
|
|
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.title+'('+row.username+')',result:row.username
|
|
};
|
|
});
|
|
}
|
|
},
|
|
formatItem: function(row,i,max) {
|
|
//提示的显示内容及格式设置
|
|
return row.title+'('+row.username+')';
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.title + row.username;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.username;
|
|
}
|
|
}).result(function(event,row,formatted){
|
|
$('#s_username').value=row.username;
|
|
});
|
|
|
|
$('#s_kh').autocomplete("./?_m=ajax_autocomplete&_a=kh", {
|
|
dataType: "json",//数据格式
|
|
max: 100, //列表里的条目数
|
|
minChars: 0, //自动完成激活之前填入的最小字符
|
|
width: 200, //提示的宽度,溢出隐藏
|
|
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.no,result:row.no
|
|
};
|
|
});
|
|
}
|
|
},
|
|
formatItem: function(row,i,max) {
|
|
//提示的显示内容及格式设置
|
|
return row.no;
|
|
},
|
|
formatMatch: function(row, i, max) {
|
|
return row.no;
|
|
},
|
|
formatResult: function(row) {
|
|
return row.no;
|
|
}
|
|
}).result(function(event,row,formatted){
|
|
$('#s_kh').value=row.no;
|
|
});
|
|
});
|
|
|
|
</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;" id="search_top">
|
|
<form class="layui-form" id="form1_search" action="client_zk.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-inline"><a class="layui-btn layui-btn-normal btn_plset">批量设置</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_copyzk_kh">按款复制折扣</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_copyzk_client">按客户复制折扣</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_ppzk_client">按客户字段平铺折扣</a></div>
|
|
<br>
|
|
<div class="layui-input-inline">
|
|
<input type=text name="s_username" id="s_username" class="layui-input" placeholder="客户" onfocus="this.select()" value="">
|
|
</div>
|
|
<div class="layui-input-inline">
|
|
<input type=text name="s_kh" id="s_kh" class="layui-input searchVal" placeholder="款号" onfocus="this.select()" value="">
|
|
</div>
|
|
<div class="layui-input-inline">
|
|
<button id="form1_submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="form1_submit"> 搜 索 </button>
|
|
</div>
|
|
<div class="layui-input-inline">
|
|
<a class="layui-btn btn_showall">显示全部</a>
|
|
</div>
|
|
<div id="detail_show"></div>
|
|
|
|
</form>
|
|
</blockquote>
|
|
<div style="width:99%;">
|
|
<form class="layui-form">
|
|
<table id="layui_table" lay-filter="layui_table"></table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script type="text/html" id="tplclient">
|
|
<a style="color:blue;" lay-event="edit">{{d.clientname+"("+d.clienttitle+")"}}</a>
|
|
</script>
|
|
<script>
|
|
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=client_zk'+query_str;
|
|
|
|
var cols=[];
|
|
cols[0]={type: "checkbox"};
|
|
cols[1]={field: 'client', title: '客户',align:"center",templet:'#tplclient'};
|
|
cols[2]={field: 'kh', title: ' 款号',align:"center"};
|
|
cols[3]={field: 'price', title: '吊牌价',align:'center'};
|
|
cols[4]={field: 'zk', title: '折扣',align:'left'};
|
|
cols[5]={field: 'jsj', title: '结算价',align:'left'};
|
|
var table_heaight=(document.documentElement.clientHeight>300)?document.documentElement.clientHeight-$('#search_top').outerHeight(true)-80:"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 : "ClientzkTable",
|
|
cols : [cols],
|
|
done: function(res, curr, count){
|
|
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>';
|
|
}
|
|
|
|
html1+='<div class="layui-input-inline" style="width:120px;"><select name="s_is_sp"><option value="">-'+res.select_is_sp.title+'-</option>';
|
|
var op=res.select_is_sp.op;
|
|
for(var j=0;j<op.length;j++){
|
|
html1+='<option value="'+op[j].no+'"';
|
|
if(op[j].no==res.select_is_sp.value)
|
|
html1+='selected';
|
|
html1+='>'+op[j].title+'</option>';
|
|
}
|
|
html1+='</select></div> ';
|
|
$("#detail_show").html(html1);
|
|
$("#s_username").val(res.s_username);
|
|
$("#s_kh").val(res.s_kh);
|
|
form.render();
|
|
}
|
|
});
|
|
//列表操作
|
|
table.on('tool(layui_table)', function(obj){
|
|
var layEvent = obj.event,
|
|
data = obj.data;
|
|
if(layEvent === 'edit'){
|
|
//编辑
|
|
add(data.id);
|
|
}
|
|
});
|
|
|
|
//显示全部
|
|
$(".btn_showall").click(function(){
|
|
tableIns.reload({url:'./?_m=client_zk', height : "full-160"});
|
|
})
|
|
|
|
//新增、编辑
|
|
function add(id){
|
|
var t1=(id>0)?"编辑":"新增";
|
|
var index = layui.layer.open({
|
|
title : t1+"折扣",
|
|
type : 2,
|
|
content : "client_zk_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);
|
|
})
|
|
//导出
|
|
function export_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导出客户折扣",
|
|
type : 2,
|
|
content : "client_zk_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=client_zk",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_import").click(function(){
|
|
import_excel();
|
|
})
|
|
//批量删除
|
|
$(".btn_del").click(function(){
|
|
var checkStatus = table.checkStatus('ClientzkTable'),
|
|
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_zk&_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 btnplset(){
|
|
var index = layui.layer.open({
|
|
title : "批量设置",
|
|
type : 2,
|
|
content : "client_zk_plset.htm",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_plset").click(function(){
|
|
btnplset();
|
|
})
|
|
|
|
//按款复制折扣
|
|
function btncopyzk_kh(){
|
|
var index = layui.layer.open({
|
|
title : "按款复制折扣",
|
|
type : 2,
|
|
content : "client_zk_copyzk_kh.htm",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_copyzk_kh").click(function(){
|
|
btncopyzk_kh();
|
|
})
|
|
|
|
//按客户复制折扣
|
|
function btncopyzk_client(){
|
|
var index = layui.layer.open({
|
|
title : "按客户复制折扣",
|
|
type : 2,
|
|
content : "client_zk_copyzk_client.htm",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_copyzk_client").click(function(){
|
|
btncopyzk_client();
|
|
})
|
|
//按客户字段平铺折扣
|
|
function btnppzk_client(){
|
|
var index = layui.layer.open({
|
|
title : "按客户字段平铺折扣",
|
|
type : 2,
|
|
content : "client_zk_ppzk_client.htm",
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_ppzk_client").click(function(){
|
|
btnppzk_client();
|
|
})
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |