|
@@ -14,8 +14,6 @@ $(function () {
|
|
|
cardNoChange();
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 清空
|
|
|
*/
|
|
@@ -29,35 +27,12 @@ $(function () {
|
|
|
*/
|
|
|
$("#saveHybird").on("click", function (t) {
|
|
|
var hybirdType = $("#hybirdType").val();
|
|
|
- if(hybirdType==null){
|
|
|
+ if (hybirdType == null) {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageContent").html("请选择混采类型!");
|
|
|
return;
|
|
|
}
|
|
|
- $.ajax({
|
|
|
- type: "GET",
|
|
|
- url: '/thmz/saveHybirdTestPatient?number='+hybirdType,
|
|
|
- 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) {
|
|
|
- $("#hybirdPatientName").text(res.data.name);
|
|
|
- $("#hybirdPatientId").text(res.data.patientId);
|
|
|
- //$("#creatHybird").hide();
|
|
|
- $("#hc_number").val(hybirdType);
|
|
|
- $("#hybirdTypeModal").modal('hide');
|
|
|
- $("#messageButton").attr("data-clipboard-text",'');
|
|
|
- } else {
|
|
|
- errorMesage(res);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ creatHyBird(hybirdType);
|
|
|
});
|
|
|
|
|
|
|
|
@@ -68,52 +43,19 @@ $(function () {
|
|
|
$("#messageContent").html("确定要提交当前操作吗?");
|
|
|
$("#messageButton").off("click").on("click", function (t) {
|
|
|
$("#messageModal").modal("hide");
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: '/thmz/saveHybirdTestPatientRelation',
|
|
|
- contentType: "application/json;charset=UTF-8",
|
|
|
- dataType: "json",
|
|
|
- async: false,
|
|
|
- data: JSON.stringify({
|
|
|
- "parentPatientId": $("#hybirdPatientId").text(),
|
|
|
- "patientId": $("#fullPatientIds").val()
|
|
|
- }),
|
|
|
- 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) {
|
|
|
- //将混检主体的ID设置到复制区域
|
|
|
- $("#messageButton").attr("data-clipboard-text",$("#hybirdPatientId").text());
|
|
|
- copyParentPatient();
|
|
|
- successMesage(res);
|
|
|
- $("#hybirdList").empty();
|
|
|
- $("#hybirdPatientId").text(null);
|
|
|
- $("#hybirdPatientName").text(null);
|
|
|
- $("#fullPatientIds").val(null);
|
|
|
- $("#hc_number").val(null);
|
|
|
- } else {
|
|
|
- errorMesage(res);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ saveHybirdTestPatientRelation();
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//每隔三秒读一次身份证
|
|
|
setInterval(function () {
|
|
|
new Device().startFun();
|
|
|
+ // //默认光标在卡号输入框
|
|
|
+ // $("#cardNo").focus();
|
|
|
}, 3000);
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
$("#idCard").change(function (e) {
|
|
|
queryUserInfoBySocialNo();
|
|
|
});
|
|
@@ -142,9 +84,90 @@ $(function () {
|
|
|
queryUserInfoByName();
|
|
|
});
|
|
|
|
|
|
+ //将缓存中未提交的数据展示到页面
|
|
|
+ recoverLocalStorageData();
|
|
|
});
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 创建混采主体
|
|
|
+ * @param hybirdType 主体类型 试管人数
|
|
|
+ */
|
|
|
+function creatHyBird(hybirdType) {
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/saveHybirdTestPatient?number=' + hybirdType,
|
|
|
+ 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) {
|
|
|
+ $("#hybirdPatientName").text(res.data.name);
|
|
|
+ $("#hybirdPatientId").text(res.data.patientId);
|
|
|
+ //$("#creatHybird").hide();
|
|
|
+ $("#hc_number").val(hybirdType);
|
|
|
+ $("#hybirdTypeModal").modal('hide');
|
|
|
+ $("#messageButton").attr("data-clipboard-text", '');
|
|
|
+ //创建混采主体的时候,默认添加一次
|
|
|
+ addToList();
|
|
|
+ localStorage.setItem("hybirdPatientName", res.data.name);
|
|
|
+ localStorage.setItem("hybirdPatientId", res.data.patientId);
|
|
|
+ localStorage.setItem("hc_number", hybirdType);
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 提交混采记录
|
|
|
+ */
|
|
|
+function saveHybirdTestPatientRelation() {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '/thmz/saveHybirdTestPatientRelation',
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
+ dataType: "json",
|
|
|
+ async: false,
|
|
|
+ data: JSON.stringify({
|
|
|
+ "parentPatientId": $("#hybirdPatientId").text(),
|
|
|
+ "patientId": $("#fullPatientIds").val()
|
|
|
+ }),
|
|
|
+ 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) {
|
|
|
+ var hybirdType = $("#hc_number").val();
|
|
|
+ //将混检主体的ID设置到复制区域
|
|
|
+ $("#messageButton").attr("data-clipboard-text", $("#hybirdPatientId").text());
|
|
|
+ copyParentPatient();
|
|
|
+ successMesage(res);
|
|
|
+ $("#hybirdList").empty();
|
|
|
+ $("#hybirdPatientId").text(null);
|
|
|
+ $("#hybirdPatientName").text(null);
|
|
|
+ $("#fullPatientIds").val(null);
|
|
|
+ $("#hc_number").val(null);
|
|
|
+ localStorage.removeItem("hybirdPatientName");
|
|
|
+ localStorage.removeItem("hybirdPatientId");
|
|
|
+ localStorage.removeItem("fullPatientIds");
|
|
|
+ localStorage.removeItem("hc_number");
|
|
|
+ localStorage.removeItem("hybirdList");
|
|
|
+ //提交完默认创建一个与上次相同的混采主体
|
|
|
+ creatHyBird(hybirdType);
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -238,9 +261,6 @@ function initCertificateTypeSelect() {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 打开编辑用户信息窗口
|
|
|
* @param data
|
|
@@ -276,8 +296,6 @@ function editUserModal(data) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* checkBox样式
|
|
|
*/
|
|
@@ -313,7 +331,7 @@ function queryUserInfoByCardNo() {
|
|
|
}
|
|
|
if (res.code == 0) {
|
|
|
if (res.data != null) {
|
|
|
- extracted(res);
|
|
|
+ setPatientValue(res);
|
|
|
} else {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageButton").addClass("hide");
|
|
@@ -359,7 +377,6 @@ function userNameChange() {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 按照病人id查询病人信息
|
|
|
* @param patientId
|
|
@@ -381,7 +398,7 @@ function fillPatinet(patientId) {
|
|
|
}
|
|
|
if (res.code == 0) {
|
|
|
if (res.data != null) {
|
|
|
- extracted(res);
|
|
|
+ setPatientValue(res);
|
|
|
}
|
|
|
} else {
|
|
|
errorMesage(res);
|
|
@@ -390,8 +407,11 @@ function fillPatinet(patientId) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-function extracted(res) {
|
|
|
+/**
|
|
|
+ * 填充患者信息
|
|
|
+ * @param res
|
|
|
+ */
|
|
|
+function setPatientValue(res) {
|
|
|
$("#cardNo").val(res.data.icCardNo);
|
|
|
$("#cardNo").attr("title", res.data.icCardNo);
|
|
|
$("#cardNo").blur();
|
|
@@ -431,7 +451,8 @@ function extracted(res) {
|
|
|
$("#nucleicAcid").show();
|
|
|
$("#editUser").show();
|
|
|
}
|
|
|
- $("#saveUser").hide();
|
|
|
+ //自动添加进列表
|
|
|
+ addToList();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -473,9 +494,6 @@ function fillPlusPatinet(patinet) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 给某些域增加title或者清除title
|
|
|
* @param obj
|
|
@@ -493,9 +511,6 @@ function clearTextOrTitle(obj) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 清空挂号信息
|
|
|
*/
|
|
@@ -521,16 +536,12 @@ function clearRegistration() {
|
|
|
$("#nucleicAcid").hide();
|
|
|
//默认光标在卡号输入框
|
|
|
$("#cardNo").focus();
|
|
|
- initMzWorkTime();
|
|
|
$('#certificateType').selectpicker('val', '01');
|
|
|
$('#certificateType').selectpicker('refresh');
|
|
|
$("#saveUser").hide();
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 根据手机号码查询病人信息
|
|
|
*/
|
|
@@ -628,25 +639,28 @@ function setAge() {
|
|
|
*/
|
|
|
function hybirdTypeModal() {
|
|
|
var hcNumber = $("#hc_number").val();
|
|
|
- if(hcNumber!=null && hcNumber!=''){
|
|
|
+ if (hcNumber != null && hcNumber != '') {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageButton").removeClass("hide");
|
|
|
- $("#messageContent").html("已经创建了【核酸混检"+hcNumber+"人】主体,是否仍要继续创建?");
|
|
|
+ $("#messageContent").html("已经创建了【核酸混检" + hcNumber + "人】主体,是否仍要继续创建?");
|
|
|
$("#messageButton").off("click").on("click", function (t) {
|
|
|
$("#messageModal").modal("hide");
|
|
|
$("#hybirdTypeModal").modal();
|
|
|
});
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
$("#hybirdTypeModal").modal();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 将当前病人就诊人添加到混采列表
|
|
|
+ * 将当前病人就诊人添加到混采列表
|
|
|
*/
|
|
|
function addToList() {
|
|
|
- var patientId=$("#patientId").val();
|
|
|
+ var patientId = $("#patientId").val();
|
|
|
+ if (patientId == null || patientId == "") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: '/thmz/verifyHybridTestStatus?patientId=' + patientId,
|
|
@@ -659,58 +673,69 @@ function addToList() {
|
|
|
return;
|
|
|
}
|
|
|
if (res.code == 0) {
|
|
|
- var userName=$("#userName").val();
|
|
|
- var gender=$('#gender option:selected').text();
|
|
|
- var age=$("#age").val();
|
|
|
- var phoneNum=$("#phoneNum").val();
|
|
|
- var idCard=$("#idCard").val();
|
|
|
- var hybirdPatientId =$("#hybirdPatientId").text();
|
|
|
- if(hybirdPatientId==null || hybirdPatientId==""){
|
|
|
+ var userName = $("#userName").val();
|
|
|
+ var gender = $('#gender option:selected').text();
|
|
|
+ var age = $("#age").val();
|
|
|
+ var phoneNum = $("#phoneNum").val();
|
|
|
+ var idCard = $("#idCard").val();
|
|
|
+ var hybirdPatientId = $("#hybirdPatientId").text();
|
|
|
+ if (hybirdPatientId == null || hybirdPatientId == "") {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageButton").addClass("hide");
|
|
|
$("#messageContent").html("请先创建混检主体再执行该操作!");
|
|
|
return;
|
|
|
}
|
|
|
- if(patientId==null){
|
|
|
+ if (patientId == null) {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageButton").addClass("hide");
|
|
|
$("#messageContent").html("未选择任何待检人,无法进行该操作!");
|
|
|
return;
|
|
|
}
|
|
|
- var fullPatientIds=$("#fullPatientIds").val();
|
|
|
- if(fullPatientIds!=null && fullPatientIds.indexOf(patientId)>0){
|
|
|
+ var fullPatientIds = $("#fullPatientIds").val();
|
|
|
+ if (fullPatientIds != null && fullPatientIds.indexOf(patientId) > 0) {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageButton").addClass("hide");
|
|
|
$("#messageContent").html("请不要重复添加该待检人!");
|
|
|
clearRegistration();
|
|
|
return;
|
|
|
}
|
|
|
- var length=$("#hybirdList").children().length;
|
|
|
+ var length = $("#hybirdList").children().length;
|
|
|
var hc_number = $("#hc_number").val();
|
|
|
- if(length>=hc_number){
|
|
|
+ if (length >= hc_number) {
|
|
|
$("#messageModal").modal();
|
|
|
$("#messageButton").addClass("hide");
|
|
|
$("#messageContent").html("当前混检主体已经达到最大人数,请提交后创建新混检主体再继续操作!");
|
|
|
//clearRegistration();
|
|
|
return;
|
|
|
}
|
|
|
- fullPatientIds+=","+patientId+"_"+res.times;
|
|
|
+ fullPatientIds += "," + patientId + "_" + res.times;
|
|
|
$("#fullPatientIds").val(fullPatientIds);
|
|
|
- var html= '<div class="col-md-6 col-sm-6 col-xs-12 item">';
|
|
|
- html+=userName+" "+gender+" "+age+"岁 "+phoneNum+" "+idCard+" ";
|
|
|
- html+='<a style="cursor: pointer;color: #337AB7 !important;" onclick="editUserModal(\''+patientId+'\')">详情</a> ';
|
|
|
- html+='<a style="cursor: pointer;color: #337AB7 !important;" onclick="deleteFromList(this,\''+patientId+'\')">删除</a>';
|
|
|
- html+=' </div>';
|
|
|
+ localStorage.setItem("fullPatientIds", fullPatientIds);
|
|
|
+ var html = '<div class="col-md-6 col-sm-6 col-xs-12 item">';
|
|
|
+ html += userName + " " + gender + " " + age + "岁 " + phoneNum + " " + idCard + " ";
|
|
|
+ html += '<a style="cursor: pointer;color: #337AB7 !important;" onclick="editUserModal(\'' + patientId + '\')">详情</a> ';
|
|
|
+ html += '<a style="cursor: pointer;color: #337AB7 !important;" onclick="deleteFromList(this,\'' + patientId + '\')">删除</a>';
|
|
|
+ html += ' </div>';
|
|
|
$("#hybirdList").append(html);
|
|
|
+ localStorage.setItem("hybirdList", $("#hybirdList").html());
|
|
|
clearRegistration();
|
|
|
- }else {
|
|
|
+ length = $("#hybirdList").children().length;
|
|
|
+ if (length == hc_number) {
|
|
|
+ $("#messageModal").modal();
|
|
|
+ $("#messageContent").html("当前混检主体已经达到最大人数,是否立即提交并新增混采主体!");
|
|
|
+ $("#messageButton").removeClass("hide");
|
|
|
+ $("#messageButton").off("click").on("click", function (t) {
|
|
|
+ $("#messageModal").modal("hide");
|
|
|
+ saveHybirdTestPatientRelation();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
errorMesage(res);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -719,15 +744,16 @@ function addToList() {
|
|
|
* @param obj
|
|
|
* @param patientId
|
|
|
*/
|
|
|
-function deleteFromList(obj,patientId) {
|
|
|
+function deleteFromList(obj, patientId) {
|
|
|
$(obj).parent().remove();
|
|
|
- var fullPatientIds=$("#fullPatientIds").val();
|
|
|
- fullPatientIds= fullPatientIds.replace(patientId,"");
|
|
|
+ var fullPatientIds = $("#fullPatientIds").val();
|
|
|
+ fullPatientIds = fullPatientIds.replace(patientId, "");
|
|
|
$("#fullPatientIds").val(fullPatientIds);
|
|
|
+ localStorage.setItem("fullPatientIds", fullPatientIds);
|
|
|
+ localStorage.setItem("hybirdList", $("#hybirdList").html());
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 复制混检主体的ID
|
|
|
*/
|
|
@@ -742,3 +768,35 @@ function copyParentPatient() {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 将缓存中未提交的数据展示到页面
|
|
|
+ */
|
|
|
+function recoverLocalStorageData() {
|
|
|
+ var fullPatientIds = localStorage.getItem("fullPatientIds");
|
|
|
+ var hybirdPatientName = localStorage.getItem("hybirdPatientName");
|
|
|
+ var hybirdPatientId = localStorage.getItem("hybirdPatientId");
|
|
|
+ var hybirdType=localStorage.getItem("hc_number");
|
|
|
+ $("#hc_number").val(hybirdType);
|
|
|
+ $("#hybirdPatientId").text(hybirdPatientId);
|
|
|
+ $("#hybirdPatientName").text(hybirdPatientName);
|
|
|
+ // var arr = fullPatientIds.split(",");
|
|
|
+ // if (arr == null || arr.length == 0) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // for (var i = 0; i < arr.length; i++) {
|
|
|
+ // var temp = arr[i];
|
|
|
+ // if (temp == null || temp.length == 0) {
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
+ // var tempArr = temp.split("_");
|
|
|
+ // if (tempArr != null && tempArr.length == 2) {
|
|
|
+ // var patientId = tempArr[0];
|
|
|
+ // $("#cardNo").val(patientId);
|
|
|
+ // queryUserInfoByCardNo(false);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ $("#fullPatientIds").val(fullPatientIds);
|
|
|
+ var hybirdListHtml= localStorage.getItem("hybirdList");
|
|
|
+ $("#hybirdList").html(hybirdListHtml);
|
|
|
+}
|