浏览代码

'建档手机号回车生成卡号'

yaodeguang 2 天之前
父节点
当前提交
5a945fc9a3
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      src/main/resources/static/js/mz/registration.js

+ 11 - 1
src/main/resources/static/js/mz/registration.js

@@ -447,6 +447,7 @@ function getNewPatientId(flag) {
                 }
                 if (res.code == 0) {
                     $("#cardNo").val(res.data)
+                    $("#cardNo").blur()
                     $("#patientId").val(res.data)
                     $("#jdFlag").val('1')
                 }else {
@@ -2113,8 +2114,17 @@ function queryUserInfoByphoneNo() {
                     window.location.href = '/thmz/login/view'
                     return;
                 }
-                if (res.code == 0) {
+                if (res.code == 0 && res.data.length > 0) {
                     fitPatient(res);
+                } else {
+                    $("#saveUser").show();
+                    $("#newCardModal").modal();
+                    $(document).keydown(function (event) { //监听键盘按下时的事件
+                        if (event.keyCode == 13) {
+                            //回车键
+                            $('#newCardModal').modal('hide');
+                        }
+                    });
                 }
             }
         });