InitPortal.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. Ext.define('erp.view.sys.InitPortal',{
  2. extend: 'Ext.panel.Panel',
  3. alias: 'widget.syspanel',
  4. id:'syspanel',
  5. layout:'card',
  6. //animCollapse: false,
  7. //constrainHeader: true,
  8. bodyBorder: true,
  9. layout:'card',
  10. title:'初始向导',
  11. border: false,
  12. autoShow: true,
  13. bodyStyle:'background-color:#f1f1f1;',
  14. buttons: [{
  15. id: 'move-prev',
  16. text: '上一步',
  17. handler: function(btn) {
  18. var panel=btn.up("syspanel");
  19. panel.changeCard(panel, "prev");
  20. },
  21. disabled: true
  22. },
  23. '->',
  24. {
  25. id: 'move-next',
  26. text: '下一步',
  27. handler: function(btn) {
  28. var panel=btn.up("syspanel");
  29. panel.changeCard(panel, "next");
  30. }
  31. }
  32. ],
  33. initComponent : function(){
  34. var me=this;
  35. Ext.applyIf(me,{
  36. items:me.getItems()
  37. });
  38. this.callParent(arguments);
  39. },
  40. ActiveIndex_:0,
  41. changeCard:function(panel,direction,index){
  42. var layout = panel.getLayout();
  43. var app=erp.getApplication();
  44. if(direction){
  45. layout[direction]();
  46. }else{
  47. var a=index;
  48. layout.setActiveItem(index);
  49. }
  50. this.ActiveIndex_=direction=='next'?++this.ActiveIndex_:--this.ActiveIndex_;
  51. activeItem=layout.getActiveItem();
  52. if(activeItem.type){
  53. var contrlPath=this.getContrlPath(activeItem.type);
  54. Ext.require("erp.controller."+contrlPath,function(){
  55. var Controller = app.getController(contrlPath);//4.2 直接init
  56. },self);
  57. }
  58. Ext.getCmp('syspanel').setTitle(activeItem.desc);
  59. Ext.getCmp('move-prev').setDisabled(!layout.getPrev());
  60. Ext.getCmp('move-next').setDisabled(!layout.getNext());
  61. //showResult('提示','初始化成功!');
  62. },
  63. getContrlPath:function(type){
  64. return "sys.step."+type+"Controller";
  65. },
  66. getItems:function(){
  67. var array=[{
  68. desc: '企业信息',
  69. xtype:'enterpriseportal'
  70. },{
  71. desc: '系统设置',
  72. xtype:'modulesetportal',
  73. condition:"step='sys'"
  74. },{
  75. desc: '组织人员',
  76. layout:'fit',
  77. type:'Hr'
  78. },{
  79. desc:'销售管理',
  80. type:'Sale',
  81. layout:'fit'
  82. },{
  83. desc:'采购管理',
  84. type:'PU',
  85. layout:'fit'
  86. },{
  87. desc: '物料信息',
  88. layout:'fit',
  89. type:'PR'
  90. },{
  91. desc: '库存管理',
  92. glyph:'72@My Font Family',
  93. type:'SC',
  94. layout:'fit'
  95. },{
  96. desc: '财务会计',
  97. glyph:'73@My Font Family',
  98. layout:'fit',
  99. type:'FA'
  100. }];
  101. if(installtype && installtype=='Make'){
  102. array=Ext.Array.insert(array,6,[{
  103. desc: '生产委外管理',
  104. layout:'fit',
  105. type:'MO'
  106. }]);
  107. }
  108. return array;
  109. }
  110. });