开封利通水务前端

XgBlack.html 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>黑名单管理</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <script src="../js/laydate/laydate.js"></script>
  10. <style>
  11. .greetings {
  12. margin-top: 20px;
  13. }
  14. .greetings label {
  15. text-align: right;
  16. }
  17. .greetings ul {
  18. margin: 0;
  19. padding: 0;
  20. }
  21. .greetings li {
  22. list-style: none;
  23. }
  24. .text_require {
  25. color: red;
  26. vertical-align: middle;
  27. font-weight: 900;
  28. }
  29. .time-box {
  30. position: relative;
  31. }
  32. i.tub {
  33. position: absolute;
  34. right: 26px;
  35. top: 8px;
  36. font-size: 18px;
  37. color: rgb(26, 179, 148);
  38. }
  39. .greetings .radio-inline input[type="radio"] {
  40. margin-top: 4px;
  41. }
  42. .greetings textarea {
  43. resize: none;
  44. }
  45. .greetings .form-horizontal .radio-inline {
  46. padding-top: 0;
  47. }
  48. #greetingSave {
  49. background: rgb(26, 179, 148);
  50. color: #fff;
  51. }
  52. </style>
  53. </head>
  54. <body class="gray-bg">
  55. <div class="container greetings">
  56. <ul class="row clearfix form-horizontal">
  57. <li class="form-group">
  58. <label for="greetingTitle" class="col-md-2">轮播内容</label>
  59. <div class="col-md-10">
  60. <input id="TelNum" class="form-control" type="text" autofocus="true" autocomplete="off" />
  61. </div>
  62. </li>
  63. <li class="form-group">
  64. <label for="greetingTimes" class="col-md-2">起始截止时间</label>
  65. <div class="col-md-10 time-box">
  66. <i class="tub fa fa-calendar"></i>
  67. <input class="form-control" type="text" id="greetingTimes">
  68. </div>
  69. </li>
  70. <!-- <li class="form-group">
  71. <label for="greetingRemark" class="col-md-2">屏蔽说明</label>
  72. <div class="col-md-10">
  73. <textarea id="Pb" class="form-control" rows="7"></textarea>
  74. </div>
  75. </li> -->
  76. </ul>
  77. <div class="form-group row clearfix" style="text-align: center;">
  78. <div class="col-md-offset-2 col-md-10">
  79. <button class="btn " id="greetingSave" type="button" onclick="addedit()">保存</button>
  80. </div>
  81. </div>
  82. <input type="hidden" id="oldname" />
  83. <input type="hidden" id="newname" />
  84. <input type="hidden" id="wavpath" />
  85. </div>
  86. <script>
  87. $(document).ready(function() {
  88. var str = helper.request.queryString("str");
  89. laydate.render({
  90. elem: '#greetingTimes',
  91. range: '~',
  92. type: 'datetime',
  93. //max : 31,
  94. theme: '#1ab394',
  95. });
  96. if(str) {
  97. $.getJSON(huayi.config.callcenter_url + "NoWaterInfo/GetData", {
  98. id: str,
  99. token: $.cookie("token")
  100. }, function(result) {
  101. if(result.state.toLowerCase() == "success") {
  102. $("#TelNum").val(result.data.ContentInfo);
  103. $('#greetingTimes').val(result.data.StartDate + ' ~ ' + result.data.EndDate);
  104. // $("#Pb").val(result.data.F_Describe);
  105. }
  106. })
  107. }
  108. })
  109. //新增或者编辑
  110. function addedit() {
  111. var str = helper.request.queryString("str");
  112. var telreg = /^\d{1,12}$/;
  113. // if(!telreg.test($.trim($("#TelNum").val()))) {
  114. // layer.confirm('请输入有效的电话号码', {
  115. // icon: 2,
  116. // btn: ['确定'] //按钮
  117. // });
  118. // return;
  119. // }
  120. if(!$("#greetingTimes").val()) {
  121. layer.confirm('请选择时间', {
  122. icon: 2,
  123. btn: ['确定'] //按钮
  124. });
  125. return;
  126. }
  127. /*发送请求*/
  128. $.post(huayi.config.callcenter_url + "NoWaterInfo/AddData", {
  129. blackid: $("#ID").val(),
  130. id: str,
  131. contentinfo: $("#TelNum").val(),
  132. startdate: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0],//生效时间
  133. enddate: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1],//失效时间
  134. des: $("#Pb").val(),
  135. token: $.cookie("token")
  136. }, function(result) {
  137. result = JSON.parse(result);
  138. if(result.state.toLowerCase() == "success") {
  139. var index = parent.layer.getFrameIndex(window.name);
  140. parent.layer.close(index);
  141. parent.layer.msg("保存成功");
  142. parent.initTable();
  143. }
  144. })
  145. }
  146. </script>
  147. </body>
  148. </html>