Ext.QuickTips.init(); Ext.define('erp.controller.fa.fp.ProduceBudgetBill', { extend: 'Ext.app.Controller', FormUtil: Ext.create('erp.util.FormUtil'), BaseUtil: Ext.create('erp.util.BaseUtil'), views:[ 'fa.fp.ProduceBudgetBillForm', 'fa.fp.ProduceBudgetBill', 'core.form.Panel','core.button.ProduceBudgetBill','core.button.Close','core.form.MonthDateField' ] , init:function(){ var me = this; this.control({ 'erpCloseButton': { click: function(btn){ me.FormUtil.onClose(); } }, 'erpProduceBudgetBillButton' : { click : function(btn) { Ext.Ajax.request({ url : basePath + "fa/fp/ProduceBudgetBill.action", method : 'post', timeout : 300000, callback : function(options, success, response) { var res = Ext.decode(response.responseText); if (res.exceptionInfo) { showError(res.exceptionInfo); return; } if (res.success) { showMessage("提示", "生成收款预算单成功!"); } } }); } }, 'monthdatefield': { afterrender: function(f) { me.getCurrentYearmonth(f); } } }); }, getForm: function(btn){ return btn.ownerCt.ownerCt; }, getCurrentYearmonth: function(f) { Ext.Ajax.request({ url: basePath + 'fa/fp/getCurrentYearmonth.action', method: 'GET', callback: function(opt, s, r) { var rs = Ext.decode(r.responseText); if(rs.exceptionInfo) { showError(rs.exceptionInfo); } else if(rs.data) { f.setValue(rs.data); } } }); } });