|
|
|
@ -106,7 +106,8 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
|
rates: function () {
|
|
|
|
|
return angular.copy($scope.bd_rate_configs);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
size:'lg'
|
|
|
|
|
}).result.then(function () {
|
|
|
|
|
$scope.loadRateConfigs();
|
|
|
|
|
})
|
|
|
|
@ -136,7 +137,9 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
|
value: 3,
|
|
|
|
|
label: '>=7 Months'
|
|
|
|
|
}];
|
|
|
|
|
$scope.filter = {bd_level: 1, months: 1};
|
|
|
|
|
$scope.kpiRanges = [{value: 1, label: '<50%'}, {value: 2, label: '50%<=kpi<80%'}, {value: 3, label: '80%<=kpi<100%'},
|
|
|
|
|
{value: 4, label: '100%<=kpi<120%'}, {value: 5, label: '>=120%'}];
|
|
|
|
|
$scope.filter = {bd_level: 1, months: 1,kpi_range:1};
|
|
|
|
|
$scope.rates = rates;
|
|
|
|
|
$scope.submitRates = function () {
|
|
|
|
|
var validation = null;
|
|
|
|
@ -191,7 +194,7 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
|
app.controller('bdCommissionConfigCtrl', ['$scope', '$state', '$http', '$filter', 'monModal', function ($scope, $state, $http, $filter, monModal) {
|
|
|
|
|
$scope.monModal = monModal;
|
|
|
|
|
$scope.params = {year: new Date().getFullYear()};
|
|
|
|
|
$scope.bdtypes = [{id: 1, label: 'Leader'}, {id: 2, label: 'Manager'}, {id: 3, label: 'Director'}];
|
|
|
|
|
$scope.bdtypes = [{id: 1, label: 'Director'}, {id: 2, label: 'Manager'}, {id: 3, label: 'Sydney GM'},{id: 4, label: 'COO'},{id: 5, label: 'NJ Department'}];
|
|
|
|
|
// $scope.bdmon;
|
|
|
|
|
// $scope.newSwitch;
|
|
|
|
|
$scope.initMonth = function (year) {
|
|
|
|
@ -209,6 +212,12 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
|
var end = $filter('date')(new Date(), 'yyyy-MM');
|
|
|
|
|
return start <= mon && end >= mon
|
|
|
|
|
};
|
|
|
|
|
$scope.getBDLevels = function () {
|
|
|
|
|
$http.get('/sys/bd_prize/config/bd_levels').then(function (resp) {
|
|
|
|
|
$scope.bds = resp.data;
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
$scope.getBDLevels();
|
|
|
|
|
$scope.listCurrentMonBDCommission = function (mon) {
|
|
|
|
|
$http.get('/sys/bd_prize/commission/le_ma/' + mon).then(function (resp) {
|
|
|
|
|
$scope.bdlm = resp.data;
|
|
|
|
@ -266,6 +275,22 @@ define(['angular', '../../analysis/bd/analysis-bd'], function (angular) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$scope.submitBdCommmissionConfig = function (mon, bds) {
|
|
|
|
|
$scope.check = true;
|
|
|
|
|
angular.forEach(bds, function (data, index) {
|
|
|
|
|
$scope.errmsg = null;
|
|
|
|
|
if (!data.kpi_amount) {
|
|
|
|
|
$scope.errmsg = "BD kpi Amount not be null";
|
|
|
|
|
$scope.check = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if ($scope.check) {
|
|
|
|
|
$http.post('/sys/bd_prize/commission/kpi/update/' + mon, bds).then(function (resp) {
|
|
|
|
|
$scope.$close();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
app.controller('bdPrizeMonthReportCtrl', ['$scope', '$http', 'report', function ($scope, $http, report) {
|
|
|
|
|
$scope.report = report.data;
|
|
|
|
|