MakeCostClose.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.co.cost.MakeCostClose', {
  3. extend : 'Ext.app.Controller',
  4. FormUtil : Ext.create('erp.util.FormUtil'),
  5. BaseUtil : Ext.create('erp.util.BaseUtil'),
  6. views : [ 'co.cost.MakeCostCloseForm', 'co.cost.MakeCostClose',
  7. 'core.button.MakeCostClose', 'core.button.Close' ],
  8. init : function() {
  9. var me = this;
  10. this.control({
  11. 'erpCloseButton' : {
  12. click : function(btn) {
  13. me.FormUtil.onClose();
  14. }
  15. },
  16. 'erpMakeCostCloseButton' : {
  17. click : function(btn) {
  18. var form = btn.ownerCt.ownerCt, account = form
  19. .down('#account').value;
  20. this.deal(account);
  21. }
  22. }
  23. });
  24. },
  25. getForm : function(btn) {
  26. return btn.ownerCt.ownerCt;
  27. },
  28. deal : function(account) {
  29. var tab = this.BaseUtil.getActiveTab();
  30. tab.setLoading(true);
  31. Ext.Ajax.request({
  32. url : basePath + 'co/cost/mainCreate.action',
  33. params : {
  34. account : account
  35. },
  36. timeout: 120000,
  37. callback : function(opt, s, r) {
  38. tab.setLoading(false);
  39. var rs = Ext.decode(r.responseText);
  40. if (rs.data) {
  41. showMessage('提示', rs.data);
  42. }
  43. }
  44. });
  45. }
  46. });