GridPanel.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. Ext.define('erp.view.oa.myProcess.jprocessStatistics.GridPanel',{
  2. extend: 'Ext.grid.Panel',
  3. alias: 'widget.erpJProcessjprocessStatisticsGridPanel',
  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:'string'
  16. },{
  17. name:'name',
  18. type:'string'
  19. },{
  20. name:'form',
  21. type:'string'
  22. },{
  23. name:'nodeName',
  24. type:'string'
  25. },{
  26. name:'launcherId',
  27. type:'string'
  28. },{
  29. name:'launcherName',
  30. type:'string'
  31. },{
  32. name:'launchTime',
  33. type:'date'
  34. },{
  35. name:'stayMinutes',
  36. type:'string'
  37. },{
  38. name:'nodeDealMan',
  39. type:'string'
  40. },{
  41. name:'nodeId',
  42. type:'string'
  43. },{
  44. name:'status',
  45. type:'string'
  46. }]
  47. }),
  48. iconCls: 'icon-grid',
  49. frame: true,
  50. bodyStyle:'background-color:#f1f1f1;',
  51. features: [Ext.create('Ext.grid.feature.Grouping',{
  52. groupHeaderTpl: '{name} ({rows.length} 封)'
  53. })],
  54. selModel: Ext.create('Ext.selection.CheckboxModel',{
  55. }),
  56. dockedItems: [{
  57. id : 'paging',
  58. xtype: 'erpMailPaging',
  59. dock: 'bottom',
  60. displayInfo: true
  61. }],
  62. columns: [{
  63. text: '流程ID号',
  64. width: 80,
  65. dataIndex: 'jp_id'
  66. },{
  67. text: '流程名称',
  68. width: 160,
  69. dataIndex: 'jp_name'
  70. },{
  71. text: '流程单据',
  72. width: 160,
  73. dataIndex: 'jp_form'
  74. },{
  75. text: '当前步骤',
  76. width: 80,
  77. dataIndex: 'jp_nodeName'
  78. },{
  79. text: '发起人ID',
  80. width: 80,
  81. dataIndex: 'jp_launcherId'
  82. },{
  83. text: '发起人',
  84. width: 80,
  85. dataIndex: 'jp_launcherName'
  86. },{
  87. text: '发起时间',
  88. width: 120,
  89. dataIndex: 'jp_launchTime',
  90. renderer: function(val, meta, record){
  91. return Ext.util.Format.date(new Date(val),'Y-m-d H:i:s');
  92. }
  93. },{
  94. text: '停留分钟',
  95. width: 80,
  96. dataIndex: 'jp_stayMinutes'
  97. },{
  98. text: '当前办理人',
  99. width: 90,
  100. dataIndex: 'jp_nodeDealMan'
  101. },{
  102. text: '节点编号',
  103. width: 100,
  104. dataIndex: 'jp_nodeId'
  105. },{
  106. text: '流程状态',
  107. width: 100,
  108. dataIndex: 'jp_status'
  109. }],
  110. tbar: [{
  111. iconCls: 'group-delete',
  112. text: $I18N.common.button.erpDeleteButton,
  113. handler: function(btn){
  114. var selectItem = Ext.getCmp('grid').selModel.selected.items;
  115. if (selectItem.length == 0) {
  116. showError("请先选中要删除的流程");return;
  117. } else {
  118. var ids = new Array();
  119. Ext.each(selectItem, function(item, index){
  120. ids[index] = item.data.jp_id;
  121. // alert(ids[index]);
  122. });
  123. Ext.Ajax.request({//拿到grid的columns
  124. url : basePath + 'oa/myprocess/delete.action',
  125. params: {
  126. ids : ids.join(',')
  127. },
  128. method : 'post',
  129. async: false,
  130. callback : function(options, success, response){
  131. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  132. var res = new Ext.decode(response.responseText);
  133. if(res.exceptionInfo){
  134. showError(res.exceptionInfo);return;
  135. }
  136. if(res.success){
  137. alert(' 删除成功!');
  138. }
  139. }
  140. });
  141. url = "oa/myprocess/getJProcessList.action";
  142. // url = "oa/myprocess/getMyList.action";
  143. btn.ownerCt.ownerCt.getGroupData();
  144. }
  145. }
  146. },{
  147. iconCls: 'x-button-icon-print',
  148. text: $I18N.common.button.erpPrintButton,
  149. id: 'print',
  150. handler: function(btn){
  151. }
  152. },{
  153. iconCls: 'x-button-icon-print',
  154. text: '催办',
  155. id: 'fast',
  156. handler: function(btn){
  157. }
  158. },{
  159. iconCls: 'x-button-icon-print',
  160. text: '控制',
  161. id: 'control',
  162. handler: function(btn){
  163. }
  164. }],
  165. initComponent : function(){
  166. this.callParent(arguments);
  167. url = "oa/myprocess/getJProcessList.action";
  168. // url = "oa/myprocess/getMyList.action";
  169. this.getGroupData(page, pageSize);
  170. },
  171. listeners: {//滚动条有时候没反应,添加此监听器
  172. scrollershow: function(scroller) {
  173. if (scroller && scroller.scrollEl) {
  174. scroller.clearManagedListeners();
  175. scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
  176. }
  177. }
  178. },
  179. getGroupData: function(page, pageSize){
  180. var me = this;
  181. if(!page){
  182. page = 1;
  183. }
  184. if(!pageSize){
  185. pageSize = 15;
  186. }
  187. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading...
  188. Ext.Ajax.request({//拿到grid的columns
  189. url : basePath + url,
  190. params: {
  191. page: page,
  192. pageSize: pageSize
  193. },
  194. method : 'post',
  195. async: false,
  196. callback : function(options, success, response){
  197. // console.log(response);
  198. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  199. var res = new Ext.decode(response.responseText);
  200. if(res.exceptionInfo){
  201. showError(res.exceptionInfo);return;
  202. }
  203. if(res.error){
  204. showError(res.error);return;
  205. }
  206. if(!res.jprocesslist){
  207. return;
  208. } else {
  209. // console.log(res.jprocesslist);
  210. dataCount = res.count;
  211. me.store.loadData(res.jprocesslist);
  212. }
  213. }
  214. });
  215. },
  216. updateWindow: function(id){
  217. var win = new Ext.window.Window({
  218. id : 'win2',
  219. title: "修改日程",
  220. height: "90%",
  221. width: "80%",
  222. maximizable : false,
  223. buttonAlign : 'left',
  224. layout : 'anchor',
  225. items: [{
  226. tag : 'iframe',
  227. frame : true,
  228. anchor : '100% 100%',
  229. layout : 'fit',
  230. 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>'
  231. }]
  232. });
  233. win.show();
  234. }
  235. });