Periodsdetailcancelfreeze.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.scm.reserve.Periodsdetailcancelfreeze', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'core.form.Panel','scm.reserve.Periodsdetailcancelfreeze','core.button.Close',
  8. 'core.button.CancelFreeze','core.form.MonthDateField'
  9. ],
  10. init:function(){
  11. var me = this;
  12. this.control({
  13. 'erpCloseButton': {
  14. click: function(btn){
  15. me.FormUtil.onClose();
  16. }
  17. },
  18. 'erpCancelFreezeButton':{
  19. click: function(btn){
  20. Ext.Ajax.request({
  21. url : basePath + "scm/reserves/Periodsdetailcancelfreeze.action",
  22. method : 'post',
  23. callback : function(options,success,response){
  24. var res = new Ext.decode(response.responseText);
  25. if(res.exceptionInfo != null){
  26. showError(res.exceptionInfo);
  27. return;
  28. }
  29. if(res.success){
  30. Ext.Msg.alert("提示","取消冻结成功!");
  31. window.location.reload();
  32. }
  33. }
  34. });
  35. }
  36. },
  37. 'field[name=date]':{
  38. afterrender:function(f){
  39. me.getFreezeDetno(f);
  40. }
  41. }
  42. });
  43. },
  44. getCurrentMonth: function(f) {
  45. Ext.Ajax.request({
  46. url: basePath + 'fa/getMonth.action',
  47. params: {
  48. type: 'MONTH-P'
  49. },
  50. callback: function(opt, s, r) {
  51. var rs = Ext.decode(r.responseText);
  52. if(rs.data) {
  53. f.setValue(rs.data.PD_DETNO);
  54. }
  55. }
  56. });
  57. },
  58. getFreezeDetno: function(f) {
  59. Ext.Ajax.request({
  60. url: basePath + 'scm/reserve/getFreezeDetno.action',
  61. method: 'GET',
  62. callback: function(opt, s, r) {
  63. var rs = Ext.decode(r.responseText);
  64. if(rs.exceptionInfo) {
  65. showError(rs.exceptionInfo);
  66. } else if(rs.data) {
  67. f.setValue(rs.data);
  68. } else {
  69. f.setValue('无');
  70. }
  71. }
  72. });
  73. }
  74. });