|
@@ -1,5 +1,9 @@
|
|
//@ sourceURL=west_pharmacy_dispensing.js
|
|
//@ sourceURL=west_pharmacy_dispensing.js
|
|
var LODOP; //声明为全局变量
|
|
var LODOP; //声明为全局变量
|
|
|
|
+var printIndex;
|
|
|
|
+var mzCfPrintIndex;
|
|
|
|
+var ekCfPrintIndex;
|
|
|
|
+var jzCfPrintIndex;
|
|
$(function () {
|
|
$(function () {
|
|
init_daterangepicker();
|
|
init_daterangepicker();
|
|
initTable();
|
|
initTable();
|
|
@@ -234,7 +238,6 @@ function printPrescription(patientId, orderNo, realNo, chargeDate, times, receip
|
|
warnDept: warnDept,
|
|
warnDept: warnDept,
|
|
groupNo: 71
|
|
groupNo: 71
|
|
};
|
|
};
|
|
- console.log(tem);
|
|
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "POST",
|
|
type: "POST",
|
|
url: '/thmz/getPrintPrescriptionData',
|
|
url: '/thmz/getPrintPrescriptionData',
|
|
@@ -249,8 +252,7 @@ function printPrescription(patientId, orderNo, realNo, chargeDate, times, receip
|
|
}
|
|
}
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
successMesage(res);
|
|
successMesage(res);
|
|
- console.log("查询打印数据结果");
|
|
|
|
- console.log(res.data);
|
|
|
|
|
|
+ setPrint();//初始化默认打印机
|
|
$('#print_view input').attr("value", "");
|
|
$('#print_view input').attr("value", "");
|
|
if (null != res.data) {
|
|
if (null != res.data) {
|
|
for (var key in res.data) {
|
|
for (var key in res.data) {
|
|
@@ -258,16 +260,20 @@ function printPrescription(patientId, orderNo, realNo, chargeDate, times, receip
|
|
}
|
|
}
|
|
}
|
|
}
|
|
var list = res.data.list;
|
|
var list = res.data.list;
|
|
- if (list[0].drugFlag == 2 || list[0].drugFlag == 3) {
|
|
|
|
|
|
+ /*if (list[0].drugFlag == 2 || list[0].drugFlag == 3) {
|
|
$('#drugFlag').attr("value", "麻、精一");
|
|
$('#drugFlag').attr("value", "麻、精一");
|
|
} else if (list[0].drugFlag == 4) {
|
|
} else if (list[0].drugFlag == 4) {
|
|
$('#drugFlag').attr("value", "精二");
|
|
$('#drugFlag').attr("value", "精二");
|
|
- }else if(res.data.warnDeptName.indexOf("儿科") != -1){
|
|
|
|
|
|
+ }else */
|
|
|
|
+ if(res.data.warnDeptName.indexOf("儿科") != -1){
|
|
$('#drugFlag').attr("value", "儿科");
|
|
$('#drugFlag').attr("value", "儿科");
|
|
|
|
+ printIndex = ekCfPrintIndex;
|
|
}else if(res.data.warnDeptName.indexOf("急诊") != -1){
|
|
}else if(res.data.warnDeptName.indexOf("急诊") != -1){
|
|
$('#drugFlag').attr("value", "急诊");
|
|
$('#drugFlag').attr("value", "急诊");
|
|
|
|
+ printIndex = jzCfPrintIndex;
|
|
}else if(list[0].drugFlag == '' || list[0].drugFlag == null || list[0].drugFlag == 6){
|
|
}else if(list[0].drugFlag == '' || list[0].drugFlag == null || list[0].drugFlag == 6){
|
|
$('#drugFlag').attr("value", "普通");
|
|
$('#drugFlag').attr("value", "普通");
|
|
|
|
+ printIndex = mzCfPrintIndex;
|
|
}
|
|
}
|
|
$('#priceTime').attr("value", format(list[0].priceTime, "yyyy-MM-dd HH:mm"));
|
|
$('#priceTime').attr("value", format(list[0].priceTime, "yyyy-MM-dd HH:mm"));
|
|
$('#employeeName').attr("value", res.data.employeeName + "/" + res.data.employeeCode);
|
|
$('#employeeName').attr("value", res.data.employeeName + "/" + res.data.employeeCode);
|
|
@@ -309,14 +315,14 @@ function printPrescription(patientId, orderNo, realNo, chargeDate, times, receip
|
|
LODOP.PRINT_INITA(6, 0, "141mm", "171mm", "泰和医院处方笺");
|
|
LODOP.PRINT_INITA(6, 0, "141mm", "171mm", "泰和医院处方笺");
|
|
LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
|
|
LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
|
|
//设置默认打印机
|
|
//设置默认打印机
|
|
- //LODOP.SET_PRINTER_INDEX(-1);
|
|
|
|
|
|
+ LODOP.SET_PRINTER_INDEX(printIndex);
|
|
LODOP.SET_PRINT_PAGESIZE(1, '141mm', '171mm', "CreateCustomPage");
|
|
LODOP.SET_PRINT_PAGESIZE(1, '141mm', '171mm', "CreateCustomPage");
|
|
LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "141mm");
|
|
LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "141mm");
|
|
LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "171mm");
|
|
LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "171mm");
|
|
LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
|
|
LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊处方笺");//对新建的纸张重命名
|
|
LODOP.ADD_PRINT_HTM("10mm", "5mm", "RightMargin:5mm","BottomMargin:5mm", $("div[id='print_view']").html());
|
|
LODOP.ADD_PRINT_HTM("10mm", "5mm", "RightMargin:5mm","BottomMargin:5mm", $("div[id='print_view']").html());
|
|
- //LODOP.PRINT();
|
|
|
|
- LODOP.PREVIEW();
|
|
|
|
|
|
+ LODOP.PRINT();
|
|
|
|
+ //LODOP.PREVIEW();
|
|
} else {
|
|
} else {
|
|
errorMesage(res);
|
|
errorMesage(res);
|
|
}
|
|
}
|
|
@@ -349,6 +355,39 @@ function cleanParams() {
|
|
$("#dispensingStatusSearch").selectpicker('refresh');
|
|
$("#dispensingStatusSearch").selectpicker('refresh');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * 查询默认打印机
|
|
|
|
+ */
|
|
|
|
+function setPrint() {
|
|
|
|
+ if (mzCfPrintIndex >= 0 && ekCfPrintIndex >= 0 && jzCfPrintIndex >= 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "GET",
|
|
|
|
+ url: '/thmz/getLastDispensingWindowsByCurrentUser',
|
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
|
|
+ async: false,
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res == '401' || res == 401) {
|
|
|
|
+ window.location.href = '/thmz/login/view'
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ mzCfPrintIndex = res.data.mzCfPrintIndex;
|
|
|
|
+ ekCfPrintIndex = res.data.ekCfPrintIndex;
|
|
|
|
+ jzCfPrintIndex = res.data.jzCfPrintIndex;
|
|
|
|
+ } else {
|
|
|
|
+ mzCfPrintIndex = -1;
|
|
|
|
+ ekCfPrintIndex = -1;
|
|
|
|
+ jzCfPrintIndex = -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
var prescriptionPrintWebsocket = null;
|
|
var prescriptionPrintWebsocket = null;
|
|
var toMedicineWebsocket = null;
|
|
var toMedicineWebsocket = null;
|
|
@@ -376,9 +415,14 @@ prescriptionPrintWebsocket.onopen = function (event) {
|
|
prescriptionPrintWebsocket.onmessage = function (event) {
|
|
prescriptionPrintWebsocket.onmessage = function (event) {
|
|
var printStatus = $("#printStatusSearch").val();
|
|
var printStatus = $("#printStatusSearch").val();
|
|
var dispensingStatus = $("#dispensingStatusSearch").val();
|
|
var dispensingStatus = $("#dispensingStatusSearch").val();
|
|
- if (data.type == 0 && data.content == 1 && printStatus == 0 && dispensingStatus == 0) {//来自缴费成功后的消息
|
|
|
|
|
|
+ var data = JSON.parse(event.data);
|
|
|
|
+ if (data.type == 'jf' && data.content == 1 && printStatus == 0 && dispensingStatus == 0) {//来自缴费成功后的消息
|
|
console.log("刷新配药表格");
|
|
console.log("刷新配药表格");
|
|
initTable();
|
|
initTable();
|
|
|
|
+ if($("#aotuPrint1").is(':checked')){//自动打印
|
|
|
|
+ console.log("自动打印");
|
|
|
|
+ printPrescription(data.patientId, data.orderNo, data.realNo, data.chargeDate, data.times, data.receiptNo, data.warnDept);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|