ZZDianXin_UI - 郑州电信 演示

AddBlack.html 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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"><b class="text_require">*</b>电话号码</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 class="col-md-2"><b class="text_require">*</b>拉黑时限</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" autocomplete="off">
  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. laydate.render({
  89. elem: '#greetingTimes',
  90. range: '~',
  91. theme: '#1ab394',
  92. calendar: 'true'
  93. //type: 'datetime',
  94. //max : 31,
  95. //min: 0,
  96. });
  97. })
  98. //新增或者编辑
  99. function addedit() {
  100. var telreg = /^\d{1,12}$/;
  101. if(!telreg.test($.trim($("#TelNum").val()))) {
  102. layer.confirm('请输入有效的电话号码', {
  103. icon: 2,
  104. btn: ['确定'] //按钮
  105. });
  106. return;
  107. }
  108. if(!$("#greetingTimes").val()) {
  109. layer.confirm('请选择时间', {
  110. icon: 2,
  111. btn: ['确定'] //按钮
  112. });
  113. return;
  114. }
  115. /*发送请求*/
  116. $.post(huayi.config.callcenter_url + "Callblack/AddBlack", {
  117. blackid: $("#ID").val(),
  118. telphone: $("#TelNum").val(),
  119. // settime: $("#StartTime").val(),
  120. // removetime: $("#EndTime").val(),
  121. settime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[0],//生效时间
  122. removetime: $('#greetingTimes').val() && $('#greetingTimes').val().split(' ~ ')[1],//失效时间
  123. des: $("#Pb").val(),
  124. token: $.cookie("token")
  125. }, function(result) {
  126. result = JSON.parse(result);
  127. if(result.state.toLowerCase() == "success") {
  128. var index = parent.layer.getFrameIndex(window.name);
  129. parent.layer.close(index);
  130. parent.layer.msg("保存");
  131. parent.initTable();
  132. }
  133. })
  134. }
  135. </script>
  136. </body>
  137. </html>