反馈详情
MeetingFeedBackDao.java
/** * 根据会议ID获取会议反馈详情信息 * @param back * @return */ @SuppressWarnings("unchecked") public List<Map<String,Object>> queryBackPersons(MeetiingFeedback back){ String sql="select " + "f.result,GROUP_CONCAT(u.name) as name " + "from " + "t_oa_meeting_feedback f,t_oa_user u " + "where f.personId=u.id and meetingId="+back.getMeetingId()+" group by f.result"; System.out.println(sql); return super.executeQuery(sql, null, new convert<Map<String,Object>>() { @Override public List<Map<String, Object>> forEach(ResultSet rs) throws Exception { return CommonUtils.toList(rs); } }); }
MeetingFeedBackAction.java
/** * 查询会议相关人员的反馈信息 * @param req * @param resp */ public void listMeetingFeedback(HttpServletRequest req, HttpServletResponse resp) { try { PageBean pageBean = new PageBean(); pageBean.setRequest(req); List<MeetiingFeedback> list = service.listMeetingFeedback(meetingFeedback, pageBean); CommonUtil.sendResponse(0, "会议反馈查询成功", pageBean.getTotal(), list, resp); } catch (Exception e) { e.printStackTrace(); CommonUtil.sendResponse(0, "会议反馈查失败", resp); } }
myMeeting.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <%@ include file="/common/head.jsp" %> <title>Insert title here</title> <style> .layui-inline { margin-top: 20px; } .seatPicDiv { height: 180px; } .seatPic:active { height: 360px; } .layui-layer-page .layui-layer-content { /* 解决送审对话框中人员选择下拉框不能完全显示问题 */ overflow: visible;!important } </style> </head> <body> <!-- 查询条件 --> <div class="layui-inline"> <label class="layui-form-label">标题:</label> <div class="layui-input-block"> <input type="text" name="title" id="title" placeholder="会议标题" class="layui-input"> </div> </div> <div class="layui-inline"> <button class="layui-btn" id="queryMeetingInfo"><i class="layui-icon layui-icon-search"></i>查询</button> </div> <!-- 用户信息表格 --> <table class="layui-hide" id="meetingInfoTable" lay-filter="meetingInfoTable"></table> <!-- 使用了layui自定义语法,当会议不能送审或排座时将按钮显示为禁用状态 --> <script type="text/html" id="toolbar"> {{# if(d.state==1 || d.state==3){ }} <button class="layui-btn layui-btn-sm" lay-event="seat">排座</button> <button class="layui-btn layui-btn-sm" lay-event="send">送审</button> {{# } else{ }} <button class="layui-btn layui-btn-sm layui-btn-disabled" lay-event="seat">排座</button> <button class="layui-btn layui-btn-sm layui-btn-disabled" lay-event="send">送审</button> {{# } }} <button class="layui-btn layui-btn-sm" lay-event="feedback">反馈</button> </script> <!-- 送审对话框内容 --> <div id="auditDiv" style="display:none;"> <form style="margin:20px 15px;" class="layui-form layui-form-pane" id="sendAudit" lay-filter="sendAudit"> <div class="layui-inline"> <label class="layui-form-label">送审人</label> <div class="layui-input-inline"> <select name="auditPerson" xm-select="auditPerson" xm-select-radio> <option value="" disabled="disabled">--请选择--</option> </select> </div> <div class="layui-input-inline"> <!-- <button id="btn_auditor" class="layui-btn" lay-filter="sendAudit">送审</button> --> <button type="button" id="sendAudit" lay-submit lay-filter="sendAudit" class="layui-btn layui-btn-normal">送审</button> </div> </div> </form> </div> </body> </html>
myMeeting.js
<script> let table=null; let $ = null; var row = null; let formSelects = null; let form = null; let layer = null; layui.use(['table','jquery','formSelects','form','layer'], function(){ table = layui.table; $ = layui.jquery; formSelects = layui.formSelects; form = layui.form; layer = layui.layer; loadMeetingInfo(); //查询我的会议信息 $("#queryMeetingInfo").click(function() { loadMeetingInfo(); }); //对表格的功能按钮增加事件监听,如排座,送审,反馈按钮 table.on('tool(meetingInfoTable)', function(obj) { //排座 if(obj.event == 'seat') { //对于新建或驳回状态的会议可以执行排座 if(obj.data.state == 1 || obj.data.state == 3) { openSeatPic(obj.data.id); } else { layer.msg("对于审核通过,结束,取消,进行中等状态的会议不能再执行排座") } } //送审 if(obj.event == 'send') { if(obj.data.seatPic) { //对于新建或驳回状态的会议可以送审 if(obj.data.state == 1 || obj.data.state == 3) { openSendAudit(obj.data.id); } else { layer.msg("对于审核通过,结束,取消,进行中等状态的会议不能执行送审"); } } else { layer.msg("未进行排座不能送审"); } } //查看反馈 if(obj.event == 'feedback') { openFeedbackInfo(obj.data); } }); }); function openFeedbackInfo(data) { let ignore = [0,1,2,3]; if(ignore.indexOf(data.state) >= 0) { layer.msg("对于新建、驳回、取消、待审状态下的会议,不用查看反馈"); return; } debugger; layer.open({ type: 2, //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) title:'反馈详情', area: ['600px', '650px'], //宽高 skin: 'layui-layer-rim', //样式类名 content: ctx+'/jsp/meeting/meetingFeedback.jsp?meetingId=' + data.id, btn:['关闭'], yes:function(index,layero){ layer.closeAll(); } }); } // 打开送审的对话框,执行送审 function openSendAudit(id) { let index = layer.open({ type: 1, //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) title: '送审', area: ['660px', '200px'], //宽高 skin: 'layui-layer-rim', //样式类名 content: $("#auditDiv") //送审对应的div }); //初始化送审人员选择下拉列表的数据 formSelects.data('auditPerson', 'server', { url: ctx + '/meetinginfoAction.action?methodName=listMeetingMember' }); //添加送审按钮的监听事件,发送ajax请求执行送审 form.on('submit(sendAudit)', function(data) { console.log(data); data.field["id"] = id; console.log(data); $.ajax({ url: ctx + '/meetinginfoAction.action?methodName=sendAudit', data: data.field, type: 'post', dataType: 'json', success: function(resp) { layer.msg(resp.msg); layer.close(index); //送审成功,更新我的会议列表 loadMeetingInfo(); } }) }); } //会议排座 function openSeatPic(id) { row = null; layer.open({ type: 2, //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) title: '会议排座', area: ['660px', '350px'], //宽高 skin: 'layui-layer-rim', //样式类名 content: ctx+'/jsp/meeting/seatPic.jsp?id='+id }); }; //查询会议信息 function loadMeetingInfo() { table.render({ elem: '#meetingInfoTable', url: ctx + '/meetinginfoAction.action?methodName=listMeetingInfo', cols: [[ {field:'id', width:60, title: 'ID'}, {field:'title', width:180, title: '会议标题', sort: true}, {field:'location', width:180, title: '会议地点', sort: true}, {field:'startTime', width:160, title: '开始时间'}, {field:'endTime', width:160, title: '结束时间'}, {field:'meetingState', width:180, title: '会议状态'}, //显示排座图片 {field: 'seatPic', title: '会议排座', width: 180, templet:function(d){ if(null==d.seatPic) return "尚未排座"; else return "<img height='180px' src='"+d.seatPic+"'/>"; } }, {field: '', title: '操作', width: 250, toolbar:'#toolbar'} ]], page: true, request: { pageName: 'page', limitName: 'rows' }, method: 'post', where: { title: $("#title").val() }, loading: true, }); } </script>