|
|
|
@ -12,7 +12,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
app.controller('partnersAnalysisCtrl', ['$scope', '$http', '$filter', '$timeout', 'commonDialog', 'chartParser','industryMap',
|
|
|
|
|
function ($scope, $http, $filter, $timeout, commonDialog, chartParser,industryMap) {
|
|
|
|
|
$scope.params = {};
|
|
|
|
|
|
|
|
|
|
$scope.analysis = {};
|
|
|
|
|
if (($scope.currentUser.role & parseInt('1000000000', 2)) > 0 && $scope.currentUser.org_id) {
|
|
|
|
|
$http.get('/sys/manager_accounts/group/group_bds').then(function (resp) {
|
|
|
|
|
$scope.bd_group_bds = resp.data;
|
|
|
|
@ -23,6 +23,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
if (!$scope.params.onlyGroup){
|
|
|
|
|
$scope.loadPartnersInTypes();
|
|
|
|
|
$scope.doAnalysis();
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (groupBD == 'all') {
|
|
|
|
@ -36,6 +37,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
}
|
|
|
|
|
$scope.loadPartnersInTypes();
|
|
|
|
|
$scope.doAnalysis();
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle();
|
|
|
|
|
};
|
|
|
|
|
$scope.loadRoyalpayindustry = function () {
|
|
|
|
|
$http.get('/static/data/royalpayindustry.json').then(function (resp) {
|
|
|
|
@ -176,6 +178,71 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
|
|
|
|
|
series: series
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle = function () {
|
|
|
|
|
var params = angular.copy($scope.analysis);
|
|
|
|
|
params.onlyGroup = $scope.params.onlyGroup;
|
|
|
|
|
if ($scope.params.group_bd){
|
|
|
|
|
params.group_bd=angular.copy($scope.params.group_bd);
|
|
|
|
|
}
|
|
|
|
|
$http.get('/analysis/partners/settlement', {params:params}).then(function (resp) {
|
|
|
|
|
$scope.settlementCycle = resp.data;
|
|
|
|
|
$scope.partners_settlement_chart = chartParser.parse(partnersBySettlementCycle, resp.data);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle();
|
|
|
|
|
$scope.chooseAll = function () {
|
|
|
|
|
$scope.analysis = {};
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle()
|
|
|
|
|
};
|
|
|
|
|
$scope.chooseThirtyDays = function () {
|
|
|
|
|
$scope.analysis = {};
|
|
|
|
|
$scope.analysis.end = $filter('date')(new Date(), 'yyyyMMdd');
|
|
|
|
|
var day = new Date();
|
|
|
|
|
day.setDate(day.getDate() - 30);
|
|
|
|
|
$scope.analysis.begin = $filter('date')(day, 'yyyyMMdd');
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle();
|
|
|
|
|
};
|
|
|
|
|
$scope.chooseLastMonth = function () {
|
|
|
|
|
$scope.analysis = {};
|
|
|
|
|
var monthFinish = new Date();
|
|
|
|
|
monthFinish.setDate(0);
|
|
|
|
|
$scope.analysis.end = $filter('date')(monthFinish, 'yyyyMMdd');
|
|
|
|
|
var monthBegin = new Date();
|
|
|
|
|
monthBegin.setDate(0);
|
|
|
|
|
monthBegin.setDate(1);
|
|
|
|
|
$scope.analysis.begin = $filter('date')(monthBegin, 'yyyyMMdd');
|
|
|
|
|
$scope.loadTradePartnersBySettlementCycle();
|
|
|
|
|
};
|
|
|
|
|
var partnersBySettlementCycle = {
|
|
|
|
|
chart: {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'item',
|
|
|
|
|
formatter :"{a} {b} : {c} ({d}%)"
|
|
|
|
|
},
|
|
|
|
|
color: colors
|
|
|
|
|
},
|
|
|
|
|
series: [{
|
|
|
|
|
basic: {
|
|
|
|
|
name: '周期', type: 'pie',
|
|
|
|
|
radius: '60%',
|
|
|
|
|
center: ['50%', '40%'],
|
|
|
|
|
itemStyle: {
|
|
|
|
|
emphasis: {
|
|
|
|
|
shadowBlur: 10,
|
|
|
|
|
shadowOffsetX: 0,
|
|
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
|
},
|
|
|
|
|
normal : {
|
|
|
|
|
label : {
|
|
|
|
|
position : 'outer',
|
|
|
|
|
formatter :"{a} {b} : {c} ({d}%)"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
column: {key: 'client_count', name: 'clean_days'}
|
|
|
|
|
}]
|
|
|
|
|
};
|
|
|
|
|
/*var partnerTypesConfig = function (legend) {
|
|
|
|
|
return {
|
|
|
|
|
chart: {
|
|
|
|
|