|
@@ -0,0 +1,258 @@
|
|
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
|
|
+<html>
|
|
|
|
|
+<head>
|
|
|
|
|
+ <title>积分排行榜</title>
|
|
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
|
+ // 初始化获取时间 laydate 日期选择器
|
|
|
|
|
+ layui.use('laydate', function() {
|
|
|
|
|
+ var laydate = layui.laydate;
|
|
|
|
|
+ laydate.render({ elem: '#gainBeginDate', event: 'focus', type: 'date', format: 'yyyy-MM-dd', trigger: 'click' });
|
|
|
|
|
+ laydate.render({ elem: '#gainEndDate', event: 'focus', type: 'date', format: 'yyyy-MM-dd', trigger: 'click' });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ var columnId = $("#columnId").val();
|
|
|
|
|
+ $(".list-tabs li").each(function(){
|
|
|
|
|
+ $(this).removeClass("active");
|
|
|
|
|
+ if($(this).attr('value') == columnId){
|
|
|
|
|
+ $(this).addClass("active");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ $(".list-tabs li").click(function(){
|
|
|
|
|
+ $(".list-tabs li").removeClass("active");
|
|
|
|
|
+ $(this).addClass("active");
|
|
|
|
|
+ $("#columnId").val($(this).attr('value'));
|
|
|
|
|
+ $("#searchForm").submit();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function search() {
|
|
|
|
|
+ $('#searchForm').submit();
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function resetSearch() {
|
|
|
|
|
+ var currentColumnId = $("#columnId").val();
|
|
|
|
|
+ $('#searchForm div.query input[type=text]').val('');
|
|
|
|
|
+ $('#searchForm div.query input[type=hidden]').val('');
|
|
|
|
|
+ $('#searchForm div.query select').val('');
|
|
|
|
|
+ $("#columnId").val(currentColumnId);
|
|
|
|
|
+ $('#searchForm').submit();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function openUserDetail(userId, userName) {
|
|
|
|
|
+ var columnId = $("#columnId").val() || '0';
|
|
|
|
|
+ var columnNames = {'0': '全部积分', '1': '基础积分', '2': '贡献积分'};
|
|
|
|
|
+ var typeName = columnNames[columnId] || '积分';
|
|
|
|
|
+ var url = '${ctx}/workKnowledgeBase/point/userDetail?userId=' + userId + '&userName=' + encodeURIComponent(userName || '') + '&columnId=' + columnId;
|
|
|
|
|
+ top.layer.open({
|
|
|
|
|
+ type: 2, area: ['85%', '80%'], title: (userName || '用户') + ' - ' + typeName + '明细',
|
|
|
|
|
+ maxmin: true, content: url, btn: ['关闭'], btn1: function(index) { top.layer.close(index); }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ </script>
|
|
|
|
|
+</head>
|
|
|
|
|
+<body>
|
|
|
|
|
+<div class="wrapper wrapper-content">
|
|
|
|
|
+ <sys:message content="${message}"/>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="list-form-tab contentShadow shadowLTR" id="tabDiv">
|
|
|
|
|
+ <ul class="list-tabs" >
|
|
|
|
|
+ <li value="0" class="active"><a>全部</a></li>
|
|
|
|
|
+ <li value="2"><a>贡献积分</a></li>
|
|
|
|
|
+ <li value="1"><a>基础积分</a></li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="layui-row">
|
|
|
|
|
+ <!-- 查询条件 -->
|
|
|
|
|
+ <div class="full-width fl">
|
|
|
|
|
+ <div class="contentShadow layui-row" id="queryDiv">
|
|
|
|
|
+ <form:form id="searchForm" modelAttribute="workKnowledgeBasePoint" action="${ctx}/workKnowledgeBase/point/rankingPage" method="post" class="form-inline">
|
|
|
|
|
+ <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
|
|
|
|
+ <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
|
|
|
|
+ <input id="columnId" name="columnId" type="hidden" value="${workKnowledgeBasePoint.columnId}"/>
|
|
|
|
|
+ <div class="commonQuery lw7">
|
|
|
|
|
+ <div class="layui-item query athird" style="width: 25%">
|
|
|
|
|
+ <label class="layui-form-label">人员名称:</label>
|
|
|
|
|
+ <div class="layui-input-block with-icon">
|
|
|
|
|
+ <sys:inquireselectUserNotReadolnyTow id="submitter" name="submitterId" value="${workKnowledgeBasePoint.submitterId}" labelName="submitterName" labelValue="${workKnowledgeBasePoint.submitterName}" cssStyle="background-color: #fff"
|
|
|
|
|
+ title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="layui-item query athird" style="width: 25%">
|
|
|
|
|
+ <label class="layui-form-label">人员部门:</label>
|
|
|
|
|
+ <div class="layui-input-block with-icon">
|
|
|
|
|
+ <sys:treeselect id="officeId" name="officeId" value="${workKnowledgeBasePoint.officeId}" labelName="officeName" labelValue="${workKnowledgeBasePoint.officeName}" cssStyle="background-color: #fff"
|
|
|
|
|
+ title="部门" url="/sys/office/treeDataAll?type=6" cssClass="form-control layui-input" allowInput="true" allowClear="true" notAllowSelectParent="true" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="layui-item query athird" style="width: 25%">
|
|
|
|
|
+ <label class="layui-form-label">获取时间:</label>
|
|
|
|
|
+ <div class="layui-input-block">
|
|
|
|
|
+ <input id="gainBeginDate" name="gainBeginDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
|
|
|
|
|
+ value="<fmt:formatDate value='${workKnowledgeBasePoint.gainBeginDate}' pattern='yyyy-MM-dd'/>"/>
|
|
|
|
|
+ <span class="group-sep">-</span>
|
|
|
|
|
+ <input id="gainEndDate" name="gainEndDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
|
|
|
|
|
+ value="<fmt:formatDate value='${workKnowledgeBasePoint.gainEndDate}' pattern='yyyy-MM-dd'/>"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="layui-item athird" style="width: 25%">
|
|
|
|
|
+ <div class="input-group">
|
|
|
|
|
+ <div class="layui-btn-group search-spacing">
|
|
|
|
|
+ <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="return search()">查询</button>
|
|
|
|
|
+ <button id="searchReset" type="button" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="clear:both;"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </form:form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 表格 + 分页 -->
|
|
|
|
|
+ <div class="full-width fl">
|
|
|
|
|
+ <div class="contentShadow layui-form contentDetails">
|
|
|
|
|
+ <div class="nav-btns">
|
|
|
|
|
+ <div class="layui-btn-group">
|
|
|
|
|
+ <button type="button" class="layui-btn layui-btn-sm layui-bg-blue" onclick="exportRanking()">
|
|
|
|
|
+ <i class="layui-icon"></i> 导出当前排行榜
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="clear: both;"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <table class="oa-table layui-table" id="contentTable"></table>
|
|
|
|
|
+ <table:page page="${page}"></table:page>
|
|
|
|
|
+ <div style="clear:both;"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|
|
|
|
|
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
|
|
|
|
|
+<script>
|
|
|
|
|
+ var rankingType = $('#columnId').val() || '0';
|
|
|
|
|
+
|
|
|
|
|
+ layui.use('table', function(){
|
|
|
|
|
+ var cols;
|
|
|
|
|
+ if (rankingType === '2') {
|
|
|
|
|
+ cols = [[
|
|
|
|
|
+ {field:'index', align:'center', title: '排名', width:60}
|
|
|
|
|
+ ,{field:'userName', align: 'center', title: '姓名', minWidth: 120, templet: function(d) {
|
|
|
|
|
+ var name = d.userName || '';
|
|
|
|
|
+ return '<a href="javascript:void(0)" class="attention-info" onclick="openUserDetail(\'' + d.userId + '\',\'' + name.replace(/'/g, "\\'") + '\')">' + name + '</a>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ,{field:'officeName', align: 'center', title: '所属部门', minWidth: 160}
|
|
|
|
|
+ ,{field:'mobile', align: 'center', title: '手机号', minWidth: 130, templet: function(d) { return d.mobile || d.phone || ''; }}
|
|
|
|
|
+ ,{field:'exchangedContributionPoint', align: 'center', title: '贡献已兑换', width: 110}
|
|
|
|
|
+ ,{field:'remainingContributionPoint', align: 'center', title: '贡献剩余', width: 100}
|
|
|
|
|
+ ,{field:'contributionPoint', align: 'center', title: '贡献积分(总获取)', width: 130, templet: function(d) {
|
|
|
|
|
+ return '<span style="color:#1565c0;font-weight:bold;">' + (d.contributionPoint || 0) + '</span>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ]];
|
|
|
|
|
+ } else if (rankingType === '1') {
|
|
|
|
|
+ cols = [[
|
|
|
|
|
+ {field:'index', align:'center', title: '排名', width:60}
|
|
|
|
|
+ ,{field:'userName', align: 'center', title: '姓名', minWidth: 120, templet: function(d) {
|
|
|
|
|
+ var name = d.userName || '';
|
|
|
|
|
+ return '<a href="javascript:void(0)" class="attention-info" onclick="openUserDetail(\'' + d.userId + '\',\'' + name.replace(/'/g, "\\'") + '\')">' + name + '</a>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ,{field:'officeName', align: 'center', title: '所属部门', minWidth: 160}
|
|
|
|
|
+ ,{field:'mobile', align: 'center', title: '手机号', minWidth: 130, templet: function(d) { return d.mobile || d.phone || ''; }}
|
|
|
|
|
+ ,{field:'exchangedBasicPoint', align: 'center', title: '基础已兑换', width: 110}
|
|
|
|
|
+ ,{field:'remainingBasicPoint', align: 'center', title: '基础剩余', width: 100}
|
|
|
|
|
+ ,{field:'basicPoint', align: 'center', title: '基础积分(总获取)', width: 130, templet: function(d) {
|
|
|
|
|
+ return '<span style="color:#2e7d32;font-weight:bold;">' + (d.basicPoint || 0) + '</span>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ]];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cols = [[
|
|
|
|
|
+ {field:'index', align:'center', title: '排名', width:60}
|
|
|
|
|
+ ,{field:'userName', align: 'center', title: '姓名', minWidth: 120, templet: function(d) {
|
|
|
|
|
+ var name = d.userName || '';
|
|
|
|
|
+ return '<a href="javascript:void(0)" class="attention-info" onclick="openUserDetail(\'' + d.userId + '\',\'' + name.replace(/'/g, "\\'") + '\')">' + name + '</a>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ,{field:'officeName', align: 'center', title: '所属部门', minWidth: 160}
|
|
|
|
|
+ ,{field:'mobile', align: 'center', title: '手机号', minWidth: 130, templet: function(d) { return d.mobile || d.phone || ''; }}
|
|
|
|
|
+ ,{field:'basicPoint', align: 'center', title: '基础积分(总获取)', width: 120, templet: function(d) {
|
|
|
|
|
+ return '<span style="color:#2e7d32;font-weight:bold;">' + (d.basicPoint || 0) + '</span>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ,{field:'exchangedBasicPoint', align: 'center', title: '基础已兑换', width: 100}
|
|
|
|
|
+ ,{field:'remainingBasicPoint', align: 'center', title: '基础剩余', width: 90}
|
|
|
|
|
+ ,{field:'contributionPoint', align: 'center', title: '贡献积分(总获取)', width: 130, templet: function(d) {
|
|
|
|
|
+ return '<span style="color:#1565c0;font-weight:bold;">' + (d.contributionPoint || 0) + '</span>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ,{field:'exchangedContributionPoint', align: 'center', title: '贡献已兑换', width: 110}
|
|
|
|
|
+ ,{field:'remainingContributionPoint', align: 'center', title: '贡献剩余', width: 100}
|
|
|
|
|
+ ,{field:'totalPoint', align: 'center', title: '总积分', width: 100, templet: function(d) {
|
|
|
|
|
+ return '<span style="color:#1aa094;font-weight:bold;font-size:15px;">' + (d.totalPoint || 0) + '</span>';
|
|
|
|
|
+ }}
|
|
|
|
|
+ ]];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ layui.table.render({
|
|
|
|
|
+ limit:${ page.pageSize }
|
|
|
|
|
+ ,elem: '#contentTable'
|
|
|
|
|
+ ,page: false
|
|
|
|
|
+ ,cols: cols
|
|
|
|
|
+ ,data: [
|
|
|
|
|
+ <c:choose>
|
|
|
|
|
+ <c:when test="${not empty page.list}">
|
|
|
|
|
+ <c:forEach items="${page.list}" var="row" varStatus="st">
|
|
|
|
|
+ <c:if test="${st.index != 0}">,</c:if>
|
|
|
|
|
+ {
|
|
|
|
|
+ "index": "${st.index + 1 + (page.pageNo - 1) * page.pageSize}"
|
|
|
|
|
+ ,"userId": "${row.userId}"
|
|
|
|
|
+ ,"userName": "<c:out value='${row.userName}'/>"
|
|
|
|
|
+ ,"officeName": "<c:out value='${row.officeName}'/>"
|
|
|
|
|
+ ,"mobile": "<c:out value='${row.mobile}'/>"
|
|
|
|
|
+ ,"phone": "<c:out value='${row.phone}'/>"
|
|
|
|
|
+ ,"basicPoint": "${row.basicPoint}"
|
|
|
|
|
+ ,"exchangedBasicPoint": "${row.exchangedBasicPoint}"
|
|
|
|
|
+ ,"remainingBasicPoint": "${row.remainingBasicPoint}"
|
|
|
|
|
+ ,"contributionPoint": "${row.contributionPoint}"
|
|
|
|
|
+ ,"exchangedContributionPoint": "${row.exchangedContributionPoint}"
|
|
|
|
|
+ ,"remainingContributionPoint": "${row.remainingContributionPoint}"
|
|
|
|
|
+ ,"totalPoint": "${row.totalPoint}"
|
|
|
|
|
+ }
|
|
|
|
|
+ </c:forEach>
|
|
|
|
|
+ </c:when>
|
|
|
|
|
+ <c:otherwise></c:otherwise>
|
|
|
|
|
+ </c:choose>
|
|
|
|
|
+ ]
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ function exportRanking() {
|
|
|
|
|
+ var type = $('#columnId').val() || '0';
|
|
|
|
|
+ var submitterId = $('input[name="submitterId"]').val() || '';
|
|
|
|
|
+ var officeId = $('input[name="officeId"]').val() || '';
|
|
|
|
|
+ var gainBeginDate = $('#gainBeginDate').val() || '';
|
|
|
|
|
+ var gainEndDate = $('#gainEndDate').val() || '';
|
|
|
|
|
+ var randomId = "down_" + new Date().getTime();
|
|
|
|
|
+ var downForm = $('<form>', {
|
|
|
|
|
+ 'action': '${ctx}/workKnowledgeBase/point/exportRanking',
|
|
|
|
|
+ 'method': 'GET',
|
|
|
|
|
+ 'style': 'display:none;'
|
|
|
|
|
+ }).appendTo('body');
|
|
|
|
|
+ $('<input>').attr({ type: 'hidden', name: 'rankingType', value: type }).appendTo(downForm);
|
|
|
|
|
+ if (submitterId) $('<input>').attr({ type: 'hidden', name: 'submitterId', value: submitterId }).appendTo(downForm);
|
|
|
|
|
+ if (officeId) $('<input>').attr({ type: 'hidden', name: 'officeId', value: officeId }).appendTo(downForm);
|
|
|
|
|
+ if (gainBeginDate) $('<input>').attr({ type: 'hidden', name: 'gainBeginDate', value: gainBeginDate }).appendTo(downForm);
|
|
|
|
|
+ if (gainEndDate) $('<input>').attr({ type: 'hidden', name: 'gainEndDate', value: gainEndDate }).appendTo(downForm);
|
|
|
|
|
+ var downIframe = $('<iframe>', { 'name': randomId, 'style': 'display:none;' }).appendTo('body');
|
|
|
|
|
+ downForm.attr('target', randomId);
|
|
|
|
|
+ downIframe.on('load', function() {
|
|
|
|
|
+ try { downForm.remove(); downIframe.remove(); } catch(e) {}
|
|
|
|
|
+ });
|
|
|
|
|
+ downForm.submit();
|
|
|
|
|
+ setTimeout(function() {
|
|
|
|
|
+ try { downForm.remove(); downIframe.remove(); } catch(e) {}
|
|
|
|
|
+ }, 3000);
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
+</body>
|
|
|
|
|
+</html>
|