|
|
@@ -48,6 +48,7 @@ function setCertificateData(result)
|
|
|
var returnAge=jsGetAge($("#birthDay").val());
|
|
|
$("#age").val(returnAge);
|
|
|
$("#idCard").val(result.Certificate.IDNumber);
|
|
|
+ queryUserInfoBySocialNo();
|
|
|
//$("#idIssued").val(result.Certificate.IDIssued);
|
|
|
//$("#issuedValidDate").val(result.Certificate.IssuedData+"-"+result.Certificate.ValidDate);
|
|
|
|
|
|
@@ -238,4 +239,86 @@ function jsGetAge(strBirthday) {
|
|
|
}
|
|
|
}
|
|
|
return returnAge;//返回周岁年龄
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 身份证号有变化后查询病人信息
|
|
|
+ */
|
|
|
+function queryUserInfoBySocialNo() {
|
|
|
+ var idCard = $("#idCard").val();
|
|
|
+ if (idCard.length == 18) {
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getBySocialNo?socialNo=' + idCard,
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
+ dataType: "json",
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
+ success: function (res) {
|
|
|
+ if (res == '401' || res == 401) {
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (res.code == 0) {
|
|
|
+ if (res.data != null) {
|
|
|
+ $("#cardNo").blur();
|
|
|
+ $("#userName").val(res.data.name);
|
|
|
+ $("#userName").blur();
|
|
|
+ $("#userNameReadOnly").val(res.data.name);
|
|
|
+ $("#age").val(res.data.age);
|
|
|
+ $("#age").blur();
|
|
|
+ $("#gender").selectpicker('val', res.data.sex);
|
|
|
+ $("#gender").selectpicker('refresh');
|
|
|
+ $("#gender").blur();
|
|
|
+ $("#birthDayReadonly").val(res.data.birthDayStr);
|
|
|
+ $("#birthDayReadonly").attr("title", res.data.birthDayStr);
|
|
|
+ $("#birthDay").val(res.data.birthDayStr);
|
|
|
+ $("#birthDay").blur();
|
|
|
+ $("#phoneNum").val(res.data.phoneNo);
|
|
|
+ $("#phoneNum").attr("title", res.data.phoneNo);
|
|
|
+ $("#phoneNum").blur();
|
|
|
+ $("#patientsNature").selectpicker('val', res.data.responseType);//默认选中
|
|
|
+ $('#patientsNature').selectpicker('refresh');
|
|
|
+ $("#patientsNature").blur();
|
|
|
+ $("#idCard").val(res.data.socialNo);
|
|
|
+ $("#idCard").attr("title", res.data.socialNo);
|
|
|
+ $("#idCard").blur();
|
|
|
+ $("#address").val(res.data.address);
|
|
|
+ $("#address").blur();
|
|
|
+ $("#patientId").val(res.data.patientId);
|
|
|
+ if (res.data.name != null && res.data.name != "") {
|
|
|
+ $("#editUser").show();
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#cardNo").attr("readonly", "readonly");
|
|
|
+ $("#userName").attr("readonly", "readonly");
|
|
|
+ $("#age").attr("readonly", "readonly");
|
|
|
+ $("#gender").attr("disabled", "disabled");
|
|
|
+ $("#phoneNum").attr("readonly", "readonly");
|
|
|
+ $("#patientsNature").attr("disabled", "disabled");
|
|
|
+ $("#idCard").attr("readonly", "readonly");
|
|
|
+ $("#address").attr("readonly", "readonly");
|
|
|
+ $("#birthDayReadonly").removeClass("hide").addClass("in");
|
|
|
+ $("#birthDayGroup").removeClass("in").addClass("hide");
|
|
|
+ $("#userName").removeClass("in").addClass("hide");
|
|
|
+ $("#userNameReadOnly").removeClass("hide").addClass("in");
|
|
|
+ $("#webuiPopover0").css("display", "none");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ new PNotify({
|
|
|
+ title: '错误提示',
|
|
|
+ text: res.message,
|
|
|
+ type: 'error',
|
|
|
+ hide: true,
|
|
|
+ styling: 'bootstrap3'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+}
|