7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
373 lines
12 KiB
HTML
373 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 autocomp(){
|
||
$('#s_client').autocomplete("./?_m=ajax_autocomplete&_a=client&s_face=4", {
|
||
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_client').value=row.username;
|
||
});
|
||
}
|
||
document.onkeydown = function(e){
|
||
var ev =document.all ? window.event : e;
|
||
if(ev.keyCode==13) {
|
||
return false
|
||
}
|
||
}
|
||
</script>
|
||
<style type="text/css">
|
||
.layui-table-cell {
|
||
height: auto;
|
||
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="layui-tab" lay-filter="tab1">
|
||
<div>
|
||
<ul class="layui-tab-title">
|
||
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="layui-tab-content">
|
||
<div class="layui-tab-item layui-show">
|
||
<div id="detail_show">
|
||
|
||
</div>
|
||
<div style="width:99%;"><table id="layui_table" lay-filter="layui_table"></table></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script type="text/html" id="tplzf">
|
||
<a href="javascript:;" style="color:blue;" lay-event="openDetail">{{d.zf}}</a>
|
||
</script>
|
||
<script>
|
||
|
||
var this_tab_no="";
|
||
var this_tab_title="";
|
||
var tableIns={};
|
||
layui.use(['form','layer','table','laytpl','element'],function(){
|
||
var form = layui.form,
|
||
layer = layui.layer,
|
||
$=layui.jquery,
|
||
laytpl = layui.laytpl,
|
||
table = layui.table;
|
||
var element = layui.element;
|
||
|
||
//取得url传递参数
|
||
var query_str=location.search.substring(1);
|
||
if(query_str)
|
||
query_str="&"+query_str;
|
||
//---------------------------------------------数据表格
|
||
var cols=[];
|
||
cols[0]={field: 'ct', title: '次序', align:"center"};
|
||
cols[1]={field: 'kh', title: '款号',align:'center'};
|
||
cols[2]={field: 'pjf', title: '平均分',align:'center' ,sort: true};
|
||
cols[3]={field: 'zf', title: '总分',align:'center' ,templet:'#tplzf',sort: true};
|
||
cols[4]={field: 'zkhs', title: '总客户数',align:'center'};
|
||
cols[5]={field: 'fs5', title: '5星',align:'center'};
|
||
cols[6]={field: 'fs4', title: '4星',align:'center'};
|
||
cols[7]={field: 'fs3', title: '3星',align:'center'};
|
||
cols[8]={field: 'fs2', title: '2星',align:'center'};
|
||
cols[9]={field: 'fs1', title: '1星',align:'center'};
|
||
var url='./?_m=pj_report'+query_str;
|
||
var arr_tab=[];
|
||
tableIns = table.render({
|
||
even:false,
|
||
elem: '#layui_table',
|
||
url : url,
|
||
cellMinWidth:80,
|
||
page : false,
|
||
height : "full-190",
|
||
id : "pj_reportTable",
|
||
cols : [cols],
|
||
defaultToolbar: ['filter'],
|
||
done: function(res, curr, count){
|
||
|
||
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)+"\";");
|
||
}
|
||
}
|
||
|
||
this_tab_no=res.s_a;
|
||
//加载tab
|
||
arr_tab=res.tab;
|
||
var html1="";
|
||
for(var i=0;i<arr_tab.length;i++){
|
||
html1+='<li';
|
||
if(arr_tab[i]._a==res.s_a){
|
||
html1+=' class="layui-this"';
|
||
this_tab_title=arr_tab[i].title;
|
||
}
|
||
html1+='>'+arr_tab[i].title+'</li>';
|
||
}
|
||
$(".layui-tab-title").html(html1);
|
||
|
||
if(this_tab_no=="gl"){
|
||
var arr_th_zd=res.th_zd;
|
||
var html1="";
|
||
html1+='<div style="margin-top:5px;"><form class="layui-form" id="form1_search">';
|
||
html1+='<div class="layui-input-inline" style="width:150px;"><input id="s_no" name="s_no" type="text" class="layui-input searchVal" placeholder="款号" value="'+res.s_no+'" /></div> ';
|
||
//html1+='<div class="layui-input-inline">';
|
||
|
||
for(var s=0;s<arr_th_zd.length;s++){
|
||
|
||
html1+='<input type="checkbox" name="s_zd" value="'+arr_th_zd[s]["no"]+'" lay-skin="primary" title="'+arr_th_zd[s]["title"]+'"';
|
||
if(arr_th_zd[s]["sign"]=="y"){
|
||
html1+=' checked="" ';
|
||
}
|
||
html1+='>';
|
||
}
|
||
|
||
//html1+='</div>';
|
||
html1+='<a id="form1_submit2" class="layui-btn layui-btn-normal"> 搜 索 </a><a class="layui-btn btn_showall">显示全部</a>';
|
||
html1+='</form></div>';
|
||
$("#detail_show").html(html1);
|
||
//显示全部
|
||
$(".btn_showall").click(function(){
|
||
var url='./?_m=pj_report&_a='+this_tab_no;
|
||
tableIns.reload({url:url});
|
||
})
|
||
//
|
||
$("#form1_submit2").click(function(){
|
||
var s_no2="";
|
||
s_no2=$("#s_no").val();
|
||
var zd_array=new Array();
|
||
var zd_array2=new Array();
|
||
$('input[name="s_zd"]:checked').each(function(){
|
||
zd_array.push($(this).val());
|
||
});
|
||
//console.log(zd_array2);
|
||
var url='./?_m=pj_report&_a='+this_tab_no+'&s_zd='+zd_array+'&s_no='+s_no2;
|
||
|
||
cols[0]={field: 'ct', title: '次序', align:"center"};
|
||
cols[1]={field: 'kh', title: '款号',align:'center'};
|
||
var gs=2;
|
||
$('input[name="s_zd"]:checked').each(function(){
|
||
cols[gs]={field: $(this).val(), title: $(this).attr('title'),align:'center'};
|
||
gs++;
|
||
});
|
||
cols[gs]={field: 'pjf', title: '平均分',align:'center' ,sort: true};
|
||
gs++;
|
||
cols[gs]={field: 'zf', title: '总分',align:'center' ,templet:'#tplzf',sort: true};
|
||
gs++;
|
||
cols[gs]={field: 'zkhs', title: '总客户数',align:'center'};
|
||
gs++;
|
||
cols[gs]={field: 'fs5', title: '5星',align:'center'};
|
||
gs++;
|
||
cols[gs]={field: 'fs4', title: '4星',align:'center'};
|
||
gs++;
|
||
cols[gs]={field: 'fs3', title: '3星',align:'center'};
|
||
gs++;
|
||
cols[gs]={field: 'fs2', title: '2星',align:'center'};
|
||
gs++;
|
||
cols[gs]={field: 'fs1', title: '1星',align:'center'};
|
||
tableIns.reload({
|
||
cols:[cols],
|
||
url:url
|
||
});
|
||
});
|
||
form.render();
|
||
}else{
|
||
var html1="";
|
||
html1+='<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_export">导出数据</a></div> ';
|
||
html1+='<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_del">删除</a></div> ';
|
||
html1+='<div class="layui-inline"><a class="layui-btn btn_showall">显示全部</a></div>';
|
||
html1+='<div style="margin-top:5px;"><form class="layui-form" id="form1_search">';
|
||
html1+='<div class="layui-input-inline" style="width:150px;"><input id="s_client" name="s_client" type="text" class="layui-input searchVal" placeholder="客户" value="'+res.s_client+'" /></div> ';
|
||
html1+='<div class="layui-input-inline" style="width:150px;"><input id="s_no" name="s_no" type="text" class="layui-input searchVal" placeholder="款号" value="'+res.s_no+'" /></div> ';
|
||
html1+='<div class="layui-input-inline" style="width:150px;"><input id="s_xh" name="s_xh" type="text" class="layui-input searchVal" placeholder="序号" value="'+res.s_xh+'" /></div> ';
|
||
html1+='<a id="form1_submit" class="layui-btn layui-btn-normal"> 搜 索 </a>';
|
||
html1+='</form></div>';
|
||
|
||
$("#detail_show").html(html1);
|
||
|
||
$("#s_client").on("click",autocomp());
|
||
$(".btn_export").click(function(){
|
||
export_excel();
|
||
})
|
||
|
||
//批量删除
|
||
$(".btn_del").click(function(){
|
||
var checkStatus = table.checkStatus('pj_reportTable'),
|
||
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=pj_report&_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("请选择需要删除的记录");
|
||
}
|
||
});
|
||
//
|
||
$("#form1_submit").click(function(){
|
||
var s_client2=s_no2=s_xh2="";
|
||
s_client2=$("#s_client").val();
|
||
s_no2=$("#s_no").val();
|
||
s_xh2=$("#s_xh").val();
|
||
var url='./?_m=pj_report&_a='+this_tab_no+'&s_client='+s_client2+'&s_no='+s_no2+'&s_xh='+s_xh2;
|
||
tableIns.reload({url:url});
|
||
});
|
||
//显示全部
|
||
$(".btn_showall").click(function(){
|
||
var url='./?_m=pj_report&_a='+this_tab_no;
|
||
tableIns.reload({url:url});
|
||
})
|
||
form.render();
|
||
}
|
||
|
||
|
||
element.render('tab1');
|
||
|
||
}
|
||
});
|
||
|
||
//点击tab
|
||
element.on('tab(tab1)', function(data){
|
||
this_tab_title=this.innerHTML;
|
||
for(var i=0;i<arr_tab.length;i++){
|
||
if(arr_tab[i].title==this_tab_title){
|
||
this_tab_no=arr_tab[i]._a;
|
||
}
|
||
}
|
||
var url='./?_m=pj_report&_a='+this_tab_no;
|
||
|
||
var cols=[];
|
||
if(this_tab_no=="gl"){
|
||
cols[0]={field: 'ct', title: '次序', align:"center"};
|
||
cols[1]={field: 'kh', title: '款号',align:'center'};
|
||
cols[2]={field: 'pjf', title: '平均分',align:'center' ,sort: true};
|
||
cols[3]={field: 'zf', title: '总分',align:'center' ,templet:'#tplzf',sort: true};
|
||
cols[4]={field: 'zkhs', title: '总客户数',align:'center'};
|
||
cols[5]={field: 'fs5', title: '5星',align:'center'};
|
||
cols[6]={field: 'fs4', title: '4星',align:'center'};
|
||
cols[7]={field: 'fs3', title: '3星',align:'center'};
|
||
cols[8]={field: 'fs2', title: '2星',align:'center'};
|
||
cols[9]={field: 'fs1', title: '1星',align:'center'};
|
||
tableIns.reload({
|
||
cols:[cols],
|
||
height : "full-190",
|
||
page : false,
|
||
url:url
|
||
});
|
||
}else{
|
||
cols[0]={type: "checkbox", width:50};
|
||
cols[1]={field: 'ct', title: '次序', align:"center" ,sort: true};
|
||
cols[2]={field: 'kh', title: '款号',align:'center' ,sort: true};
|
||
cols[3]={field: 'xh', title: '序号',align:'center'};
|
||
cols[4]={field: 'client', title: '客户',align:'center'};
|
||
cols[5]={field: 'xj', title: '星级',align:'center' ,sort: true};
|
||
cols[6]={field: 'remark', title: '文字',align:'center' };
|
||
cols[7]={field: 'pjtime', title: '评价时间',align:'center' ,sort: true};
|
||
|
||
tableIns.reload({
|
||
cols:[cols],
|
||
page : true,
|
||
height : "full-190",
|
||
limit:20,
|
||
limits : [10,20,30,50,100],
|
||
url:url
|
||
});
|
||
}
|
||
|
||
});
|
||
|
||
//列表操作
|
||
table.on('tool(layui_table)', function(obj){
|
||
var layEvent = obj.event,
|
||
data = obj.data;
|
||
if(layEvent === 'openDetail'){
|
||
var index = layui.layer.open({
|
||
title : data.kh+"-评价明细",
|
||
type : 2,
|
||
offset: 'r',
|
||
area: ['600px', '550px'],
|
||
content : "pj_report_openDetail.htm?id="+data.khid,
|
||
success : function(layero, index){
|
||
//
|
||
}
|
||
})
|
||
}
|
||
});
|
||
|
||
//导出
|
||
function export_excel(){
|
||
var index = layui.layer.open({
|
||
title : "导出资料",
|
||
type : 2,
|
||
content : "pj_report_export.htm",
|
||
})
|
||
layui.layer.full(index);
|
||
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
||
$(window).on("resize",function(){
|
||
layui.layer.full(index);
|
||
})
|
||
}
|
||
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|