Kaynağa Gözat

挂号优化

hurugang 5 yıl önce
ebeveyn
işleme
8beb2c7fae

+ 7 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -604,7 +604,13 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         } else {
             int times = mzChargeDetails.get(0).getTimes();
             List<String> orderCodes = new ArrayList<>();
-            Map<String, String> tcMap = tcMzChargeDetails.stream().collect(Collectors.toMap(MzChargeDetail::getChargeItemCode, MzChargeDetail::getTcNo));
+            Map<String, String> tcMap =new HashMap<>();
+            for (MzChargeDetail mt:tcMzChargeDetails){
+                if(!tcMap.containsKey(mt.getChargeItemCode())){
+                    tcMap.put(mt.getChargeItemCode(),mt.getTcNo());
+                }
+            }
+            //Map<String, String> tcMap = tcMzChargeDetails.stream().collect(Collectors.toMap(MzChargeDetail::getChargeItemCode, MzChargeDetail::getTcNo));
             for (MzChargeDetail md : removeMzChargeDetails) {
                 String tcNo = tcMap.get(md.getTcNo());
                 if (StringUtils.isNotBlank(tcNo) && !orderCodes.contains(tcNo)) {

+ 17 - 0
src/main/resources/static/js/jBox/common.js

@@ -308,6 +308,20 @@ function queryUserInfoBySocialNo() {
                         $("#userName").removeClass("in").addClass("hide");
                         $("#userNameReadOnly").removeClass("hide").addClass("in");
                         $("#webuiPopover0").css("display", "none");
+                        validator.checkAll($("#regi_form"));
+                    }else {
+                        var birthday = idCard.substring(6,14);
+                        birthday =birthday.substring(0,4)+"-"+birthday.substring(4,6)+"-"+birthday.substring(6);
+                        $("#birthDay").val(birthday);
+                        var returnAge=jsGetAge(birthday);
+                        $("#age").val(returnAge);
+                        var gender = idCard.substring(16,17);
+                        if (gender%2 ==0){
+                            $("#gender").val(2);
+                        }else {
+                            $("#gender").val(1);
+                        }
+                        $('#gender').selectpicker('refresh');
                     }
                 } else {
                     new PNotify({
@@ -323,3 +337,6 @@ function queryUserInfoBySocialNo() {
 
     }
 }
+
+
+

+ 98 - 14
src/main/resources/static/js/registration.js

@@ -99,17 +99,17 @@ var TableInit = function () {
 $(function () {
     initGenderSelect();
     initResponceTypeSelect();
-    var birthDay = $('#birthDayGroup').datetimepicker({
-        format: 'yyyy-mm-dd',
-        language: 'zh-CN',
-        minView: "month",
-    }).on('changeDate', changeDate);
-
-    var editUserBirthDay = $('#editUserBirthDayGroup').datetimepicker({
-        format: 'yyyy-mm-dd',
-        language: 'zh-CN',
-        minView: "month",
-    });
+    // var birthDay = $('#birthDayGroup').datetimepicker({
+    //     format: 'yyyy-mm-dd',
+    //     language: 'zh-CN',
+    //     minView: "month",
+    // }).on('changeDate', changeDate);
+
+    // var editUserBirthDay = $('#editUserBirthDayGroup').datetimepicker({
+    //     format: 'yyyy-mm-dd',
+    //     language: 'zh-CN',
+    //     minView: "month",
+    // });
 
     //设置挂号窗口的高度
     var width = $('#confirmFee').css("width");
@@ -127,7 +127,7 @@ $(function () {
     //默认光标在卡号输入框
     $("#cardNo").focus();
     //根据病人姓名输入框内容动态加载病人列表
-    initUserList();
+    //initUserList();
     //卡号输入改变事件
     cardNoChange();
 
@@ -233,18 +233,102 @@ $(function () {
         new Device().startFun();
     },3000);
 
+
+    // $("#birthDay").keypress(function () {   // keypress:输入框每获取一个字符,就触发一次该事件。
+    //     var birthDay= $("#birthDay").val();
+    //     birthDay='19880613';
+    //
+    // });
+
     $("#birthDay").change(function(e){
-        var returnAge=jsGetAge($("#birthDay").val());
+        var birthDay= $("#birthDay").val();
+        if(birthDay.length==8 && birthDay.indexOf("-")<=0){
+            birthDay=birthDay.substring(0,4)+"-"+birthDay.substring(4,6)+"-"+birthDay.substring(6);
+            $("#birthDay").val(birthDay);
+        }
+        var dateFormat =/^(\d{4})-(\d{2})-(\d{2})$/;
+        if(!dateFormat.test(birthDay)){
+            new PNotify({
+                title: '错误提示',
+                text: '生日日期错误',
+                type: 'error',
+                hide: true,
+                styling: 'bootstrap3'
+            });
+        }
+        var arr =birthDay.split("-");
+        if(!checkDate(arr[0],arr[1],arr[2])){
+            new PNotify({
+                title: '错误提示',
+                text: '生日日期错误',
+                type: 'error',
+                hide: true,
+                styling: 'bootstrap3'
+            });
+        }
+        var returnAge=jsGetAge(birthDay);
         $("#age").val(returnAge);
     });
 
+    $("#editUserBirthDay").change(function(e){
+        var editUserBirthDay= $("#editUserBirthDay").val();
+        if(editUserBirthDay.length==8 && editUserBirthDay.indexOf("-")<=0){
+            editUserBirthDay=editUserBirthDay.substring(0,4)+"-"+editUserBirthDay.substring(4,6)+"-"+editUserBirthDay.substring(6);
+            $("#editUserBirthDay").val(editUserBirthDay);
+        }
+        var dateFormat =/^(\d{4})-(\d{2})-(\d{2})$/;
+        if(!dateFormat.test(editUserBirthDay)){
+            new PNotify({
+                title: '错误提示',
+                text: '生日日期错误',
+                type: 'error',
+                hide: true,
+                styling: 'bootstrap3'
+            });
+        }
+        var arr =editUserBirthDay.split("-");
+        if(!checkDate(arr[0],arr[1],arr[2])){
+            new PNotify({
+                title: '错误提示',
+                text: '生日日期错误',
+                type: 'error',
+                hide: true,
+                styling: 'bootstrap3'
+            });
+        }
+        var returnAge=jsGetAge(editUserBirthDay);
+        $("#editUserAge").val(returnAge);
+    });
+
     $("#idCard").change(function(e){
         queryUserInfoBySocialNo();
     });
+    $("#editUserIdCard").change(function(e){
+        var editUserIdCard = $("#editUserIdCard").val();
+        var birthday = editUserIdCard.substring(6,14);
+        birthday =birthday.substring(0,4)+"-"+birthday.substring(4,6)+"-"+birthday.substring(6);
+        $("#editUserBirthDay").val(birthday);
+        var returnAge=jsGetAge(birthday);
+        $("#editUserAge").val(returnAge);
+        var gender = editUserIdCard.substring(16,17);
+        if (gender%2 ==0){
+            $("#editUserGender").val(2);
+        }else {
+            $("#editUserGender").val(1);
+        }
+        $('#editUserGender').selectpicker('refresh');
+    });
 });
 
 
-
+//判断给定日期是否合法
+function checkDate(year,month,date){
+    var now = new Date(year,month -1,date);
+    if(now.getDate()==date&&now.getFullYear()==year&&now.getMonth()==(month-1)){
+        return true;
+    }
+    return false;
+}
 
 // function CreatePageList() {
 //     LODOP = getLodop();