Viewport.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Ext.define('erp.view.scm.product.GetUUid.Viewport',{
  2. extend: 'Ext.Viewport',
  3. layout: 'border',
  4. initComponent : function(){
  5. var me = this;
  6. Ext.apply(me, {
  7. items: [{
  8. region: 'north',
  9. items: [{
  10. xtype: 'panel',
  11. id: 'choose',
  12. height: 30,
  13. hidden: true,
  14. tpl: Ext.create('Ext.XTemplate',
  15. '<ul class="breadcrumb">',
  16. '<li><a href="#"><img src="' + basePath + 'resource/images/screens/home.png" alt="Home" class="home" /></a></li>',
  17. '<tpl for="nodes">',
  18. '<li><a href="#" title="{.}">{.}</a></li>',
  19. '</tpl>',
  20. '</ul>'
  21. )
  22. },{
  23. xtype: 'form',
  24. layout : 'column',
  25. height: 34,
  26. bodyStyle: {background: '#f0f0f1'},
  27. items: [{
  28. fieldLabel: '原厂型号',
  29. xtype: 'textfield',
  30. fieldStyle : "background:#FFFAFA;color:#515151;",
  31. labelWidth : 90,
  32. columnWidth: .38,
  33. id: 'orispecode',
  34. name: 'orispecode',
  35. emptyText:'原厂型号',
  36. margin:'3 3 3 3'
  37. },{
  38. xtype: 'button',
  39. columnWidth: .1,
  40. iconCls: 'x-form-search',
  41. cls: 'x-btn-gray-1',
  42. name: 'search',
  43. text: '搜索',
  44. margin:'3 3 3 3'
  45. },{
  46. xtype:'button',
  47. columnWidth:.1,
  48. style: {
  49. background: '#f0f0f1'
  50. },
  51. name:'refresh',
  52. iconCls: 'tree-back',
  53. cls: 'x-btn-tb',
  54. margin:'3 3 3 3',
  55. tooltip: '刷新',
  56. hidden: false,
  57. handler: function(){
  58. Ext.getCmp('tree-panel').getTreeRootNode(0);
  59. Ext.getCmp('orispecode').setValue(null);
  60. Ext.getCmp('uuIdGrid').store.loadData("");
  61. }
  62. },{
  63. xtype : 'label',
  64. id : 'getpage',
  65. name : 'getpage',
  66. columnWidth: .15,
  67. margin:'3 3 3 3',
  68. html: '<a href=# style="font-size:14px;text-align:left;"> 找不到标准器件 </a>' ,
  69. height:28,
  70. listeners: {
  71. render : function() {//渲染后添加click事件
  72. Ext.fly(this.el).on('click',
  73. function(e, t) {
  74. Ext.Ajax.request({//拿到tree数据
  75. url : basePath + 'scm/product/getPageAccess.action',
  76. async: false,
  77. callback : function(options,success,response){
  78. var res = new Ext.decode(response.responseText);
  79. if(res.exceptionInfo){
  80. showError(res.exceptionInfo);
  81. }else{
  82. window.open(res.path+'/api/webpage?access_token='+res.access_token+'&redirect_page=product#/componentEdit_T/detail/create/');
  83. }
  84. }
  85. });
  86. }
  87. )
  88. }
  89. }
  90. }]
  91. }]
  92. }, {
  93. xtype: 'prodb2ckindtree',
  94. region: 'center',
  95. autoScroll: true
  96. },{
  97. xtype:'erpComponentGrid',
  98. region: 'east',
  99. split: true
  100. }]
  101. });
  102. me.callParent(arguments);
  103. }
  104. });