Grid.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. Ext.define('uas.view.form.formpanel.Grid', {
  2. extend: 'Ext.grid.Panel',
  3. xtype: 'formpanel-grid',
  4. requires: [
  5. 'Ext.selection.CellModel',
  6. 'Ext.grid.feature.Summary'
  7. ],
  8. emptyText: '无数据',
  9. loadMask: true,
  10. bind:'{formGridStore}',
  11. features: [{
  12. ftype: 'summary',
  13. dock: 'bottom'
  14. }],
  15. selModel: {
  16. type: 'cellmodel'
  17. },
  18. plugins: {
  19. cellediting: {
  20. clicksToEdit: 1
  21. }
  22. },
  23. initComponent: function () {
  24. var me = this;
  25. Ext.apply(me, {
  26. store: Ext.create('uas.store.FormGridStore',{
  27. grid: me,
  28. autoLoad: true,
  29. autoDestroy: true
  30. })
  31. });
  32. me.callParent(arguments);
  33. },
  34. dockedItems: [{
  35. cls:'x-grid-operateToolbar',
  36. xtype: 'toolbar',
  37. dock: 'top',
  38. height:32,
  39. defaults:{
  40. cls:'x-btn-blue',
  41. xtype:'button',
  42. margin:'0 0 0 6',
  43. },
  44. items:[{
  45. text:'新增'
  46. },{
  47. text:'处理'
  48. },{
  49. text:'删除'
  50. },{
  51. text:'复制行'
  52. },{
  53. text:'粘贴行'
  54. }]
  55. }],
  56. columns: [{
  57. dataIndex: 'id',
  58. text: '序号',
  59. width:110,
  60. align:'center',
  61. locked: true,
  62. summaryType: 'count',
  63. summaryRenderer: function(value, summaryData, dataIndex) {
  64. return Ext.String.format('共{0}条', value);
  65. }
  66. }, {
  67. dataIndex: 'code',
  68. text: '采购单号(单选)',
  69. width:200,
  70. locked: true,
  71. filter: {
  72. type:'string'
  73. },
  74. editor: {
  75. name:'code',
  76. xtype:'producttrigger',
  77. allowBlank: false,
  78. selectOnFocus: false
  79. }
  80. },{
  81. dataIndex: 'vcode',
  82. text: '供应商编号(多选)',
  83. width:200,
  84. locked: true,
  85. filter: {
  86. type:'string'
  87. },
  88. editor: {
  89. name:'vcode',
  90. xtype:'vendormultitrigger',
  91. allowBlank: false,
  92. selectOnFocus: false
  93. }
  94. }, {
  95. dataIndex: 'status',
  96. text: '单据状态',
  97. width:100,
  98. filter: {
  99. type:'string'
  100. }
  101. }, {
  102. xtype: 'datecolumn',
  103. dataIndex: 'date',
  104. text: '下单日期',
  105. width: 200,
  106. filter: {
  107. type:'date'
  108. }
  109. }, {
  110. dataIndex: 'vendor',
  111. text: '供应商名',
  112. width: 220,
  113. filter: {
  114. type:'string'
  115. }
  116. }, {
  117. xtype:'numbercolumn',
  118. dataIndex: 'price',
  119. text: '含税金额',
  120. format:'0,000.00',
  121. width:190,
  122. filter: {
  123. type:'number'
  124. },
  125. summaryType: 'sum',
  126. summaryRenderer: function(value, summaryData, dataIndex) {
  127. return Ext.String.format('合计:{0} 元', value.toFixed(2));
  128. }
  129. },{
  130. dataIndex: 'special',
  131. text:'特殊采购',
  132. width:120,
  133. filter: {
  134. type:'combo',
  135. combo:[
  136. ["true", "是"],
  137. ["false", "否"]
  138. ]
  139. }
  140. },{
  141. dataIndex: 'currency',
  142. text: '币别',
  143. width:70
  144. },{
  145. dataIndex: 'recordman',
  146. text: '采购员',
  147. width:70
  148. },{
  149. dataIndex: 'auditman',
  150. text: '审核人',
  151. width:70
  152. }]
  153. });