KpiBillPortal.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. Ext.define('erp.view.common.DeskTop.KpiBillPortal',{
  2. extend: 'erp.view.common.DeskTop.Portlet',
  3. alias: 'widget.kpibillportal',
  4. title: '<div class="div-left">考核管理</div>',
  5. enableTools:true,
  6. activeRefresh:true,
  7. iconCls: 'main-kpi',
  8. itemConfig:{
  9. toDo:'未评分',
  10. alreadyDo:'已评分'
  11. },
  12. initComponent : function(){
  13. var me=this;
  14. Ext.apply(this,{
  15. items:[Ext.widget('tabpanel',{
  16. autoShow: true,
  17. tabPosition:'top',
  18. minHeight:200,
  19. frame:true,
  20. bodyBorder: false,
  21. border: false,
  22. items:[me._kpibill()]
  23. })]
  24. });
  25. this.callParent(arguments);
  26. },
  27. _kpibill:function(){
  28. var me=this,items=new Array(),conf=me.itemConfig;
  29. for(var c in conf){
  30. var condition='';
  31. switch(c){
  32. case 'toDo':
  33. condition+="and kb_statuscode='ENTERING'";
  34. break;
  35. case 'alreadyDo':
  36. condition+="and kb_statuscode='COMMITED'";
  37. break;
  38. }
  39. var config={
  40. columnLines:false,
  41. title:conf[c],
  42. listeners:{
  43. 'activate':function(tab){
  44. tab.getStore().load();
  45. }
  46. },
  47. columns:[{
  48. text:'标题',
  49. cls:'x-grid-header-simple',
  50. dataIndex:'KB_TITLE',
  51. flex:1,
  52. renderer:function(val,meta,record){
  53. meta.tdCls='x-grid-cell-topic1';
  54. var detail=record.get('KB_TITLE');
  55. return Ext.String.format('<span style="color:#436EEE;padding-left:2px"><a href="javascript:openTable({0},\'Kpibill\',\'评估单\',\'jsps/hr/kpi/Kpibill.jsp?caller=Kpibill\',\'kb_id\',\'kbd_kbid\',null,null);" target="_blank" style="padding-left:2px">{1}</a></span>',
  56. record.get('KB_ID'),
  57. record.get('KB_TITLE')
  58. );}
  59. },{
  60. text:'考核类型',
  61. cls:'x-grid-header-simple',
  62. width:80,
  63. dataIndex:'KD_STARTKIND',
  64. filter: {
  65. dataIndex: 'KD_STARTKIND',
  66. displayField: 'display',
  67. queryMode: 'local',
  68. store: {data: [{display: "周考核", value: "week"},
  69. {display: "月度考核", value: "month"},
  70. {display: "季度考核", value: "season"},
  71. {display: "手动考核", value: "manual"}],
  72. fields: ["display", "value"]
  73. },
  74. valueField: "value",
  75. xtype: "combo"
  76. },
  77. xtype: 'combocolumn'
  78. },{
  79. text:'受评人',
  80. cls:'x-grid-header-simple',
  81. width:80,
  82. dataIndex:'KB_BEMAN'
  83. },{
  84. text:'截止日期',
  85. cls:'x-grid-header-simple',
  86. xtype:'datecolumn',
  87. width:100,
  88. dataIndex:'KB_ENDDATE',
  89. renderer:function(value){
  90. return Ext.Date.format(new Date(value),'Y-m-d');
  91. }
  92. }],
  93. store:Ext.create('Ext.data.Store',{
  94. fields:['KB_ID','KB_TITLE','KD_STARTKIND','KB_BEMAN','KB_ENDDATE'],
  95. proxy: {
  96. type: 'ajax',
  97. url : basePath + 'common/desktop/kpi/getKpibill.action',
  98. method : 'GET',
  99. extraParams:{
  100. count:me.pageCount,
  101. condition:condition
  102. },
  103. reader: {
  104. type: 'json',
  105. root: 'data'
  106. }
  107. },
  108. autoLoad:false
  109. })};
  110. items.push(Ext.create('Ext.grid.Panel',config));
  111. };
  112. return items;
  113. },
  114. getMore:function(){
  115. openTable(null,null,'更多评估单',"jsps/common/datalist.jsp?whoami=Kpibill&urlcondition=kb_manid=session:em_uu",null,null);
  116. },
  117. _dorefresh:function(panel){
  118. var activeTab=panel.down('tabpanel').getActiveTab();
  119. if(activeTab) activeTab.fireEvent('activate',activeTab);
  120. }
  121. });