xinzengtx.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>湖北智慧水运</title>
  5. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  6. <meta http-equiv="description" content="this is my page">
  7. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  9. <link>
  10. <link href="../css/base.min.css" rel="stylesheet">
  11. <link rel="stylesheet" type="text/css" href="../css/mui.min.css">
  12. <script type="text/javascript" src="../js/zepto.min.js"></script>
  13. <script type="text/javascript">
  14. $(function(){
  15. $.ajax({
  16. type: 'post',
  17. url: '../../txlcontroller/queryZmtxl.do',
  18. data:{uid:"402881e44e86c26d014e86c9ae8c0008"},
  19. dataType: 'json',
  20. success: function(data){
  21. console.log(data)
  22. var result = "";
  23. for(var i=0;i<data.zmList.length;i++){
  24. result+='<option value="'+data.zmList[i].id+'">'+data.zmList[i].name+'</option>';
  25. }
  26. $("#zuming").html(result);
  27. }})
  28. $("#baocun").on("click",function(){
  29. var zm = $("#zm").val();
  30. var content = $("#content").val();
  31. if(zm.length<1){
  32. layer.open({
  33. shade:false,
  34. content: '组名不能为空',
  35. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  36. time:1
  37. });
  38. return;
  39. }
  40. $.ajax({
  41. type: 'post',
  42. url: '../../txlcontroller/saveEntitytxl.do',
  43. data:{uid:"402881e44e86c26d014e86c9ae8c0008",zm:zm,content:content},
  44. dataType: 'json',
  45. success: function(data){
  46. layer.open({
  47. shade:false,
  48. content: '添加成功',
  49. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  50. time:1
  51. });
  52. $("#zuming").append('<option value="'+data.zmEntity.id+'">'+data.zmEntity.name+'</option>');
  53. }})
  54. $("#div-alert").hide();
  55. $("#div-alert1").hide();
  56. $("#zm").val("")
  57. $("#content").val("");
  58. })
  59. $("#addtxl").on("click",function(){
  60. var zmid = $("#zuming").val();
  61. var name = $("#name").val();
  62. var bumen = $("#bumen").val();
  63. var phone = $("#phone").val();
  64. var mobile = $("#mobile").val();
  65. var email = $("#email").val();
  66. var no = $("#no").val();
  67. if(zmid.length<1){
  68. layer.open({
  69. shade:false,
  70. content: '请选择组名',
  71. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  72. time:1
  73. });
  74. return;
  75. }
  76. if(name.length<1){
  77. layer.open({
  78. shade:false,
  79. content: '姓名不能为空',
  80. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  81. time:1
  82. });
  83. return;
  84. }
  85. if(bumen.length<1){
  86. layer.open({
  87. shade:false,
  88. content: '部门不能为空',
  89. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  90. time:1
  91. });
  92. return;
  93. }
  94. var telValidate = /(0[1-9]{2,3})(^[0-9]{3,4}\-[0-9]{8}$)|(^[0-9]{8}$)|(^[0-9]{3,4}[0-9]{8}$)|(^0{0,1}13[0-9]{9}$)/;
  95. if(phone.length!=""){
  96. if(!telValidate.test(phone)){
  97. layer.open({
  98. shade:false,
  99. content: '请输入正确的固定电话',
  100. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  101. time:1
  102. });
  103. return;
  104. }
  105. }
  106. var mobileValidate = /^(1[3|5|7|8])[\d]{9}$/;
  107. if(mobile.length!=""){
  108. if(!mobileValidate.test(mobile)){
  109. layer.open({
  110. shade:false,
  111. content: '请输入正确移动电话',
  112. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  113. time:1
  114. });
  115. return;
  116. }
  117. }
  118. var emailValidate = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
  119. if(email.length!=""){
  120. if(!emailValidate.test(email)){
  121. layer.open({
  122. shade:false,
  123. content: '请输入正确的电子邮箱',
  124. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  125. time:1
  126. });
  127. return;
  128. }
  129. }
  130. if(no.length<1){
  131. layer.open({
  132. shade:false,
  133. content: '排序号不能为空',
  134. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  135. time:1
  136. });
  137. return;
  138. }
  139. if(!parseInt(no)&&no!="0"){
  140. layer.open({
  141. shade:false,
  142. content: '排序号只能为数字',
  143. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  144. time:1
  145. });
  146. return;
  147. }
  148. $.ajax({
  149. type: 'post',
  150. url: '../../txlcontroller/savetxl.do',
  151. data:{uid:"402881e44e86c26d014e86c9ae8c0008",zmid:zmid,name:name,bumen:bumen,mobile:mobile,phone:phone,email:email,no:no},
  152. dataType: 'json',
  153. success: function(data){
  154. if(data.resultCode==0){
  155. layer.open({
  156. shade:false,
  157. content: '添加成功',
  158. style: 'background-color:rgba(0,0,0,0.5); color:white; border:none;font-size:20px;text-align:center',
  159. time:1
  160. });
  161. setTimeout(function(){
  162. window.history.back();
  163. },500);
  164. }
  165. }})
  166. });
  167. $("#quxiao").on("click",function(){
  168. $("#div-alert").hide();
  169. $("#div-alert1").hide();
  170. })
  171. $("#tianjia").on("click",function(){
  172. $("#div-alert").show();
  173. $("#div-alert1").show();
  174. })
  175. })
  176. </script>
  177. <style type="text/css">
  178. *{padding: 0px;margin: 0px;}
  179. .header {
  180. width:100%;
  181. height:45px;
  182. line-height:45px;
  183. padding:0;
  184. color:#eee;
  185. font-size:22px;
  186. text-align:left;
  187. color:white;
  188. background: #2196f3;
  189. }
  190. #header {
  191. position:fixed; z-index:2;
  192. top:0; left:0;
  193. width:100%;
  194. height:45px;
  195. line-height:45px;
  196. text-align:center;
  197. padding:0;
  198. font-size:22px;
  199. color:white;
  200. background: #2196f3;
  201. color: white;
  202. }
  203. #header a{
  204. color:white;
  205. }
  206. body,button,input,div{margin: 0px;padding: 0px}
  207. .mui-input-group:after {
  208. position: absolute;
  209. right: 0;
  210. bottom: 0;
  211. left: 0;
  212. height: 0px;
  213. content: '';
  214. background-color: #c8c7cc;
  215. -webkit-transform: scaleY(.5);
  216. transform: scaleY(.5);
  217. }
  218. .mui-select:before {
  219. position: absolute;
  220. top: 8px;
  221. right: 50px;
  222. font-family: Muiicons;
  223. color: rgba(170,170,170,.6);
  224. content: '\e581';
  225. }
  226. </style>
  227. </head>
  228. <body>
  229. <div id="header"><a>新增联系人</a></div>
  230. <div class="mui-off-canvas-wrap mui-draggable">
  231. <div class="mui-inner-wrap">
  232. <div class="mui-content" style="margin-top:50px;background: white;">
  233. <div class="mui-content-padded">
  234. <form class="mui-input-group">
  235. <div class="mui-input-row mui-select">
  236. <label>组名</label>
  237. <select id="zuming">
  238. </select>
  239. <span class="mui-icon mui-icon-plusempty" id="tianjia" style="position: absolute;background:#2196f3;color: white;right: 5px;margin-top: 7px"></span>
  240. </div>
  241. <div class="mui-input-row">
  242. <label>姓名</label>
  243. <input type="text" id="name" placeholder="请输入姓名">
  244. </div>
  245. <div class="mui-input-row">
  246. <label>部门</label>
  247. <input id="bumen" type="text" placeholder="请输入部门">
  248. </div>
  249. <div class="mui-input-row">
  250. <label>固定电话</label>
  251. <input id="phone" type="text" placeholder="请输入固定电话">
  252. </div>
  253. <div class="mui-input-row">
  254. <label>移动电话</label>
  255. <input id="mobile" type="text" placeholder="请输入移动电话">
  256. </div>
  257. <div class="mui-input-row">
  258. <label >电子邮箱</label>
  259. <input id="email" type="text" placeholder="请输入电子邮箱">
  260. </div>
  261. <div class="mui-input-row">
  262. <label>排序号</label>
  263. <input id="no" type="tel" placeholder="请输入排序号">
  264. </div>
  265. <div class="mui-button-row" style="margin-top: 30px;">
  266. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="addtxl">保存 </button>&nbsp;&nbsp;
  267. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" onclick="history.back()">取消</button>
  268. </div>
  269. </form>
  270. </div>
  271. </div>
  272. <!-- off-canvas backdrop -->
  273. <div class="mui-off-canvas-backdrop"></div>
  274. </div>
  275. </div>
  276. <div id="div-alert" style="position: absolute;display:none;top: 20%;left: 10%;z-index: 100;height:260px;border:4px solid #2196f3;border-radius:10px;width: 82%;background:white;">
  277. <form id="jhform">
  278. <input type="hidden" name="jid" id="jid" value="" />
  279. <div id="title" style="width:100%;height:30px;text-align: center;background:#2196f3;line-height: 30px;color: white;margin-bottom: 20px;font-size:20px;">新增组名</div>
  280. <label style="margin-left: 5px">组名:&nbsp;</label><input id="zm" type="text" style="width: 80%" /><br/>
  281. <label style="float: left;margin-left: 5px">描述:&nbsp;</label><textarea name="content" id="content" type="text" style="width: 80%"></textarea>
  282. </form>
  283. <div style="width: 100%;text-align: center;">
  284. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="baocun">保存 </button>&nbsp;&nbsp;
  285. <button class="mui-btn mui-btn-positive" type="button" style="width: 40%;background: #2196f3;border: 0px;" id="quxiao">取消</button>
  286. </div>
  287. </div>
  288. <div id="div-alert1" style="position:absolute;display:none;;width:100%;height: 100%;z-index: 50;top:0px;background: black; opacity:0.2; "></div>
  289. </body>
  290. </html>