Ext.define('saas.view.purchase.b2b.reconciliation.FormPanelController', { extend: 'saas.view.core.form.FormPanelController', alias: 'controller.purchase-b2b-reconciliation-formpanel', init: function (form) { var me = this; this.control({}); }, agree:function(){ var me = this; var url = '/api/money/apcheck/agree/'; me.sendUrl(url) }, disagree:function(){ var me = this; var url = '/api/money/apcheck/reject/'; me.sendUrl(url) }, sendUrl:function(url){ var me = this; var view = me.getView(); var id = me.getViewModel().getData().id; view.setLoading(true); saas.util.BaseUtil.request({ url: url + id, params: '', method: 'POST', }) .then(function() { view.setLoading(false); //解析参数 saas.util.BaseUtil.showSuccessToast('操作成功'); me.refresh() }) .catch(function(e) { //失败 saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message); }); } });