| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 | 
							- <!DOCTYPE html>
 
- <html>
 
- <head>
 
- <meta charset="UTF-8">
 
- <meta name="viewport" content="width=device-width, initial-scale=1">
 
- <title>添加物业</title>
 
- <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
 
- <link rel="stylesheet" href="css/bootstrap.css"/>
 
- <script src="js/bootstrap.js"></script>
 
- <script src="js/public.js"></script> 
 
- <style>
 
- 	*{
 
- 		margin:0;
 
- 		padding:0;
 
- 	}
 
- 	.title{
 
- 		width:100%;
 
- 		height:50px;
 
- 		font-size:16px;
 
- 		background:#555;
 
- 		text-align:center;
 
- 		color:#fff;
 
- 		line-height:50px;
 
- 		font-weight:600;
 
- 	}
 
- 	h4.title>span:last-child img{
 
- 		width: 18px;
 
-     	vertical-align: text-bottom;
 
-     	margin-left: 10px;
 
-     	cursor:pointer;
 
- 	}
 
- 	#formArea>p{
 
- 			position:relative;
 
- 	}
 
- 	#formArea>p input,#formArea>p select{
 
- 			padding-left:84px;
 
- 	}
 
- 	#formArea>p>span{
 
- 			position: absolute;
 
- 		    left: 10px;
 
- 		    display: inline-block;
 
- 		    width: 80px;
 
- 		    height: 34px;
 
- 		    line-height: 34px;
 
- 		    color:#555;
 
- 	}
 
- 	@media screen and (min-width:1024px){
 
- 		.formArea{
 
- 			width:40%;
 
- 			margin:0 auto;
 
- 			padding-top:60px;
 
- 		}
 
- 		.formArea input,select{
 
- 			margin-bottom:20px;
 
- 		}
 
- 	}
 
- 	@media screen and (max-width:1024px){
 
- 		.formArea{
 
- 			width:90%;
 
- 			margin:0 auto;
 
- 		}
 
- 	}
 
- </style>
 
- <script>
 
- var comId;
 
- var postUrl = "system/addCommunityProperty.do";
 
- 	$(function(){
 
- 		loadWy();
 
- 		if(sessionStorage.id != null && sessionStorage.userName == "系统"){
 
- 			$("h4.title>span:last-child").html("<img onclick='returnPage()' src='images/return.png'>");
 
- 			comId = getQueryString("id");
 
- 			if(comId != null){
 
- 				$("h4.title>span:first-child").html("修改业主");
 
- 				postUrl = "system/updateCommunityProperty.do"
 
- 				$.post("getComDetail.do",{"comId":comId},function(resp){
 
- 					var proData = resp.data;
 
- 					for(key in proData){
 
- 						$("#"+key).val(proData[key]);
 
- 					}
 
- 					$("#rePwd").val(proData.pwd);
 
- 				})				
 
- 			}
 
- 		}
 
- 	})
 
- function getQueryString(name) {
 
-     var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
 
-     var r = window.location.search.substr(1).match(reg);
 
-     if (r != null) {
 
-         return unescape(r[2]);
 
-     }
 
-     return null;
 
- }
 
- /*获取物业*/
 
- function loadWy(){
 
- 	$.post("system/getCommunityPropertyAllMessageList.do",{},function(resp) {
 
- 		var listArray = resp.data;
 
- 		$("#comId").html("<option value=''>--请选择--</option>")
 
- 		for(var i = 0;i<listArray.length;i++){
 
- 		 	var leng = "<option value=\""+listArray[i].id+"\">"+listArray[i].username+"</option>";
 
- 		 	$("#comId").append(leng);
 
- 		}
 
- 	})
 
- }
 
- /*提交*/	
 
- 	function submits(){
 
- 		var param = {};
 
- 		if($("#nickname").val() == ""){ 
 
- 			alert("请输入账号");
 
- 			return
 
- 		}
 
- 		if($("#mobile").val() == ""){ 
 
- 			alert("请输入手机号");
 
- 			return
 
- 		}
 
- 		if($("#comId").val() == ""){ 
 
- 			alert("请选择物业");
 
- 			return
 
- 		}
 
- // 		if($("#income").val() != "" && ($("#income").val() < 0 || $("#income").val() > 100)){ 
 
- // 			alert("收益范围0~100"); 
 
- // 			return
 
- // 		}
 
- 		var formData = $("#formArea").serialize();
 
- 		if(comId != null){
 
- 			formData += "&id="+comId;
 
- 		}
 
- 		console.log(formData)
 
- 		$.post("addUser.do",formData,function(resp){
 
- 			if(resp.code == "ok"){
 
- 				alert("提交成功!");
 
- 				location.reload();
 
- 			}else{
 
- 				alert(resp.msg);
 
- 			}
 
- 		});
 
- 	}
 
- </script>
 
- </head>
 
- <body>
 
- 	<h4 class="title"><span>添加业主</span><span></span></h4>
 
- 	<div class="formArea">
 
- 		<form id="formArea">
 
- 		<p><span>账       号:</span><input type="text" class="form-control" id="count" name="count"></p>
 
- 		<p><span>姓       名:</span><input type="text" class="form-control" id="nickname" name="nickname"></p>
 
- 		<p><span>手  机  号:</span><input type="text" class="form-control" id="mobile" name="mobile"></p>
 
- 		<p><span>住       址:</span><input type="text" class="form-control" id="address" name="address"></p>
 
- 		<p><span>所属物业:</span><select class="form-control" id="comId" name="comId">
 
- 		</select>
 
- 		</p>
 
- 		<p><span>收       益:</span><input type="number" class="form-control" placeholder="0~100" id="income" name="income"></p>
 
- 		<button type="button" class="btn btn-success btn-md btn-block" onclick="submits()">提交</button>
 
- 		</form>
 
- 	</div>
 
- </body>
 
- </html>
 
 
  |