Procházet zdrojové kódy

Merge branch 'dev-1.1.1' of https://172.16.32.165/hurugang/thmz_system into dev-1.1.1

hurugang před 3 roky
rodič
revize
2853d86a16

+ 31 - 0
src/main/resources/static/js/common/pharmacy-com.js

@@ -447,4 +447,35 @@ function getLocalStorage(name,nullReturn) {
         }
     }
     return returnValue;
+}
+
+/**
+ * 指定区域全屏显示
+ * @param divStr 指定元素ID
+ */
+function fullScreen(divStr) {
+    let fullarea = document.getElementById(divStr);
+    if (fullscreen) {    // 退出全屏
+        if (document.exitFullscreen) {
+            document.exitFullscreen();
+        } else if (document.webkitCancelFullScreen) {
+            document.webkitCancelFullScreen();
+        } else if (document.mozCancelFullScreen) {
+            document.mozCancelFullScreen();
+        } else if (document.msExitFullscreen) {
+            document.msExitFullscreen();
+        }
+    } else {    // 进入全屏
+        if (fullarea.requestFullscreen) {
+            fullarea.requestFullscreen();
+        } else if (fullarea.webkitRequestFullScreen) {
+            fullarea.webkitRequestFullScreen();
+        } else if (fullarea.mozRequestFullScreen) {
+            fullarea.mozRequestFullScreen();
+        } else if (fullarea.msRequestFullscreen) {
+            // IE11
+            fullarea.msRequestFullscreen();
+        }
+    }
+    fullscreen = !fullscreen;
 }

+ 62 - 64
src/main/resources/static/js/common/socket-com.js

@@ -2,22 +2,63 @@
 var prescriptionPrintWebsocket = null;
 var lockReconnect = false; //避免ws重复连接
 var lastPatient = '';
-
 //取药队列
-var lineUpList = getLocalStorage("lineUpList",[]);
+var lineUpList = getLocalStorage("lineUpList", []);
 //待取药队列
-var currentList = getLocalStorage("currentList",[]);
+var currentList = getLocalStorage("currentList", []);
 //过号名单队列
