ProblemPanel.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. Ext.define('erp.view.opensys.home.ProblemPanel', {
  2. extend: 'Ext.panel.Panel',
  3. alias: 'widget.problempanel',
  4. cls: 'preview',
  5. autoScroll: true,
  6. region: 'south',
  7. border:false,
  8. flex: 2,
  9. title:'问题反馈',
  10. layout:'fit',
  11. initComponent: function(){
  12. Ext.apply(this, {
  13. items:[
  14. Ext.widget('panel',{
  15. layout: 'anchor',
  16. border:true,
  17. items:[Ext.widget('gridpanel',{
  18. id:'feedbackgridpanel',
  19. columnLines : false,
  20. autoScroll : true,
  21. anchor:'100% 100%',
  22. layout:'fit',
  23. store: Ext.create('Ext.data.Store', {
  24. fields:['FB_ID','FB_CODE','FB_KIND','FB_THEME','FB_DETAIL','FB_POSITION','FB_DATE'],
  25. data: []
  26. }),
  27. columns:[{
  28. text:'标题',
  29. cls:'x-grid-header-simple',
  30. dataIndex:'FB_ID',
  31. resizable :false,
  32. //width:300,
  33. flex:1,
  34. id: 'topic',
  35. renderer:function(val,meta,record){
  36. var detail=record.get('FB_DETAIL');
  37. if(detail==null || detail =='' || detail=='null') {
  38. detail='';
  39. }
  40. else detail='</br></br><font color="#777">'+detail+'</font>';
  41. return Ext.String.format('<span style="color:#436EEE;padding-left:2px;"><a href="javascript:openTable(\'问题反馈\',\'jsps/opensys/FeedBack.jsp?caller=Feedback!Customer&formCondition=fb_idIS'+record.get('FB_ID')+'\',null);" target="_blank" style="padding-left:2px">{0}&nbsp;{1}</a>{2}</span>',
  42. record.get('FB_THEME'),
  43. record.get('FB_CODE'),
  44. detail
  45. );
  46. }
  47. },{
  48. text:'当前进展',
  49. cls:'x-grid-header-simple',
  50. width:100,
  51. dataIndex:'FB_POSITION',
  52. renderer:function(value){
  53. return value;
  54. }
  55. },{
  56. text:'发起时间',
  57. cls:'x-grid-header-simple',
  58. width:150,
  59. dataIndex:'FB_DATE',
  60. xtype:'datecolumn',
  61. renderer:function(value){
  62. return Ext.Date.format(new Date(value),'Y-m-d H:i:s');
  63. }
  64. }]
  65. })],
  66. dockedItems: [this.createToolbar()]
  67. })]
  68. });
  69. this.loadTab();
  70. this.callParent(arguments);
  71. },
  72. createToolbar: function(){
  73. var me=this;
  74. var items = [],
  75. config = {
  76. /*style:'border-left-width: 10px!important;' */
  77. };
  78. items.push({
  79. scope: this,
  80. handler: function(){
  81. me.loadTab('1=1');
  82. },
  83. text: '全部',
  84. iconCls: 'x-button-icon-showall'
  85. }, '-');
  86. items.push({
  87. scope: this,
  88. handler: function(){
  89. var condition="fb_statuscode='FINISH'";
  90. this.loadTab(condition);
  91. },
  92. text: '已确认',
  93. iconCls: 'x-button-icon-showcomplete'
  94. },'-');
  95. items.push({
  96. scope: this,
  97. handler: function(){
  98. me.loadTab("fb_statuscode<>'FINISH'");
  99. },
  100. text: '未确认',
  101. iconCls: 'x-button-icon-showuncomplete'
  102. });
  103. config.items = items;
  104. return Ext.create('widget.toolbar', config);
  105. },
  106. loadTab:function(condition){
  107. var con='fb_enid='+enUU;
  108. if(condition){
  109. con=con+" and "+condition;
  110. }
  111. var me=this;
  112. var data=new Object();
  113. Ext.Ajax.request({
  114. url : basePath + 'sys/feedback/getFeedback.action',
  115. async: false,
  116. params: {
  117. condition:con
  118. },
  119. method : 'get',
  120. callback : function(opt, s, res){
  121. var r = new Ext.decode(res.responseText);
  122. if(r.exceptionInfo){
  123. showError(r.exceptionInfo);return;
  124. } else if(r.success && r.data){
  125. Ext.getCmp('feedbackgridpanel').store.loadData(r.data);
  126. }
  127. }
  128. });
  129. }
  130. });