Browse Source

实现门诊医生全业务回车功能

hurugang 3 years ago
parent
commit
6a801f7303

+ 1 - 1
src/main/resources/static/js/login.js

@@ -21,7 +21,7 @@ $(function (){
         login();
     });
 
-    $(document).keyup(function(event){
+    $(document).unbind("keyup").keyup(function(event){
         if(event.keyCode ==13){
             login();
         }

+ 1 - 1
src/main/resources/static/js/menu.js

@@ -64,7 +64,7 @@ $(function () {
     //$("#home").click();
 
 
-    $(document).keyup(function (event) { //监听键盘按下时的事件
+    $(document).unbind("keyup").keyup(function (event) { //监听键盘按下时的事件
         //按F4进行页面切换
         if (event.keyCode == 115) {
             if (content_url == '/thmz/registration') {

+ 88 - 41
src/main/resources/static/js/mz/clinic.js

@@ -254,10 +254,12 @@ $(function () {
 
 
     //键盘监听回车键
-    $(document).keyup(function (event) {
+    $(document).unbind("keyup").keyup(function (event) {
         if (event.keyCode == 13) {  //是否是回车
             var el = event.srcElement || event.target;
             var id = el.getAttribute("id");
+            var current_code = $("#current_code").val();
+            var index = getIndex("bill_item_group");
             if (id == null || id == "") {
                 id = el.getAttribute("data-id");
             }
@@ -267,30 +269,69 @@ $(function () {
                     id = $(el).parent().parent().prev().attr("data-id");
                 }
             }
-            console.log(id);
-            //回车时,光标不在任何区域
+            //回车时,光标不在任何区域判断是不是在药品和诊疗开立区域
             if (id == null || id == "") {
                 var index = getIndex("bill_item_group");
-                if (index==0) {
-                    //当前页面是西药保存页面,且有药品选中
-                    $("#supplyType").next().click();
-                }else if(index==1){
+                if (index == 0) {
+                    if (current_code != null && current_code != "") {
+                        //当前页面是西药保存页面,且有药品选中
+                        $("#supplyType").next().click();
+                    }
+                } else if (index == 1) {
                     //当前页面是中草药保存页面,且有药品选中
-                }else if(index==2){
-                    //当前页面是医技保存页面,且有选中
-                    if($("#jyZdSampleDiv").hasClass('hide')){
-                        //检验物是隐藏,说明现在是检查
-                        $("#yshPart").next().click();
-                    }else {
-                        //此时是检验
-                        $("#jyZdSample").next().click();
+                } else if (index == 2) {
+                    if (current_code != null && current_code != "") {
+                        //当前页面是医技保存页面,且有选中
+                        if ($("#jyZdSampleDiv").hasClass('hide')) {
+                            //检验物是隐藏,说明现在是检查
+                            $("#yshPart").next().click();
+                        } else {
+                            //此时是检验
+                            $("#jyZdSample").next().click();
+                        }
                     }
-                }else if(index==3){
+                } else if (index == 3) {
                     //当前页面是住院保存页面
                     $("#inpatientWardBeHospitalized").next().click();
+                    return;
                 }
             }
-            if (id == 'zy_drugWin') {
+            console.log("id=" + id);
+            var customization = $("div.customization").not(".hide");
+            //回车时,光标不在任何区域,默认点击主诉
+            if (id == null || id == "") {
+                var eleId = $(customization[0]).attr("target-id");
+                $("#" + eleId).focus();
+                if (eleId == 'symptom') {
+                    $("#" + eleId).click();
+                }
+                console.log("eleId=" + eleId);
+            } else if (id == 'symptom' || id == 'emrHpi' || id == 'emrPs' || id == 'personalHistory' || id == 'familyHistory' || id == 'obstericalHistory' || id == 'otherCheck' || id == 'diagnose' || id == 'tentativeDiagnosis') {
+                console.log("1id=" + id);
+                if (id != $(customization[customization.length - 1]).attr("target-id")) {
+                    var next = $("#" + id + "Flag").next();
+                    while($(next).hasClass("foreclose") || $(next).hasClass("hide")){
+                        next=$(next).next();
+                    }
+                    var eleId = $(next).attr("target-id");
+                    $("#" + eleId).focus();
+                    if (eleId == 'diagnose' || id == 'diagnose' || id == 'symptom') {
+                        $("#" + eleId).click();
+                    }
+                    console.log("1eleId=" + eleId);
+                } else {
+                    if (index == 0) {
+                        $("#western_medicine_name").focus();
+                    } else if (index == 1) {
+                        $("#chinese_medicine_name").focus();
+                    } else if (index == 2) {
+                        $("#jcJyItem").focus();
+                    } else if (index == 3) {
+                        console.log("初步诊断")
+                        $("#inpatientWardBeHospitalized").next().click();
+                    }
+                }
+            } else if (id == 'zy_drugWin') {
                 $("#zyInstruction").next().click();
             } else if (id == 'zyInstruction') {
                 var ariaExpanded = $("#zyInstruction").next().attr("aria-expanded");
@@ -355,8 +396,6 @@ $(function () {
             } else if (id == 'saveJyJcItem') {
                 $("#jcJyItem").focus();
                 $("#jcJyItem").click();
-            } else if (id == 'freeBedNum') {
-                $("#inpatientWardBeHospitalized").next().click();
             } else if (id == 'inpatientWardBeHospitalized') {
                 $("#smallWardBeHospitalized").next().click();
             } else if (id == 'smallWardBeHospitalized') {
@@ -364,13 +403,29 @@ $(function () {
             } else if (id == 'admissStatus') {
                 saveZyReq(true);
             } else if (id == 'western_medicine_name') {
-                $("#western_medicine_name").click();
+                if (current_code != null && current_code != "") {
+                    //已经选中药品,跳到用法
+                    $("#supplyType").next().click();
+                } else {
+                    //药品查询框是空白的,打开查询框
+                    $("#western_medicine_name").click();
+                }
             } else if (id == 'chinese_medicine_name') {
-                $("#chinese_medicine_name").click();
+                if (current_code != null && current_code != "") {
+                    $("#supplyType").next().click();
+                }else {
+                    $("#chinese_medicine_name").click();
+                }
+
             } else if (id == 'jcJyItem') {
-                $("#jcJyItem").click();
-            }else if(id=='zy_req_button'){
+                if (current_code != null && current_code != "") {
+                    $("#supplyType").next().click();
+                }else {
+                    $("#jcJyItem").click();
+                }
+            } else if (id == 'zy_req_button') {
                 //当前页面是住院保存页面,此时光标在入院按钮上
+                console.log("入院按钮")
                 $("#inpatientWardBeHospitalized").next().click();
             }
         }
@@ -4253,7 +4308,7 @@ function fitDiagnoseValue(value, code) {
     }
     html += ' title="' + value + '(' + code + ')" id="' + code + '"><span class="el-select__tags-text">' + value + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removeDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
     $("#diagnoseTags").append(html);
-    $("#diagnoseTags").parent().parent().css("height",$("#diagnoseTags").height());
+    $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
 
 
 }
@@ -4278,7 +4333,7 @@ function removeDiagnoseValue(code) {
     }
     var diagnoseValue = $("#diagnoseValue").val();
     $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
-    $("#diagnoseTags").parent().parent().css("height",$("#diagnoseTags").height());
+    $("#diagnoseTags").parent().parent().css("height", $("#diagnoseTags").height());
 }
 
 
@@ -5348,7 +5403,7 @@ function fitWesternMedicine(res, groupNo) {
     //     $("#gross").attr("readonly", "readonly");
     // }
     calculate();
-
+    $("#western_medicine_name").focus();
 }
 
 /**
@@ -8198,7 +8253,7 @@ function initCertificateTypeSelect() {
  * @param times
  * @param type 1 编辑  2 预览
  */
-function showMzBlRecordModal(patientId, times,type) {
+function showMzBlRecordModal(patientId, times, type) {
     $.ajax({
         type: "GET",
         url: '/thmz/getMzBlrecord?patientId=' + patientId + '&times=' + times,
@@ -8291,21 +8346,21 @@ function showMzBlRecordModal(patientId, times,type) {
                 } else {
                     $("#editEmrJkjy").parent().parent().parent().css("display", "none");
                 }
-                if(type==1){
+                if (type == 1) {
                     $("#mzBlRecorTitle").html("门诊病历【编辑】");
                     $("#setOtherEmrProcess").removeClass("in").addClass("hide");
                     $("#openBlRecordModel").removeClass("hide").addClass("in");
                     $("#setEmrProcess").removeClass("hide").addClass("in");
                     $("#newEmrProcessDiv").removeClass("hide").addClass("in");
                     $("#visitingDetailModal").modal("hide");
-                }else if(type==2){
+                } else if (type == 2) {
                     $("#mzBlRecorTitle").html("门诊病历【预览】");
                     $("#setOtherEmrProcess").removeClass("hide").addClass("in");
                     $("#openBlRecordModel").removeClass("in").addClass("hide");
                     $("#setEmrProcess").removeClass("in").addClass("hide");
                     $("#newEmrProcessDiv").removeClass("in").addClass("hide");
                     //因为预览的时候,关闭预览框没有清空数据,且 此时基础数据的病历次数被清空
-                    if($("#mzBlTimes").val()!=null && $("#mzBlTimes").val()!="" && ($("#baseMzBlTimes").val()==null || $("#baseMzBlTimes").val()=="")){
+                    if ($("#mzBlTimes").val() != null && $("#mzBlTimes").val() != "" && ($("#baseMzBlTimes").val() == null || $("#baseMzBlTimes").val() == "")) {
                         $("#baseMzBlTimes").val($("#mzBlTimes").val());
                     }
                     $("#otherBlRecordModal").modal("hide");
@@ -8320,13 +8375,12 @@ function showMzBlRecordModal(patientId, times,type) {
 }
 
 
-
 /**
  * 清空区域
  */
 function clearInput() {
     //编辑病历的时候,没有基础病历的就诊次数,如果是预览病历的时候,有基础病历的次数
-    var baseMzBlTimes=$("#baseMzBlTimes").val();
+    var baseMzBlTimes = $("#baseMzBlTimes").val();
     $("#editPatientId").text(null);
     $("#editPatientName").text(null);
     $("#editPatientGender").text(null);
@@ -8344,7 +8398,7 @@ function clearInput() {
     $("#editEmrJkjy").val(null);
     $("#newEmrProcess").val(null);
     $("#mzBlTimes").val(null);
-    if(baseMzBlTimes!=null && baseMzBlTimes!=""){
+    if (baseMzBlTimes != null && baseMzBlTimes != "") {
         $("#otherBlRecordModal").modal();
     }
 
@@ -8352,9 +8406,6 @@ function clearInput() {
 }
 
 
-
-
-
 /**
  * 保存门诊病历
  */
@@ -8381,7 +8432,6 @@ function setEmrProcess() {
 }
 
 
-
 /**
  * 提交保存门诊病历
  */
@@ -8421,8 +8471,6 @@ function sendEmrProcess() {
 }
 
 
-
-
 /**
  * 打开待合并病历列表弹框
  */
@@ -8574,7 +8622,6 @@ function queryOtherParams(params) {
 }
 
 
-
 /**
  * 提取处理意见保存
  */
@@ -8586,7 +8633,7 @@ function setOtherEmrProcess() {
         $("#messageModal").modal("hide");
         $.ajax({
             type: "GET",
-            url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val()+ '&times=' + $("#mzBlTimes").val(),
+            url: '/thmz/extractEmrProcess?patientId=' + $("#editPatientId").html() + '&baseTimes=' + $("#baseMzBlTimes").val() + '&times=' + $("#mzBlTimes").val(),
             contentType: "application/json;charset=UTF-8",
             dataType: "json",
             headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},

+ 1 - 1
src/main/resources/static/js/mz/to-medicine.js

@@ -57,7 +57,7 @@ $(function () {
         setHeightForTable();
     });
 
-    $(document).keyup(function(event){
+    $(document).unbind("keyup").keyup(function(event){
         if(event.keyCode ==13){
             initTable();
         }

+ 1 - 1
src/main/resources/static/js/zy/hospitalized.js

@@ -255,7 +255,7 @@ $(function () {
 
 
     //回车键事件
-    $(document).keyup(function (event) {
+    $(document).unbind("keyup").keyup(function (event) {
         if (event.keyCode == 13) {
             //当光标在新住院号的时候触发
             if ($("input:focus,textarea:focus").attr("id") == "new_inpatientNo") {

+ 10 - 10
src/main/resources/templates/mz/clinic.html

@@ -365,7 +365,7 @@
             </div>
             <div class="col-md-12 col-sm-12 col-xs-12" style="margin-top: 10px;">
                 <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off">
-                    <div class="item form-group" id="symptomFlag">
+                    <div class="item form-group customization" id="symptomFlag" target-id="symptom">
                         <label class="my_label">主诉:</label>
                         <div class="form-group has-feedback" style="float: right;width: calc(100% - 65px);">
                             <input type="text" class="form-control has-feedback-left" id="symptom"
@@ -374,33 +374,33 @@
                                   style="right: 0px;"></span>
                         </div>
                     </div>
-                    <div class="item form-group" id="emrHpiFlag">
+                    <div class="item form-group customization" id="emrHpiFlag" target-id="emrHpi">
                         <label class="my_label">现病史:</label>
                         <!--   <input id="emrHpi" class="form-control my_label_input"
                                   placeholder="请输入" type="text" data-placement="bottom-right">-->
                         <textarea id="emrHpi" class="form-control my_label_input" placeholder="请输入"></textarea>
                     </div>
-                    <div class="item form-group" id="emrPsFlag">
+                    <div class="item form-group customization" id="emrPsFlag" target-id="emrPs">
                         <label class="my_label">既往史:</label>
                         <input id="emrPs" class="form-control my_label_input"
                                placeholder="请输入" type="text" data-placement="bottom-right">
                     </div>
-                    <div class="item form-group" id="personalHistoryFlag">
+                    <div class="item form-group customization" id="personalHistoryFlag" target-id="personalHistory">
                         <label class="my_label">个人史:</label>
                         <input id="personalHistory" class="form-control my_label_input"
                                placeholder="请输入" type="text" data-placement="bottom-right">
                     </div>
-                    <div class="item form-group" id="familyHistoryFlag">
+                    <div class="item form-group customization" id="familyHistoryFlag" target-id="familyHistory">
                         <label class="my_label">家族史:</label>
                         <input id="familyHistory" class="form-control my_label_input"
                                placeholder="请输入" type="text" data-placement="bottom-right">
                     </div>
-                    <div class="item form-group" id="obstericalHistoryFlag">
+                    <div class="item form-group customization" id="obstericalHistoryFlag" target-id="obstericalHistory">
                         <label class="my_label">婚育史:</label>
                         <input id="obstericalHistory" class="form-control my_label_input"
                                placeholder="请输入" type="text" data-placement="bottom-right">
                     </div>
-                    <div class="item form-group">
+                    <div class="item form-group foreclose">
                         <label class="my_label">体格检查:</label>
                         <div class="my_label_input" style="height: 34px;line-height: 34px;">
                             <div style="float: left;">
@@ -424,12 +424,12 @@
                     <!--<input type="text" class="form-control has-feedback-left" id="healthCheckUp" style="display: block">-->
                     <!--</div>-->
                     <!--</div>-->
-                    <div class="item form-group">
+                    <div class="item form-group customization" target-id="otherCheck" id="otherCheckFlag">
                         <label class="my_label">其他检查:</label>
                         <textarea id="otherCheck" class="form-control my_label_input"
                                   placeholder="请输入" type="text" data-placement="bottom-right"></textarea>
                     </div>
-                    <div class="item form-group">
+                    <div class="item form-group customization" target-id="diagnose" id="diagnoseFlag">
                         <label class="my_label">诊断:</label>
                         <div class="form-group has-feedback" style="float: right;width: calc(100% - 65px);">
                             <div class="el-select__tags" style="width: 90%;"><span id="diagnoseTags"></span></div>
@@ -440,7 +440,7 @@
                                   style="right: 0px;"></span>
                         </div>
                     </div>
-                    <div class="item form-group" id="tentativeDiagnosisFlag">
+                    <div class="item form-group customization" id="tentativeDiagnosisFlag" target-id="tentativeDiagnosis">
                         <label class="my_label">初步诊断:</label>
                         <textarea id="tentativeDiagnosis" class="form-control my_label_input"
                                   placeholder="请输入"></textarea>