FormPanelController.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Ext.define('saas.view.purchase.b2b.reconciliation.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.purchase-b2b-reconciliation-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({});
  7. },
  8. agree:function(){
  9. var me = this;
  10. var url = '/api/money/apcheck/agree/';
  11. me.sendUrl(url)
  12. },
  13. disagree:function(){
  14. var me = this;
  15. var url = '/api/money/apcheck/reject/';
  16. me.sendUrl(url)
  17. },
  18. sendUrl:function(url){
  19. var me = this;
  20. var view = me.getView();
  21. var id = me.getViewModel().getData().id;
  22. view.setLoading(true);
  23. saas.util.BaseUtil.request({
  24. url: url + id,
  25. params: '',
  26. method: 'POST',
  27. })
  28. .then(function() {
  29. view.setLoading(false);
  30. //解析参数
  31. saas.util.BaseUtil.showSuccessToast('操作成功');
  32. me.refresh()
  33. })
  34. .catch(function(e) {
  35. //失败
  36. saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
  37. });
  38. }
  39. });