mailDetail.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.oa.mail.mailDetail', {
  3. extend: 'Ext.app.Controller',
  4. BaseUtil: Ext.create('erp.util.BaseUtil'),
  5. FormUtil: Ext.create('erp.util.FormUtil'),
  6. views:[
  7. 'oa.mail.mailDetail','oa.mail.MailDetailForm'
  8. ],
  9. init:function(){
  10. var me = this;
  11. this.control({
  12. 'button[id=close]': {
  13. click: function(){
  14. me.FormUtil.onClose();
  15. }
  16. },
  17. 'button[id=post]': {
  18. click: function(){
  19. var form = Ext.getCmp('form').getForm();
  20. me.FormUtil.getActiveTab().setLoading(true);
  21. Ext.Ajax.request({
  22. url : basePath + 'oa/mail/send.action',
  23. params: {
  24. receAddr: Ext.getCmp('receAddr').value,
  25. subject: Ext.getCmp('subject').value,
  26. context: unescape(Ext.getCmp('context').getValue().replace(/\\u/g,"%u"))
  27. },
  28. method : 'post',
  29. callback : function(options,success,response){
  30. me.FormUtil.getActiveTab().setLoading(false);
  31. var localJson = new Ext.decode(response.responseText);
  32. if(localJson.exceptionInfo){
  33. showError(localJson.exceptionInfo);
  34. }
  35. if(localJson.success){
  36. Ext.Msg.alert("提示","邮件发送成功!");
  37. form.reset();
  38. }
  39. }
  40. });
  41. }
  42. }
  43. });
  44. }
  45. });