|
|
|
@ -14,18 +14,20 @@ var commissionTypeMap = [{
|
|
|
|
|
"value": "收益比例"
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
|
|
|
|
'use strict';
|
|
|
|
|
var app = angular.module('orgcommission', ['ui.router']);
|
|
|
|
|
app.config(['$stateProvider', function ($stateProvider) {
|
|
|
|
|
$stateProvider.state('analysis_org.orgcommission', {
|
|
|
|
|
$stateProvider.state('analysis_org.commission', {
|
|
|
|
|
url: '/org_commissions',
|
|
|
|
|
templateUrl: '/static/config/orgcommission/templates/org_commission_root.html',
|
|
|
|
|
controller: 'orgCommissionRootCtrl'
|
|
|
|
|
}).state('analysis_org.orgcommission.month', {
|
|
|
|
|
url: '/months/{monthStr}',
|
|
|
|
|
}).state('analysis_org.commission.month', {
|
|
|
|
|
url: '/commissionorg/months/{monthStr}',
|
|
|
|
|
templateUrl: '/static/config/orgcommission/templates/org_commission_month_root.html',
|
|
|
|
|
controller: 'commissionMonthRootCtrl'
|
|
|
|
|
}).state('analysis_org.commission.month.org', {
|
|
|
|
|
url: '/org',
|
|
|
|
|
templateUrl: '/static/config/orgcommission/templates/org_commission_month.html',
|
|
|
|
|
controller: 'orgCommissionMonthViewCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
@ -33,7 +35,16 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
|
|
|
|
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).state('analysis_org.orgcommission.month.orgdetail', {
|
|
|
|
|
}).state('analysis_org.commission.month.referrer', {
|
|
|
|
|
url: '/referrer',
|
|
|
|
|
templateUrl: '/static/config/referrercommission/templates/referrer_commission_month.html',
|
|
|
|
|
controller: 'referrerCommissionMonthViewCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
monthData: ['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).state('analysis_org.commission.month.org.orgdetail', {
|
|
|
|
|
url: '/citypartners/{orgId}',
|
|
|
|
|
templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html',
|
|
|
|
|
controller: 'orgCommissionOrgDetailCtrl',
|
|
|
|
@ -42,13 +53,25 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
|
|
|
|
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
}).state('analysis_org.commission.month.referrer.referrerdetail', {
|
|
|
|
|
url: '/referrer_commissions/{orgId}',
|
|
|
|
|
templateUrl: '/static/config/referrercommission/templates/referrer_commission_detail.html',
|
|
|
|
|
controller: 'referrerCommissionOrgDetailCtrl',
|
|
|
|
|
resolve: {
|
|
|
|
|
detail: ['$http', '$stateParams', function ($http, $stateParams) {
|
|
|
|
|
return $http.get('/sys/citypartner_prizes/referrer/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId);
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('commissionMonthRootCtrl', ['$scope', '$state', function ($scope, $state) {
|
|
|
|
|
if($state.is('analysis_org.commission.month')){
|
|
|
|
|
$state.go('.org');
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog',
|
|
|
|
|
function ($scope, $http, $filter, $state, commonDialog) {
|
|
|
|
|
$scope.generate = {};
|
|
|
|
|
|
|
|
|
|
$scope.generateOrgCommission = function () {
|
|
|
|
|
$scope.generate.status = {};
|
|
|
|
|
if (!$scope.generate.month) {
|
|
|
|
@ -63,7 +86,7 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
|
|
|
|
}).then(function () {
|
|
|
|
|
var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')};
|
|
|
|
|
$http.post('/sys/citypartner_prizes/generate', params).then(function () {
|
|
|
|
|
$state.go('analysis_org.orgcommission.month', {monthStr: params.month})
|
|
|
|
|
$state.go('.org.month', {monthStr: params.month})
|
|
|
|
|
$scope.generate.status = null;
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
|
|
|
|
@ -89,9 +112,14 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
|
|
|
|
return has;
|
|
|
|
|
};
|
|
|
|
|
$scope.gotoMonth = function (mon) {
|
|
|
|
|
var monthStr = $scope.params.year.getFullYear() + '-' + (('0' + mon).substr(-2));
|
|
|
|
|
$state.go('analysis_org.orgcommission.month', {monthStr: monthStr})
|
|
|
|
|
if(mon){
|
|
|
|
|
$scope.params.month = mon;
|
|
|
|
|
}
|
|
|
|
|
var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month;
|
|
|
|
|
$state.go('analysis_org.commission.month', {monthStr: monthStr})
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$filter', function ($scope, monthData) {
|
|
|
|
|
$scope.monthData = monthData.data;
|
|
|
|
@ -118,6 +146,29 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('referrerCommissionMonthViewCtrl', ['$scope', 'monthData', function ($scope, monthData) {
|
|
|
|
|
$scope.monthData = monthData.data;
|
|
|
|
|
$scope.ctrl = {};
|
|
|
|
|
$scope.active = function (log) {
|
|
|
|
|
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){
|
|
|
|
|
$scope.ctrl.activeLog=null;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$scope.ctrl.activeLog=log;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.controller('referrerCommissionOrgDetailCtrl', ['$scope', 'detail', function ($scope, detail) {
|
|
|
|
|
$scope.detail = detail.data;
|
|
|
|
|
$scope.ctrl = {};
|
|
|
|
|
$scope.active = function (log) {
|
|
|
|
|
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.client_moniker==log.client_moniker){
|
|
|
|
|
$scope.ctrl.activeLog=null;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$scope.ctrl.activeLog=log;
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
app.filter('commission_type_filter', function () {
|
|
|
|
|
return function (sectorValue) {
|
|
|
|
|