|
@@ -1,4 +1,7 @@
|
|
|
//@ sourceURL=user_manage.js
|
|
|
+var LODOP; //声明为全局变量
|
|
|
+//默认打印机下标
|
|
|
+var printIndex = -1;
|
|
|
$(function () {
|
|
|
$("input").each(function () {
|
|
|
this.onkeydown = function (e) { // 监听键盘事件
|
|
@@ -211,7 +214,8 @@ function saveData() {
|
|
|
if (res.code == 0) {
|
|
|
$("#editModal").modal("hide");
|
|
|
clearZyReq();
|
|
|
- successMesage(res);
|
|
|
+ //successMesage(res);
|
|
|
+ printZyReq($("#patientId").val(),1)
|
|
|
} else {
|
|
|
errorMesage(res);
|
|
|
}
|
|
@@ -508,4 +512,108 @@ function resetSearch() {
|
|
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 打印入院通知单
|
|
|
+ * @param patientId
|
|
|
+ * @param times
|
|
|
+ * @param clnicId
|
|
|
+ * @param payMark
|
|
|
+ * @param printType 打印模式 1 预览打印 2 打印设置
|
|
|
+ */
|
|
|
+function printZyReq(patientId, printType) {
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/printZyReq?patientId=' + patientId,
|
|
|
+ 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) {
|
|
|
+ setPrint();
|
|
|
+ LODOP = getLodop();
|
|
|
+ LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "长沙泰和医院入院通知单");
|
|
|
+ LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
|
|
|
+ //设置默认打印机
|
|
|
+ LODOP.SET_PRINTER_INDEX(printIndex);
|
|
|
+ LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
|
|
|
+ LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
|
|
|
+ LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
|
|
|
+ LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
|
|
|
+ //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
|
|
|
+ //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
|
|
|
+ //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
|
|
|
+ //intWidth,intHeight 窗口的宽和高,整数型,单位是px
|
|
|
+ //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
|
|
|
+ //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
|
|
|
+ LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
|
|
|
+ //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
|
|
|
+ var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
|
|
|
+ var mzPatientMi = res.mzPatientMi;
|
|
|
+ var mzZyReq = res.mzZyReq;
|
|
|
+ $("#patientIdZyReq").text(mzPatientMi.patientId);
|
|
|
+ $("#patientNameZyReq").text(mzPatientMi.name);
|
|
|
+ $("#patientGenderZyReq").text(mzPatientMi.gender);
|
|
|
+ $("#patientAgeZyReq").text(mzPatientMi.ageString);
|
|
|
+ $("#sfzZyReq").text(mzPatientMi.socialNo);
|
|
|
+ $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
|
|
|
+ $("#phoneZyReq").text(mzPatientMi.phoneNo);
|
|
|
+ $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
|
|
|
+ $("#addressZyReq").text(mzPatientMi.address);
|
|
|
+ if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
|
|
|
+ $("#icsCodeZyReq").html(" ");
|
|
|
+ $("#icsTextZyReq").text(mzZyReq.icdText);
|
|
|
+ } else {
|
|
|
+ $("#icsCodeZyReq").text(mzZyReq.icdCode);
|
|
|
+ $("#icsTextZyReq").text(mzZyReq.icdText);
|
|
|
+ }
|
|
|
+ $("#reqDeptZyReq").text(mzZyReq.reqWardName);
|
|
|
+ $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
|
|
|
+ //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
|
|
|
+ $("input:checkbox[value='" + mzZyReq.admissStatus + "']").attr('checked', 'true');
|
|
|
+ $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ $("#deptCodeZyReq").text(mzZyReq.deptName);
|
|
|
+ $("#doctorCodeZyReq").text(mzZyReq.doctorName);
|
|
|
+ LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
|
|
|
+ if (printType == 1) {
|
|
|
+ LODOP.PREVIEW();
|
|
|
+ } else if (printType == 2) {
|
|
|
+ LODOP.PRINT_SETUP();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
|
|
|
+/**
|
|
|
+ * 查询默认打印机
|
|
|
+ */
|
|
|
+function setPrint() {
|
|
|
+ if (printIndex >= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getLastWindowsByCurrentUser',
|
|
|
+ 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) {
|
|
|
+ printIndex = res.data.cgPrintIndex;
|
|
|
+ } else {
|
|
|
+ printIndex = -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|