meetingNotify.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 == 'feeback') { openFeebackDialog(obj.data); } }); }); var row = null; function openFeebackDialog(data) { row = data; layer.open({ type: 2, //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) title:'会议反馈', area: ['654px', '420px'], //宽高 skin: 'layui-layer-rim', //样式类名 content: ctx + '/jsp/meeting/addFeedBack.jsp', //弹出内容。可以传入普通的html内容,还可以指定DOM,更可以随着type的不同而不同 btn: ['确定', '关闭'], yes: function(index,layero) { let formData = $(layero).find("iframe")[0].contentWindow.getFormData(); console.log(formData); addMeetingFeedback(formData); }, btn2: function(index,layero){ } }); } //查询会议信息 function loadMeetingInfo() { table.render({ elem: '#meetingInfoTable', url: ctx + '/meetinginfoAction.action?methodName=listRelatedMeetingInfoByUserId', cols: [[ {field:'id', width:80, title: 'ID'}, {field:'title', width:180, title: '会议标题', sort: true}, {field:'location', width:180, title: '会议地点', sort: true}, {field:'startTime', width:180, title: '开始时间'}, {field:'endTime', width:180, title: '结束时间'}, {field:'meetingState', width:180, title: '会议状态'}, {fixed:'right', title: '操作', width:200, align:'left', unresize: true, toolbar:'#toolbar'} ]], page: true, request: { pageName: 'page', limitName: 'rows' }, method: 'post', where: { title: $("#title").val() }, loading: true, }); } </script>
是否参会
MeetingFeedBackDao.java
/** * 新增会议反馈 * @param back */ public void addMeetingFeedback(MeetiingFeedback back) { String sql="insert into t_oa_meeting_feedback(meetingId,personType,personId,result,reason) values(?,?,?,?,?)"; super.executeUpdate(sql, new Object[] { back.getMeetingId(), back.getPersonType(), back.getPersonId(), back.getResult(), back.getReason() }); }
MeetingFeedBackAction.java
/** * 增加会议反馈 * @param req * @param resp */ public void addMeetingFeedback(HttpServletRequest req, HttpServletResponse resp) { try { service.addMeetingFeedback(meetingFeedback); CommonUtil.sendResponse(0, "会议反馈成功", resp); } catch (Exception e) { e.printStackTrace(); CommonUtil.sendResponse(0, "会议反馈失败", resp); } }
meetingNotify.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 == 'feeback') { openFeebackDialog(obj.data); } }); }); var row = null; function openFeebackDialog(data) { row = data; layer.open({ type: 2, //layer提供了5种层类型。可传入的值有:0(信息框,默认)1(页面层)2(iframe层)3(加载层)4(tips层) title:'会议反馈', area: ['654px', '420px'], //宽高 skin: 'layui-layer-rim', //样式类名 content: ctx + '/jsp/meeting/addFeedBack.jsp', //弹出内容。可以传入普通的html内容,还可以指定DOM,更可以随着type的不同而不同 btn: ['确定', '关闭'], yes: function(index,layero) { let formData = $(layero).find("iframe")[0].contentWindow.getFormData(); console.log(formData); addMeetingFeedback(formData); }, btn2: function(index,layero){ } }); } //增加会议反馈 function addMeetingFeedback(param) { $.ajax({ url: ctx + "/meetingFeedbackAction.action?methodName=addMeetingFeedback", data: param, type: 'post', dataType: 'json', success: function(resp) { layer.msg(resp.msg,{ icon: 1, time: 2000 //2秒关闭(如果不配置,默认是3秒) },function() { layer.closeAll(); }); } }); } //查询会议信息 function loadMeetingInfo() { table.render({ elem: '#meetingInfoTable', url: ctx + '/meetinginfoAction.action?methodName=listRelatedMeetingInfoByUserId', cols: [[ {field:'id', width:80, title: 'ID'}, {field:'title', width:180, title: '会议标题', sort: true}, {field:'location', width:180, title: '会议地点', sort: true}, {field:'startTime', width:180, title: '开始时间'}, {field:'endTime', width:180, title: '结束时间'}, {field:'meetingState', width:180, title: '会议状态'}, {fixed:'right', title: '操作', width:200, align:'left', unresize: true, toolbar:'#toolbar'} ]], page: true, request: { pageName: 'page', limitName: 'rows' }, method: 'post', where: { title: $("#title").val() }, loading: true, }); } </script>
addFeedBack.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <%@include file="/common/head.jsp" %> </head> <style> body{ margin:5px; } </style> <body> <div style="padding:10px;"> <!-- 反馈表单 --> <form class="layui-form layui-form-pane" lay-filter="back"> <input type="hidden" name="meetingId" id="meetingId"/> <input type="hidden" name="personId" value="${sessionScope.user.id }"/> <div class="layui-form-item"> <label class="layui-form-label">人员类型</label> <div class="layui-input-block"> <!-- <select id="personType" name="personType"> <option value="">请选择人员类型</option> <option value="1">参会</option> <option value="2">列席</option> </select> --> <input type="hidden" name="personType" id="personType"/> <input type="text" id="personTypeName" autocomplete="off" readonly="readonly" class="layui-input"> </div> </div> <div class="layui-form-item" pane=""> <label class="layui-form-label">反馈结果</label> <div class="layui-input-block" > <!-- <select id="result" name="result"> <option value="">请选择反馈结果</option> <option value="1">参加</option> <option value="2">不参加</option> </select> --> <input type="radio" name="result" value="1" title="参加" checked> <input type="radio" name="result" value="2" title="不参加"> </div> </div> <div class="layui-form-item layui-form-text"> <label class="layui-form-label">不参与会议的原因</label> <div class="layui-input-block"> <textarea placeholder="请输入内容" name="reason" class="layui-textarea"></textarea> </div> </div> </form> </div> </body> </html>
addFeedBack.js
<script> let form = null; layui.use(['jquery', 'form'], function() { let $ = layui.$; form = layui.form; //获取会议记录信息 let data = parent.row || {}; //获取当前登录用户ID let currentUserId = '${sessionScope.user.id}'; //设置会议ID $("#meetingId").val(data.id); //判断当前用户是存在与参与者中,如果是则设置人员类型为参与者 let canyuze = data.canyuze.split(","); if(canyuze.indexOf(currentUserId) > -1) { $("#personTypeName").val("参与者"); $("#personType").val("1"); } //判断当前用户是存在与列席者中,如果是则设置人员类型为列席者 let liexize = data.liexize.split(","); if(liexize.indexOf(currentUserId) > -1) { $("#personTypeName").val("列席者"); $("#personType").val("2"); } }); //获取表单数据,在父窗口(会议通知)会调用该方法获取表单数据用于提交 function getFormData() { return form.val('back'); } </script>