withdrawController.js 3.3 KB
"use strict";
var withdrawController = angular.module('withdrawController',[]);
withdrawController.controller('withdrawListController', [
    '$rootScope',
    '$scope',
    'WithdrawService',
    'BaseService',
    function($rootScope, $scope, WithdrawService,BaseService) {
        $scope.currentPage = 1;
        $scope.numPages = 1;
        $scope.pageSize = 20;
        $scope.totalRecord = 0;
        $scope.statisticsWithDraw=[];
        $scope.recordQuery={
            phone:'',
            partnerTradeNo:'',
            paymentNo:'',
            productRange:'',
            startDt:null,
            endDt:null,
            payStartDt:null,
            payEndDt:null,
            pageNow:1,
            pageSize:20
        };
        WithdrawService.selectWithdrawForPager($scope.recordQuery);
        $scope.$on('withdraw.list', function() {
            $scope.withdrawRecordList = WithdrawService.withDrawList.datas;
            $scope.numPages = WithdrawService.withDrawList.totalPage;
            $scope.totalRecord = WithdrawService.withDrawList.totalRecord;
        });

        $scope.onSelectPage = function(page) {
            $scope.recordQuery.pageNow=page;
            WithdrawService.selectWithdrawForPager($scope.recordQuery);
        };

        $scope.search=function() {
            $scope.recordQuery.pageNow = 1;
            WithdrawService.selectWithdrawForPager($scope.recordQuery);
        };
        $scope.comfirmPay=function(id,status){
            var param={'id':id,'status':status,'type':'succss'};
            if(confirm("确认打款")){
                WithdrawService.updateWithdrawStatus(param)
            }
        };
        $scope.refusePay=function(id,status){
            var param={'id':id,'status':status,'type':'fail'};
            if(confirm("确认审核失败")){
                WithdrawService.updateWithdrawStatus(param)
            }
        };
    }]
);


withdrawController.controller('withdrawDetailListController', [
    '$rootScope',
    '$scope',
    'WithdrawService',
    'BaseService',
    '$state',
    function($rootScope, $scope, WithdrawService,BaseService,$state) {
        $scope.currentPage = 1;
        $scope.numPages = 1;
        $scope.pageSize = 10;
        $scope.totalRecord = 0;
        $scope.memberId=$rootScope.$stateParams.memberId;
        $scope.withDrawDetailList=[];
        $scope.statisticsWithDraw=[];
        $scope.recordQuery={
            pageNow:1,
            pageSize:10,
            memberId : $scope.memberId
        };
        $scope.productQuery={
            memberId : $scope.memberId
        }
        WithdrawService.selectWithdrawDetailForPager($scope.recordQuery);
        $scope.$on('withdrawDetail.list', function() {
            $scope.withDrawDetailList = WithdrawService.withDrawDetailList.datas;
            $scope.numPages = WithdrawService.withDrawDetailList.totalPage;
            $scope.totalRecord = WithdrawService.withDrawDetailList.totalRecord;
        });

        $scope.onSelectPage = function(page) {
            $scope.recordQuery.pageNow=page;
            WithdrawService.selectWithdrawDetailForPager($scope.recordQuery);
        };
        WithdrawService.statisticsWithdrawDetailInfo($scope.productQuery);
        $scope.$on('statisticsWithdrawDetailInfo', function() {
            $scope.statisticsWithDraw=WithdrawService.statisticsWithDrawList;
        });


    }]
);