-var pastList = getLocalStorage("pastList",[]);
-/*var ip = 'webhis.thyy.cn:81';
-var ip = '172.16.30.22:8089';*/
-function openSocket(type) {
-
+var pastList = getLocalStorage("pastList", []);
 
+function openSocket(type) {
 //判断当前浏览器是否支持WebSocket
     try {
         if ('WebSocket' in window) {
-            prescriptionPrintWebsocket = new WebSocket("ws://webhis.thyy.cn:81/thmz/prescriptionPrintSocket/" + type);
+            request({
+                method: 'GET',
+                url: '/getWebSocketHost'
+            }).then((res) => {
+                prescriptionPrintWebsocket = new WebSocket(res.data + "prescriptionPrintSocket/" + type);
+                //连接发生错误的回调方法
+                prescriptionPrintWebsocket.onerror = function () {
+                    console.log(type + "连接prescriptionPrintSocket发生错误")
+                };
+                //连接成功建立的回调方法
+                prescriptionPrintWebsocket.onopen = function (event) {
+                    number = 0;
+                    console.log(type + "连接prescriptionPrintSocket连接成功");
+                    var chk_value = '';
+                    $('input[name="aotoPrint"]:checked').each(function () {
+                        chk_value = $(this).val();
+                    });
+                    if (type == 'PY' && chk_value != '') {//配药处方自动打印
+                        printPrescriptions(chk_value);
+                    }
+                };
+                //页面接收到消息的回调方法
+                prescriptionPrintWebsocket.onmessage = function (event) {
+                    var data = JSON.parse(event.data);
+                    if (type == 'PY' && data.groupNo == groupNo) {
+                        dispensingMessage(data);
+                    } else if (type == 'FY') {
+                        sendMedicineMessage(data);
+                    } else if (type == 'JH') {
+                        cellNumberMessage(data);
+                    }
+                };
+                //连接关闭的回调方法
+                prescriptionPrintWebsocket.onclose = function (event) {
+                    console.log(type + "连接prescriptionPrintSocket连接关闭 code:" + event.code + ",原因:" + event.reason + ",是否正常关闭:" + event.wasClean);
+                    if (event.code == '1001' || event.code == '1006') {//1001:终端离开, 可能因为服务端错误 1006:没有发送关闭帧
+                        reconnect(type);
+                    }
+                };
+                //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
+                window.onbeforeunload = function () {
+                    prescriptionPrintWebsocket.close();
+                }
+            }).catch(() => {
+                reconnect(type);
+            });
         } else {
             alert('当前浏览器不支持WebSocket,请更换浏览器');
         }
@@ -25,49 +66,6 @@ function openSocket(type) {
         reconnect(type);
         console.log(e);
     }
-
-//连接发生错误的回调方法
-    prescriptionPrintWebsocket.onerror = function () {
-        console.log(type + "连接prescriptionPrintSocket发生错误")
-    };
-
-//连接成功建立的回调方法
-    prescriptionPrintWebsocket.onopen = function (event) {
-        number = 0;
-        console.log(type + "连接prescriptionPrintSocket连接成功");
-        var chk_value = '';
-        $('input[name="aotoPrint"]:checked').each(function () {
-            chk_value = $(this).val();
-        });
-        if (type == 'PY' && chk_value != '') {//配药处方自动打印
-            printPrescriptions(chk_value);
-        }
-    };
-
-//页面接收到消息的回调方法
-    prescriptionPrintWebsocket.onmessage = function (event) {
-        var data = JSON.parse(event.data);
-        if (type == 'PY' && data.groupNo == groupNo) {
-            dispensingMessage(data);
-        } else if (type == 'FY') {
-            sendMedicineMessage(data);
-        } else if (type == 'JH') {
-            cellNumberMessage(data);
-        }
-    };
-
-//连接关闭的回调方法
-    prescriptionPrintWebsocket.onclose = function (event) {
-        console.log(type + "连接prescriptionPrintSocket连接关闭 code:" + event.code + ",原因:" + event.reason + ",是否正常关闭:" + event.wasClean);
-        if (event.code == '1001' || event.code == '1006') {//1001:终端离开, 可能因为服务端错误 1006:没有发送关闭帧
-            reconnect(type);
-        }
-    };
-
-//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
-    window.onbeforeunload = function () {
-        prescriptionPrintWebsocket.close();
-    }
 }
 
 //重新连接
@@ -150,7 +148,7 @@ function sendMedicineMessage(data) {
  */
 function cellNumberMessage(data) {
     if (data.type == 'JF') {//来自缴费后的消息
-        currentList = removeObjArrayByProperty(currentList,data,'patient_id');
+        currentList = removeObjArrayByProperty(currentList, data, 'patient_id');
         /*currentListClear(data);*/
         //添加等待取药列表
         currentList[currentList.length] = {name: data.name, patient_id: data.patient_id};
@@ -164,19 +162,19 @@ function cellNumberMessage(data) {
         //设置正在取药,清除过号队列
         let rightPersonName = data.name;
         for (let i = 0; i < lineUpList.length; i++) {
-            if(data.patient_id === lineUpList[i].patient_id){
-                if(rightPersonName.length > 3){
-                    rightPersonName = ((lineUpList[i].lineUp!==10000?'<span style="font-size:32px; "><span class="number-name">&nbsp;'+lineUpList[i].lineUp+'&nbsp;</span>&nbsp;':'')+rightPersonName+"</span>");
-                }else{
-                    rightPersonName = ((lineUpList[i].lineUp!==10000?'<span class="number-name">&nbsp;'+lineUpList[i].lineUp+'&nbsp;</span>&nbsp;':'')+rightPersonName);
+            if (data.patient_id === lineUpList[i].patient_id) {
+                if (rightPersonName.length > 3) {
+                    rightPersonName = ((lineUpList[i].lineUp !== 10000 ? '<span style="font-size:32px; "><span class="number-name">&nbsp;' + lineUpList[i].lineUp + '&nbsp;</span>&nbsp;' : '') + rightPersonName + "</span>");
+                } else {
+                    rightPersonName = ((lineUpList[i].lineUp !== 10000 ? '<span class="number-name">&nbsp;' + lineUpList[i].lineUp + '&nbsp;</span>&nbsp;' : '') + rightPersonName);
                 }
                 break
             }
         }
         $('#rightPerson').html(rightPersonName);
         rightPerson = data;
-        currentList = removeObjArrayByProperty(currentList,data,'patient_id');
-        pastList = removeObjArrayByProperty(pastList,data,'patient_id');
+        currentList = removeObjArrayByProperty(currentList, data, 'patient_id');
+        pastList = removeObjArrayByProperty(pastList, data, 'patient_id');
         /*currentListClear(data);
         pastListClear(data);*/
         if (data.type == 'JH') {
@@ -190,8 +188,8 @@ function cellNumberMessage(data) {
             rightPerson = null;
             $('#rightPerson').text("");
         }
-        currentList = removeObjArrayByProperty(currentList,data,'patient_id');
-        pastList = removeObjArrayByProperty(pastList,data,'patient_id');
+        currentList = removeObjArrayByProperty(currentList, data, 'patient_id');
+        pastList = removeObjArrayByProperty(pastList, data, 'patient_id');
         window.localStorage["currentList"] = JSON.stringify(currentList);
         window.localStorage["pastList"] = JSON.stringify(pastList);
         //currentListClear(data);
@@ -260,14 +258,14 @@ function getLineUpData(data) {
     for (let i = 0; i < data.length; i++) {
         let flag = true;
         for (let j = 0; j < lineUpList.length; j++) {
-            let id = data[i].patientId==null?data[i].patient_id:data[i].patientId;
+            let id = data[i].patientId == null ? data[i].patient_id : data[i].patientId;
             if (id == lineUpList[j].patient_id) {
                 data[i].lineUp = lineUpList[j].lineUp;
                 flag = false;
                 break
             }
         }
-        if(flag){
+        if (flag) {
             data[i].lineUp = 10000;
         }
     }

+ 3 - 37
src/main/resources/static/js/mz/pharmacy-cell-number.js

@@ -29,7 +29,7 @@ $(function () {
         var code = theEvent.keyCode || theEvent.which;
         if(code == 122){//捕捉F11键盘动作
             e.preventDefault();  //阻止F11默认动作
-            fullScreen();
+            fullScreen('fulldiv');
         }
     }
     $(".selectpicker").selectpicker({
@@ -175,7 +175,7 @@ function initTable() {
     $("#winNum").text(winNo);
     $("#editModal").modal("hide");
     getTableDate();
-    fullScreen();
+    fullScreen('fulldiv');
 }
 
 
@@ -296,38 +296,4 @@ function currentListClear(data) {
             break;
         }
     }
-}
-
-/**
- * 指定区域全屏显示
- * @param divStr 指定元素ID
- */
-function fullScreen() {
-    let fullarea = document.getElementById('fulldiv');
-        if (fullscreen) {    // 退出全屏
-            if (document.exitFullscreen) {
-                document.exitFullscreen();
-            } else if (document.webkitCancelFullScreen) {
-                document.webkitCancelFullScreen();
-            } else if (document.mozCancelFullScreen) {
-                document.mozCancelFullScreen();
-            } else if (document.msExitFullscreen) {
-                document.msExitFullscreen();
-            }
-        } else {    // 进入全屏
-            if (fullarea.requestFullscreen) {
-                fullarea.requestFullscreen();
-            } else if (fullarea.webkitRequestFullScreen) {
-                fullarea.webkitRequestFullScreen();
-            } else if (fullarea.mozRequestFullScreen) {
-                fullarea.mozRequestFullScreen();
-            } else if (fullarea.msRequestFullscreen) {
-                // IE11
-                fullarea.msRequestFullscreen();
-            }
-        }
-        fullscreen = !fullscreen;
-}
-
-
-
+}

+ 2 - 35
src/main/resources/static/js/mz/pharmacy-cell.js

@@ -11,7 +11,7 @@ $(function () {
         var code = theEvent.keyCode || theEvent.which;
         if (code == 122) {//捕捉F11键盘动作
             e.preventDefault();  //阻止F11默认动作
-            fullScreen();
+            fullScreen('fulldiv');
         }
     };
     $("#patientId").bind("input propertychange", function () {
@@ -174,37 +174,4 @@ function CurentTime() {
     if (s < 10) time += '0';
     time += s;
     $("#timeNow").html(time)
-}
-
-/**
- * 指定区域全屏显示
- * @param divStr 指定元素ID
- */
-function fullScreen() {
-    let fullarea = document.getElementById('fulldiv');
-    if (fullscreen) {    // 退出全屏
-        if (document.exitFullscreen) {
-            document.exitFullscreen();
-        } else if (document.webkitCancelFullScreen) {
-            document.webkitCancelFullScreen();
-        } else if (document.mozCancelFullScreen) {
-            document.mozCancelFullScreen();
-        } else if (document.msExitFullscreen) {
-            document.msExitFullscreen();
-        }
-    } else {    // 进入全屏
-        if (fullarea.requestFullscreen) {
-            fullarea.requestFullscreen();
-        } else if (fullarea.webkitRequestFullScreen) {
-            fullarea.webkitRequestFullScreen();
-        } else if (fullarea.mozRequestFullScreen) {
-            fullarea.mozRequestFullScreen();
-        } else if (fullarea.msRequestFullscreen) {
-            // IE11
-            fullarea.msRequestFullscreen();
-        }
-    }
-    fullscreen = !fullscreen;
-}
-
-
+}

+ 5 - 5
src/main/resources/templates/index.html

@@ -92,22 +92,22 @@
                             </a>
                             <span>收费管理</span>
                         </div>
-                        <div class="w_left w_25" style="width: 33.3%;cursor: pointer">
+                        <div class="w_left w_25" style="width: 33.3%;cursor: pointer" onclick="changeContent('/thmz/west-pharmacy-send')">
                             <a class="pull-left profile_thumb shortcuts" style="padding: 3px 3px;">
                                 <i class="fa fa-shopping-cart"></i>
                             </a>
-                            <span>配药管理</span>
+                            <span>门诊退发药</span>
                         </div>
                         <div class="clearfix"></div>
                     </div>
                     <div class="widget_summary">
-                        <div class="w_left w_25" style="width: 33.3%;cursor: pointer">
+                        <div class="w_left w_25" style="width: 33.3%;cursor: pointer" onclick="changeContent('/thmz/ward-prescription')">
                             <a class="pull-left  profile_thumb shortcuts" style="padding: 3px 3px;">
                                 <i class="fa fa-medkit"></i>
                             </a>
-                            <span>药品零售</span>
+                            <span>住院退发药</span>
                         </div>
-                        <div class="w_left w_25" style="width: 33.3%;cursor: pointer">
+                        <div class="w_left w_25" style="width: 33.3%;cursor: pointer"  onclick="changeContent('/thmz/yf-inventory-list')">
                             <a class="pull-left profile_thumb shortcuts" style="padding: 3px 3px;">
                                 <i class="fa fa-bank"></i>
                             </a>

+ 1 - 1
src/main/resources/templates/mz/pharmacy-cell.html

@@ -85,7 +85,7 @@
             <div class="modal-content"
                  style="position: relative;width: 620px;height:350px;margin-left: 150px;margin-top: 250px;background: url('/thmz/images/scanningCode.jpg');">
                 <div class="modal-body" style="position: absolute;right: 0;bottom: 0;">
-                    <input id="patientId" type='text' style="background: rgb(46,100,234);border: rgb(46,100,234);"/>
+                    <input id="patientId" type='text' style="background: rgb(46,100,234);border: rgb(46,100,234);" inputmode="none"/>
                 </div>
             </div>
         </div>