PagingGet.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.oa.info.PagingGet', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:['oa.info.PagingGet','core.form.FileField','core.form.HrOrgSelectField','common.datalist.GridPanel','common.datalist.Toolbar'],
  7. init:function(){
  8. var me = this;
  9. this.control({
  10. 'htmleditor[id=readEl]':{
  11. afterrender:function(editor){
  12. editor.getToolbar().hide();
  13. editor.setHeight(300);
  14. }
  15. },
  16. 'htmleditor[id=replyEl]':{
  17. afterrender:function(editor){
  18. editor.setHeight(300);
  19. }
  20. },
  21. 'HrOrgSelectfield>htmleditor':{
  22. beforerender:function(field){
  23. Ext.apply(field,{
  24. height:30,
  25. fieldLabel:'<div style="margin-top:15px">接收人:</div>',
  26. labelStyle:'margin-right:2px !important;',
  27. style: {
  28. background: 'transparent'
  29. },
  30. hideBorders: true,
  31. fieldBodyCls:'x-editor'
  32. });
  33. },
  34. afterrender:function(editor){
  35. editor.getToolbar().hide();
  36. }
  37. },
  38. 'htmleditor[name=man]':{
  39. afterrender:function(editor){
  40. editor.getToolbar().hide();
  41. editor.setHeight(30);
  42. }
  43. },
  44. 'button[itemId=saveTask]':{
  45. click:function(){
  46. me.saveScheduleTask();
  47. }
  48. },
  49. 'button[itemId=reply]':{
  50. click:function(btn){
  51. me.showSendTab();
  52. me.setReplyMan();
  53. }
  54. },
  55. 'button[itemId=close]':{
  56. click:function(btn){
  57. window.close();
  58. }
  59. },
  60. 'button[itemId=send]':{
  61. click:function(btn){
  62. var f=btn.ownerCt.ownerCt,mans=Ext.getCmp('manid').getValue(),context=f.down('htmleditor[name=replycontext]');
  63. var value=context.cleanHtml(context.getValue());
  64. if(!mans || mans==null || mans==''){
  65. alert('未选择任何消息接受人!');
  66. }else if( value.trim() == ""){
  67. alert('未填写任务消息内容!');
  68. }else {
  69. me.sendMsg(f);
  70. }
  71. }
  72. },
  73. 'button[itemId=turnOver]':{
  74. click:function(btn){
  75. me.showSendTab();
  76. }
  77. }
  78. });
  79. },
  80. showSendTab:function(){
  81. var tabP=Ext.getCmp('msgTab'),msgTab=tabP.items.items[0],replyTab=tabP.items.items[1];
  82. var tabbar=tabP.getTabBar();
  83. tabbar.items.items[1].show();
  84. replyTab.show();
  85. tabP.remove(msgTab);
  86. },
  87. setReplyMan:function(){
  88. Ext.getCmp('manid').setValue("employee#"+data.PR_RELEASERID);
  89. Ext.getCmp('man').setValue('<font color="#4DB34D">[个人]</font>'+data.PR_RELEASER);
  90. },
  91. sendMsg:function(f){
  92. var data=f.getForm().getValues(),me=this;
  93. me.FormUtil.setLoading(true);
  94. Ext.Ajax.request({
  95. method:'post',
  96. url:basePath+"/oa/info/paging.action",
  97. params:{
  98. mans:data.manid,
  99. context:data.replycontext
  100. },
  101. callback:function(options,success,response){
  102. var localJson = new Ext.decode(response.responseText);
  103. me.FormUtil.setLoading(false);
  104. if(localJson.success){
  105. alert('发送成功!');
  106. window.close();
  107. }
  108. }
  109. });
  110. },
  111. saveScheduleTask:function(){
  112. var me=this;
  113. me.FormUtil.setLoading(true);
  114. Ext.Ajax.request({
  115. method:'post',
  116. url:basePath+"plm/task/addScheduleTask.action",
  117. params:{
  118. title:data.PR_RELEASER,
  119. context:data.PR_CONTEXT
  120. },
  121. callback:function(options,success,response){
  122. var localJson = new Ext.decode(response.responseText);
  123. me.FormUtil.setLoading(false);
  124. if(localJson.success){
  125. alert('发送成功!');
  126. window.close();
  127. }
  128. }
  129. });
  130. }
  131. });