|
@@ -1,4 +1,11 @@
|
|
|
//@ sourceURL=jy_jc.js
|
|
|
+var LODOP; //声明为全局变量
|
|
|
+//默认打印机下标
|
|
|
+var printIndex = -1;
|
|
|
+//是否有检查内容可以打印
|
|
|
+var canBePrintJc = false;
|
|
|
+//是否有检验内容可以打印
|
|
|
+var canBePrintJy = false;
|
|
|
$(function () {
|
|
|
//默认光标在卡号输入框
|
|
|
$("#cardNo").focus();
|
|
@@ -15,6 +22,10 @@ $(function () {
|
|
|
$('#btn_query').click(function () {
|
|
|
initJcJyTable();
|
|
|
});
|
|
|
+ //打印检查检验报告单
|
|
|
+ $('#btn_print').click(function () {
|
|
|
+ printJyJcReport();
|
|
|
+ });
|
|
|
|
|
|
});
|
|
|
|
|
@@ -38,14 +49,14 @@ function payMarkButtonChange(object) {
|
|
|
*/
|
|
|
function initJcJyTable() {
|
|
|
var typeIndex = getIndex("pay_mark_group");
|
|
|
- if(typeIndex==0){
|
|
|
+ if (typeIndex == 0) {
|
|
|
//检查
|
|
|
$('#tb_jy_pName_table_list').bootstrapTable("destroy");
|
|
|
$('#tb_jy_table_list').bootstrapTable("destroy");
|
|
|
initJcListTable();
|
|
|
$("#jy_detail").removeClass("in").addClass("hide");
|
|
|
$("#jc_detail").removeClass("hide").addClass("in");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
$('#tb_table_list').bootstrapTable("destroy");
|
|
|
initJyListTable();
|
|
|
$("#jc_detail").removeClass("in").addClass("hide");
|
|
@@ -54,7 +65,6 @@ function initJcJyTable() {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 初始化检查报告列表
|
|
|
*/
|
|
@@ -97,7 +107,7 @@ function initJcListTable() {
|
|
|
title: '门诊ID',
|
|
|
align: "center",
|
|
|
valign: 'middle',
|
|
|
- },{
|
|
|
+ }, {
|
|
|
field: 'patientName',
|
|
|
title: '病人姓名',
|
|
|
align: "center",
|
|
@@ -121,6 +131,7 @@ function initJcListTable() {
|
|
|
}
|
|
|
],
|
|
|
onClickRow: function (row) {
|
|
|
+ clearJcDetail();
|
|
|
$("#patientId_t").text(row.patientId);
|
|
|
$("#name_t").text(row.patientName);
|
|
|
$("#date_t").text(format(row.reqDate, "yyyy-MM-dd HH:mm:ss"));
|
|
@@ -186,6 +197,7 @@ function fitJcDetail(reqNo) {
|
|
|
return;
|
|
|
}
|
|
|
if (res.code == 0) {
|
|
|
+ canBePrintJc = true;
|
|
|
$("#jy_detail").removeClass("in").addClass("hide");
|
|
|
$("#jc_detail").removeClass("hide").addClass("in");
|
|
|
var mzPatientMi = res.data.mzPatientMi;
|
|
@@ -198,15 +210,15 @@ function fitJcDetail(reqNo) {
|
|
|
var jcRecord = res.data.jcRecord;
|
|
|
$("#report_no").text(jcRecord.reportNo);
|
|
|
$("#reportId").text(jcRecord.reportId);
|
|
|
- if(jcRecord.reportDate==null || jcRecord.reportDate==""){
|
|
|
+ if (jcRecord.reportDate == null || jcRecord.reportDate == "") {
|
|
|
$("#reportDate").html(" ");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
$("#reportDate").text(format(jcRecord.reportDate, "yyyy-MM-dd HH:mm:ss"));
|
|
|
}
|
|
|
$("#confirmId").text(jcRecord.confirmId);
|
|
|
- if(jcRecord.confirmDate==null || jcRecord.confirmDate==""){
|
|
|
+ if (jcRecord.confirmDate == null || jcRecord.confirmDate == "") {
|
|
|
$("#confirmDate").html(" ");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
$("#confirmDate").text(format(jcRecord.confirmDate, "yyyy-MM-dd HH:mm:ss"));
|
|
|
}
|
|
|
} else {
|
|
@@ -217,6 +229,28 @@ function fitJcDetail(reqNo) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 清空检查明细
|
|
|
+ * @param reqNo
|
|
|
+ */
|
|
|
+function clearJcDetail() {
|
|
|
+ canBePrintJc = false;
|
|
|
+ $("#patientId_t").text("");
|
|
|
+ $("#name_t").text("");
|
|
|
+ $("#date_t").text("");
|
|
|
+ $("#gender_jc").text("");
|
|
|
+ $("#age_jc").text("");
|
|
|
+ $("#groupName").text("");
|
|
|
+ $("#textJc").text("");
|
|
|
+ $("#textZd").text("");
|
|
|
+ $("#report_no").text("");
|
|
|
+ $("#reportId").text("");
|
|
|
+ $("#reportDate").html(" ");
|
|
|
+ $("#confirmId").text("");
|
|
|
+ $("#confirmDate").html(" ");
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 初始化检验报告列表
|
|
|
*/
|
|
@@ -260,7 +294,7 @@ function initJyListTable() {
|
|
|
title: '门诊ID',
|
|
|
align: "center",
|
|
|
valign: 'middle',
|
|
|
- },{
|
|
|
+ }, {
|
|
|
field: 'patientName',
|
|
|
title: '病人姓名',
|
|
|
align: "center",
|
|
@@ -292,9 +326,9 @@ function initJyListTable() {
|
|
|
},
|
|
|
onLoadSuccess: function (data) {
|
|
|
$("#pName_table_div").find(".pagination-detail").css("display", "none");
|
|
|
- var pageItems=$("#pName_table_div").find(".page-item");
|
|
|
- if(pageItems!=null && pageItems.length>0){
|
|
|
- for(var i=1;i<pageItems.length-1;i++){
|
|
|
+ var pageItems = $("#pName_table_div").find(".page-item");
|
|
|
+ if (pageItems != null && pageItems.length > 0) {
|
|
|
+ for (var i = 1; i < pageItems.length - 1; i++) {
|
|
|
$(pageItems[i]).css("display", "none");
|
|
|
}
|
|
|
}
|
|
@@ -328,7 +362,7 @@ function initInspectionsIndexTable(patientId) {
|
|
|
var rePortRangeArr = getRePortRangeArr();
|
|
|
$('#tb_jy_table_list').bootstrapTable("destroy");
|
|
|
$('#tb_jy_table_list').bootstrapTable({
|
|
|
- url: '/thmz/getJyList?patientId='+patientId+"&beginTime="+rePortRangeArr[0]+"&endTime="+rePortRangeArr[1], //请求后台的URL(*)
|
|
|
+ url: '/thmz/getJyList?patientId=' + patientId + "&beginTime=" + rePortRangeArr[0] + "&endTime=" + rePortRangeArr[1], //请求后台的URL(*)
|
|
|
method: 'get', //请求方式(*)
|
|
|
toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
striped: true, //是否显示行间隔色
|
|
@@ -364,7 +398,7 @@ function initInspectionsIndexTable(patientId) {
|
|
|
title: '检验名称',
|
|
|
align: "center",
|
|
|
valign: 'middle',
|
|
|
- },{
|
|
|
+ }, {
|
|
|
field: 'ordr_CREATE_DATE',
|
|
|
title: '检验时间',
|
|
|
align: "center",
|
|
@@ -407,12 +441,35 @@ function initInspectionsIndexTable(patientId) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * 清空检验明细
|
|
|
+ * @param orderId
|
|
|
+ */
|
|
|
+function clearInspectionDetail() {
|
|
|
+ canBePrintJy = false;
|
|
|
+ $("#patientId_t_jy").text("");
|
|
|
+ $("#name_t_jy").text("");
|
|
|
+ $("#gender_jy").text("");
|
|
|
+ $("#age_jy").text("");
|
|
|
+ $("#reqDept_t_jy").text("");
|
|
|
+ $("#bed_no_jy").text("");
|
|
|
+ $("#smpl_jy").text("");
|
|
|
+ $("#item_jy").text("");
|
|
|
+ $("#applyDate").text("");
|
|
|
+ $("#orderCreateDate").text("");
|
|
|
+ $("#auditTime").text("");
|
|
|
+ $("#orderUsrName").text("");
|
|
|
+ $("#testUsrName").text("");
|
|
|
+ $("#auditUsrName").text("");
|
|
|
+ $("#jyBody").html("");
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 加载检验明细
|
|
|
* @param orderId
|
|
|
*/
|
|
|
function queryInspectionDetail(orderId) {
|
|
|
+ clearInspectionDetail();
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: '/thmz/getInspectionDetail?orderId=' + orderId,
|
|
@@ -425,6 +482,7 @@ function queryInspectionDetail(orderId) {
|
|
|
return;
|
|
|
}
|
|
|
if (res.code == 0) {
|
|
|
+ canBePrintJy = true;
|
|
|
$("#jc_detail").removeClass("in").addClass("hide");
|
|
|
$("#jy_detail").removeClass("hide").addClass("in");
|
|
|
var mzPatientMi = res.mzPatientMi;
|
|
@@ -432,48 +490,34 @@ function queryInspectionDetail(orderId) {
|
|
|
$("#name_t_jy").text(mzPatientMi.name);
|
|
|
$("#gender_jy").text(mzPatientMi.gender);
|
|
|
$("#age_jy").text(mzPatientMi.age);
|
|
|
- var html="";
|
|
|
- if(res.data!=null){
|
|
|
+ var html = "";
|
|
|
+ if (res.data != null) {
|
|
|
var inspectionHeader = res.data.inspectionHeader;
|
|
|
$("#reqDept_t_jy").text(inspectionHeader.dept_NAME);
|
|
|
$("#bed_no_jy").text(inspectionHeader.ptnt_BED_NO);
|
|
|
$("#smpl_jy").text(inspectionHeader.smpl_NAME);
|
|
|
$("#item_jy").text(inspectionHeader.aply_CNTN);
|
|
|
+ $("#applyDate").text(format(inspectionHeader.aply_DATE, "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ $("#orderCreateDate").text(format(inspectionHeader.ordr_CREATE_DATE, "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ $("#auditTime").text(format(inspectionHeader.audt_TIME, "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ $("#orderUsrName").text(inspectionHeader.ordr_USR_NAME);
|
|
|
+ $("#testUsrName").text(inspectionHeader.test_USR_NAME);
|
|
|
+ $("#auditUsrName").text(inspectionHeader.audt_USR_NAME);
|
|
|
var inspectionItems = res.data.inspectionItems;
|
|
|
- if(inspectionItems!=null && inspectionItems.length>0){
|
|
|
- for(var i=0;i<inspectionItems.length;i++){
|
|
|
- if(i%2==0){
|
|
|
- html+="<tr>";
|
|
|
- }
|
|
|
+ if (inspectionItems != null && inspectionItems.length > 0) {
|
|
|
+ for (var i = 0; i < inspectionItems.length; i++) {
|
|
|
+ html += "<tr>";
|
|
|
var obj = inspectionItems[i];
|
|
|
- html+="<td>"+obj.itm_NAME+"</td>";
|
|
|
- html+="<td>"+obj.range_STR+"</td>";
|
|
|
- html+="<td>"+obj.itm_UNIT+"</td>";
|
|
|
- html+="<td>"+obj.itm_STR_VALUE+"</td>";
|
|
|
- html+="<td>"+obj.range+"</td>";
|
|
|
- if(i%2==1){
|
|
|
- html+="</tr>";
|
|
|
- }
|
|
|
- }
|
|
|
- if((inspectionItems.length-1)%2==0){
|
|
|
- html+="</tr>";
|
|
|
+ html += "<td width='25%'>" + obj.itm_NAME + "</td>";
|
|
|
+ html += "<td width='16.66%'>" + obj.range_STR + "</td>";
|
|
|
+ html += "<td width='16.66%'>" + obj.itm_UNIT + "</td>";
|
|
|
+ html += "<td width='16.66%'>" + obj.itm_STR_VALUE + "</td>";
|
|
|
+ html += "<td width='25%'>" + obj.range + "</td>";
|
|
|
+ html += "</tr>";
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
$("#jyBody").html(html);
|
|
|
-
|
|
|
- // if(jcRecord.reportDate==null || jcRecord.reportDate==""){
|
|
|
- // $("#reportDate").html(" ");
|
|
|
- // }else {
|
|
|
- // $("#reportDate").text(format(jcRecord.reportDate, "yyyy-MM-dd HH:mm:ss"));
|
|
|
- // }
|
|
|
- // $("#confirmId").text(jcRecord.confirmId);
|
|
|
- // if(jcRecord.confirmDate==null || jcRecord.confirmDate==""){
|
|
|
- // $("#confirmDate").html(" ");
|
|
|
- // }else {
|
|
|
- // $("#confirmDate").text(format(jcRecord.confirmDate, "yyyy-MM-dd HH:mm:ss"));
|
|
|
- // }
|
|
|
} else {
|
|
|
errorMesage(res);
|
|
|
}
|
|
@@ -482,7 +526,6 @@ function queryInspectionDetail(orderId) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 卡号输入改变事件
|
|
|
*/
|
|
@@ -507,7 +550,7 @@ function queryUserInfoByCardNo() {
|
|
|
var index = cardNo.indexOf("-");
|
|
|
if (index > 0 && index == cardNo.length - 2) {
|
|
|
$("#patientId").val(cardNo);
|
|
|
- initFeeTable();
|
|
|
+ initJcJyTable();
|
|
|
} else if (cardNo == '120' || cardNo.length == 8) {
|
|
|
$("#cardNo").attr("title", cardNo);
|
|
|
$.ajax({
|
|
@@ -523,17 +566,11 @@ function queryUserInfoByCardNo() {
|
|
|
}
|
|
|
if (res.code == 0) {
|
|
|
if (res.data != null) {
|
|
|
- $("#patientId").val(res.data.patientId);
|
|
|
- initFeeTable();
|
|
|
+ $("#cardNo").val(res.data.patientId);
|
|
|
+ initJcJyTable();
|
|
|
}
|
|
|
} else {
|
|
|
- new PNotify({
|
|
|
- title: '错误提示',
|
|
|
- text: res.message,
|
|
|
- type: 'error',
|
|
|
- hide: true,
|
|
|
- styling: 'bootstrap3'
|
|
|
- });
|
|
|
+ errorMesage(res);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -573,88 +610,97 @@ function getRePortRangeArr() {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 退费操作
|
|
|
- */
|
|
|
-function refundFee(patientId, id, totalFee, tradeNo, name, body, orderType) {
|
|
|
- $("#refundId").val(id);
|
|
|
- $("#patientIdRead").val(patientId);
|
|
|
- $("#nameRead").val(name);
|
|
|
- $("#bodyRead").val(body);
|
|
|
- $("#amountRead").val(totalFee);
|
|
|
- $("#refundFeeModal").modal();
|
|
|
- $("#tradeNoRead").val(tradeNo);
|
|
|
- $("#refundOrderType").val(orderType);
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-/**
|
|
|
- * 清空提示区域
|
|
|
+ * 清空查询条件
|
|
|
*/
|
|
|
-function clearMode() {
|
|
|
- $("#refundId").val(null);
|
|
|
- $("#tradeNoRead").val(null);
|
|
|
- $("#patientIdRead").val(null);
|
|
|
- $("#patientId").val(null);
|
|
|
- $("#bodyRead").val(null);
|
|
|
- $("#amountRead").val(null);
|
|
|
- $("#refundOrderType").val(null);
|
|
|
+function cleanParams() {
|
|
|
+ $("#cardNo").val(null);
|
|
|
+ $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
+ initJcJyTable();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 提交退费操作
|
|
|
+ * 查询默认打印机
|
|
|
*/
|
|
|
-function saveRefundFee() {
|
|
|
+function setPrint() {
|
|
|
+ if (printIndex >= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
- type: "POST",
|
|
|
- url: '/thmz/refundOrder',
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getLastWindowsByCurrentUser',
|
|
|
contentType: "application/json;charset=UTF-8",
|
|
|
dataType: "json",
|
|
|
- data: JSON.stringify({
|
|
|
- id: $("#refundId").val(),
|
|
|
- totalFee: $("#amountRead").val(),
|
|
|
- tradeNo: $("#tradeNoRead").val(),
|
|
|
- orderType: $("#refundOrderType").val()
|
|
|
- }),
|
|
|
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) {
|
|
|
- new PNotify({
|
|
|
- title: '操作提示',
|
|
|
- text: res.message,
|
|
|
- type: 'success',
|
|
|
- hide: true,
|
|
|
- styling: 'bootstrap3'
|
|
|
- });
|
|
|
- $("#refundFeeModal").modal("hide");
|
|
|
- initFeeTable();
|
|
|
+ printIndex = res.data.cgPrintIndex;
|
|
|
} else {
|
|
|
- new PNotify({
|
|
|
- title: '错误提示',
|
|
|
- text: res.message,
|
|
|
- type: 'error',
|
|
|
- hide: true,
|
|
|
- styling: 'bootstrap3'
|
|
|
- });
|
|
|
+ printIndex = -1;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 清空查询条件
|
|
|
+ * 打印检查检验报告单
|
|
|
+ * @param patientId
|
|
|
+ * @param times
|
|
|
+ * @param clnicId
|
|
|
+ * @param payMark
|
|
|
*/
|
|
|
-function cleanParams() {
|
|
|
- $("#orderType").selectpicker('val', null);//默认选中
|
|
|
- $("#orderType").selectpicker('refresh');
|
|
|
- $("#patientId").val(null);
|
|
|
- $("#name").val(null);
|
|
|
- $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
- $("#orderType").selectpicker('val', -1);//默认选中
|
|
|
- $('#orderType').selectpicker('refresh');
|
|
|
-}
|
|
|
-
|
|
|
+function printJyJcReport() {
|
|
|
+ var typeIndex = getIndex("pay_mark_group");
|
|
|
+ var title = "检查报告单";
|
|
|
+ if (typeIndex == 1) {
|
|
|
+ title = "检验报告单"
|
|
|
+ if (!canBePrintJy) {
|
|
|
+ warningMesageSimaple("没有任何【" + title + "】可供打印!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!canBePrintJc) {
|
|
|
+ warningMesageSimaple("没有任何【" + title + "】可供打印!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setPrint();
|
|
|
+ LODOP = getLodop();
|
|
|
+ LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院" + title);
|
|
|
+ LODOP.SET_PRINT_STYLE("FontSize", 7); //字体大小
|
|
|
+ //设置默认打印机
|
|
|
+ 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", title);//对新建的纸张重命名
|
|
|
+ //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%;} #jy_detail_content thead {border-bottom: 1px solid black;border-collapse: collapse;}</style>";
|
|
|
+ if (typeIndex == 0) {
|
|
|
+ LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("jc_detail").innerHTML);
|
|
|
+ }
|
|
|
+ if (typeIndex == 1) {
|
|
|
+ LODOP.ADD_PRINT_TABLE("36mm", "5mm", "130mm", "138mm", strStyle + document.getElementById("jy_detail_content").innerHTML);
|
|
|
+ LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
|
|
|
+ LODOP.ADD_PRINT_HTM("0mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_title").innerHTML);
|
|
|
+ LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
|
|
|
+ LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
|
|
|
+ LODOP.ADD_PRINT_HTM("176mm", "5mm", "130mm", "200mm", strStyle + document.getElementById("jy_detail_foot").innerHTML);
|
|
|
+ LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
|
|
|
+ LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
|
|
|
+ }
|
|
|
+ LODOP.PREVIEW();
|
|
|
+}
|