GridPanel.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. Ext.define('erp.view.oa.myProcess.timeoutNode.GridPanel',{
  2. extend: 'Ext.grid.Panel',
  3. alias: 'widget.erpTimeoutNodeGridPanel',
  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: 'je_id',
  66. hidden :true
  67. },{
  68. text: '流程名称',
  69. width: 160,
  70. dataIndex: 'je_processInstanceName'
  71. },{
  72. text: '流程ID',
  73. width: 160,
  74. dataIndex: 'je_processInstanceId'
  75. },{
  76. text: '当前步骤',
  77. width: 80,
  78. dataIndex: 'je_nodeName'
  79. },{
  80. text: '人员ID',
  81. width: 80,
  82. dataIndex: 'je_nodeDealMan'
  83. },{
  84. text: '个人平均耗时',
  85. width: 120,
  86. dataIndex: 'je_nodeMinutes',
  87. renderer: function(value){
  88. return value+' (分钟)';
  89. }
  90. },{
  91. text: '全员平均耗时',
  92. width: 120,
  93. dataIndex: 'je_wholeMinutes',
  94. renderer: function(value){
  95. return value+' (分钟)';
  96. }
  97. },{
  98. text: '标准耗时',
  99. width: 120,
  100. dataIndex: 'je_standardMinutes',
  101. renderer: function(value){
  102. return value==0? '无限时 ': value+' (分钟)';
  103. }
  104. },{
  105. text: '节点超时',
  106. width: 120,
  107. dataIndex: 'je_nodeTimeout',
  108. renderer: function(value){
  109. return value+' (分钟)';
  110. }
  111. }],
  112. /* tbar: [{
  113. iconCls: 'group-delete',
  114. text: $I18N.common.button.erpDeleteButton,
  115. handler: function(btn){
  116. var selectItem = Ext.getCmp('grid').selModel.selected.items;
  117. if (selectItem.length == 0) {
  118. showError("请先选中要删除的流程");return;
  119. } else {
  120. var ids = new Array();
  121. Ext.each(selectItem, function(item, index){
  122. ids[index] = item.data.jp_id;
  123. // alert(ids[index]);
  124. });
  125. Ext.Ajax.request({//拿到grid的columns
  126. url : basePath + 'oa/myprocess/delete.action',
  127. params: {
  128. ids : ids.join(',')
  129. },
  130. method : 'post',
  131. async: false,
  132. callback : function(options, success, response){
  133. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  134. var res = new Ext.decode(response.responseText);
  135. if(res.exceptionInfo){
  136. showError(res.exceptionInfo);return;
  137. }
  138. if(res.success){
  139. alert(' 删除成功!');
  140. }
  141. }
  142. });
  143. url = "oa/myprocess/getJNodeEfficiencyReviewedFromJProcessList.action";
  144. // url = "oa/myprocess/getMyList.action";
  145. btn.ownerCt.ownerCt.getGroupData();
  146. }
  147. }
  148. },{
  149. iconCls: 'x-button-icon-print',
  150. text: $I18N.common.button.erpPrintButton,
  151. id: 'print',
  152. handler: function(btn){
  153. }
  154. },{
  155. iconCls: 'x-button-icon-print',
  156. text: '催办',
  157. id: 'fast',
  158. handler: function(btn){
  159. }
  160. },{
  161. iconCls: 'x-button-icon-print',
  162. text: '控制',
  163. id: 'control',
  164. handler: function(btn){
  165. }
  166. }],*/
  167. initComponent : function(){
  168. this.callParent(arguments);
  169. url = "oa/myprocess/getTimeoutNodeList.action";
  170. // url = "oa/myprocess/getMyList.action";
  171. this.getGroupData(page, pageSize);
  172. },
  173. listeners: {//滚动条有时候没反应,添加此监听器
  174. scrollershow: function(scroller) {
  175. if (scroller && scroller.scrollEl) {
  176. scroller.clearManagedListeners();
  177. scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
  178. }
  179. }
  180. },
  181. getGroupData: function(page, pageSize){
  182. var me = this;
  183. if(!page){
  184. page = 1;
  185. }
  186. if(!pageSize){
  187. pageSize = 15;
  188. }
  189. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(true);//loading...
  190. Ext.Ajax.request({//拿到grid的columns
  191. url : basePath + url,
  192. params: {
  193. page: page,
  194. pageSize: pageSize
  195. },
  196. method : 'post',
  197. async: false,
  198. callback : function(options, success, response){
  199. // console.log(response);
  200. parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  201. var res = new Ext.decode(response.responseText);
  202. if(res.exceptionInfo){
  203. showError(res.exceptionInfo);return;
  204. }
  205. if(res.error){
  206. showError(res.error);return;
  207. }
  208. if(!res.jprocesslist){
  209. return;
  210. } else {
  211. // console.log(res.jprocesslist);
  212. dataCount = res.count;
  213. me.store.loadData(res.jprocesslist);
  214. }
  215. }
  216. });
  217. },
  218. updateWindow: function(id){
  219. var win = new Ext.window.Window({
  220. id : 'win2',
  221. title: "修改日程",
  222. height: "90%",
  223. width: "80%",
  224. maximizable : false,
  225. buttonAlign : 'left',
  226. layout : 'anchor',
  227. items: [{
  228. tag : 'iframe',
  229. frame : true,
  230. anchor : '100% 100%',
  231. layout : 'fit',
  232. 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>'
  233. }]
  234. });
  235. win.show();
  236. }
  237. });