yuhaitao14 6 years ago
parent
commit
24f49b29b3

+ 13 - 3
shop/src/main/java/com/zskk/shop/controller/h5/H5AppointmentController.java

@@ -134,9 +134,19 @@ public class H5AppointmentController extends AbstractController  {
 			throw new ZSKKException(ErrorConstant.PARAM_ERROR);
 		}
 		
-		FamilyPeople people = this.familyPeopleService.queryMyPeople(fid);
-		if (people == null){
-			throw new ZSKKException(ErrorConstant.PARAM_ERROR);
+		FamilyPeople people = null;
+		if (fid.equals(0)){ //新建
+			people = new FamilyPeople();
+			people.setId(0);
+			people.setAddress("");
+			people.setCtime(ToolUtils.getNow());
+			people.setIsDel(0);
+			people.setUid(userBean.getUserid());
+		}else{
+			people = familyPeopleService.queryMyPeople(fid);
+			if (people == null){
+				throw new ZSKKException(ErrorConstant.PARAM_ERROR);
+			}
 		}
 		
 		appointment.setFid(fid);

+ 8 - 1
shop/src/main/java/com/zskk/shop/service/FamilyPeopleService.java

@@ -202,7 +202,14 @@ public class FamilyPeopleService {
 	
 	@Transactional
 	public Appointment change(UserBean userBean, FamilyPeople people, Appointment appointment){
-		familyPeopleMapper.updateMyPeople(people);
+		//维护家人 
+		if (people.getId().equals(0)) {
+			people = addMyPeople(userBean.getUserid(), people.getName(), people.getPhone(), people.getIdcard(),
+					people.getSex(), people.getBirth());
+		} else {
+			updateMyPeople(userBean.getUserid(), people.getId(), people.getName(), people.getPhone(),
+					people.getIdcard(), people.getSex(), people.getBirth());
+		}
 		
 		//取消原有订单
 		tjCenterService.cancelAppointment(people, appointment);

+ 27 - 3
shop/src/main/resource/templates/h5/changeappointment.html

@@ -18,7 +18,7 @@
             <table>
                 <tr>
                     <td>
-                        <span><input name="fid" type="radio" value="" id="tj0" class="radio" checked="checked" /><label for="tj0">新建体检人</label></span>
+                        <span><input name="fid" type="radio" value="0" id="tj0" class="radio" checked="checked" /><label for="tj0" onclick="selectPeople(0)">新建体检人</label></span>
                         <span th:each="people : ${peoples}">
 							<input name="fid" type="radio"  th:attr="value=${people.id},id=${people.id}" class="radio" />
 							<label th:attr="for=${people.id},onclick='selectPeople(' + ${people.id} + ')',id='l' + ${people.id}" for="tj1" th:text="${people.name}"></label>
@@ -101,12 +101,19 @@
     </div>
 
     <script th:inline="javascript">
+   	 	/* <![CDATA[ */
         var peoples = JSON.parse([[${peoplesJSON}]])
         var fid = [[${appointment.fid}]]
         var extend = [[${appointment.extend}]]
-
-        /* <![CDATA[ */
+        
         function selectPeople(id) {
+   	 		if (id == 0){
+   	 		 $("#idcard").val('');
+             $("#name").val('');
+             $("#sex1").attr("checked", "checked")
+             $("#phone").val("")
+   	 		}
+   	 		
             for (var i = 0; i < peoples.length; ++i) {
                 var obj = peoples[i]
                 if (obj.id == id) {
@@ -122,6 +129,23 @@
         $("#extend").val(extend);
 
         function save() {
+        	var idcard = $("#idcard").val();
+        	var name = $("#name").val();
+        	var phone = $("#phone").val();
+        	
+        	if (idcard.length == 0){
+        		alert("请输入身份证号");
+        		return;
+        	}
+        	if (name.length == 0){
+        		alert("请输入姓名");
+        		return;
+        	}
+        	if (phone.length == 0){
+        		alert("请输入手机号");
+        		return;
+        	}
+        	
             $("#form1").submit();
         }
 

+ 1 - 1
shop/src/main/resource/templates/h5/indexv2.html

@@ -111,7 +111,7 @@
 	<table class="n-tab">
     	<tr>
         	<td><a href="/h5/index" class="n-1-c">首页</a></td>
-            <td><a href="/h5/buy/completedorders" class="n-2">报告</a></td>
+            <td><a href="/h5/buy/tjorders" class="n-2">报告</a></td>
             <td><a href="/h5/my/index" class="n-3">我的</a></td>
         </tr>
     </table>

+ 2 - 2
shop/src/main/resource/templates/h5/my.html

@@ -22,7 +22,7 @@
         </div>
         <ul>
         	<li class="yytj"><a href="/h5/buy/mypayedorders">预约体检</a></li>
-            <li class="bgcx"><a href="/h5/buy/completedorders">报告查询</a></li>
+            <li class="bgcx"><a href="/h5/buy/tjorders">报告查询</a></li>
         </ul>
         <ul>
         	<li class="scdd"><a href="/h5/buy/nopayorders">商城订单</a></li>
@@ -42,7 +42,7 @@
 	<table class="n-tab">
     	<tr>
         	<td><a href="/h5/index" class="n-1-c">首页</a></td>
-            <td><a href="/h5/buy/completedorders" class="n-2">报告</a></td>
+            <td><a href="/h5/buy/tjorders" class="n-2">报告</a></td>
             <td><a href="/h5/my/index" class="n-3">我的</a></td>
         </tr>
     </table>

+ 5 - 5
shop/src/main/resource/templates/h5/query_report.html

@@ -33,10 +33,10 @@
 					<a th:if="${order.status eq 7}" href="#" class="btn-blue y">报告生成中</a>
 
 					<a th:if="${order.status eq 2}"
-						th:attr="href='http://kunlun.pacsonline.cn/public/api.php/shop/reportDetails?id=' + ${order.id}"
+						th:attr="href='/api/rjreport/' + ${order.id}"
 						class="btn-blue y" target="_blank">查看报告</a> 
 					<a th:if="${order.status eq 6}"
-						th:attr="href='http://kunlun.pacsonline.cn/public/api.php/shop/reportDetails?id=' + ${order.id}"
+						th:attr="href='/api/rjreport/' + ${order.id}"
 						class="btn-blue y" target="_blank">查看报告</a>
 				</p>
 			</div>
@@ -52,11 +52,11 @@
 	 </div>
 	 
 	 <!--底部-->
-    <div style="height:60px;" th:if="${iscomplete}"></div>
-	<table class="n-tab" th:if="${iscomplete}">
+    <div style="height:60px;" ></div>
+	<table class="n-tab" >
     	<tr>
         	<td><a href="/h5/index" class="n-1-c">首页</a></td>
-            <td><a href="/h5/buy/completedorders" class="n-2">报告</a></td>
+            <td><a href="/h5/buy/tjorders" class="n-2">报告</a></td>
             <td><a href="/h5/my/index" class="n-3">我的</a></td>
         </tr>
     </table>

+ 0 - 1
shop/static/h5/js/nav.js

@@ -52,7 +52,6 @@ $(function () {
         var dom = $(this);
         dom.on('click', function () {
             hideNav();
-            alert(dom.text())
         });
     });