ProduceFKBudgetBill.js 1.9 KB

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