QueryGrid.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /**
  2. *
  3. */
  4. Ext.define('erp.view.fa.ars.QueryGrid',{
  5. extend: 'Ext.grid.Panel',
  6. alias: 'widget.querygrid',
  7. layout : 'fit',
  8. id: 'querygrid',
  9. emptyText : $I18N.common.grid.emptyText,
  10. columnLines : true,
  11. autoScroll : true,
  12. store: Ext.create('Ext.data.Store', {
  13. fields:[{
  14. name: 'cm_yearmonth',
  15. type: 'string'
  16. },{
  17. name: 'cm_custcode',
  18. type: 'string'
  19. },{
  20. name: 'cm_custname',
  21. type: 'string'
  22. },{
  23. name: 'cm_currency',
  24. type: 'string'
  25. },{
  26. name: 'asl_date',
  27. type: 'string'
  28. },{
  29. name: 'asl_source',
  30. type: 'string'
  31. },{
  32. name: 'asl_othercode',
  33. type: 'string'
  34. },{
  35. name: 'asl_action',
  36. type: 'string'
  37. },{
  38. name: 'asl_explanation',
  39. type: 'string'
  40. },{
  41. name: 'asl_aramount',
  42. type: 'number'
  43. },{
  44. name: 'asl_payamount',
  45. type: 'number'
  46. },{
  47. name: 'asl_balance',
  48. type: 'number'
  49. },{
  50. name: 'index',
  51. type: 'number'
  52. }],
  53. data: []
  54. }),
  55. defaultColumns: [{
  56. dataIndex: 'cm_yearmonth',
  57. cls: 'x-grid-header-1',
  58. width: 100,
  59. text: '期间'
  60. },{
  61. dataIndex: 'cm_custcode',
  62. cls: 'x-grid-header-1',
  63. text: '客户编码',
  64. width: 120
  65. },{
  66. dataIndex: 'cm_custname',
  67. cls: 'x-grid-header-1',
  68. text: '客户名称',
  69. width: 200
  70. },{
  71. dataIndex: 'cm_currency',
  72. cls: 'x-grid-header-1',
  73. text: '币别',
  74. width: 70
  75. },{
  76. dataIndex: 'asl_date',
  77. cls: 'x-grid-header-1',
  78. text: '日期',
  79. width: 100
  80. },{
  81. dataIndex: 'asl_source',
  82. cls: 'x-grid-header-1',
  83. text: '单据类型',
  84. width: 100
  85. },{
  86. dataIndex: 'asl_othercode',
  87. cls: 'x-grid-header-1',
  88. text: '单据编号',
  89. width: 150
  90. },{
  91. dataIndex: 'asl_action',
  92. cls: 'x-grid-header-1',
  93. text: '操作',
  94. width: 100
  95. },{
  96. dataIndex: 'asl_explanation',
  97. cls: 'x-grid-header-1',
  98. text: '说明',
  99. width: 150
  100. },{
  101. dataIndex: 'asl_aramount',
  102. cls: 'x-grid-header-1',
  103. text: '应收金额',
  104. width: 100
  105. },{
  106. dataIndex: 'asl_payamount',
  107. cls: 'x-grid-header-1',
  108. text: '收款金额',
  109. width: 100
  110. },{
  111. dataIndex: 'asl_balance',
  112. cls: 'x-grid-header-1',
  113. text: '余额',
  114. width: 100
  115. }],
  116. bodyStyle:'background-color:#f1f1f1;',
  117. cls: 'custom-grid',
  118. GridUtil: Ext.create('erp.util.GridUtil'),
  119. initComponent : function(){
  120. this.columns = this.defaultColumns;
  121. this.callParent(arguments);
  122. },
  123. viewConfig: {
  124. getRowClass: function(record) {
  125. return record.get('index')%2 == 0 ? (!Ext.isEmpty(record.get('cm_id')) ? 'custom-first' : 'custom') :
  126. (!Ext.isEmpty(record.get('cm_id')) ? 'custom-alt-first' : 'custom-alt');
  127. }
  128. }
  129. });