GridPanel.js 6.2 KB

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