PingAnYeXianSZCG_Web 前端代码

AnnDatil.html 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/layer/need/layer.css" />
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title>详情</title>
  10. <style>
  11. .BiaoTi{
  12. width: 100%;
  13. border-color:#ccc ;
  14. border:1px solid #ccc;
  15. }
  16. textarea{
  17. border-color:#ccc ;
  18. border:1px solid #ccc;
  19. height: 100px;
  20. }
  21. .BiaoTi{
  22. width: 100%;
  23. text-align:center;
  24. border-color:#ccc ;
  25. border:1px solid #ccc;
  26. }
  27. textarea{
  28. border-color:#ccc ;
  29. border:1px solid #ccc;
  30. height: 100px;
  31. }
  32. .Common {
  33. width: 100%;
  34. background: #fff;
  35. text-align: center;
  36. padding: 10px 15px;
  37. height: auto;
  38. overflow-y: auto;
  39. }
  40. .Common table th {
  41. padding: 5px 8px 5px 0;
  42. text-align: right;
  43. width: 20%;
  44. }
  45. .Common table {
  46. width: 100%;
  47. }
  48. .Common table td textarea {
  49. width: 100%;
  50. vertical-align: middle;
  51. resize: none;
  52. outline: none;
  53. }
  54. .Common table td {
  55. padding: 6px 0 5px 10px;
  56. text-align: left;
  57. color: #717171;
  58. line-height: 200%;
  59. }
  60. .btn_box {
  61. margin-top: 30px;
  62. }
  63. </style>
  64. </head>
  65. <body>
  66. <div class="Common">
  67. <table >
  68. <tr>
  69. <th>标题:</th>
  70. <td>
  71. <input class="BiaoTi" id="title" type="text" style="" />
  72. </td>
  73. </tr>
  74. <tr>
  75. <th >内容:</th>
  76. <td colspan="2">
  77. <textarea data-adaptheight id="content" name="" rows="" cols=""></textarea>
  78. </td>
  79. </tr>
  80. </table>
  81. <div class="btn_box">
  82. <button class="btns">保存</button>
  83. </div>
  84. </div>
  85. <script >
  86. var wid = helper.request.queryString("wid");
  87. $(document).ready(function(){
  88. $(".btns").click(function(){
  89. if(!$("#title").val()){
  90. layer.msg("输入标题");
  91. }
  92. else if(!$("#content").val()){
  93. layer.msg("输入选择日期");
  94. }
  95. Add()
  96. })
  97. if(wid){
  98. $.getJSON(huayi.config.callcenter_url + 'Notice/GetNotice', {
  99. noticeid: wid,
  100. "token": $.cookie("token")
  101. },function(result){
  102. if(result.state.toLowerCase() == "success"){
  103. $("#title").val(result.data.F_Title);
  104. $("#content").val(result.data.F_Content);
  105. console.log(result.data);
  106. }
  107. });
  108. }
  109. })
  110. function Add(){
  111. $.post(huayi.config.callcenter_url + "Notice/EditNotice", {
  112. nid: wid,
  113. title:$("#title").val(),
  114. content:$("#content").val(),
  115. token: $.cookie("token")
  116. }, function(result) {
  117. result = JSON.parse(result);
  118. if(result.state.toLowerCase() == "success") {
  119. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  120. parent.layer.close(index); //再执行关闭
  121. parent.initTable();
  122. parent.layer.msg("修改成功");
  123. }
  124. })
  125. }
  126. </script>
  127. </body>
  128. </html>