7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
192 lines
6.1 KiB
HTML
192 lines
6.1 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_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>
|
|
<form class="layui-form" id="form1_search" action="survey.htm" method="get">
|
|
<div class="layui-input-inline" style="width:100px;" id="s_keyword"></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_xh">
|
|
<div class="yph">{{d.xh}}</div>
|
|
</script>
|
|
<script type="text/html" id="tpl_detail">
|
|
<div align="left"><a href="javascript:;" lay-event="edit">{{d.question}}</a></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=survey'+query_str;
|
|
var cols=[];
|
|
cols[0]={type: "checkbox", fixed:"left",width:50,style:"height:150px;"};
|
|
cols[1]={field: 'xh', title: '编号', width:90,align:"center"};
|
|
cols[2]={field: 'question', title: '问题描述', align:"center",templet:'#tpl_detail'};
|
|
cols[3]={field: 'single_t', title: '选项类型',width:150,align:'left'};
|
|
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 s_keyword=res.s_keyword;
|
|
var html1='<input id="s_keyword" name="s_keyword" type="text" class="layui-input searchVal" style="width:100px" value="'+s_keyword+'" />';
|
|
$("#s_keyword").html(html1);
|
|
|
|
form.render();
|
|
layer.close(index);
|
|
}
|
|
});
|
|
//导出
|
|
function export_excel(){
|
|
var index = layui.layer.open({
|
|
title : "导出问卷调查",
|
|
type : 2,
|
|
content : "survey_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 : "survey_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("请选择需要删除的记录");
|
|
}
|
|
})
|
|
//列表操作
|
|
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_cmmx").click(function(){
|
|
size_mx();
|
|
})
|
|
//搜索
|
|
form.on("submit(form1_submit)",function(data){
|
|
//弹出loading
|
|
return true;
|
|
})
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |