DepreciationReduction.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.fa.fix.DepreciationReduction', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'fa.fix.DepreciationReduction', 'core.button.Confirm', 'core.button.Close'
  8. ] ,
  9. init:function(){
  10. var me = this;
  11. this.control({
  12. 'erpConfirmButton': {
  13. click: function(btn){
  14. this.confirm();
  15. }
  16. }
  17. });
  18. },
  19. getForm: function(btn){
  20. return btn.ownerCt.ownerCt;
  21. },
  22. confirm: function(){
  23. //次方法为点击确定的时候执行的操作
  24. var form = Ext.getCmp('DepreciationReductionView');
  25. //参数
  26. var param ='';
  27. Ext.Ajax.request({
  28. //confirmUrl为在对应view js中创建此form时赋值的地址
  29. url:basePath+form.confirmUrl,
  30. params:{
  31. param:param,
  32. caller:caller
  33. },
  34. method:'post',
  35. callback:function(options,success,response){
  36. var localJson = new Ext.decode(response.responseText);
  37. if(localJson.success){
  38. //执行成功
  39. Ext.Msg.alert('操作成功!');
  40. }else{
  41. //执行失败
  42. Ext.Msg.alert('操作失败!');
  43. }
  44. }
  45. });
  46. }
  47. });