| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- //@ sourceURL=pharmacy-cell.js
- //待取药队列
- var fullscreen = false;//浏览器全屏状态
- //药房编号
- var groupNo = 71;
- $(function () {
- openSocket("PD");
- this.onkeydown = function (e) { // 监听键盘事件
- var theEvent = window.event || e;
- var code = theEvent.keyCode || theEvent.which;
- if (code == 122) {//捕捉F11键盘动作
- e.preventDefault(); //阻止F11默认动作
- fullScreen('fulldiv');
- }
- };
- $("#patientId").bind("input propertychange", function () {
- if($(this).val().split("-").length === 2 && $(this).val().split("-")[1] !== ""){
- let data = {
- patientId: $("#patientId").val()
- };
- // if(lineUpList){
- // data.lineUpList = lineUpList
- // }
- $.ajax({
- type: "POST",
- url: '/thmz/mzLineUp',
- data: JSON.stringify(data),
- 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) {
- $("#showSuccessModal").modal("show");
- hideModelTimeout('showSuccessModal',3000);
- window.localStorage["lineUpList"] = JSON.stringify(res.data);
- lineUpList = res.data;
- } else {
- $("#errorText").text(res.message);
- $("#showErrorModal").modal("show");
- hideModelTimeout('showErrorModal',3000);
- }
- $("#showModal").modal("hide");
- },
- error: function(err){
- console.log(err)
- $("#showModal").modal("hide");
- }
- });
- }
- });
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- fullScreen('fulldiv');
- //调用函数,执行一次
- currentTime();
- //调用setInterval函数,实现始终计时
- setInterval(currentTime, 1000);
- setHeightForTable();
- $(window).resize(function () {
- //设置页面宽度
- setHeightForTable();
- });
- $("#btn_med_in_cert").click(function (t) {
- readcardRequest({
- method: 'get',
- data: {
- // param: 'qrcode_01302'
- param: 'jiangsu_qrcode_01302'
- }
- }).then((res)=>{
- console.log(res.data);
- let data = {
- socialNo: res.data.idNo
- };
- // if(lineUpList){
- // console.log("------------" + lineUpList);
- // data.lineUpList = lineUpList
- // }
- $.ajax({
- type: "POST",
- url: '/thmz/mzLineUp',
- data: JSON.stringify(data),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res.code == 0) {
- $("#showSuccessModal").modal("show");
- hideModelTimeout('showSuccessModal',3000);
- window.localStorage["lineUpList"] = JSON.stringify(res.data);
- lineUpList = res.data;
- } else {
- $("#errorText").text("排队失败,未找到待取药的处方");
- $("#showErrorModal").modal("show");
- hideModelTimeout('showErrorModal',3000);
- }
- $("#showModal").modal("hide");
- }
- });
- });
- });
- $("#btn_patient_id").click(function (t) {
- $("#showModal").modal("show");
- });
- $("#showModal").on('shown.bs.modal', function (t) {
- $("#patientId").focus();
- $("#patientId").val("");
- });
- });
- /**
- *医保电子凭证读卡
- * @param bizType 电子凭证数据类型
- */
- function siReadCard(bizType) {
- $.ajax({
- type: "GET",
- // url: "http://localhost:8321/readcard/entry?param=qrcode_" + bizType,
- url: "http://localhost:8321/api/entry?param=jiangsu_qrcode_" + bizType,
- 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 == 200) {
- successMesage(res);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置页面宽度
- */
- function setHeightForTable() {
- var height = $(window).height() - 320;
- var realHeight = height / 7;
- if (realHeight < 75) {
- realHeight = 75;
- }
- $("#tableList tr").css("height", realHeight + "px");
- }
- function currentTime(){
- //获取时间保存到date变量
- var date = new Date();
- //将星期日~星期一保存到数组
- var week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
- //获取date中的小时,如果小于9,则在前面拼接一个0
- var hours = date.getHours()>9?date.getHours():'0'+date.getHours();
- //获取date中的分钟,如果小于9,则在前面拼接一个0
- var minutes = date.getMinutes()>9?date.getMinutes():'0'+date.getMinutes();
- //获取date中的秒,如果小于9,则在前面拼接一个0
- var seconds = date.getSeconds()>9?date.getSeconds():'0'+date.getSeconds();
- //获取date中的年、月、日
- var dates = date.getFullYear()+'年'+(date.getMonth()+1)+'月'+date.getDate()+'日';
- //拼接时分秒, 拼接星期
- var times = hours+':'+minutes+':'+seconds+' '+week[date.getDay()];
- //向dateNow节点添加dates(年、月、日, 星期)
- $("#dateNow").html(dates);
- //向timeNow节点添加timess(时、分、秒)
- $("#timeNow").html(times);
- }
|