|
|
@@ -3,8 +3,10 @@ Ext.define('saas.view.home.HomeModel', {
|
|
|
alias: 'viewmodel.home',
|
|
|
|
|
|
data: {
|
|
|
- month_sale_amount: '0',
|
|
|
- month_purchase_amount: '0'
|
|
|
+ month_sale_amount: '0', // 本月销售合计
|
|
|
+ month_purchase_amount: '0', // 本月采购合计
|
|
|
+ month_in: '0', // 本月收入合计
|
|
|
+ month_out: '0', // 本月支出合计
|
|
|
},
|
|
|
|
|
|
stores: {
|
|
|
@@ -15,6 +17,10 @@ Ext.define('saas.view.home.HomeModel', {
|
|
|
type: 'ajax',
|
|
|
// url: 'http://192.168.253.58:8920/homePage/liveData',
|
|
|
url: '/api/commons/homePage/liveData',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
+ },
|
|
|
reader: {
|
|
|
type: 'json'
|
|
|
},
|
|
|
@@ -40,14 +46,33 @@ Ext.define('saas.view.home.HomeModel', {
|
|
|
|
|
|
month_sale: {
|
|
|
model: 'saas.model.chart.DataXY',
|
|
|
- // url: 'http://192.168.253.58:8920/homePage/liveData',
|
|
|
- data: [{
|
|
|
- "xvalue": "无",
|
|
|
- "yvalue": 1
|
|
|
- }],
|
|
|
+ autoLoad: true,
|
|
|
+ proxy: {
|
|
|
+ type: 'ajax',
|
|
|
+ // url: 'http://192.168.253.58:8920/homePage/saleData',
|
|
|
+ url: '/api/commons/homePage/saleData',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
+ },
|
|
|
+ reader: {
|
|
|
+ type: 'json',
|
|
|
+ rootProperty: 'data',
|
|
|
+ },
|
|
|
+ listeners: {
|
|
|
+ exception: function(proxy, response, operation, eOpts) {
|
|
|
+ Ext.getCmp('month_sale').setLoading(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
listeners: {
|
|
|
- load: function() {
|
|
|
- console.log();
|
|
|
+ beforeload: function() {
|
|
|
+ Ext.getCmp('month_sale').setLoading(true);
|
|
|
+ },
|
|
|
+ load: function(s, d) {
|
|
|
+ Ext.getCmp('month_sale').setLoading(false);
|
|
|
+ var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
|
|
|
+ Ext.getCmp('home').getViewModel().set('month_sale_amount', sum)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -57,10 +82,15 @@ Ext.define('saas.view.home.HomeModel', {
|
|
|
autoLoad: true,
|
|
|
proxy: {
|
|
|
type: 'ajax',
|
|
|
- url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
|
|
|
- // url: '/api/commons/homePage/liveData',
|
|
|
+ // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
|
|
|
+ url: '/api/commons/homePage/purchaseData?sixMonths=false',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
+ },
|
|
|
reader: {
|
|
|
- type: 'json'
|
|
|
+ type: 'json',
|
|
|
+ rootProperty: 'data',
|
|
|
},
|
|
|
listeners: {
|
|
|
exception: function(proxy, response, operation, eOpts) {
|
|
|
@@ -74,384 +104,151 @@ Ext.define('saas.view.home.HomeModel', {
|
|
|
},
|
|
|
load: function(s, d) {
|
|
|
Ext.getCmp('month-purchase').setLoading(false);
|
|
|
+ var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
|
|
|
+ Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- barData: {
|
|
|
- model: 'saas.model.chart.DataXY',
|
|
|
- data: [
|
|
|
- {
|
|
|
- "xvalue": 2004,
|
|
|
- "yvalue": 239
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2005,
|
|
|
- "yvalue": 402
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2006,
|
|
|
- "yvalue": 706
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2007,
|
|
|
- "yvalue": 432
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2008,
|
|
|
- "yvalue": 200
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2009,
|
|
|
- "yvalue": 763
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2010,
|
|
|
- "yvalue": 550
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2011,
|
|
|
- "yvalue": 630
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2012,
|
|
|
- "yvalue": 278
|
|
|
+ month_io: {
|
|
|
+ fields: ['x', 'main', 'other'],
|
|
|
+ autoLoad: true,
|
|
|
+ proxy: {
|
|
|
+ type: 'ajax',
|
|
|
+ // url: 'http://192.168.253.58:8920/homePage/payAndRecData',
|
|
|
+ url: '/api/commons/homePage/payAndRecData',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 2013,
|
|
|
- "yvalue": 312
|
|
|
+ reader: {
|
|
|
+ type: 'json',
|
|
|
+ rootProperty: 'data',
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 2014,
|
|
|
- "yvalue": 600
|
|
|
+ listeners: {
|
|
|
+ exception: function(proxy, response, operation, eOpts) {
|
|
|
+ Ext.getCmp('month_io').setLoading(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ listeners: {
|
|
|
+ beforeload: function() {
|
|
|
+ Ext.getCmp('month_io').setLoading(true);
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 2015,
|
|
|
- "yvalue": 283
|
|
|
+ load: function(s, d) {
|
|
|
+ Ext.getCmp('month_io').setLoading(false);
|
|
|
+ s.each(function(r) {
|
|
|
+ var sum = Ext.util.Format.number(r.get('main') + r.get('other'), '0.00') || 0;
|
|
|
+ if(r.get('x') == '收入') {
|
|
|
+ Ext.getCmp('home').getViewModel().set('month_in', sum);
|
|
|
+ }else if(r.get('x') == '支出') {
|
|
|
+ Ext.getCmp('home').getViewModel().set('month_in', sum);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- ]
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- stackedData: {
|
|
|
- model: 'saas.model.chart.MultiDataXY',
|
|
|
- data: [
|
|
|
- {
|
|
|
- "xvalue": 1997,
|
|
|
- "y1value": 281,
|
|
|
- "y2value": 72,
|
|
|
- "y3value": 269,
|
|
|
- "y4value": 762
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1981,
|
|
|
- "y1value": 518,
|
|
|
- "y2value": 999,
|
|
|
- "y3value": 43,
|
|
|
- "y4value": 310
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1985,
|
|
|
- "y1value": 38,
|
|
|
- "y2value": 311,
|
|
|
- "y3value": 942,
|
|
|
- "y4value": 77
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1984,
|
|
|
- "y1value": 936,
|
|
|
- "y2value": 415,
|
|
|
- "y3value": 562,
|
|
|
- "y4value": 412
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1979,
|
|
|
- "y1value": 978,
|
|
|
- "y2value": 331,
|
|
|
- "y3value": 927,
|
|
|
- "y4value": 114
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1982,
|
|
|
- "y1value": 196,
|
|
|
- "y2value": 240,
|
|
|
- "y3value": 72,
|
|
|
- "y4value": 888
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1992,
|
|
|
- "y1value": 481,
|
|
|
- "y2value": 375,
|
|
|
- "y3value": 139,
|
|
|
- "y4value": 762
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 19895,
|
|
|
- "y1value": 623,
|
|
|
- "y2value": 999,
|
|
|
- "y3value": 260,
|
|
|
- "y4value": 310
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1988,
|
|
|
- "y1value": 328,
|
|
|
- "y2value": 451,
|
|
|
- "y3value": 542,
|
|
|
- "y4value": 77
|
|
|
+ sale_trend: {
|
|
|
+ fields: ['x', 'sale', 'saleback'],
|
|
|
+ autoLoad: true,
|
|
|
+ proxy: {
|
|
|
+ type: 'ajax',
|
|
|
+ // url: 'http://192.168.253.58:8920/homePage/saleFutureData',
|
|
|
+ url: '/api/commons/homePage/saleFutureData',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 1980,
|
|
|
- "y1value": 456,
|
|
|
- "y2value": 615,
|
|
|
- "y3value": 342,
|
|
|
- "y4value": 412
|
|
|
+ reader: {
|
|
|
+ type: 'json',
|
|
|
+ rootProperty: 'data',
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 1990,
|
|
|
- "y1value": 788,
|
|
|
- "y2value": 531,
|
|
|
- "y3value": 489,
|
|
|
- "y4value": 114
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
-
|
|
|
- gaugeData: {
|
|
|
- data: [
|
|
|
- {
|
|
|
- position: 40
|
|
|
+ listeners: {
|
|
|
+ exception: function(proxy, response, operation, eOpts) {
|
|
|
+ Ext.getCmp('sale_trend').setLoading(false);
|
|
|
+ }
|
|
|
}
|
|
|
+ },
|
|
|
+ sorters: [
|
|
|
+ { property: 'x', direction: 'ASC' }
|
|
|
],
|
|
|
-
|
|
|
- fields: [
|
|
|
- {
|
|
|
- name: 'position'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
-
|
|
|
- radialData: {
|
|
|
- model: 'saas.model.chart.DataXY',
|
|
|
- data: [
|
|
|
- {
|
|
|
- "xvalue": "A",
|
|
|
- "yvalue": 417
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "B",
|
|
|
- "yvalue": 676
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "C",
|
|
|
- "yvalue": 606
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "D",
|
|
|
- "yvalue": 124
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "E",
|
|
|
- "yvalue": 473
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "F",
|
|
|
- "yvalue": 108
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "G",
|
|
|
- "yvalue": 847
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "H",
|
|
|
- "yvalue": 947
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": "I",
|
|
|
- "yvalue": 694
|
|
|
+ listeners: {
|
|
|
+ beforeload: function() {
|
|
|
+ Ext.getCmp('sale_trend').setLoading(true);
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": "J",
|
|
|
- "yvalue": 603
|
|
|
+ load: function(s, d) {
|
|
|
+ Ext.getCmp('sale_trend').setLoading(false);
|
|
|
}
|
|
|
- ]
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
- lineData: {
|
|
|
- model: 'saas.model.chart.DataXY',
|
|
|
- data: [
|
|
|
- {
|
|
|
- "xvalue": 2011,
|
|
|
- "yvalue": 0.1,
|
|
|
- "y1value": 0.2,
|
|
|
- "y2value": 0.3,
|
|
|
- "y3value": 0.1,
|
|
|
- "y4value": 0,
|
|
|
- "y5value": 1
|
|
|
+ purchase_trend: {
|
|
|
+ fields: ['x', 'y'],
|
|
|
+ autoLoad: true,
|
|
|
+ proxy: {
|
|
|
+ type: 'ajax',
|
|
|
+ // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=true',
|
|
|
+ url: '/api/commons/homePage/purchaseData?sixMonths=true',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 2012,
|
|
|
- "yvalue": 0.2,
|
|
|
- "y1value": 0.4,
|
|
|
- "y2value": 0.2,
|
|
|
- "y3value": 0.2,
|
|
|
- "y4value": 0,
|
|
|
- "y5value": 1
|
|
|
+ reader: {
|
|
|
+ type: 'json',
|
|
|
+ rootProperty: 'data',
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 2013,
|
|
|
- "yvalue": 0.3,
|
|
|
- "y1value": 0.2,
|
|
|
- "y2value": 0.4,
|
|
|
- "y3value": 0.3,
|
|
|
- "y4value": 0,
|
|
|
- "y5value": 1
|
|
|
-
|
|
|
+ listeners: {
|
|
|
+ exception: function(proxy, response, operation, eOpts) {
|
|
|
+ Ext.getCmp('purchase_trend').setLoading(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sorters: [
|
|
|
+ { property: 'x', direction: 'ASC' }
|
|
|
+ ],
|
|
|
+ listeners: {
|
|
|
+ beforeload: function() {
|
|
|
+ Ext.getCmp('purchase_trend').setLoading(true);
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 2014,
|
|
|
- "yvalue": 0.2,
|
|
|
- "y1value": 0.4,
|
|
|
- "y2value": 0.1,
|
|
|
- "y3value": 0.2,
|
|
|
- "y4value": 0,
|
|
|
- "y5value": 1
|
|
|
- },{
|
|
|
- "xvalue": 2015,
|
|
|
- "yvalue": 0.4,
|
|
|
- "y1value": 0.3,
|
|
|
- "y2value": 0.4,
|
|
|
- "y3value": 0.4,
|
|
|
- "y4value": 0,
|
|
|
- "y5value": 1
|
|
|
+ load: function(s, d) {
|
|
|
+ Ext.getCmp('purchase_trend').setLoading(false);
|
|
|
}
|
|
|
- ]
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- areaData: {
|
|
|
- model: 'saas.model.chart.MultiDataXY',
|
|
|
- data: [
|
|
|
- {
|
|
|
- "xvalue": 250,
|
|
|
- "y1value": 94,
|
|
|
- "y2value": 40
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 500,
|
|
|
- "y1value": 78,
|
|
|
- "y2value": 46
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 750,
|
|
|
- "y1value": 60,
|
|
|
- "y2value": 53
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1250,
|
|
|
- "y1value": 51,
|
|
|
- "y2value": 48
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1500,
|
|
|
- "y1value": 60,
|
|
|
- "y2value": 36
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 1750,
|
|
|
- "y1value": 68,
|
|
|
- "y2value": 26
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2250,
|
|
|
- "y1value": 59,
|
|
|
- "y2value": 37
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2500,
|
|
|
- "y1value": 40,
|
|
|
- "y2value": 58
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 2750,
|
|
|
- "y1value": 24,
|
|
|
- "y2value": 78
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 3250,
|
|
|
- "y1value": 36,
|
|
|
- "y2value": 85
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 3500,
|
|
|
- "y1value": 65,
|
|
|
- "y2value": 70
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 3750,
|
|
|
- "y1value": 94,
|
|
|
- "y2value": 55
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 4250,
|
|
|
- "y1value": 103,
|
|
|
- "y2value": 61
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 4500,
|
|
|
- "y1value": 83,
|
|
|
- "y2value": 82
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 4750,
|
|
|
- "y1value": 61,
|
|
|
- "y2value": 102
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 5250,
|
|
|
- "y1value": 55,
|
|
|
- "y2value": 95
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 5500,
|
|
|
- "y1value": 70,
|
|
|
- "y2value": 67
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 5750,
|
|
|
- "y1value": 84,
|
|
|
- "y2value": 39
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 6250,
|
|
|
- "y1value": 78,
|
|
|
- "y2value": 31
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 6500,
|
|
|
- "y1value": 58,
|
|
|
- "y2value": 49
|
|
|
- },
|
|
|
- {
|
|
|
- "xvalue": 6750,
|
|
|
- "y1value": 38,
|
|
|
- "y2value": 69
|
|
|
+ stock_amount: {
|
|
|
+ fields: ['x', 'y'],
|
|
|
+ autoLoad: true,
|
|
|
+ proxy: {
|
|
|
+ type: 'ajax',
|
|
|
+ // url: 'http://192.168.253.58:8920/homePage/storageData',
|
|
|
+ url: '/api/commons/homePage/storageData',
|
|
|
+ timeout: 8000,
|
|
|
+ actionMethods: {
|
|
|
+ read: 'GET'
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 7250,
|
|
|
- "y1value": 41,
|
|
|
- "y2value": 74
|
|
|
+ reader: {
|
|
|
+ type: 'json',
|
|
|
+ rootProperty: 'data',
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 7500,
|
|
|
- "y1value": 65,
|
|
|
- "y2value": 60
|
|
|
+ listeners: {
|
|
|
+ exception: function(proxy, response, operation, eOpts) {
|
|
|
+ Ext.getCmp('stock_amount').setLoading(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ sorters: [
|
|
|
+ { property: 'x', direction: 'ASC' }
|
|
|
+ ],
|
|
|
+ listeners: {
|
|
|
+ beforeload: function() {
|
|
|
+ Ext.getCmp('stock_amount').setLoading(true);
|
|
|
},
|
|
|
- {
|
|
|
- "xvalue": 7750,
|
|
|
- "y1value": 89,
|
|
|
- "y2value": 46
|
|
|
+ load: function(s, d) {
|
|
|
+ Ext.getCmp('stock_amount').setLoading(false);
|
|
|
}
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
});
|