MRPLoad.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Ext.define('erp.view.core.button.MRPLoad',{
  2. extend: 'Ext.Button',
  3. alias: 'widget.erpMRPLoadButton',
  4. iconCls: 'x-button-icon-delete',
  5. cls: 'x-btn-gray',
  6. text: '装载',
  7. id: 'consign',
  8. style: {
  9. marginLeft: '10px'
  10. },
  11. width: 80,
  12. menu: [{
  13. iconCls: 'main-msg',
  14. text: '装载来源',
  15. listeners: {
  16. afterrender: function(btn){
  17. var status = Ext.getCmp("mm_statuscode");
  18. if(status && status.value != 'ENTERING'){
  19. btn.hide();
  20. }
  21. },
  22. click:function(btn){
  23. var form=Ext.getCmp('form');
  24. var keyField=form.keyField;
  25. var KeyValue=Ext.getCmp(keyField).value;
  26. var MainCode=Ext.getCmp(form.codeField).value;
  27. if(KeyValue==null||KeyValue==''){
  28. showError('请先保存记录');
  29. }
  30. var url=basePath+"jsps/pm/source/Source.jsp";
  31. var panel = Ext.getCmp("sourceid=" +KeyValue);
  32. var main = parent.Ext.getCmp("content-panel");
  33. var kind=getUrlParam('kind');
  34. var panelId= main.getActiveTab().id;
  35. main.getActiveTab().currentGrid = Ext.getCmp('grid');
  36. if(!panel){
  37. var title = "";
  38. if (KeyValue.toString().length>4) {
  39. title = KeyValue.toString().substring(KeyValue.toString().length-4);
  40. } else {
  41. title = KeyValue;
  42. }
  43. panel = {
  44. title:'来源查询('+KeyValue+')',
  45. tag : 'iframe',
  46. tabConfig:{tooltip:'来源查询('+title+')'},
  47. frame : true,
  48. border : false,
  49. layout : 'fit',
  50. iconCls : 'x-tree-icon-tab-tab',
  51. html : '<iframe id="iframe_maindetail_'+caller+"_"+KeyValue+'" src="'+url+'?keyValue='+KeyValue+'&maincode='+MainCode+'&kind='+kind+'&panelId='+panelId+'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>',
  52. closable : true,
  53. listeners : {
  54. close : function(){
  55. main.setActiveTab(main.getActiveTab().id);
  56. }
  57. }
  58. };
  59. openTab(panel,"sourceid=" + KeyValue);
  60. }else{
  61. main.setActiveTab(panel);
  62. }
  63. }
  64. }
  65. },{
  66. iconCls: 'main-msg',
  67. text:'装载排程',
  68. listeners: {
  69. click: function(m){
  70. var keyValue=Ext.getCmp('mm_id').value;
  71. var win = new Ext.window.Window({
  72. id : 'win',
  73. height: "100%",
  74. width: "95%",
  75. maximizable : true,
  76. title:'销售排程装载',
  77. buttonAlign : 'center',
  78. layout : 'anchor',
  79. draggable:false,
  80. items: [{
  81. tag : 'iframe',
  82. frame : true,
  83. anchor : '100% 100%',
  84. layout : 'fit',
  85. html : '<iframe id="iframe_' + caller + '" src="' + basePath + 'jsps/pm/mps/loadSaleDetailDet.jsp?type=MPS&keyValue='+keyValue
  86. +'" height="100%" width="100%" frameborder="0" scrolling="no"></iframe>'
  87. }],
  88. buttons : [{
  89. text : $I18N.common.button.erpCloseButton,
  90. iconCls: 'x-button-icon-close',
  91. cls: 'x-btn-gray',
  92. handler : function(){
  93. Ext.getCmp('win').close();
  94. }
  95. }]
  96. });
  97. win.show();
  98. }
  99. }
  100. }],
  101. initComponent : function(){
  102. this.callParent(arguments);
  103. }
  104. });