Ext.define('erp.view.core.button.MRPLoad',{ extend: 'Ext.Button', alias: 'widget.erpMRPLoadButton', iconCls: 'x-button-icon-delete', cls: 'x-btn-gray', text: '装载', id: 'consign', style: { marginLeft: '10px' }, width: 80, menu: [{ iconCls: 'main-msg', text: '装载来源', listeners: { afterrender: function(btn){ var status = Ext.getCmp("mm_statuscode"); if(status && status.value != 'ENTERING'){ btn.hide(); } }, click:function(btn){ var form=Ext.getCmp('form'); var keyField=form.keyField; var KeyValue=Ext.getCmp(keyField).value; var MainCode=Ext.getCmp(form.codeField).value; if(KeyValue==null||KeyValue==''){ showError('请先保存记录'); } var url=basePath+"jsps/pm/source/Source.jsp"; var panel = Ext.getCmp("sourceid=" +KeyValue); var main = parent.Ext.getCmp("content-panel"); var kind=getUrlParam('kind'); var panelId= main.getActiveTab().id; main.getActiveTab().currentGrid = Ext.getCmp('grid'); if(!panel){ var title = ""; if (KeyValue.toString().length>4) { title = KeyValue.toString().substring(KeyValue.toString().length-4); } else { title = KeyValue; } panel = { title:'来源查询('+KeyValue+')', tag : 'iframe', tabConfig:{tooltip:'来源查询('+title+')'}, frame : true, border : false, layout : 'fit', iconCls : 'x-tree-icon-tab-tab', html : '', closable : true, listeners : { close : function(){ main.setActiveTab(main.getActiveTab().id); } } }; openTab(panel,"sourceid=" + KeyValue); }else{ main.setActiveTab(panel); } } } },{ iconCls: 'main-msg', text:'装载排程', listeners: { click: function(m){ var keyValue=Ext.getCmp('mm_id').value; var win = new Ext.window.Window({ id : 'win', height: "100%", width: "95%", maximizable : true, title:'销售排程装载', buttonAlign : 'center', layout : 'anchor', draggable:false, items: [{ tag : 'iframe', frame : true, anchor : '100% 100%', layout : 'fit', html : '' }], buttons : [{ text : $I18N.common.button.erpCloseButton, iconCls: 'x-button-icon-close', cls: 'x-btn-gray', handler : function(){ Ext.getCmp('win').close(); } }] }); win.show(); } } }], initComponent : function(){ this.callParent(arguments); } });