ProduceFKBudgetBill.js 1.8 KB

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