ProduceBudgetBill.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. params:{
  25. yearmonth:Ext.getCmp('date').value,
  26. },
  27. method : 'post',
  28. timeout : 300000,
  29. callback : function(options, success, response) {
  30. var res = Ext.decode(response.responseText);
  31. if (res.exceptionInfo) {
  32. showError(res.exceptionInfo);
  33. return;
  34. }
  35. if (res.success) {
  36. showMessage("提示", "生成收款预算单成功!");
  37. }
  38. }
  39. });
  40. }
  41. },
  42. 'monthdatefield': {
  43. afterrender: function(f) {
  44. me.getCurrentYearmonth(f);
  45. }
  46. }
  47. });
  48. },
  49. getForm: function(btn){
  50. return btn.ownerCt.ownerCt;
  51. },
  52. getCurrentYearmonth: function(f) {
  53. Ext.Ajax.request({
  54. url: basePath + 'fa/fp/getCurrentYearmonth.action',
  55. method: 'GET',
  56. callback: function(opt, s, r) {
  57. var rs = Ext.decode(r.responseText);
  58. if(rs.exceptionInfo) {
  59. showError(rs.exceptionInfo);
  60. } else if(rs.data) {
  61. f.setValue(rs.data);
  62. }
  63. }
  64. });
  65. }
  66. });