GridPanel.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. Ext.define('erp.view.oa.officialDocument.sendODManagement.query.GridPanel',{
  2. extend: 'Ext.grid.Panel',
  3. alias: 'widget.erpSODQueryGridPanel',
  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:'sod_id',
  15. type:'int'
  16. },{
  17. name:'sod_type',
  18. type:'string'
  19. },{
  20. name:'sod_title',
  21. type:'string'
  22. },{
  23. name:'sod_cs_organ',
  24. type:'string'
  25. },{
  26. name:'sod_drafter',
  27. type:'string'
  28. },{
  29. name:'date',
  30. type:'date'
  31. },{
  32. name:'sod_status',
  33. type:'string'
  34. },{
  35. name:'sod_number',
  36. type:'string'
  37. },{
  38. name:'sod_statuscode',
  39. type:'string'
  40. }]
  41. }),
  42. iconCls: 'icon-grid',
  43. frame: true,
  44. bodyStyle:'background-color:#f1f1f1;',
  45. features: [Ext.create('Ext.grid.feature.Grouping',{
  46. groupHeaderTpl: '{name} ({rows.length} 封)'
  47. })],
  48. // selModel: Ext.create('Ext.selection.CheckboxModel',{
  49. //
  50. // }),
  51. dockedItems: [{
  52. id : 'paging',
  53. xtype: 'erpMailPaging',
  54. dock: 'bottom',
  55. displayInfo: true
  56. }],
  57. columns: [{
  58. text: 'ID',
  59. width: 0,
  60. dataIndex: 'sod_id'
  61. },{
  62. text: '发文类型',
  63. width: 90,
  64. dataIndex: 'sod_type'
  65. },{
  66. text: '发文标题',
  67. width: 80,
  68. dataIndex: 'sod_title'
  69. },{
  70. text: '抄送部门',
  71. width: 150,
  72. dataIndex: 'sod_cs_organ'
  73. },{
  74. text: '拟稿人',
  75. width: 80,
  76. dataIndex: 'sod_drafter'
  77. },{
  78. text: '拟稿日期',
  79. width: 90,
  80. dataIndex: 'sod_date',
  81. renderer: function(val, meta, record){
  82. return Ext.util.Format.date(new Date(val),'Y-m-d');
  83. }
  84. },{
  85. text: '审批状态',
  86. width: 80,
  87. // id: 'sod_status',
  88. // xtype:'gridcolumn',
  89. dataIndex: 'sod_status'
  90. },{
  91. text: '发文字号',
  92. width: 80,
  93. dataIndex: 'sod_number'
  94. },{
  95. text: '审批状态码',
  96. width: 0,
  97. // xtype:'gridcolumn',
  98. dataIndex: 'sod_statuscode'
  99. }],
  100. tbar: [{
  101. iconCls: 'x-button-icon-print',
  102. text: $I18N.common.button.erpPrintButton,
  103. id: 'print',
  104. handler: function(btn){
  105. }
  106. }],
  107. initComponent : function(){
  108. this.callParent(arguments);
  109. url = "oa/officialDocument/sendODM/getSODList.action";
  110. this.getGroupData(page, pageSize);
  111. },
  112. listeners: {//滚动条有时候没反应,添加此监听器
  113. scrollershow: function(scroller) {
  114. if (scroller && scroller.scrollEl) {
  115. scroller.clearManagedListeners();
  116. scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
  117. }
  118. }
  119. },
  120. getGroupData: function(page, pageSize){
  121. var me = this;
  122. if(!page){
  123. page = 1;
  124. }
  125. if(!pageSize){
  126. pageSize = 15;
  127. }
  128. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading...
  129. Ext.Ajax.request({//拿到grid的columns
  130. url : basePath + url,
  131. params: {
  132. page: page,
  133. pageSize: pageSize
  134. },
  135. method : 'post',
  136. async: false,
  137. callback : function(options, success, response){
  138. // console.log(response);
  139. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  140. var res = new Ext.decode(response.responseText);
  141. if(res.exceptionInfo){
  142. showError(res.exceptionInfo);return;
  143. }
  144. if(res.error){
  145. showError(res.error);return;
  146. }
  147. if(!res.success){
  148. return;
  149. } else {
  150. // console.log(res.jprocesslist);
  151. dataCount = res.count;
  152. me.store.loadData(res.success);
  153. }
  154. }
  155. });
  156. },
  157. updateWindow: function(id){
  158. var win = new Ext.window.Window({
  159. id : 'win2',
  160. title: "修改日程",
  161. height: "90%",
  162. width: "80%",
  163. maximizable : false,
  164. buttonAlign : 'left',
  165. layout : 'anchor',
  166. items: [{
  167. tag : 'iframe',
  168. frame : true,
  169. anchor : '100% 100%',
  170. layout : 'fit',
  171. 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>'
  172. }]
  173. });
  174. win.show();
  175. }
  176. });