deltx.html 12 KB

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