mode_emailm.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. function initbodys(){
  2. $(form('type')).change(function(){changestype(1)});
  3. changestype(0);
  4. get('btnchange_recename').onclick=function(){
  5. changeuserss(0);
  6. }
  7. get('btnchange_ccname').onclick=function(){
  8. changeuserss(1);
  9. }
  10. //读取转发邮件的内容
  11. var zfid = js.request('zfid');
  12. var zflx = js.request('zflx');
  13. if(mid==0&&zfid){
  14. js.ajax(geturlact('getzfcont',{zfid:zfid,zflx:zflx}),false,function(a){
  15. form('type').value = a.type; //外发还是 其他
  16. //转发
  17. if(a.zflx==0){
  18. form('title').value='转发:'+a.title+'';
  19. form('content').value=a.content;
  20. if(c.editorobj['content']){
  21. c.editorobj['content'].html(a.content);
  22. }else{
  23. form('content').value=a.content.replace(/<br>/g,"\n");
  24. }
  25. js.downupshow(a.filers,'fileidview');
  26. if(ismobile==1 && form('fileid'))f.fileobj.oldids=form('fileid').value;
  27. }
  28. //回复
  29. if(a.zflx==1){
  30. submitparams.huiid = a.id;
  31. form('title').value='回复:'+a.title+'';
  32. form('recename').value = a.sendname;
  33. form('receid').value = a.sendid;
  34. if(a.type==1){
  35. if(c.editorobj['content']){
  36. c.editorobj['content'].html(a.content);
  37. }else{
  38. form('content').value=a.content.replace(/<br>/g,"\n");
  39. }
  40. }
  41. }
  42. },'get,json');
  43. }
  44. if(mid==0){
  45. form('isturn').checked=true;
  46. }
  47. get('AltS').value='发送(S)';
  48. if(ismobile==0)$('#fileupaddbtn').append('&nbsp; <input onclick="addfujian()" value="相关文件用链接放入内容中" type="button" class="webbtn">');
  49. }
  50. var txlbool=false,txldata=[];
  51. function changestype(lx){
  52. var val = form('type').value;
  53. if(lx==1){
  54. js.changeclear('changeccname');
  55. js.changeclear('changerecename');
  56. }
  57. }
  58. function changeuserss(lx){
  59. var val = form('type').value;
  60. if(val==1){
  61. var ss1 = 'receid',ss2='recename',tit='选择收信人';
  62. if(lx==1){
  63. var ss1 = 'ccid',ss2='ccname';
  64. tit='抄送给';
  65. }
  66. c.selectdata('getvcard,'+ss1+'', true, ss2, tit);
  67. return;
  68. }
  69. if(lx==0){
  70. js.changeuser('changerecename','changedeptusercheck');
  71. }else{
  72. js.changeuser('changeccname','changeusercheck');
  73. }
  74. }
  75. function addfujian(){
  76. var fid = form('fileid').value;
  77. if(!fid){
  78. js.msg('msg','没有上传文件');
  79. return;
  80. }
  81. js.ajax('api.php?m=upload&a=filedao',{fileid:fid},function(ret){
  82. if(ret){
  83. c.editorobj['content'].appendHtml(ret);
  84. $('#view_fileidview').html('');
  85. form('fileid').value='';
  86. }
  87. });
  88. }