123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- //@ sourceURL=pharmacy-cell.js
- //待取药队列
- var fullscreen = false;//浏览器全屏状态
- //药房编号
- var groupNo = 71;
- var timeInterval;
- $(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] !== ""){
- $("#showErrorModal").modal("hide");
- $("#showSuccessrModal").modal("hide");
- 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");
- window.localStorage["lineUpList"] = JSON.stringify(res.data);
- lineUpList = res.data;
- } else {
- $("#errorText").text(res.message);
- $("#showErrorModal").modal("show");
- }
- $("#showModal").modal("hide");
- }
- });
- }
- });
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- //进入页面就加载一次
- CurentTime();
- fullScreen();
- //每秒获取当前时间
- timeInterval = setInterval(CurentTime, 1000);
- setHeightForTable();
- $(window).resize(function () {
- //设置页面宽度
- setHeightForTable();
- });
- $("#btn_med_in_cert").click(function (t) {
- readcardRequest({
- method: 'get',
- data: {
- param: 'qrcode_01302'
- }
- }).then((res)=>{
- console.log(res.data);
- $.ajax({
- type: "POST",
- url: '/thmz/mzLineUp',
- data: JSON.stringify({
- socialNo: res.data.idNo
- }),
- 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");
- window.localStorage["lineUpList"] = JSON.stringify(res.data);
- lineUpList = res.data;
- } else {
- $("#showErrorModal").modal("show");
- }
- $("#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,
- 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 realHeigt = height / 7;
- if (realHeigt < 75) {
- realHeigt = 75;
- }
- $("#tableList tr").css("height", realHeigt + "px");
- }
- /**
- * 取当前时间 格式 yyyy年mm月dd日 hh:mm:ss weekday
- * @constructor
- */
- function CurentTime() {
- let now = new Date();
- let year = now.getFullYear(); //年
- let month = now.getMonth() + 1; //月
- let day = now.getDate(); //日
- let hh = now.getHours(); //时
- let mm = now.getMinutes(); //分
- let s = now.getSeconds(); //分
- let weekday = new Array(7); //周
- weekday[0] = "星期日";
- weekday[1] = "星期一";
- weekday[2] = "星期二";
- weekday[3] = "星期三";
- weekday[4] = "星期四";
- weekday[5] = "星期五";
- weekday[6] = "星期六";
- let date = year + "/" + month + "/";
- if (day < 10) date += "0";
- date += day;
- date += " " + weekday[now.getDay()];
- $("#dateNow").html(date);
- let time = "";
- if (hh < 10) time += "0";
- time += hh + ":";
- if (mm < 10) time += '0';
- time += mm + ":";
- if (s < 10) time += '0';
- time += s;
- $("#timeNow").html(time)
- }
|