增加了充值记录页
This commit is contained in:
parent
4f31892d7c
commit
633c21bff8
@ -151,6 +151,24 @@ public class AccountRechargeController extends DefaultBaseController {
|
|||||||
return accountRechargeService.listPage(page);
|
return accountRechargeService.listPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "账户充值分页列表", notes = "账户充值分页列表接口")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||||
|
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||||
|
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||||
|
})
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@GetMapping("listpage2")
|
||||||
|
public SuccessResultList<List<AccountRechargeDTO>> listPage2(ListPage page) {
|
||||||
|
Map<String, Object> params = requestParams();
|
||||||
|
params.put("rechargeCheck", "2");
|
||||||
|
params.put("reconciliationStatus", "1");
|
||||||
|
page.setParams(params);
|
||||||
|
return accountRechargeService.listPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "账户充值分页列表", notes = "账户充值分页列表接口")
|
@ApiOperation(value = "账户充值分页列表", notes = "账户充值分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||||
@ -165,7 +183,7 @@ public class AccountRechargeController extends DefaultBaseController {
|
|||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
params.put("rechargeCheck", "2");
|
params.put("rechargeCheck", "2");
|
||||||
params.put("reconciliationStatus", "1");
|
params.put("reconciliationStatus", "1");
|
||||||
params.put("accountId", params.get("accountId") == null ? "-1" : params.get("accountId"));
|
params.put("accountId", params.get("accountId") == null ? "" : params.get("accountId"));
|
||||||
page.setParams(params);
|
page.setParams(params);
|
||||||
return accountRechargeService.listPage(page);
|
return accountRechargeService.listPage(page);
|
||||||
}
|
}
|
||||||
@ -177,5 +195,12 @@ public class AccountRechargeController extends DefaultBaseController {
|
|||||||
Map<String, Object> params = requestParams();
|
Map<String, Object> params = requestParams();
|
||||||
return new SuccessResultData<>(accountRechargeService.count(params));
|
return new SuccessResultData<>(accountRechargeService.count(params));
|
||||||
}
|
}
|
||||||
|
@ApiOperation(value = "账户充值统计", notes = "账户充值统计接口")
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@GetMapping("total-sum")
|
||||||
|
SuccessResultData<Double> totalSum() {
|
||||||
|
Map<String, Object> params = requestParams();
|
||||||
|
return new SuccessResultData<>(accountRechargeService.totalSum(params));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -102,6 +102,11 @@ public class AccountRechargeRouteController extends DefaultBaseController {
|
|||||||
return mv;
|
return mv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("recharge-list")
|
||||||
|
public ModelAndView rechargeList() {
|
||||||
|
return new ModelAndView("accountrecharge/recharge-list");
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public ModelAndView list() {
|
public ModelAndView list() {
|
||||||
return new ModelAndView("accountrecharge/list");
|
return new ModelAndView("accountrecharge/list");
|
||||||
|
@ -128,4 +128,6 @@ public interface IAccountRechargeDao {
|
|||||||
Integer getTodayByAccountId(String userId);
|
Integer getTodayByAccountId(String userId);
|
||||||
|
|
||||||
List<AccountRechargeInvoiceDTO> getCanIsSueInvoices(Map<String, Object> params);
|
List<AccountRechargeInvoiceDTO> getCanIsSueInvoices(Map<String, Object> params);
|
||||||
|
|
||||||
|
Double totalSum(Map<String, Object> params);
|
||||||
}
|
}
|
@ -26,9 +26,9 @@ public interface IAccountRechargeService {
|
|||||||
/**
|
/**
|
||||||
* 新增账户充值
|
* 新增账户充值
|
||||||
*
|
*
|
||||||
* @param accountRechargeVO
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
Double totalSum(Map<String, Object> params);
|
||||||
void save(AccountRechargeVO accountRechargeVO);
|
void save(AccountRechargeVO accountRechargeVO);
|
||||||
|
|
||||||
void saveSystemReduce(AccountRechargeVO accountRechargeVO);
|
void saveSystemReduce(AccountRechargeVO accountRechargeVO);
|
||||||
|
@ -118,6 +118,12 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA
|
|||||||
return new SuccessResultList<>(accountRechargeDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
return new SuccessResultList<>(accountRechargeDTOs, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Double totalSum(Map<String, Object> params) {
|
||||||
|
Double totalSum = accountRechargeDao.totalSum(params);
|
||||||
|
return totalSum;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(AccountRechargeVO accountRechargeVO) {
|
public void save(AccountRechargeVO accountRechargeVO) {
|
||||||
saveReturnId(accountRechargeVO);
|
saveReturnId(accountRechargeVO);
|
||||||
@ -471,6 +477,7 @@ public class AccountRechargeServiceImpl extends DefaultBaseService implements IA
|
|||||||
|
|
||||||
PageHelper.startPage(page.getPage(), page.getRows());
|
PageHelper.startPage(page.getPage(), page.getRows());
|
||||||
List<AccountRechargeDTO> accountRechargeDTOs = accountRechargeDao.list(page.getParams());
|
List<AccountRechargeDTO> accountRechargeDTOs = accountRechargeDao.list(page.getParams());
|
||||||
|
|
||||||
Map<String, UserInfoDTO> user = new HashMap<>();
|
Map<String, UserInfoDTO> user = new HashMap<>();
|
||||||
for(AccountRechargeDTO dto : accountRechargeDTOs) {
|
for(AccountRechargeDTO dto : accountRechargeDTOs) {
|
||||||
if (user.get(dto.getCreator()) != null) {
|
if (user.get(dto.getCreator()) != null) {
|
||||||
|
@ -576,6 +576,66 @@
|
|||||||
#{selectedRechargeIds[${index}]}
|
#{selectedRechargeIds[${index}]}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderMode != null and orderMode != ''">
|
||||||
|
t1.recharge_money ${orderMode}
|
||||||
|
</if>
|
||||||
|
<if test="orderMode == null or orderMode == ''">
|
||||||
|
t1.id DESC
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="totalSum" parameterType="map" resultType="java.lang.Double">
|
||||||
|
SELECT
|
||||||
|
SUM(recharge_money)
|
||||||
|
FROM
|
||||||
|
operator_account_recharge t1
|
||||||
|
WHERE
|
||||||
|
t1.is_delete = 0
|
||||||
|
<if test="accountId != null and accountId != ''">
|
||||||
|
AND t1.account_id = #{accountId}
|
||||||
|
</if>
|
||||||
|
<if test="rechargeType != null and rechargeType != ''">
|
||||||
|
AND t1.recharge_type = #{rechargeType}
|
||||||
|
</if>
|
||||||
|
<if test="thirdParty != null and thirdParty != ''">
|
||||||
|
AND t1.third_party = #{thirdParty}
|
||||||
|
</if>
|
||||||
|
<if test="thirdPartyNo != null and thirdPartyNo != ''">
|
||||||
|
AND t1.third_party_no LIKE CONCAT('%', #{thirdPartyNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="reconciliationStatus != null and reconciliationStatus != ''">
|
||||||
|
AND t1.reconciliation_status = #{reconciliationStatus}
|
||||||
|
</if>
|
||||||
|
<if test="rechargeCheck != null and rechargeCheck != ''">
|
||||||
|
AND t1.recharge_check = #{rechargeCheck}
|
||||||
|
</if>
|
||||||
|
<if test="keywords != null and keywords != ''">
|
||||||
|
AND (
|
||||||
|
<!-- 这里添加其他条件 -->
|
||||||
|
t1.recharge_check_remark LIKE CONCAT('%', #{keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null and startTime != ''">
|
||||||
|
AND
|
||||||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
AND
|
||||||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||||||
|
</if>
|
||||||
|
<if test="accountRechargeIds != null and accountRechargeIds.size > 0">
|
||||||
|
AND
|
||||||
|
t1.account_recharge_id IN
|
||||||
|
<foreach collection="accountRechargeIds" index="index" open="(" separator="," close=")">
|
||||||
|
#{accountRechargeIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
ORDER BY
|
||||||
|
<if test="selectedRechargeIds != null and selectedRechargeIds.size > 0">
|
||||||
|
<foreach collection="selectedRechargeIds" index="index" open=" FIELD (t1.account_recharge_id , " separator="," close=") DESC ,">
|
||||||
|
#{selectedRechargeIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
t1.id DESC
|
t1.id DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
355
src/main/resources/templates/accountrecharge/recharge-list.html
Normal file
355
src/main/resources/templates/accountrecharge/recharge-list.html
Normal file
@ -0,0 +1,355 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<base th:href="${#request.getContextPath() + '/'}">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="renderer" content="webkit">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||||
|
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||||
|
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||||
|
<style>
|
||||||
|
.search-item .layui-form-select .layui-input {width: 140px;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="layui-anim layui-anim-fadein">
|
||||||
|
<div class="layui-row">
|
||||||
|
<div class="layui-col-md12">
|
||||||
|
<div class="layui-card">
|
||||||
|
<div class="layui-card-body">
|
||||||
|
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||||
|
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||||
|
<div class="layui-inline">
|
||||||
|
<input type="text" style="cursor: pointer" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<input type="text" style="cursor: pointer" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline layui-form search-item">
|
||||||
|
<select id="rechargeType" name="rechargeType">
|
||||||
|
<option value="">选择类型</option>
|
||||||
|
<option value="1">线下充值</option>
|
||||||
|
<option value="2">线上充值</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="layui-inline layui-form search-item" >
|
||||||
|
<select id="thirdParty" name="thirdParty">
|
||||||
|
<option value="">选择名称</option>
|
||||||
|
<option value="系统">系统</option>
|
||||||
|
<option value="微信">微信</option>
|
||||||
|
<option value="支付宝">支付宝</option>
|
||||||
|
<option value="百度">百度</option>
|
||||||
|
<option value="对公转账">对公转账</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<input type="radio" name="orderMode" value="" checked title="默认">
|
||||||
|
<input type="radio" name="orderMode" value="DESC" title="金额从高到低">
|
||||||
|
<input type="radio" name="orderMode" value="ASC" title="金额从低到高">
|
||||||
|
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||||
|
<i class="fa fa-lg fa-search"></i> 搜索
|
||||||
|
</button>
|
||||||
|
<span id="totalSum"></span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||||
|
<script type="text/html" id="headerToolBar">
|
||||||
|
<div class="layui-btn-group">
|
||||||
|
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="closeBatchEvent">
|
||||||
|
<i class="fa fa-close"></i> 批量关闭
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||||
|
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||||
|
<script>
|
||||||
|
layui.config({
|
||||||
|
base: 'assets/layuiadmin/'
|
||||||
|
}).extend({
|
||||||
|
index: 'lib/index'
|
||||||
|
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||||
|
var $ = layui.$;
|
||||||
|
var $win = $(window);
|
||||||
|
var table = layui.table;
|
||||||
|
var admin = layui.admin;
|
||||||
|
var laydate = layui.laydate;
|
||||||
|
var common = layui.common;
|
||||||
|
var resizeTimeout = null;
|
||||||
|
var query = top.restAjax.params(window.location.href);
|
||||||
|
var accountId = query.accountId;
|
||||||
|
var tableUrl = `api/accountrecharge/listpage2`;
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
function initTable() {
|
||||||
|
getSum({});
|
||||||
|
table.render({
|
||||||
|
elem: '#dataTable',
|
||||||
|
id: 'dataTable',
|
||||||
|
url: top.restAjax.path(tableUrl, []),
|
||||||
|
width: admin.screen() > 1 ? '100%' : '',
|
||||||
|
height: $win.height() - 60,
|
||||||
|
limit: 20,
|
||||||
|
limits: [20, 40, 60, 80, 100, 200],
|
||||||
|
defaultToolbar: [],
|
||||||
|
// toolbar: '#headerToolBar',
|
||||||
|
request: {
|
||||||
|
pageName: 'page',
|
||||||
|
limitName: 'rows'
|
||||||
|
},
|
||||||
|
cols: [
|
||||||
|
[
|
||||||
|
{type:'checkbox', fixed: 'left'},
|
||||||
|
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||||
|
{field: 'rechargeType', width: 100, title: '类型', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
if(rowData === '1') {
|
||||||
|
return '线下';
|
||||||
|
}
|
||||||
|
if(rowData === '2') {
|
||||||
|
return '线上';
|
||||||
|
}
|
||||||
|
return '错误';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'userInfoDTO', width: 300, title: '用户名/手机', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
return "【" + rowData.userInfoName + '】' + rowData.userUsername;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'thirdParty', width: 120, title: '充值名称', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'rechargeMoney', width: 120, title: '金额', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
return `¥${rowData}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'gmtCreate', width: 180, title: '创建时间', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'rechargeFinalTime', width: 180, title: '充值时间', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'reconciliationTime', width: 180, title: '到账时间', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'thirdPartyNo', width: 250, title: '三方订单号', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{field: 'accountItemId', width: 250, title: '关联流水号', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/*{field: 'operate', width: 80, title: '操作', align:'center', fixed: 'right',
|
||||||
|
templet: function(row) {
|
||||||
|
if(row.rechargeCheck === '1') {
|
||||||
|
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event="showEvent">核对</button>'
|
||||||
|
}
|
||||||
|
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-primary" lay-event="showEvent">查看</button>'
|
||||||
|
}
|
||||||
|
},*/
|
||||||
|
]
|
||||||
|
],
|
||||||
|
page: true,
|
||||||
|
parseData: function(data) {
|
||||||
|
return {
|
||||||
|
'code': 0,
|
||||||
|
'msg': '',
|
||||||
|
'count': data.total,
|
||||||
|
'data': data.rows
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 重载表格
|
||||||
|
function reloadTable(currentPage) {
|
||||||
|
// 修复:使用正确的选择器获取单选按钮的值
|
||||||
|
var orderMode = $('input[name="orderMode"]:checked').val();
|
||||||
|
var data = {
|
||||||
|
startTime: $('#startTime').val(),
|
||||||
|
orderMode: orderMode,
|
||||||
|
endTime: $('#endTime').val(),
|
||||||
|
rechargeType: $('#rechargeType').val(),
|
||||||
|
thirdParty: $('#thirdParty').val(),
|
||||||
|
/* reconciliationStatus: $('#reconciliationStatus').val(),
|
||||||
|
rechargeCheck: $('#rechargeCheck').val(),*/
|
||||||
|
};
|
||||||
|
table.reload('dataTable', {
|
||||||
|
url: top.restAjax.path(tableUrl, []),
|
||||||
|
where: data,
|
||||||
|
page: {
|
||||||
|
curr: currentPage
|
||||||
|
},
|
||||||
|
});
|
||||||
|
getSum(data);
|
||||||
|
}
|
||||||
|
// 初始化日期
|
||||||
|
function initDate() {
|
||||||
|
// 日期选择
|
||||||
|
laydate.render({
|
||||||
|
elem: '#startTime',
|
||||||
|
format: 'yyyy-MM-dd'
|
||||||
|
});
|
||||||
|
laydate.render({
|
||||||
|
elem: '#endTime',
|
||||||
|
format: 'yyyy-MM-dd'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSum(params) {
|
||||||
|
var loadLayerIndex;
|
||||||
|
top.restAjax.get(top.restAjax.path('api/accountrecharge/total-sum', []), params, null, function(code, data) {
|
||||||
|
$("#totalSum").html(`共计 : ${data.data}元`);
|
||||||
|
}, function(code, data) {
|
||||||
|
top.dialog.msg(data.msg);
|
||||||
|
}, function() {
|
||||||
|
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
|
||||||
|
}, function() {
|
||||||
|
top.dialog.close(loadLayerIndex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
initTable();
|
||||||
|
initDate();
|
||||||
|
// 事件 - 页面变化
|
||||||
|
$win.on('resize', function() {
|
||||||
|
clearTimeout(resizeTimeout);
|
||||||
|
resizeTimeout = setTimeout(function() {
|
||||||
|
reloadTable();
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
// 事件 - 搜索
|
||||||
|
$(document).on('click', '#search', function() {
|
||||||
|
reloadTable(1);
|
||||||
|
});
|
||||||
|
function closeRecharge(idArray) {
|
||||||
|
top.dialog.msg('确认关闭吗', {
|
||||||
|
time: 0,
|
||||||
|
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||||
|
shade: 0.3,
|
||||||
|
yes: function (index) {
|
||||||
|
top.dialog.close(index);
|
||||||
|
var layIndex;
|
||||||
|
top.restAjax.put(top.restAjax.path('api/accountrecharge/update-close', []), {
|
||||||
|
ids: idArray
|
||||||
|
}, null, function (code, data) {
|
||||||
|
top.dialog.msg('关闭成功', {time: 1000});
|
||||||
|
reloadTable();
|
||||||
|
}, function (code, data) {
|
||||||
|
top.dialog.msg(data.msg);
|
||||||
|
}, function () {
|
||||||
|
layIndex = top.dialog.msg('', {icon: 16, time: 0, shade: 0.3});
|
||||||
|
}, function () {
|
||||||
|
top.dialog.close(layIndex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 事件 - 增删改
|
||||||
|
table.on('toolbar(dataTable)', function(obj) {
|
||||||
|
var layEvent = obj.event;
|
||||||
|
var checkStatus = table.checkStatus('dataTable');
|
||||||
|
var checkDatas = checkStatus.data;
|
||||||
|
if(layEvent === 'closeBatchEvent') {
|
||||||
|
if(checkDatas.length === 0) {
|
||||||
|
top.dialog.msg('选择要批量关闭的数据');
|
||||||
|
} else {
|
||||||
|
var ids = [];
|
||||||
|
for(var i = 0, item; item = checkDatas[i++];) {
|
||||||
|
ids.push(item['accountRechargeId']);
|
||||||
|
}
|
||||||
|
closeRecharge(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(layEvent === 'confirmEvent') {
|
||||||
|
if(checkDatas.length === 0) {
|
||||||
|
top.dialog.msg(top.dataMessage.table.selectDelete);
|
||||||
|
} else {
|
||||||
|
var ids = '';
|
||||||
|
for(var i = 0, item; item = checkDatas[i++];) {
|
||||||
|
if(i > 1) {
|
||||||
|
ids += '_';
|
||||||
|
}
|
||||||
|
ids += item['accountRechargeId'];
|
||||||
|
}
|
||||||
|
top.dialog.msg('将选中的这些记录确认充值到账', {
|
||||||
|
time: 0,
|
||||||
|
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
|
||||||
|
className: 'my-custom-class',
|
||||||
|
btnAlign: 'c',
|
||||||
|
shade: 0.3,
|
||||||
|
yes: function (index) {
|
||||||
|
top.dialog.close(index);
|
||||||
|
var layIndex;
|
||||||
|
top.restAjax.put(top.restAjax.path('api/accountrecharge/confirm/{ids}', [ids]), {}, null, function (code, data) {
|
||||||
|
top.dialog.msg("核对完成", {time: 1000});
|
||||||
|
reloadTable();
|
||||||
|
}, function (code, data) {
|
||||||
|
top.dialog.msg(data.msg);
|
||||||
|
}, function () {
|
||||||
|
layIndex = top.dialog.msg("正在核对中...", {icon: 16, time: 0, shade: 0.3});
|
||||||
|
}, function () {
|
||||||
|
top.dialog.close(layIndex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
table.on('tool(dataTable)', function(obj) {
|
||||||
|
var event = obj.event;
|
||||||
|
var data = obj.data;
|
||||||
|
if(event === 'showEvent') {
|
||||||
|
top.dialog.open({
|
||||||
|
url: top.restAjax.path('route/accountrecharge/update?accountRechargeId={accountRechargeId}', [data.accountRechargeId]),
|
||||||
|
title: '资金详情',
|
||||||
|
width: '800px',
|
||||||
|
height: '70%',
|
||||||
|
onClose: function() {
|
||||||
|
reloadTable();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user