Prechádzať zdrojové kódy

医生快速接诊查询病人

‘chenzhilei’ 3 mesiacov pred
rodič
commit
a85237099a

+ 3 - 2
src/main/resources/static/js/jBox/common.js

@@ -540,7 +540,8 @@ function queryUserInfoBySocialNo(flag) {
 /**
  * 查询患者信息
  */
-function fitPatient(res) {
+function fitPatient(res,dataTargetKey) {
+    var keyName = dataTargetKey?dataTargetKey:"patientId"
     if (res.data.length > 0) {
         $("#patientModal").modal();
         $("#patientTable").html(null);
@@ -571,7 +572,7 @@ function fitPatient(res) {
             if (lastVisitDate == null || lastVisitDate == "null") {
                 lastVisitDate = "";
             }
-            $("<tr data-target='" + res.data[i].patientId + "'><td>" + res.data[i].patientId + "</td><td>" + res.data[i].name + "</td><td>" + gender + "</td><td>" + icCardNo + "</td><td>" + phoneNo + "</td><td>" + birthDay + "</td><td>" + socialNo + "</td><td>" + lastVisitDate + "</td></tr>").appendTo("#patientTable").bind('click', function () {
+            $("<tr data-target='" + res.data[i][keyName] + "'><td>" + res.data[i][keyName] + "</td><td>" + res.data[i].name + "</td><td>" + gender + "</td><td>" + icCardNo + "</td><td>" + phoneNo + "</td><td>" + birthDay + "</td><td>" + socialNo + "</td><td>" + lastVisitDate + "</td></tr>").appendTo("#patientTable").bind('click', function () {
                 $("#patientModal").modal("hide");
                 fillPatinet($(this).attr("data-target"));
             });

+ 57 - 16
src/main/resources/static/js/mz/clinic.js

@@ -251,6 +251,9 @@ $(function () {
     //初始医生工作太配置
     initWorkspaceConfigForCurrent();
     initExecUnit();
+    $("#rapidAcceptsUserName").change(function (e) {
+        queryUserInfoByName();
+    });
     /**
      * 西药点击事件
      */
@@ -1146,6 +1149,44 @@ function initDayNum() {
     setSelectDefaultVal('medcDays',1)
 }
 
+/**
+ * 根据病人姓名查询病人信息
+ */
+function queryUserInfoByName() {
+    var userName = $('#rapidAcceptsUserName').val();
+    // var cardNo=$("#cardNo").val();
+    if (userName == null || userName == "") {
+        return;
+    }
+    if (userName.length > 0) {
+        $.ajax({
+            type: "GET",
+            url: '/thmz/getPatientMiByName?name=' + userName,
+            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) {
+                    fitPatient(res,"icCardNo");
+                }
+            }
+        });
+    }
+
+}
+
+/**
+ * 按照病人id查询病人信息
+ * @param patientId
+ */
+function fillPatinet(value) {
+    $("#rapidAcceptsUserCardNo").val(value);
+    queryUserInfoByCardNo()
+}
 /**
  * 下拉框设置默认值
  * @param id
@@ -7377,13 +7418,13 @@ function initUserList() {
         padding: true,
         height: 300,
     };
-    var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
-    //用户姓名选中事件
-    $("#rapidAcceptsUserName").on("click", function (t) {
-        if ($(webuiPopover).css("display") == "block") {
-            refeshPatinetList(true);
-        }
-    });
+//    var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
+//    //用户姓名选中事件
+//    $("#rapidAcceptsUserName").on("click", function (t) {
+//        if ($(webuiPopover).css("display") == "block") {
+//            refeshPatinetList(true);
+//        }
+//    });
 }
 
 /**
@@ -7414,8 +7455,8 @@ function refeshPatinetList(flag) {
             }
             if (res.code == 0) {
                 if (res.data != null && res.data.length > 0) {
-                    $("#webuiPopover0").css("display", "block");
-                    $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
+//                    $("#webuiPopover0").css("display", "block");
+//                    $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
                     var html = '<div class="list-group">';
                     for (var i = 0; i < res.data.length; i++) {
                         var mzPatientMi = res.data[i];
@@ -7435,14 +7476,14 @@ function refeshPatinetList(flag) {
                         html += '</div></a>';
                     }
                     html += '</div>';
-                    if (flag) {
-                        $("#webuiPopover0 div.webui-popover-content").html("");
-                    }
-                    $("#webuiPopover0 div.webui-popover-content").append(html);
-                    $("#webuiPopover0 div.arrow").css("left", "23px");
+//                    if (flag) {
+//                        $("#webuiPopover0 div.webui-popover-content").html("");
+//                    }
+//                    $("#webuiPopover0 div.webui-popover-content").append(html);
+//                    $("#webuiPopover0 div.arrow").css("left", "23px");
                     refeshPatinetListScrollEvent();
                 } else {
-                    $("#webuiPopover0").css("display", "none");
+//                    $("#webuiPopover0").css("display", "none");
                 }
             }
             //查询完成,设置加载完成
@@ -7475,7 +7516,7 @@ function refeshPatinetListScrollEvent() {
  */
 function fillUnClinicPatinet(patientId) {
     $("#rapidAcceptsUserCardNo").val(patientId);
-    $("#webuiPopover0").css("display", "none");
+//    $("#webuiPopover0").css("display", "none");
     queryUserInfoByCardNo();
 }