QueryGrid.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. *
  3. */
  4. Ext.define('erp.view.fa.arp.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: 'vm_yearmonth',
  15. type: 'string'
  16. },{
  17. name: 'vm_vendcode',
  18. type: 'string'
  19. },{
  20. name: 'vm_vendname',
  21. type: 'string'
  22. },{
  23. name: 'vm_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_apamount',
  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. name: 'vm_esamount',
  54. type: 'number'
  55. }],
  56. data: []
  57. }),
  58. defaultColumns: [{
  59. dataIndex: 'vm_yearmonth',
  60. cls: 'x-grid-header-1',
  61. width: 100,
  62. text: '期间'
  63. },{
  64. dataIndex: 'vm_vendcode',
  65. cls: 'x-grid-header-1',
  66. text: '供应商号',
  67. width: 120
  68. },{
  69. dataIndex: 'vm_vendname',
  70. cls: 'x-grid-header-1',
  71. text: '供应商名',
  72. width: 200
  73. },{
  74. dataIndex: 'vm_currency',
  75. cls: 'x-grid-header-1',
  76. text: '币别',
  77. width: 70
  78. },{
  79. dataIndex: 'asl_date',
  80. cls: 'x-grid-header-1',
  81. text: '日期',
  82. width: 100
  83. },{
  84. dataIndex: 'asl_source',
  85. cls: 'x-grid-header-1',
  86. text: '单据类型',
  87. width: 100
  88. },{
  89. dataIndex: 'asl_othercode',
  90. cls: 'x-grid-header-1',
  91. text: '单据编号',
  92. width: 150
  93. },{
  94. dataIndex: 'asl_action',
  95. cls: 'x-grid-header-1',
  96. text: '操作',
  97. width: 100
  98. },{
  99. dataIndex: 'asl_explanation',
  100. cls: 'x-grid-header-1',
  101. text: '说明',
  102. width: 150
  103. },{
  104. dataIndex: 'asl_apamount',
  105. cls: 'x-grid-header-1',
  106. text: '应付金额',
  107. xtype: 'numbercolumn',
  108. format: '0,000.00',
  109. align: 'right',
  110. width: 100
  111. },{
  112. dataIndex: 'asl_payamount',
  113. cls: 'x-grid-header-1',
  114. text: '付款金额',
  115. xtype: 'numbercolumn',
  116. format: '0,000.00',
  117. align: 'right',
  118. width: 100
  119. },{
  120. dataIndex: 'vm_esamount',
  121. cls: 'x-grid-header-1',
  122. text: '暂估金额',
  123. xtype: 'numbercolumn',
  124. format: '0,000.00',
  125. align: 'right',
  126. width: 100
  127. },{
  128. dataIndex: 'asl_balance',
  129. cls: 'x-grid-header-1',
  130. text: '余额',
  131. xtype: 'numbercolumn',
  132. format: '0,000.00',
  133. align: 'right',
  134. width: 100
  135. }],
  136. bodyStyle:'background-color:#f1f1f1;',
  137. cls: 'custom-grid',
  138. GridUtil: Ext.create('erp.util.GridUtil'),
  139. initComponent : function(){
  140. this.columns = this.defaultColumns;
  141. this.callParent(arguments);
  142. },
  143. viewConfig: {
  144. getRowClass: function(record) {
  145. return record.get('index')%2 == 0 ? (!Ext.isEmpty(record.get('cm_id')) ? 'custom-first' : 'custom') :
  146. (!Ext.isEmpty(record.get('cm_id')) ? 'custom-alt-first' : 'custom-alt');
  147. }
  148. }
  149. });