ProduceBudgetBill.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.fa.fp.ProduceBudgetBill', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'fa.fp.ProduceBudgetBillForm',
  8. 'fa.fp.ProduceBudgetBill',
  9. 'core.form.Panel','core.button.ProduceBudgetBill','core.button.Close','core.form.MonthDateField'
  10. ] ,
  11. init:function(){
  12. var me = this;
  13. this.control({
  14. 'erpCloseButton': {
  15. click: function(btn){
  16. me.FormUtil.onClose();
  17. }
  18. },
  19. 'erpProduceBudgetBillButton' : {
  20. click : function(btn) {
  21. Ext.Ajax.request({
  22. url : basePath
  23. + "fa/fp/ProduceBudgetBill.action",
  24. method : 'post',
  25. timeout : 300000,
  26. callback : function(options, success, response) {
  27. var res = Ext.decode(response.responseText);
  28. if (res.exceptionInfo) {
  29. showError(res.exceptionInfo);
  30. return;
  31. }
  32. if (res.success) {
  33. showMessage("提示", "生成收款预算单成功!");
  34. }
  35. }
  36. });
  37. }
  38. },
  39. 'monthdatefield': {
  40. afterrender: function(f) {
  41. me.getCurrentYearmonth(f);
  42. }
  43. }
  44. });
  45. },
  46. getForm: function(btn){
  47. return btn.ownerCt.ownerCt;
  48. },
  49. getCurrentYearmonth: function(f) {
  50. Ext.Ajax.request({
  51. url: basePath + 'fa/fp/getCurrentYearmonth.action',
  52. method: 'GET',
  53. callback: function(opt, s, r) {
  54. var rs = Ext.decode(r.responseText);
  55. if(rs.exceptionInfo) {
  56. showError(rs.exceptionInfo);
  57. } else if(rs.data) {
  58. f.setValue(rs.data);
  59. }
  60. }
  61. });
  62. }
  63. });