初始化
This commit is contained in:
@@ -0,0 +1,362 @@
|
||||
<%@page import="com.ifish.enums.ReplyTypeEnum"%>
|
||||
<%@page import="com.ifish.enums.SysUserEnum"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>问题反馈</title>
|
||||
<!-- css and js -->
|
||||
<%@ include file="../htm/script.jsp" %>
|
||||
|
||||
<script type="text/javascript">
|
||||
var dataTable = null;
|
||||
$(function(){
|
||||
//模态框
|
||||
$('#myModal').modal({
|
||||
backdrop:'static',
|
||||
show:false
|
||||
});
|
||||
$("#zhipaiModal").modal({
|
||||
backdrop:'static',
|
||||
show:false
|
||||
});
|
||||
//关闭
|
||||
$(".closeIcon").click(function(){
|
||||
$('#myModal').modal("hide");
|
||||
$('#zhipaiModal').modal("hide");
|
||||
});
|
||||
//分页
|
||||
dataTable = $('#sample-table-1').dataTable({
|
||||
"sPaginationType": "bootstrap",
|
||||
//"bProcessing": true,
|
||||
"bServerSide": true,//指定从服务器端获取数据
|
||||
"sAjaxSource": "<%=basePath%>page/admin/questionInf.do",
|
||||
"fnServerData": function(sSource, aoData, fnCallback){
|
||||
//查询参数
|
||||
var searchClass = $(".searchClass");
|
||||
for (var i = 0; i < searchClass.length; i++) {
|
||||
var id = $(searchClass[i]).attr("id");
|
||||
var value = $(searchClass[i]).val();
|
||||
aoData.push({"name":id,"value":value});
|
||||
}
|
||||
$.ajax({
|
||||
"dataType": "json",
|
||||
"type": "POST",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"cache": false,
|
||||
"success": function(json){
|
||||
fnCallback(json);
|
||||
}
|
||||
});
|
||||
},
|
||||
"aoColumns": [
|
||||
{ "mData": function(question){
|
||||
return '<input type="checkbox" value="'+question.questionId+'" class="ace checkboxs"/><span class="lbl"></span>';
|
||||
},
|
||||
"bSortable": false,
|
||||
"sClass":"center"
|
||||
},
|
||||
{ "mData": "questionId","bSortable": false, "sClass":"center"},
|
||||
{ "mData": "createTime","bSortable": false},
|
||||
{ "mData": "userId","bSortable": false },
|
||||
{ "mData": function(question){
|
||||
return '<a href="<%=basePath%>page/admin/userDetail.do?userId='+question.userId+'" target="_blank">'+question.phoneNumber+'</a>';
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
{ "mData": function(question){
|
||||
if(question.replyType=="<%=ReplyTypeEnum.shiyong.getKey()%>"){
|
||||
return "<%=ReplyTypeEnum.shiyong.getValue()%>";
|
||||
}
|
||||
else if(question.replyType=="<%=ReplyTypeEnum.zhiliang.getKey()%>"){
|
||||
return "<%=ReplyTypeEnum.zhiliang.getValue()%>";
|
||||
}
|
||||
else{
|
||||
return "";
|
||||
}
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
{ "mData": "questionContent","bSortable": false },
|
||||
{ "mData": function(question){
|
||||
if(question.isReply=="1"){
|
||||
return question.questionReply;
|
||||
}
|
||||
else{
|
||||
return '<span class="label label-danger arrowed">未回复</span>';
|
||||
}
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
{ "mData": "replyTime","bSortable": false},
|
||||
{ "mData": function(question){
|
||||
return '<a href="javascript:void(0);" onclick="reply('+question.questionId+','+question.userId+')" title="回复" class="label label-primary"><span class="icon-edit align-top"></span></a>';
|
||||
},
|
||||
"bSortable": false,
|
||||
"sClass":"center"
|
||||
},
|
||||
{ "mData": function(question){
|
||||
return ' <a href="javascript:void(0);" onclick="zhipai('+question.questionId+')" title="指派" class="label label-success"><span class="icon-share-alt align-top"></span></a>';
|
||||
},
|
||||
"bSortable": false,
|
||||
"sClass":"center"
|
||||
}
|
||||
],
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "每页显示 _MENU_条",
|
||||
"sZeroRecords": "没有找到符合条件的数据",
|
||||
"sInfo": "当前第 _START_ - _END_ 条 共计 _TOTAL_ 条",
|
||||
"sProcessing": "<img src='<%=basePath%>static/css/images/loading.gif'>",
|
||||
"sInfoEmpty": "木有记录",
|
||||
"sInfoFiltered": "(从 _MAX_ 条记录中过滤)",
|
||||
"sSearch": "<select id='searchField' class='searchClass' style='height:25px'><option value='userId'>用户ID</option><option value='questionContent'>提交内容</option></select>:",
|
||||
"oPaginate": {
|
||||
"sFirst": "首页",
|
||||
"sPrevious": "前一页",
|
||||
"sNext": "后一页",
|
||||
"sLast": "尾页"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("table th input:checkbox").on("click" , function(){
|
||||
var that = this;
|
||||
$(this).closest('table').find('tr > td:first-child input:checkbox').each(function(){
|
||||
this.checked = that.checked;
|
||||
$(this).closest('tr').toggleClass('selected');
|
||||
});
|
||||
});
|
||||
|
||||
//查询
|
||||
$("#sample-table-1_filter").prepend('回复状态: <select class="searchClass" id="selectField" style="height:25px"></select> ');
|
||||
$("#selectField").html('<option value="">请选择</option><option value="0">未回复</option><option value="1">已回复</option>');
|
||||
//$("#sample-table-1_filter").prepend('排序方式: <select class="searchClass" id="sortMode" style="height:25px"></select> ');
|
||||
//$("#sortMode").html('<option value="">请选择</option><option value="asc">升序↑</option><option value="desc">降序↓</option>');
|
||||
//$("#sample-table-1_filter").prepend('排序字段: <select class="searchClass" id="sortField" style="height:25px"></select> ');
|
||||
//$("#sortField").html('<option value="">请选择</option><option value="createTime">提交时间</option><option value="replyTime">回复时间</option>');
|
||||
$("#sample-table-1_filter").prepend('反馈类型: <select class="searchClass" id="selectField1" style="height:25px"></select> ');
|
||||
$("#selectField1").html('<option value="">请选择</option><option value="<%=ReplyTypeEnum.zhiliang.getKey()%>"><%=ReplyTypeEnum.zhiliang.getValue()%></option><option value="<%=ReplyTypeEnum.shiyong.getKey()%>"><%=ReplyTypeEnum.shiyong.getValue()%></option>');
|
||||
$(".searchClass").change(function(){
|
||||
dataTable.fnDraw();
|
||||
});
|
||||
|
||||
$("#sample-table-1_length").append(' <label><a href="javascript:void(0)" onclick="deleteAll()" class="btn btn-xs btn-danger"><i class="icon-trash"></i><span class="no-text-shadow">删除</span></a></label>');
|
||||
|
||||
//保存
|
||||
$("#zhipaiSaveBtn").click(function(){
|
||||
var loginAccount = $("#loginAccount").val();
|
||||
if(loginAccount==null || loginAccount==""){
|
||||
jAlert('指派的用户不能为空!', '提示');
|
||||
return false;
|
||||
}
|
||||
$("#zhipaiSaveBtn").attr("disabled",true);
|
||||
$("#zhipaiForm").submit();
|
||||
});
|
||||
$("#replaySaveBtn").click(function(){
|
||||
var questionReply = $("#questionReply").val();
|
||||
if(questionReply=="" || questionReply.length<5){
|
||||
jAlert('回复的内容不能少于5个字!', '提示');
|
||||
return false;
|
||||
}
|
||||
$("#replaySaveBtn").attr("disabled",true);
|
||||
$("#replayForm").submit();
|
||||
});
|
||||
//异步提交
|
||||
$("#replayForm,#zhipaiForm").ajaxForm(function(data){
|
||||
//弹出ajax请求后的回调结果
|
||||
if(data==true){
|
||||
//刷新当前页面
|
||||
$('.modal').modal("hide");
|
||||
refreshTable();
|
||||
jAlert('成功!', '提示');
|
||||
}
|
||||
else{
|
||||
//刷新当前页面
|
||||
refreshTable();
|
||||
jAlert('失败!', '提示');
|
||||
}
|
||||
$("#zhipaiSaveBtn").attr("disabled",false);
|
||||
$("#replaySaveBtn").attr("disabled",false);
|
||||
});
|
||||
});
|
||||
//刷新当前页
|
||||
function refreshTable(){
|
||||
var iDisplayStart = dataTable.fnSettings()._iDisplayStart;
|
||||
var iDisplayLength = dataTable.fnSettings()._iDisplayLength;
|
||||
var pageNum = (iDisplayStart+iDisplayLength)/iDisplayLength;
|
||||
dataTable.fnPageChange(--pageNum,true);
|
||||
}
|
||||
function reply(id,uId){
|
||||
$("#questionId").val(id);
|
||||
$("#userId").val(uId);
|
||||
$("#questionReply").val("");
|
||||
$('#myModal').modal("show");
|
||||
}
|
||||
function zhipai(id){
|
||||
$("#questionId2").val(id);
|
||||
$('#zhipaiModal').modal("show");
|
||||
}
|
||||
function deleteAll(){
|
||||
var array = new Array();
|
||||
$(".checkboxs:checked").each(function(){
|
||||
array.push($(this).val());
|
||||
});
|
||||
if(array.toString()==""){
|
||||
alert("请选择要删除的数据");
|
||||
}
|
||||
else{
|
||||
var r = confirm("确定要删除吗?");
|
||||
if (r == true) {
|
||||
location.href="<%=basePath%>page/admin/deleteQuestion.do?ids="+array.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 头部 -->
|
||||
<%@ include file="../htm/header.jsp" %>
|
||||
<!-- 主体 -->
|
||||
<div class="main-container" id="main-container">
|
||||
<div class="main-container-inner">
|
||||
<!-- 侧边栏 -->
|
||||
<%@ include file="../htm/sidebar.jsp" %>
|
||||
<!-- 主体内容 -->
|
||||
<div class="main-content">
|
||||
<div class="breadcrumbs" id="breadcrumbs">
|
||||
<script type="text/javascript">
|
||||
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
|
||||
</script>
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="icon-home home-icon"></i>
|
||||
<a href="<%=basePath%>page/public/index.do">首页</a>
|
||||
</li>
|
||||
<li class="active">问题反馈</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<c:set var="success100" value="<%=SysUserEnum.success100.getKey()%>"></c:set>
|
||||
<c:set var="failed101" value="<%=SysUserEnum.failed101.getKey()%>"></c:set>
|
||||
<c:if test="${status == success100}">
|
||||
<div class="alert alert-block alert-success">
|
||||
<i class="icon-ok green">操作<%=SysUserEnum.success100.getValue()%></i>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${status == failed101}">
|
||||
<div class="alert alert-block alert-danger">
|
||||
<i class="icon-remove red">操作<%=SysUserEnum.failed101.getValue()%></i>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="table-header"></div>
|
||||
<div class="table-responsive">
|
||||
<table id="sample-table-1" class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="center">
|
||||
<label>
|
||||
<input type="checkbox" class="ace" />
|
||||
<span class="lbl"></span>
|
||||
</label>
|
||||
</th>
|
||||
<th class="center">ID</th>
|
||||
<th>提交时间</th>
|
||||
<th>用户ID</th>
|
||||
<th>手机号</th>
|
||||
<th>反馈类型</th>
|
||||
<th>提交内容</th>
|
||||
<th>回复内容</th>
|
||||
<th>回复时间</th>
|
||||
<th class="center">回复</th>
|
||||
<th class="center">指派</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="<%=basePath%>page/admin/replyQuestion.do" method="post" id="replayForm">
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close closeIcon">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">回复</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input type="hidden" name="userId" id="userId">
|
||||
<input type="hidden" name="isReply" value="1">
|
||||
<input type="hidden" name="questionId" id="questionId">
|
||||
<textarea name="questionReply" id="questionReply" style="width:100%" placeholder="请输入回复的内容!字数控制在5~50个字之间!" required="required" maxlength="50"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default closeIcon">关闭</button>
|
||||
<button type="submit" id="replaySaveBtn" class="btn btn-primary">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form action="<%=basePath%>page/admin/appointQuestion.do" class="form-horizontal" method="post" id="zhipaiForm">
|
||||
<div class="modal fade" id="zhipaiModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="closeIcon close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">问题指派</h4>
|
||||
</div>
|
||||
<div class="modal-body row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label no-padding-right">指派给<span style="color:red;">*</span></label>
|
||||
<div class="col-xs-8">
|
||||
<input type="hidden" name="questionId" id="questionId2">
|
||||
<select class="form-control" name="loginAccount" id="loginAccount" required="required">
|
||||
<optgroup label="电子厂">
|
||||
<c:forEach items="${factoryMap }" var="factory">
|
||||
<option value="${factory.key }">${factory.key }【${factory.value }】</option>
|
||||
</c:forEach>
|
||||
</optgroup>
|
||||
<optgroup label="鱼缸厂">
|
||||
<c:forEach items="${venderMap }" var="vender">
|
||||
<option value="${vender.key }">${vender.key }【${vender.value }】</option>
|
||||
</c:forEach>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label no-padding-right">反馈类型<span style="color:red;">*</span></label>
|
||||
<div class="col-xs-8">
|
||||
<select class="form-control" name="replyType">
|
||||
<option value="<%=ReplyTypeEnum.zhiliang.getKey()%>"><%=ReplyTypeEnum.zhiliang.getValue()%></option>
|
||||
<option value="<%=ReplyTypeEnum.shiyong.getKey()%>"><%=ReplyTypeEnum.shiyong.getValue()%></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="closeIcon btn btn-default">关闭</button>
|
||||
<button type="submit" id="zhipaiSaveBtn" class="btn btn-primary">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 设置工具 -->
|
||||
<%@ include file="../htm/setting.jsp" %>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user