|
|
@@ -29,6 +29,33 @@ Ext.define('saas.view.home.InfoCard', {
|
|
|
'</div>'
|
|
|
],
|
|
|
|
|
|
+ cards: {
|
|
|
+ unship: {
|
|
|
+ title: '七天内待出货销售',
|
|
|
+ color: 'yellow'
|
|
|
+ },
|
|
|
+ unstorage: {
|
|
|
+ title: '七天内待入库采购',
|
|
|
+ color: 'purple'
|
|
|
+ },
|
|
|
+ unpay: {
|
|
|
+ title: '七天内代付款',
|
|
|
+ color: 'red'
|
|
|
+ },
|
|
|
+ unreceive: {
|
|
|
+ title: '七天内代收款',
|
|
|
+ color: 'pink'
|
|
|
+ },
|
|
|
+ unauditcheck: {
|
|
|
+ title: '未审核验收',
|
|
|
+ color: 'blue'
|
|
|
+ },
|
|
|
+ unauditship: {
|
|
|
+ title: '未审核出货',
|
|
|
+ color: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
initComponent: function () {
|
|
|
var me = this;
|
|
|
|
|
|
@@ -55,25 +82,39 @@ Ext.define('saas.view.home.InfoCard', {
|
|
|
me.callParent(arguments);
|
|
|
},
|
|
|
|
|
|
+ listeners: {
|
|
|
+ boforerender: function(m) {
|
|
|
+ m.addCardItems();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
addCardItems: function(infoData) {
|
|
|
+ infoData = infoData || {};
|
|
|
var me = this,
|
|
|
p = me.up('home'),
|
|
|
- // viewModel = p.getViewModel(),
|
|
|
- // infoData = viewModel.get('infoData'),
|
|
|
+ cards = me.cards,
|
|
|
datas = [],
|
|
|
items = [];
|
|
|
size = Math.ceil(me.body.el.getBox().width / 235);
|
|
|
|
|
|
me.removeAll();
|
|
|
- for(var x = 0; x < infoData.length;) {
|
|
|
+
|
|
|
+ var cl = Ext.Object.getAllKeys(cards);
|
|
|
+
|
|
|
+ for(var x = 0; x < cl.length;) {
|
|
|
var d = [];
|
|
|
- for(var y = 0; y < size && x < infoData.length; y++) {
|
|
|
- d.push(infoData[x]);
|
|
|
+ for(var y = 0; y < size && x < cl.length; y++) {
|
|
|
+ var key = cl[x];
|
|
|
+ d.push(Ext.merge(cards[key], {
|
|
|
+ content: infoData[key] || 0
|
|
|
+ }));
|
|
|
x++;
|
|
|
}
|
|
|
datas.push(d);
|
|
|
}
|
|
|
|
|
|
+ console.log(datas);
|
|
|
+
|
|
|
Ext.Array.each(datas, function(d, i) {
|
|
|
|
|
|
var store = Ext.create('Ext.data.Store', {
|