|
@@ -18,7 +18,7 @@
|
|
<table>
|
|
<table>
|
|
<tr>
|
|
<tr>
|
|
<td>
|
|
<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}">
|
|
<span th:each="people : ${peoples}">
|
|
<input name="fid" type="radio" th:attr="value=${people.id},id=${people.id}" class="radio" />
|
|
<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>
|
|
<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>
|
|
</div>
|
|
|
|
|
|
<script th:inline="javascript">
|
|
<script th:inline="javascript">
|
|
|
|
+ /* <![CDATA[ */
|
|
var peoples = JSON.parse([[${peoplesJSON}]])
|
|
var peoples = JSON.parse([[${peoplesJSON}]])
|
|
var fid = [[${appointment.fid}]]
|
|
var fid = [[${appointment.fid}]]
|
|
var extend = [[${appointment.extend}]]
|
|
var extend = [[${appointment.extend}]]
|
|
-
|
|
|
|
- /* <![CDATA[ */
|
|
|
|
|
|
+
|
|
function selectPeople(id) {
|
|
function selectPeople(id) {
|
|
|
|
+ if (id == 0){
|
|
|
|
+ $("#idcard").val('');
|
|
|
|
+ $("#name").val('');
|
|
|
|
+ $("#sex1").attr("checked", "checked")
|
|
|
|
+ $("#phone").val("")
|
|
|
|
+ }
|
|
|
|
+
|
|
for (var i = 0; i < peoples.length; ++i) {
|
|
for (var i = 0; i < peoples.length; ++i) {
|
|
var obj = peoples[i]
|
|
var obj = peoples[i]
|
|
if (obj.id == id) {
|
|
if (obj.id == id) {
|
|
@@ -122,6 +129,23 @@
|
|
$("#extend").val(extend);
|
|
$("#extend").val(extend);
|
|
|
|
|
|
function save() {
|
|
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();
|
|
$("#form1").submit();
|
|
}
|
|
}
|
|
|
|
|