wangning 7 years ago
parent 3f9ef5d8b1
commit c95568e565

@ -6,7 +6,7 @@
<a ui-sref="analysis_org.organlasis"><i class="fa fa-hand-peace-o"></i>合伙人销售量|City Partner Sale</a> <a ui-sref="analysis_org.organlasis"><i class="fa fa-hand-peace-o"></i>合伙人销售量|City Partner Sale</a>
</li> </li>
<li ui-sref-active-eq="active" ng-if="('orgcommission'|withModule)"> <li ui-sref-active-eq="active" ng-if="('orgcommission'|withModule)">
<a ui-sref="analysis_org.orgcommission"><i class="fa fa-users"></i></i>合伙人提成|City Partner Commissions</a> <a ui-sref="analysis_org.commission"><i class="fa fa-users"></i></i>合伙人提成|City Partner Commissions</a>
</li> </li>
<li ui-sref-active-eq="active"> <li ui-sref-active-eq="active">
<a ui-sref="analysis_org.referrercommission"><i class="fa fa-users"></i></i>推荐人提成|Referrer Commissions</a> <a ui-sref="analysis_org.referrercommission"><i class="fa fa-users"></i></i>推荐人提成|Referrer Commissions</a>

@ -20,11 +20,15 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
'use strict'; 'use strict';
var app = angular.module('orgcommission', ['ui.router']); var app = angular.module('orgcommission', ['ui.router']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('analysis_org.orgcommission', { $stateProvider.state('analysis_org.commission', {
url: '/org_commissions', url: '/org_commissions',
templateUrl: '/static/config/orgcommission/templates/org_commission_root.html', templateUrl: '/static/config/orgcommission/templates/org_commission_root.html',
controller: 'orgCommissionRootCtrl' controller: 'orgCommissionRootCtrl'
}).state('analysis_org.orgcommission.month', { }).state('analysis_org.commission.month', {
url: '/commissionorg',
template: '<div ui-view></div>',
controller: ''
}).state('analysis_org.commission.month.org', {
url: '/months/{monthStr}', url: '/months/{monthStr}',
templateUrl: '/static/config/orgcommission/templates/org_commission_month.html', templateUrl: '/static/config/orgcommission/templates/org_commission_month.html',
controller: 'orgCommissionMonthViewCtrl', controller: 'orgCommissionMonthViewCtrl',
@ -33,7 +37,16 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr); return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr);
}] }]
} }
}).state('analysis_org.orgcommission.month.orgdetail', { }).state('analysis_org.commission.month.referrer', {
url: '/referrer_commissions/months/{monthStr}',
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.org.month.orgdetail', {
url: '/citypartners/{orgId}', url: '/citypartners/{orgId}',
templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html', templateUrl: '/static/config/orgcommission/templates/org_commission_detail.html',
controller: 'orgCommissionOrgDetailCtrl', controller: 'orgCommissionOrgDetailCtrl',
@ -42,9 +55,22 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId); return $http.get('/sys/citypartner_prizes/months/' + $stateParams.monthStr + '/orgs/' + $stateParams.orgId);
}] }]
} }
}).state('analysis_org.commission.referrer.month.detail', {
url: '/referrer_commissions/citypartners/{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('loginLogRootCtrl', ['$scope', '$state', function ($scope, $state) {
if ($state.is('logview.login_history')) {
$state.go('.managers')
}
}]);
app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog', app.controller('orgCommissionRootCtrl', ['$scope', '$http', '$filter', '$state', 'commonDialog',
function ($scope, $http, $filter, $state, commonDialog) { function ($scope, $http, $filter, $state, commonDialog) {
$scope.generate = {}; $scope.generate = {};
@ -63,7 +89,7 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
}).then(function () { }).then(function () {
var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')}; var params = {month: $filter('date')($scope.generate.month, 'yyyy-MM')};
$http.post('/sys/citypartner_prizes/generate', params).then(function () { $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; $scope.generate.status = null;
}, function (resp) { }, function (resp) {
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message}); commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message});
@ -89,21 +115,18 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
return has; return has;
}; };
$scope.gotoMonth = function (mon) { $scope.gotoMonth = function (mon) {
var monthStr = $scope.params.year.getFullYear() + '-' + (('0' + mon).substr(-2)); if($state.is('analysis_org.commission.month')){
$state.go('analysis_org.orgcommission.month', {monthStr: monthStr}) if(mon){
}; $scope.params.month = mon;
}
$scope.gotoMonth = function (mon) { var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month;
alert($scope.mon.monthstr); $state.go('.org', {monthStr: monthStr})
var monthStr = $scope.params.year.getFullYear() + '-' + (('0' + mon).substr(-2)); }
$state.go('analysis_org.orgcommission.month', {monthStr: monthStr})
}; };
$scope.gotoReferrerMonth = function () {
$scope.gotoReferrerMonth = function (mon) { var monthStr = $scope.params.year.getFullYear() + '-' + $scope.params.month ;
alert($scope.mon.monthstr); $state.go('analysis_org.commission.referrer.month', {monthStr: monthStr})
var monthStr = $scope.params.year.getFullYear() + '-' + (('0' + mon).substr(-2));
$state.go('analysis_agent.agentcommission.month', {monthStr: monthStr})
}; };
}]); }]);
app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$filter', function ($scope, monthData) { app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$filter', function ($scope, monthData) {
@ -131,6 +154,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 () { app.filter('commission_type_filter', function () {
return function (sectorValue) { return function (sectorValue) {

@ -1,11 +1,4 @@
<!--<section class="content-header">--> <div class="content">
<!--<h1>City Partner Commissions</h1>-->
<!--<ol class="breadcrumb">-->
<!--<li><i class="fa fa-users"></i> Analysis</li>-->
<!--<li class="active">City Partner Commissions</li>-->
<!--</ol>-->
<!--</section>-->
<section class="content">
<div class="box box-default"> <div class="box box-default">
<div class="box-body"> <div class="box-body">
<div class="form-inline"> <div class="form-inline">
@ -31,7 +24,7 @@
<div class="row"> <div class="row">
<div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="mon in availableMonths"> <div class="col-md-3 col-sm-6 col-xs-12" ng-repeat="mon in availableMonths">
<div class="info-box"> <div class="info-box">
<div class="info-box-icon bg-aqua" ng-bind="mon.month" ng-click="gotoMonth(mon.monthstr)" role="button"> <div class="info-box-icon bg-aqua" ng-bind="mon.month" ng-click="gotoMonth(mon.month)" role="button">
</div> </div>
<div class="info-box-content"> <div class="info-box-content">
<!--<div class="info-box-text text-bold text-red" ng-bind="r.charge_date"></div>--> <!--<div class="info-box-text text-bold text-red" ng-bind="r.charge_date"></div>-->
@ -58,12 +51,12 @@
<div is-open="ctrl.viewyear"> <div is-open="ctrl.viewyear">
<ul id="myTab" class="nav nav-tabs"> <ul id="myTab" class="nav nav-tabs">
<li class="active"> <li class="active">
<a ng-click="gotoMonth(mon.monthstr)" data-toggle="tab"> <a ng-click="gotoMonth(mon.month)" data-toggle="tab">
合伙人提成 合伙人提成
</a> </a>
</li> </li>
<li><a ng-click = "gotoReferrerMonth(mon.monthstr)" data-toggle="tab">推荐人提成</a></li> <li><a ng-click = "gotoReferrerMonth(mon.month)" data-toggle="tab">推荐人提成</a></li>
</ul> </ul>
</div> </div>
<div ui-view></div> <div ui-view></div>
</section> </div>

@ -1,4 +1,4 @@
<div ui-view> <div>
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header">Analysis</div> <div class="box-header">Analysis</div>
<div class="box-body"> <div class="box-body">

Loading…
Cancel
Save