|
|
@@ -260,101 +260,133 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
|
|
|
$scope.todo = data;
|
|
|
});
|
|
|
});
|
|
|
- app.controller('DataCtrl', function($scope) {
|
|
|
- $scope.charts = {
|
|
|
- sale : {
|
|
|
- chartType : 'pie',
|
|
|
- datas : {
|
|
|
- data : [ {
|
|
|
- x : "通达电子",
|
|
|
- y : [ 1800000 ],
|
|
|
- tooltip : "通达电子: ¥1800000"
|
|
|
- }, {
|
|
|
- x : "天派科技",
|
|
|
- y : [ 1600000 ],
|
|
|
- tooltip : "天派科技: ¥1600000"
|
|
|
- }, {
|
|
|
- x : "凯瑞德",
|
|
|
- y : [ 900000 ],
|
|
|
- tooltip : "凯瑞德: ¥900000"
|
|
|
- }, {
|
|
|
- x : "松下电器",
|
|
|
- y : [ 360000 ],
|
|
|
- tooltip : "松下电器: ¥360000"
|
|
|
- }, {
|
|
|
- x : "易商电子",
|
|
|
- y : [ 180000 ],
|
|
|
- tooltip : "易商电子: ¥180000"
|
|
|
- } ]
|
|
|
- },
|
|
|
- config : {
|
|
|
- labels : false,
|
|
|
- title : "客户月采购量排行榜",
|
|
|
- legend : {
|
|
|
- display : true,
|
|
|
- position : 'right'
|
|
|
- },
|
|
|
- colors : [ '#4D9934', '#33D6EA', '#98E1CC', '#8060E4', '#9999CC' ],
|
|
|
- click : function(d) {
|
|
|
+ app.controller('PersonalSaleStatCtrl', function($scope, SaleStat) {
|
|
|
+ SaleStat.cust({}, function(data){
|
|
|
+ var p = [], q = [];
|
|
|
+ angular.forEach(data.month, function(d){
|
|
|
+ p.push({x: (d.enterprise.enShortname || d.enterprise.enName), y: [(d.total || 0)], tooltip: (d.total || 0)});
|
|
|
+ });
|
|
|
+ angular.forEach(data.year, function(d){
|
|
|
+ q.push({x: (d.enterprise.enShortname || d.enterprise.enName), y: [(d.total || 0)], tooltip: (d.total || 0)});
|
|
|
+ });
|
|
|
+ $scope.custCharts = {
|
|
|
+ month : {
|
|
|
+ chartType : 'pie',
|
|
|
+ datas : {
|
|
|
+ data : p
|
|
|
+ },
|
|
|
+ config : {
|
|
|
+ labels : false,
|
|
|
+ title : "客户月采购量排行榜",
|
|
|
+ legend : {
|
|
|
+ display : true,
|
|
|
+ position : 'right'
|
|
|
+ },
|
|
|
+ colors : [ '#4D9934', '#33D6EA', '#98E1CC', '#8060E4', '#9999CC' ],
|
|
|
+ click : function(d) {
|
|
|
|
|
|
- },
|
|
|
- mouseover : function(d) {
|
|
|
+ },
|
|
|
+ mouseover : function(d) {
|
|
|
|
|
|
- },
|
|
|
- mouseout : function(d) {
|
|
|
+ },
|
|
|
+ mouseout : function(d) {
|
|
|
|
|
|
+ },
|
|
|
+ innerRadius : 0,
|
|
|
+ lineLegend : 'lineEnd'
|
|
|
+ }
|
|
|
},
|
|
|
- innerRadius : 0,
|
|
|
- lineLegend : 'lineEnd'
|
|
|
- }
|
|
|
- },
|
|
|
- seller : {
|
|
|
- chartType : 'pie',
|
|
|
- datas : {
|
|
|
- data : [ {
|
|
|
- x : "刘青松",
|
|
|
- y : [ 5000000 ],
|
|
|
- tooltip : "刘青松: ¥5000000"
|
|
|
- }, {
|
|
|
- x : "凌海洋",
|
|
|
- y : [ 2000000 ],
|
|
|
- tooltip : "凌海洋: ¥2000000"
|
|
|
- }, {
|
|
|
- x : "聂洋",
|
|
|
- y : [ 980000 ],
|
|
|
- tooltip : "聂洋: ¥980000"
|
|
|
- }, {
|
|
|
- x : "李小敏",
|
|
|
- y : [ 900000 ],
|
|
|
- tooltip : "李小敏: ¥900000"
|
|
|
- }, {
|
|
|
- x : "张韶刚",
|
|
|
- y : [ 800000 ],
|
|
|
- tooltip : "张韶刚: ¥800000"
|
|
|
- } ]
|
|
|
- },
|
|
|
- config : {
|
|
|
- labels : false,
|
|
|
- title : "业务员月销量排行榜",
|
|
|
- legend : {
|
|
|
- display : true,
|
|
|
- position : 'right'
|
|
|
- },
|
|
|
- colors : [ '#4D9934', '#33D6EA', '#98E1CC', '#8060E4', '#9999CC' ],
|
|
|
- click : function(d) {
|
|
|
+ year : {
|
|
|
+ chartType : 'pie',
|
|
|
+ datas : {
|
|
|
+ data : q
|
|
|
+ },
|
|
|
+ config : {
|
|
|
+ labels : false,
|
|
|
+ title : "客户年采购量排行榜",
|
|
|
+ legend : {
|
|
|
+ display : true,
|
|
|
+ position : 'right'
|
|
|
+ },
|
|
|
+ colors : [ '#4D9934', '#33D6EA', '#98E1CC', '#8060E4', '#9999CC' ],
|
|
|
+ click : function(d) {
|
|
|
|
|
|
- },
|
|
|
- mouseover : function(d) {
|
|
|
+ },
|
|
|
+ mouseover : function(d) {
|
|
|
|
|
|
- },
|
|
|
- mouseout : function(d) {
|
|
|
+ },
|
|
|
+ mouseout : function(d) {
|
|
|
|
|
|
- },
|
|
|
- innerRadius : 0,
|
|
|
- lineLegend : 'lineEnd'
|
|
|
- }
|
|
|
+ },
|
|
|
+ innerRadius : 0,
|
|
|
+ lineLegend : 'lineEnd'
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- };
|
|
|
+ });
|
|
|
+ SaleStat.seller({}, function(data){
|
|
|
+ var p = [], q = [];
|
|
|
+ angular.forEach(data.month, function(d){
|
|
|
+ p.push({x: (d.enterprise.enShortname || d.enterprise.enName), y: [(d.total || 0)], tooltip: (d.total || 0)});
|
|
|
+ });
|
|
|
+ angular.forEach(data.year, function(d){
|
|
|
+ q.push({x: (d.enterprise.enShortname || d.enterprise.enName), y: [(d.total || 0)], tooltip: (d.total || 0)});
|
|
|
+ });
|
|
|
+ $scope.sellerCharts = {
|
|
|
+ month : {
|
|
|
+ chartType : 'pie',
|
|
|
+ datas : {
|
|
|
+ data : []
|
|
|
+ },
|
|
|
+ config : {
|
|
|
+ labels : false,
|
|
|
+ title : "业务员月销量排行榜",
|
|
|
+ legend : {
|
|
|
+ display : true,
|
|
|
+ position : 'right'
|
|
|
+ },
|
|
|
+ colors : [ '#4D9934', '#33D6EA', '#98E1CC', '#8060E4', '#9999CC' ],
|
|
|
+ click : function(d) {
|
|
|
+
|
|
|
+ },
|
|
|
+ mouseover : function(d) {
|
|
|
+
|
|
|
+ },
|
|
|
+ mouseout : function(d) {
|
|
|
+
|
|
|
+ },
|
|
|
+ innerRadius : 0,
|
|
|
+ lineLegend : 'lineEnd'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ year : {
|
|
|
+ chartType : 'pie',
|
|
|
+ datas : {
|
|
|
+ data : []
|
|
|
+ },
|
|
|
+ config : {
|
|
|
+ labels : false,
|
|
|
+ title : "业务员年销量排行榜",
|
|
|
+ legend : {
|
|
|
+ display : true,
|
|
|
+ position : 'right'
|
|
|
+ },
|
|
|
+ colors : [ '#4D9934', '#33D6EA', '#98E1CC', '#8060E4', '#9999CC' ],
|
|
|
+ click : function(d) {
|
|
|
+
|
|
|
+ },
|
|
|
+ mouseover : function(d) {
|
|
|
+
|
|
|
+ },
|
|
|
+ mouseout : function(d) {
|
|
|
+
|
|
|
+ },
|
|
|
+ innerRadius : 0,
|
|
|
+ lineLegend : 'lineEnd'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ });
|
|
|
});
|
|
|
app.controller('SaleStatCtrl', function($scope, SaleStat){
|
|
|
SaleStat.get({}, function(data){
|