|
|
@@ -0,0 +1,85 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>积分兑换预览</title>
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
+ <script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
|
|
|
+ <style>
|
|
|
+ .preview-header { padding: 15px 15px 5px; }
|
|
|
+ .preview-header p { margin: 0 0 8px; font-size: 14px; color: #333; }
|
|
|
+ .preview-header .tip { color: #999; font-size: 12px; margin-top: 8px; }
|
|
|
+ .preview-table-wrap { padding: 0 15px 15px; }
|
|
|
+ /* 将分页器移到右侧 */
|
|
|
+ #previewTable + .layui-table-page {
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="preview-header">
|
|
|
+ <p>兑换类型:<b style="color:#1aa094;">${typeName}</b>,共 <b style="color:#FF5722;" id="totalCount">0</b> 人满足兑换条件</p>
|
|
|
+</div>
|
|
|
+<div class="preview-table-wrap">
|
|
|
+ <table class="layui-table" id="previewTable" lay-filter="previewTable"></table>
|
|
|
+</div>
|
|
|
+<p class="preview-header tip">* 确认后将执行扣分操作并下载Excel文件,请仔细核对</p>
|
|
|
+
|
|
|
+<script>
|
|
|
+ var exchangeType = '${exchangeType}';
|
|
|
+ var previewData = [];
|
|
|
+ try {
|
|
|
+ previewData = JSON.parse('${previewDataJson}'.replace(/"/g, '"').replace(/&/g, '&'));
|
|
|
+ } catch(e) {
|
|
|
+ previewData = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ document.getElementById('totalCount').innerText = previewData.length;
|
|
|
+
|
|
|
+ // 添加序号
|
|
|
+ for (var i = 0; i < previewData.length; i++) {
|
|
|
+ previewData[i].idx = i + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 根据兑换类型动态设置列
|
|
|
+ var cols;
|
|
|
+ if (exchangeType === 'basic') {
|
|
|
+ cols = [[
|
|
|
+ {field:'idx', align:'center', title:'序号', width:55},
|
|
|
+ {field:'userName', align:'center', title:'姓名', minWidth:100},
|
|
|
+ {field:'officeName', align:'center', title:'所属部门', minWidth:140},
|
|
|
+ {field:'mobile', align:'center', title:'手机号', minWidth:120, templet:function(d){ return d.mobile || d.phone || ''; }},
|
|
|
+ {field:'originalBasicPoint', align:'center', title:'当前基础积分', width:120, templet:function(d){ return '<span style="color:#1aa094;font-weight:bold;">' + (d.originalBasicPoint || 0) + '</span>'; }},
|
|
|
+ {field:'exchangedBasicPoint', align:'center', title:'预计兑换', width:100, templet:function(d){ return '<span style="color:#FF5722;font-weight:bold;">' + (d.exchangedBasicPoint || 0) + '</span>'; }},
|
|
|
+ {field:'remainingBasicPoint', align:'center', title:'兑换后剩余', width:110}
|
|
|
+ ]];
|
|
|
+ } else {
|
|
|
+ cols = [[
|
|
|
+ {field:'idx', align:'center', title:'序号', width:55},
|
|
|
+ {field:'userName', align:'center', title:'姓名', minWidth:100},
|
|
|
+ {field:'officeName', align:'center', title:'所属部门', minWidth:140},
|
|
|
+ {field:'mobile', align:'center', title:'手机号', minWidth:120, templet:function(d){ return d.mobile || d.phone || ''; }},
|
|
|
+ {field:'originalContributionPoint', align:'center', title:'当前贡献积分', width:120, templet:function(d){ return '<span style="color:#1aa094;font-weight:bold;">' + (d.originalContributionPoint || 0) + '</span>'; }},
|
|
|
+ {field:'exchangedContributionPoint', align:'center', title:'预计兑换', width:100, templet:function(d){ return '<span style="color:#FF5722;font-weight:bold;">' + (d.exchangedContributionPoint || 0) + '</span>'; }},
|
|
|
+ {field:'remainingContributionPoint', align:'center', title:'兑换后剩余', width:110}
|
|
|
+ ]];
|
|
|
+ }
|
|
|
+
|
|
|
+ layui.use('table', function(){
|
|
|
+ layui.table.render({
|
|
|
+ elem: '#previewTable',
|
|
|
+ cols: cols,
|
|
|
+ data: previewData,
|
|
|
+ page: {
|
|
|
+ layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
|
|
|
+ position: 'right'
|
|
|
+ },
|
|
|
+ limit: 10,
|
|
|
+ limits: [10, 15, 20, 30, 50],
|
|
|
+ skin: 'line',
|
|
|
+ size: 'sm'
|
|
|
+ });
|
|
|
+ });
|
|
|
+</script>
|
|
|
+</body>
|
|
|
+</html>
|