123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- Ext.define('erp.view.oa.doc.Close',{
- extend: 'Ext.Button',
- alias: 'widget.erpCloseButton',
- cls:'x-btn-close',
- style: {
- marginLeft: '10px'
- },
- text:null,
- initComponent : function(){
- this.callParent(arguments);
- },
- handler: function(btn){
- var modal=parent.Ext.getCmp('modalwindow');
- if(modal){
- var history=modal.historyMaster;
- Ext.Ajax.request({
- url: basePath + 'common/changeMaster.action',
- params: {
- to: history
- },
- callback: function(opt, s, r) {
- if (s) {
- modal.close();
- } else {
- alert('切换到原账套失败!');
- }
- }
- });
- } else {
- var main = parent.Ext.getCmp("content-panel");
- if(main){
- main.getActiveTab().close();
- } else {
- var win = parent.Ext.ComponentQuery.query('window');
- if(win){
- Ext.each(win, function(){
- this.close();
- });
- } else {
- window.close();
- }
- }
- }
- }
- });
|