FeedbackPortal.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. Ext.require([
  2. 'Ext.ux.PreviewPlugin'
  3. ]);
  4. Ext.define('erp.view.common.DeskTop.FeedbackPortal',{
  5. extend: 'erp.view.common.DeskTop.Portlet',
  6. alias: 'widget.feedbackportal',
  7. title: '<div class="div-left">系统问题反馈</div>',
  8. iconCls: 'x-button-icon-install',
  9. enableTools:true,
  10. animCollapse: false,
  11. pageCount:10,
  12. activeRefresh:true,
  13. //autoRefresh:true,
  14. initComponent : function(){
  15. var me=this;
  16. Ext.apply(this,{
  17. items:[Ext.widget('tabpanel',{
  18. autoShow: true,
  19. tabPosition:'top',
  20. minHeight:200,
  21. frame:true,
  22. bodyBorder: false,
  23. border: false,
  24. items:[me._toDo(),me._alreadyLaunch()]
  25. })]
  26. });
  27. this.callParent(arguments);
  28. },
  29. gridConfig:function(b,c){
  30. return Ext.apply(c,{
  31. autoScroll:false,
  32. viewConfig :{
  33. stripeRows:false,
  34. trackOver: false,
  35. plugins: [{
  36. ptype: 'preview',
  37. expanded: true,
  38. pluginId: 'preview'
  39. }]
  40. },
  41. listeners:{
  42. activate:function(grid){
  43. grid.getStore().load({
  44. params:{
  45. count:grid.ownerCt.pageCount
  46. }
  47. });
  48. }
  49. },
  50. columns:[
  51. {text:'项目',
  52. cls:'x-grid-header-simple',
  53. dataIndex:'FB_CODE',
  54. fixed:true,
  55. flex:1,
  56. renderer:function(val,meta,record){
  57. meta.tdCls='x-grid-cell-topic1';
  58. var detail=record.get('FB_DETAIL');
  59. detail='</br><font color="#777">'+detail+'</font>';
  60. return Ext.String.format('<span style="color:#436EEE;padding-left:2px"><a href="javascript:openTable({0},\'Feedback\',\'系统问题反馈\',\'jsps/sys/Feedback.jsp?caller=Feedback\',\'fb_id\',null,null,null);" target="_blank" style="padding-left:2px">{1}&nbsp;{2}</a>{3}</span>',
  61. record.get('FB_ID'),
  62. record.get('FB_CODE'),
  63. record.get('FB_PRJNAME'),
  64. detail
  65. );
  66. }
  67. },{
  68. text:'处理人',
  69. dataIndex:'EM_NAME',
  70. cls:'x-grid-header-simple',
  71. width:b?70:0,
  72. fixed:true
  73. },{
  74. text:'提出人',
  75. dataIndex:'FB_EMNAME',
  76. cls:'x-grid-header-simple',
  77. width:b?0:70,
  78. fixed:true
  79. },{
  80. text:'提出时间',
  81. cls:'x-grid-header-simple',
  82. width:150,
  83. fixed:true,
  84. dataIndex:'FB_DATE',
  85. xtype:'datecolumn',
  86. renderer:function(value){
  87. return Ext.Date.format(new Date(value),'Y-m-d H:i:s');
  88. }
  89. }]});
  90. },
  91. _toDo:function(){
  92. var me=this;
  93. var fields=['FB_CODE','FB_PRJNAME','FB_DETAIL','FB_DATE','FB_EMNAME','FB_URGENT','FB_POSITION','FB_ID','EM_NAME'];
  94. var condition='WHERE EM_NAME=?';
  95. return Ext.widget('gridpanel',me.gridConfig(false,{
  96. title:'待处理',
  97. store:me.getQueryStore(fields,condition)
  98. }));
  99. },
  100. _alreadyLaunch:function(){
  101. var me=this;toDo=false;
  102. var fields=['FB_CODE','FB_PRJNAME','FB_DETAIL','FB_DATE','EM_NAME','FB_URGENT','FB_POSITION','FB_ID','FB_EMNAME'];
  103. var condition='WHERE FB_EMNAME=?';
  104. return Ext.widget('gridpanel',me.gridConfig(true,{
  105. title:'已发起',
  106. store:me.getQueryStore(fields,condition)
  107. }));
  108. },
  109. getQueryStore:function(fields,condition,autoLoad){
  110. var me=this;
  111. return Ext.create('Ext.data.Store',{
  112. fields:fields,
  113. proxy: {
  114. type: 'ajax',
  115. url : basePath + 'common/desktop/calls/getFeedback.action',
  116. method : 'GET',
  117. extraParams:{
  118. count:me.pageCount,
  119. condition:condition
  120. },
  121. reader: {
  122. type: 'json',
  123. root: 'data'
  124. }
  125. },
  126. autoLoad:false
  127. });
  128. },
  129. getMore:function(){
  130. openTable(null,null,'系统问题反馈',"jsps/common/datalist.jsp?whoami=Feedback",null,null);
  131. },
  132. _dorefresh:function(panel){
  133. var activeTab=panel.down('tabpanel').getActiveTab();
  134. if(activeTab) activeTab.fireEvent('activate',activeTab);
  135. }
  136. });