GridPanel.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. Ext.define('erp.view.oa.officialDocument.receiveODManagement.query.GridPanel',{
  2. extend: 'Ext.grid.Panel',
  3. alias: 'widget.erpRODQueryGridPanel',
  4. id: 'grid',
  5. emptyText : '无数据',
  6. columnLines : true,
  7. autoScroll : true,
  8. FormUtil: Ext.create('erp.util.FormUtil'),
  9. GridUtil: Ext.create('erp.util.GridUtil'),
  10. plugins: [Ext.create('Ext.ux.grid.GridHeaderFilters')],
  11. BaseUtil: Ext.create('erp.util.BaseUtil'),
  12. store: Ext.create('Ext.data.Store', {
  13. fields: [{
  14. name:'id',
  15. type:'int'
  16. },{
  17. name:'swnumber',
  18. type:'string'
  19. },{
  20. name:'type',
  21. type:'string'
  22. },{
  23. name:'lwnumber',
  24. type:'string'
  25. },{
  26. name:'title',
  27. type:'string'
  28. },{
  29. name:'date',
  30. type:'date'
  31. },{
  32. name:'unit',
  33. type:'string'
  34. },{
  35. name:'status',
  36. type:'string'
  37. }]
  38. }),
  39. iconCls: 'icon-grid',
  40. frame: true,
  41. bodyStyle:'background-color:#f1f1f1;',
  42. features: [Ext.create('Ext.grid.feature.Grouping',{
  43. groupHeaderTpl: '{name} ({rows.length} 封)'
  44. })],
  45. // selModel: Ext.create('Ext.selection.CheckboxModel',{
  46. //
  47. // }),
  48. dockedItems: [{
  49. id : 'paging',
  50. xtype: 'erpMailPaging',
  51. dock: 'bottom',
  52. displayInfo: true
  53. }],
  54. columns: [{
  55. text: 'ID',
  56. width: 0,
  57. dataIndex: 'rod_id'
  58. },{
  59. text: '收文编号',
  60. width: 80,
  61. dataIndex: 'rod_sw_number'
  62. },{
  63. text: '收文类型',
  64. width: 90,
  65. dataIndex: 'rod_type',
  66. },{
  67. text: '来文编号',
  68. width: 80,
  69. dataIndex: 'rod_lw_number'
  70. },{
  71. text: '来文标题',
  72. width: 150,
  73. dataIndex: 'rod_title'
  74. },{
  75. text: '收文日期',
  76. width: 90,
  77. dataIndex: 'rod_date',
  78. renderer: function(val, meta, record){
  79. return Ext.util.Format.date(new Date(val),'Y-m-d');
  80. }
  81. },{
  82. text: '来文单位',
  83. width: 120,
  84. dataIndex: 'rod_unit'
  85. },{
  86. text: '审批状态',
  87. width: 80,
  88. dataIndex: 'rod_status'
  89. }],
  90. tbar: [{
  91. iconCls: 'x-button-icon-print',
  92. text: $I18N.common.button.erpPrintButton,
  93. id: 'print',
  94. handler: function(btn){
  95. }
  96. }],
  97. initComponent : function(){
  98. this.callParent(arguments);
  99. url = "oa/officialDocument/receiveODM/getRODList.action";
  100. this.getGroupData(page, pageSize);
  101. },
  102. listeners: {//滚动条有时候没反应,添加此监听器
  103. scrollershow: function(scroller) {
  104. if (scroller && scroller.scrollEl) {
  105. scroller.clearManagedListeners();
  106. scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
  107. }
  108. }
  109. },
  110. getGroupData: function(page, pageSize){
  111. var me = this;
  112. if(!page){
  113. page = 1;
  114. }
  115. if(!pageSize){
  116. pageSize = 15;
  117. }
  118. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading...
  119. Ext.Ajax.request({//拿到grid的columns
  120. url : basePath + url,
  121. params: {
  122. page: page,
  123. pageSize: pageSize
  124. },
  125. method : 'post',
  126. async: false,
  127. callback : function(options, success, response){
  128. // console.log(response);
  129. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  130. var res = new Ext.decode(response.responseText);
  131. if(res.exceptionInfo){
  132. showError(res.exceptionInfo);return;
  133. }
  134. if(res.error){
  135. showError(res.error);return;
  136. }
  137. if(!res.success){
  138. return;
  139. } else {
  140. // console.log(res.jprocesslist);
  141. dataCount = res.count;
  142. me.store.loadData(res.success);
  143. }
  144. }
  145. });
  146. },
  147. updateWindow: function(id){
  148. var win = new Ext.window.Window({
  149. id : 'win2',
  150. title: "修改日程",
  151. height: "90%",
  152. width: "80%",
  153. maximizable : false,
  154. buttonAlign : 'left',
  155. layout : 'anchor',
  156. items: [{
  157. tag : 'iframe',
  158. frame : true,
  159. anchor : '100% 100%',
  160. layout : 'fit',
  161. html : '<iframe id="iframe_' + id + '" src="' + basePath + 'jsps/common/commonpage.jsp?whoami=Agenda&formCondition=ag_idIS' + id + '&gridCondition=" height="100%" width="100%" frameborder="0" scrolling="yes"></iframe>'
  162. }]
  163. });
  164. win.show();
  165. }
  166. });