205edf8091d264362e6f88bf17396e57a92ee1d5.svn-base 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  2. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  3. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  4. $(function(){
  5. var msg =top.frmright.$("#reply_content").val();
  6. $("#msg").val(msg);
  7. /*var name = parent.frmright.$("#tel").val();*/
  8. /*$("#msg").val(name);*/
  9. });
  10. function reply(){
  11. $("#msg_content").show();
  12. $("#send").show();
  13. $("#rep").hide();
  14. $("#replys").addClass("validate[required]");
  15. }
  16. function cancle(){
  17. /*$("#msg_content").hide();
  18. $("#send").hide();
  19. $("#rep").show();
  20. $("#replys").removeClass("validate[required]");
  21. $("#replys").val("");*/
  22. top.Dialog.confirm("确定不回复吗?|确定",function(){
  23. $(parent.document.body).find("#_ButtonClose_replyWindow").click();
  24. });
  25. }
  26. function editValidate() {
  27. var valid = $("#MsgForm").validationEngine({
  28. returnIsValid : true,
  29. });
  30. if(valid==true){
  31. refer();
  32. }else{
  33. top.Dialog.alert("回复内容不能为空");
  34. }
  35. }
  36. function refer(){
  37. // var patt= /[\\\"\#\%]+/g;
  38. //var patts = /[]+/g;
  39. /*if(patt.test($("#replys").val())){
  40. top.Dialog.alert("不能输入单斜杠、英文双引号、#、%、反斜杠等特殊字符");
  41. return;
  42. }*/
  43. /* else{*/
  44. /*$("body").eq(0).showLoading();*/
  45. // var msg1 =$("#replys").val();
  46. var msg1 = $("#replys").val().replace(/\n/g,'');
  47. var msg2 = msg1.replace(/\"+/g,'');
  48. var msg3 = msg2.replace(/\\+/g,'/');
  49. $.post("/nwyj/ws/sendsms/SendSmsService/saveMessage",{
  50. smsRecTel:parent.frmright.$("#tel").val(),
  51. smsTime:getTime(),
  52. smsContent:msg3,
  53. smsPeople:parent.frmright.$("#name").val(),
  54. smsSendId:userId,
  55. /*deptName:deptName,*/
  56. realName:realName,
  57. type:"短信回复"
  58. },function(result){
  59. if(result.Msg.sucsess==true){
  60. /*$("body").eq(0).hideLoading();*/
  61. top.Dialog.alert("回复成功",null,null,null,null);
  62. // clear_msg();
  63. $(parent.document.body).find("#_ButtonClose_replyWindow").click();
  64. }else{
  65. top.Dialog.alert("回复失败");
  66. }
  67. },'json');
  68. }
  69. /*}*/
  70. function getTime(){
  71. var now=allGetServerTime();
  72. //获取年份
  73. var year=now.getFullYear();
  74. //获取月份
  75. var month=now.getMonth()+1;
  76. if(month>=1&&month<=9){
  77. month = "0"+month;
  78. }
  79. //获取日期
  80. var day=now.getDate();
  81. if(day>=1&&day<=9){
  82. day = "0"+day;
  83. }
  84. //获取小时
  85. var hours=now.getHours();
  86. if(hours>=1&&hours<=9){
  87. hours = "0"+hours;
  88. }
  89. //获取分钟
  90. var minutes=now.getMinutes();
  91. if(minutes>=1&&minutes<=9){
  92. minutes = "0"+minutes;
  93. }
  94. //获取秒
  95. var seconds=now.getSeconds();
  96. if(seconds>=1&&seconds<=9){
  97. seconds = "0"+seconds;
  98. }
  99. var currentTime =year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds;
  100. return currentTime;
  101. }