安图前端代码

addCustomerFile.html 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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 rel="stylesheet" href="../css/init.css" />
  8. <title></title>
  9. <style>
  10. .clearfix:after {
  11. content: "";
  12. display: block;
  13. clear: both;
  14. }
  15. .toolBar {
  16. padding: 15px 0;
  17. border-bottom: 1px solid #ccc;
  18. margin-bottom: 25px;
  19. padding-right: 45px;
  20. }
  21. .toolBar input {
  22. width: 128px;
  23. padding: 2px 2PX 2PX 10PX;
  24. height: 28px;
  25. border: 1px solid #ebebeb;
  26. color: #1ab394;
  27. outline: none;
  28. vertical-align: middle;
  29. }
  30. .model {
  31. position: fixed;
  32. top: 0;
  33. right: 0;
  34. bottom: 0;
  35. left: 0;
  36. height: 100%;
  37. width: 100%;
  38. background: rgba(0, 0, 0, 0.48);
  39. z-index: 100;
  40. display: none;
  41. }
  42. .delModel .box{
  43. width: 22%;
  44. }
  45. .box {
  46. width: 30%;
  47. margin: 0 auto;
  48. margin-top: 5%;
  49. }
  50. .box .btop {
  51. height: 35px;
  52. background: #1ab394;
  53. color: #fff;
  54. line-height: 35px;
  55. padding: 0 15px;
  56. /*margin-bottom: 15px;*/
  57. }
  58. .box .btop p.btl {
  59. float: left;
  60. margin: 0;
  61. }
  62. .box .btop p.btr {
  63. float: right;
  64. cursor: pointer;
  65. margin: 0;
  66. font-size: 20px;
  67. }
  68. .box>input {
  69. display: block;
  70. height: 34px;
  71. padding: 6px 12px;
  72. font-size: 14px;
  73. line-height: 1.42857143;
  74. color: #555;
  75. background-color: #fff;
  76. background-image: none;
  77. border: 1px solid #ccc;
  78. border-radius: 4px;
  79. margin: 35px auto;
  80. }
  81. .boxCon {
  82. width: 100%;
  83. background: #fff;
  84. text-align: center;
  85. padding: 10px 15px;
  86. height: auto;
  87. overflow-y: auto;
  88. }
  89. .boxCon>div {
  90. padding: 15px 0;
  91. }
  92. .boxCon table th {
  93. padding: 5px 8px 5px 0;
  94. text-align: right;
  95. width: 32%;
  96. }
  97. .boxCon table td {
  98. padding: 6px 0 5px 10px;
  99. text-align: left;
  100. color: #717171;
  101. line-height: 200%;
  102. }
  103. .kong{
  104. display: none;
  105. }
  106. </style>
  107. </head>
  108. <body>
  109. <div class="container-fluid">
  110. <div class="boxCon">
  111. <table>
  112. <tbody>
  113. <tr>
  114. <th>客户名称: </th>
  115. <td colspan="3"><input type="text" class="add_name" /><span class="addJsz_kong" style="color: red;">*</span></td>
  116. </tr>
  117. <tr>
  118. <th>客户编号: </th>
  119. <td colspan="3"><input type="text" class="add_code" /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
  120. </tr>
  121. <tr>
  122. <th>联系电话1: </th>
  123. <td colspan="3"><input type="text" class="add_ph1" /><span class="addJsz_kong" style="color: red;">*</span></td>
  124. </tr>
  125. <tr>
  126. <th>联系电话2: </th>
  127. <td colspan="3"><input type="text" class="add_ph2" /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
  128. </tr>
  129. <tr>
  130. <th>联系电话3: </th>
  131. <td colspan="3"><input type="text" class="add_ph3" /><span class="kong addJsz_kong" style="color: red;">*角色值不允许为空</span></td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. <div style="text-align: center;"><button class="btns addCun">保存</button></div>
  136. </div>
  137. </div>
  138. <script>
  139. var token = $.cookie("token");
  140. $('.addCun').click(function() {
  141. var khmc = $(".add_name").val();
  142. var khbh = $(".add_code").val();
  143. var tel1 = $(".add_ph1").val();
  144. var tel2 = $(".add_ph2").val();
  145. var tel3 = $(".add_ph3").val();
  146. if(Isnullorempty(khmc)) {
  147. layer.confirm('请输入客户名称!', {
  148. btn: ['确定']
  149. });
  150. return;
  151. }
  152. if(Isnullorempty(tel1)) {
  153. layer.confirm('请输入联系电话1', {
  154. btn: ['确定']
  155. });
  156. return;
  157. }
  158. var tflag = regBox.regMobOrTel.test(tel1);
  159. if(!tflag) {
  160. layer.confirm('请输入正确的联系电话1', {
  161. btn: ['确定']
  162. });
  163. return;
  164. }
  165. if(!Isnullorempty(tel2)) {
  166. var t2flag = regBox.regMobOrTel.test(tel2);
  167. if(!t2flag) {
  168. layer.confirm('请输入正确的联系电话2', {
  169. btn: ['确定']
  170. });
  171. return;
  172. }
  173. }
  174. if(!Isnullorempty(tel3)) {
  175. var t3flag = regBox.regMobOrTel.test(tel3);
  176. if(!t3flag) {
  177. layer.confirm('请输入正确的联系电话3', {
  178. btn: ['确定']
  179. });
  180. return;
  181. }
  182. }
  183. $.post(huayi.config.callcenter_url + 'Customer/AddCustomer', {
  184. name: khmc,
  185. code: khbh,
  186. mobile: tel1,
  187. telphone: tel2,
  188. chargetelephone: tel3,
  189. "token": $.cookie("token")
  190. }, function(result) {
  191. result = $.parseJSON(result);
  192. if(result.state.toLowerCase() == "success") {
  193. $("#activess").val(result.data);
  194. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  195. parent.layer.close(index); //再执行关闭
  196. parent.layer.msg("添加成功!");
  197. parent.table.bootstrapTable('refresh');
  198. }
  199. })
  200. // $('.addModel').css('display', 'none');
  201. })
  202. </script>
  203. </body>
  204. </html>