MonthAccountDetail.js.svn-base 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Ext.define('erp.view.scm.reserve.MonthAccountDetail',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'form',
  10. anchor: '100% 10%',
  11. bodyStyle: 'background:#f1f1f1',
  12. layout: 'column',
  13. defaults: {
  14. xtype: 'displayfield',
  15. columnWidth: .2
  16. },
  17. items: [{
  18. fieldLabel: '期间',
  19. margin: '0 0 0 8',
  20. id: 'info_ym',
  21. value: ym
  22. },{
  23. fieldLabel: '科目',
  24. value: catecode,
  25. id:'info_catecode'
  26. }]
  27. },{
  28. xtype: 'grid',
  29. anchor: '100% 90%',
  30. columnLines: true,
  31. columns: [{
  32. text: '类型',
  33. cls: 'x-grid-header-1',
  34. dataIndex: 'typename',
  35. width: 200
  36. },{
  37. text: '存货模块金额',
  38. cls: 'x-grid-header-1',
  39. dataIndex: 'pd_sumamount',
  40. xtype: 'numbercolumn',
  41. format: '0,000.000',
  42. align: 'right',
  43. width: 250
  44. },{
  45. text: '总账模块金额',
  46. cls: 'x-grid-header-1',
  47. dataIndex: 'vo_sumamount',
  48. xtype: 'numbercolumn',
  49. format: '0,000.000',
  50. align: 'right',
  51. width: 250
  52. },{
  53. text: '差额',
  54. cls: 'x-grid-header-1',
  55. dataIndex: 'sumbalance',
  56. align: 'right',
  57. width: 250,
  58. renderer: function(val, meta, record) {
  59. val = record.get('pd_sumamount') - record.get('vo_sumamount');
  60. if(record.get('sumbalance') != val) {
  61. record.set('sumbalance', val);
  62. }
  63. return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
  64. }
  65. }],
  66. store: Ext.create('Ext.data.Store', {
  67. fields: [{
  68. name: 'isCount', type: 'bool'
  69. },{
  70. name: 'typename', type: 'string'
  71. },{
  72. name: 'pd_sumamount', type: 'number'
  73. },{
  74. name: 'vo_sumamount', type: 'number'
  75. },{
  76. name: 'sumbalance', type: 'number'
  77. }],
  78. viewConfig: {
  79. getRowClass: function(record) {
  80. return record.get('isCount') ? 'isCount' : null;
  81. }
  82. }
  83. })
  84. }]
  85. });
  86. me.callParent(arguments);
  87. }
  88. });