wechatRefundOrderCtrl.js
5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
(function(angular) {
function wechatRefundOrderCtrl($scope, DTOptionsBuilder, DTColumnBuilder, wechatauthService, $uibModal, $filter, $state,Utils) {
$scope.filter={
createTime:{},
refundSuccessTime:{},
};
$scope.createOptions = {
opens : 'right',
eventHandlers : {
'apply.daterangepicker' : function(ev, picker) {
$scope.filter.createTime.startDate = picker.startDate;
$scope.filter.createTime.endDate = picker.endDate;
},
'cancel.daterangepicker' : function(ev, picker) {
$scope.filter.createTime.startDate = null;
$scope.filter.createTime.endDate = null;
$('#createTime').val('');
}
}
};
$scope.refundOptions = {
opens : 'right',
eventHandlers : {
'apply.daterangepicker' : function(ev, picker) {
$scope.filter.refundSuccessTime.startDate = picker.startDate;
$scope.filter.refundSuccessTime.endDate = picker.endDate;
},
'cancel.daterangepicker' : function(ev, picker) {
$scope.filter.refundSuccessTime.startDate = null;
$scope.filter.refundSuccessTime.endDate = null;
$('#refundSuccessTime').val('');
}
}
};
$scope.dtColumns = [
DTColumnBuilder.newColumn('createdDate').withOption('width',160).withTitle('退款申请时间').renderWith(function(e, dt, node, config){
return $filter('date')(new Date(node.createdDate), 'yyyy-MM-dd HH:mm:ss');
}),
DTColumnBuilder.newColumn('refundSuccessTime').withOption('width',160).withTitle('退款成功时间').renderWith(function(e, dt, node, config){
return $filter('date')(new Date(node.refundSuccessTime), 'yyyy-MM-dd HH:mm:ss');
}),
DTColumnBuilder.newColumn('outTradeNo').withOption('width',160).withTitle('交易单号'),
DTColumnBuilder.newColumn('outRefundNo').withOption('width',220).withTitle('商户退款单号'),
DTColumnBuilder.newColumn('transactionId').withOption('width',220).withTitle('微信交易号'),
DTColumnBuilder.newColumn('refundId').withOption('width',220).withTitle('微信退款单号'),
DTColumnBuilder.newColumn('totalFee').withOption('width',80).withTitle('订单总金额(单位:分)'),
DTColumnBuilder.newColumn('refundFee').withOption('width',80).withTitle('申请退款金额(单位:分)'),
DTColumnBuilder.newColumn('settlementTotalFee').withOption('width',80).withTitle('应结订单金额(单位:分)'),
DTColumnBuilder.newColumn('settlementRefundFee').withOption('width',80).withTitle('退款金额(单位:分)'),
DTColumnBuilder.newColumn('refundStatus').withOption('width',80).withTitle('退款状态'),
DTColumnBuilder.newColumn('refundDesc').withOption('width',80).withTitle('退款原因'),
DTColumnBuilder.newColumn('refundRecvAccount').withOption('width',160).withTitle('退款入账账户'),
DTColumnBuilder.newColumn('refundChannel').withOption('width',100).withTitle('退款渠道'),
DTColumnBuilder.newColumn('refundAccount').withOption('width',200).withTitle('退款资金来源'),
DTColumnBuilder.newColumn('refundRequestSource').withOption('width',120).withTitle('退款发起来源'),
DTColumnBuilder.newColumn('appId').withOption('width',160).withTitle('微信应用ID'),
DTColumnBuilder.newColumn('merchantId').withOption('width',100).withTitle('微信支付商户号'),
DTColumnBuilder.newColumn('subAppId').withOption('width',160).withTitle('微信子应用ID'),
DTColumnBuilder.newColumn('subMerchantId').withOption('width',120).withTitle('微信支付子商户号')
];
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('id','id')
.withFixedColumns({
leftColumns: 4
});
$scope.dtInstance = {
serverData : wechatauthService.searchRefundOrder
};
function getParams(){
var obj = {};
if($scope.fieldName){
if($scope.fieldValue){
obj[$scope.fieldName] = $scope.fieldValue;
}else {
obj[$scope.fieldName] = '';
}
}
if ($scope.filter.createTime.startDate) {
obj['createdDateStart'] = $scope.filter.createTime.startDate.format('YYYY-MM-DD 00:00:00');
}
if ($scope.filter.createTime.endDate) {
obj['createdDateEnd'] = $scope.filter.createTime.endDate.format('YYYY-MM-DD 23:59:59');
}
if ($scope.filter.refundSuccessTime.startDate) {
obj['refundSuccessTimeStart'] = $scope.filter.refundSuccessTime.startDate.format('YYYY-MM-DD 00:00:00');
}
if ($scope.filter.refundSuccessTime.endDate) {
obj['refundSuccessTimeEnd'] = $scope.filter.refundSuccessTime.endDate.format('YYYY-MM-DD 23:59:59');
}
if($scope.refundStatus){
obj['refundSuccessStatus'] = $scope.refundStatus;
}
if($scope.refundChannel){
obj['refundChannel'] = $scope.refundChannel;
}
return obj;
}
//查询
$scope.submitForm = function(){
$scope.dtInstance.query({condition:getParams()});
}
// 导出
$scope.handleExport = function() {
var pragam = getParams();
var options = {
url : 'wechat/payment/refund/order/export',
name : '退款订单列表.xlsx'
};
Utils.exportExcel(options, pragam);
}
}
angular.module('wechatauth').controller('wechatRefundOrderCtrl', wechatRefundOrderCtrl)
})(angular);