|
|
@@ -642,51 +642,71 @@ function hybirdTypeModal() {
|
|
|
* 将当前病人就诊人添加到混采列表
|
|
|
*/
|
|
|
function addToList() {
|
|
|
- var userName=$("#userName").val();
|
|
|
- var gender=$('#gender option:selected').text();
|
|
|
- var age=$("#age").val();
|
|
|
- var phoneNum=$("#phoneNum").val();
|
|
|
- var idCard=$("#idCard").val();
|
|
|
var patientId=$("#patientId").val();
|
|
|
- var hybirdPatientId =$("#hybirdPatientId").text();
|
|
|
- if(hybirdPatientId==null || hybirdPatientId==""){
|
|
|
- $("#messageModal").modal();
|
|
|
- $("#messageButton").addClass("hide");
|
|
|
- $("#messageContent").html("请先创建混检主体再执行该操作!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if(patientId==null){
|
|
|
- $("#messageModal").modal();
|
|
|
- $("#messageButton").addClass("hide");
|
|
|
- $("#messageContent").html("未选择任何待检人,无法进行该操作!");
|
|
|
- return;
|
|
|
- }
|
|
|
- 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 hc_number = $("#hc_number").val();
|
|
|
- if(length>=hc_number){
|
|
|
- $("#messageModal").modal();
|
|
|
- $("#messageButton").addClass("hide");
|
|
|
- $("#messageContent").html("当前混检主体已经达到最大人数,请提交后创建新混检主体再继续操作!");
|
|
|
- //clearRegistration();
|
|
|
- return;
|
|
|
- }
|
|
|
- fullPatientIds+=","+patientId;
|
|
|
- $("#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>';
|
|
|
- $("#hybirdList").append(html);
|
|
|
- clearRegistration();
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/verifyHybridTestStatus?patientId=' + patientId,
|
|
|
+ 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) {
|
|
|
+ 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){
|
|
|
+ $("#messageModal").modal();
|
|
|
+ $("#messageButton").addClass("hide");
|
|
|
+ $("#messageContent").html("未选择任何待检人,无法进行该操作!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ 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 hc_number = $("#hc_number").val();
|
|
|
+ if(length>=hc_number){
|
|
|
+ $("#messageModal").modal();
|
|
|
+ $("#messageButton").addClass("hide");
|
|
|
+ $("#messageContent").html("当前混检主体已经达到最大人数,请提交后创建新混检主体再继续操作!");
|
|
|
+ //clearRegistration();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ 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>';
|
|
|
+ $("#hybirdList").append(html);
|
|
|
+ clearRegistration();
|
|
|
+ }else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|