|
|
@@ -11,6 +11,7 @@ var isTableListInit = false;
|
|
|
var LODOP; //声明为全局变量pageIndex
|
|
|
//默认打印机下标
|
|
|
var printIndex = -1;
|
|
|
+var fpVsesionNo = 0;
|
|
|
var TableInit = function () {
|
|
|
var oTableInit = new Object();
|
|
|
//初始化Table
|
|
|
@@ -99,6 +100,7 @@ var TableInit = function () {
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
+ initFpVersion();
|
|
|
initGenderSelect();
|
|
|
initResponceTypeSelect();
|
|
|
|
|
|
@@ -234,6 +236,13 @@ function initCertificateTypeSelect() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+//初始化版本电子发票版本
|
|
|
+function initFpVersion() {
|
|
|
+ getAjaxRequst("/thmz/queryFpVersion",{},true,function (res) {
|
|
|
+ console.log('发票版本=',res.data)
|
|
|
+ fpVsesionNo = res.data;
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 初始化性别下拉选
|
|
|
@@ -1095,7 +1104,10 @@ function loadCardList() {
|
|
|
html += ' <i class="fa fa-rmb"></i>';
|
|
|
} else {
|
|
|
var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
|
|
|
- if (printFlag) {
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="打印并上传电子发票" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
|
|
|
+ }
|
|
|
+ else if (printFlag && fpVsesionNo == 0) {
|
|
|
html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
|
|
|
} else {
|
|
|
html += ' <button type="button" class="can-not-used" title="打印">';
|
|
|
@@ -1151,7 +1163,10 @@ function loadCardList() {
|
|
|
html += ' <i class="fa fa-rmb"></i>';
|
|
|
} else {
|
|
|
var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
|
|
|
- if (printFlag) {
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="打印并上传电子发票" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
|
|
|
+ }
|
|
|
+ else if (printFlag && fpVsesionNo ==0) {
|
|
|
html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
|
|
|
} else {
|
|
|
html += ' <button type="button" class="can-not-used" title="打印">';
|
|
|
@@ -1376,6 +1391,10 @@ function loadTableList() {
|
|
|
if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
|
|
|
html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
|
|
|
}
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += '<button type="button" class="registration-no-color-foot-button" title="电子发票作废" onclick="uploadRedInvoice(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-mail-reply-all"></i></button>';
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="下载红字电子发票" onclick="downloadInvoice(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times +',2'+ ')"><i class="fa fa-download"></i></button>';
|
|
|
+ }
|
|
|
html += '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button><button type="button" class="can-not-used" title="打印" ><i class="fa fa-print"></i></button>';
|
|
|
html += '<button type="button" class="registration-no-color-foot-button" title="智能支付参数与条形码" onclick="createBarcode(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-barcode"></i></button>';
|
|
|
return html;
|
|
|
@@ -1394,13 +1413,20 @@ function loadTableList() {
|
|
|
html += '<i class="fa fa-rmb"></i></button>';
|
|
|
} else {
|
|
|
var printFlag = isEmpty(row.mzyReqrec.printerId);
|
|
|
- if (printFlag) {
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="打印并上传电子发票" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
|
|
|
+ }
|
|
|
+ else if (printFlag && fpVsesionNo == 0) {
|
|
|
html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
|
|
|
} else {
|
|
|
html += ' <button type="button" class="can-not-used" title="打印">';
|
|
|
}
|
|
|
html += '<i class="fa fa-print"></i></button>';
|
|
|
}
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="上传电子发票" onclick="uploadBlueInvoice(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-upload"></i></button>';
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="下载电子发票" onclick="downloadInvoice(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times +',1'+ ')"><i class="fa fa-download"></i></button>';
|
|
|
+ }
|
|
|
html += '<button type="button" class="can-not-used" title="智能支付参数与条形码"><i class="fa fa-barcode"></i></button>';
|
|
|
// html += '<button type="button" class="registration-no-color-foot-button" title="取消接诊" onclick="cancelClinic(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-mail-reply"></i></button>';
|
|
|
return html;
|
|
|
@@ -1418,12 +1444,19 @@ function loadTableList() {
|
|
|
html += '<i class="fa fa-rmb"></i></button>';
|
|
|
} else {
|
|
|
var printFlag = isEmpty(row.mzyReqrec.printerId);
|
|
|
- if (printFlag) {
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="打印并上传电子发票" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
|
|
|
+ }
|
|
|
+ else if (printFlag && fpVsesionNo == 0) {
|
|
|
html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
|
|
|
} else {
|
|
|
html += ' <button type="button" class="can-not-used" title="打印">';
|
|
|
}
|
|
|
html += '<i class="fa fa-print"></i></button>';
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="上传电子发票" onclick="uploadBlueInvoice(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-upload"></i></button>';
|
|
|
+ html += ' <button type="button" class="registration-no-color-foot-button" title="下载电子发票" onclick="downloadInvoice(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times +',1'+ ')"><i class="fa fa-download"></i></button>';
|
|
|
+ }
|
|
|
}
|
|
|
html += '<button type="button" class="registration-no-color-foot-button" title="智能支付参数与条形码" onclick="createBarcode(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-barcode"></i></button>';
|
|
|
//html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
|
|
|
@@ -1659,6 +1692,10 @@ function saveBackNo(refundType) {
|
|
|
$("#refundPayDetailForm").html(html);
|
|
|
$("#refundPayDetailModal").modal();
|
|
|
}
|
|
|
+ //电子发票作废
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ uploadRedInvoice($("#backNoPatientId").val(),$("#backNoTimes").val());
|
|
|
+ }
|
|
|
} else if (res.code == -2) {
|
|
|
loadTableCount();
|
|
|
loadRegistrationList(true);
|
|
|
@@ -1687,6 +1724,40 @@ function chargeFeeForByjz(serialNo) {
|
|
|
}
|
|
|
|
|
|
|
|
|
+//上传电子发票
|
|
|
+function uploadBlueInvoice(patientId,times) {
|
|
|
+ postAjaxJsonHttpRequst("/thmz/uploadMzInvoice",{patientId:patientId,times:times,receiptNo:0,ghFlag:true,typeFlag:1},true,function (rs) {
|
|
|
+ if(rs.code ==0){
|
|
|
+ successMesageSimaple("电子发票上传成功!")
|
|
|
+ }else {
|
|
|
+ errorMesage(rs);
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//电子发票作废
|
|
|
+function uploadRedInvoice(patientId,times) {
|
|
|
+ postAjaxJsonHttpRequst("/thmz/uploadMzInvoice",{patientId:patientId,times:times,receiptNo:0,ghFlag:true,typeFlag:2},true,function (rs) {
|
|
|
+ if(rs.code ==0){
|
|
|
+ successMesageSimaple("电子发票作废成功!")
|
|
|
+ }else {
|
|
|
+ errorMesage(rs);
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//下载电子发票
|
|
|
+function downloadInvoice(patientId,times,typeFlag) {
|
|
|
+ postAjaxJsonHttpRequst("/thmz/queryInvoiceFile",{patientId:patientId,times:times,typeFlag:typeFlag,receiptNo:0},true,function (res) {
|
|
|
+ if(res.code == 0){
|
|
|
+ base64toPDF(res.data.pdfFileStr)
|
|
|
+ }else {
|
|
|
+ errorMesage(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 直接打印发票
|
|
|
* @param patientId
|
|
|
@@ -1694,9 +1765,6 @@ function chargeFeeForByjz(serialNo) {
|
|
|
function prn1Print(patientId, times) {
|
|
|
setPrint();
|
|
|
var height = "93.15mm";
|
|
|
- // if(countReceiot%2==0){
|
|
|
- // height ="93.2mm";
|
|
|
- // }
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: '/thmz/printMzyReqrecRecept?patientId=' + patientId + "×=" + times,
|
|
|
@@ -1725,35 +1793,49 @@ function prn1Print(patientId, times) {
|
|
|
LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
|
|
|
LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
|
|
|
LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", "湖南泰和医院管理有限公司");
|
|
|
- LODOP.ADD_PRINT_TEXT("6mm", "59mm", "30mm", "3mm", "流水号:");
|
|
|
- LODOP.ADD_PRINT_TEXT("6mm", "72mm", "20mm", "3mm", temp.serialNo);
|
|
|
- LODOP.ADD_PRINT_TEXT("19mm", "0mm", "35mm", "3mm", temp.receiptBill);
|
|
|
- LODOP.ADD_PRINT_TEXT("25mm", "7mm", "50mm", "3mm", temp.name);
|
|
|
- LODOP.ADD_PRINT_TEXT("25mm", "61mm", "27mm", "3mm", patientId);
|
|
|
- LODOP.ADD_PRINT_TEXT("32mm", "6mm", "50mm", "3mm", "就诊科室:" + temp.unitCode);
|
|
|
- LODOP.ADD_PRINT_TEXT("32mm", "56mm", "50mm", "3mm", "地点:" + res.officePos);
|
|
|
- LODOP.ADD_PRINT_TEXT("37mm", "6mm", "50mm", "3mm", "看诊医生:" + temp.doctorCode);
|
|
|
- LODOP.ADD_PRINT_TEXT("37mm", "56mm", "50mm", "3mm", "号段:" + temp.ampm);
|
|
|
- LODOP.ADD_PRINT_TEXT("42mm", "6mm", "50mm", "3mm", "号别:" + temp.chargeType);
|
|
|
- LODOP.ADD_PRINT_TEXT("42mm", "56mm", "50mm", "3mm", "挂号费:" + temp.reqFee);
|
|
|
- LODOP.ADD_PRINT_TEXT("47mm", "6mm", "50mm", "3mm", "诊查费:" + temp.clinicFee);
|
|
|
- LODOP.ADD_PRINT_TEXT("47mm", "56mm", "50mm", "3mm", "其他:" + temp.othFee);
|
|
|
- var blbFee=temp.blbFee;
|
|
|
- if(blbFee==null){
|
|
|
- blbFee=0;
|
|
|
- }
|
|
|
- if (temp.zlkFee != null) {
|
|
|
- blbFee = blbFee + temp.zlkFee;
|
|
|
+ if(fpVsesionNo == 0){
|
|
|
+ LODOP.ADD_PRINT_TEXT("6mm", "59mm", "30mm", "3mm", "流水号:");
|
|
|
+ LODOP.ADD_PRINT_TEXT("6mm", "72mm", "20mm", "3mm", temp.serialNo);
|
|
|
+ LODOP.ADD_PRINT_TEXT("19mm", "0mm", "35mm", "3mm", temp.receiptBill);
|
|
|
+ LODOP.ADD_PRINT_TEXT("25mm", "7mm", "50mm", "3mm", temp.name);
|
|
|
+ LODOP.ADD_PRINT_TEXT("25mm", "61mm", "27mm", "3mm", patientId);
|
|
|
+ LODOP.ADD_PRINT_TEXT("32mm", "6mm", "50mm", "3mm", "就诊科室:" + temp.unitCode);
|
|
|
+ LODOP.ADD_PRINT_TEXT("32mm", "56mm", "50mm", "3mm", "地点:" + res.officePos);
|
|
|
+ LODOP.ADD_PRINT_TEXT("37mm", "6mm", "50mm", "3mm", "看诊医生:" + temp.doctorCode);
|
|
|
+ LODOP.ADD_PRINT_TEXT("37mm", "56mm", "50mm", "3mm", "号段:" + temp.ampm);
|
|
|
+ LODOP.ADD_PRINT_TEXT("42mm", "6mm", "50mm", "3mm", "号别:" + temp.chargeType);
|
|
|
+ LODOP.ADD_PRINT_TEXT("42mm", "56mm", "50mm", "3mm", "挂号费:" + temp.reqFee);
|
|
|
+ LODOP.ADD_PRINT_TEXT("47mm", "6mm", "50mm", "3mm", "诊查费:" + temp.clinicFee);
|
|
|
+ LODOP.ADD_PRINT_TEXT("47mm", "56mm", "50mm", "3mm", "其他:" + temp.othFee);
|
|
|
+ var blbFee=temp.blbFee;
|
|
|
+ if(blbFee==null){
|
|
|
+ blbFee=0;
|
|
|
+ }
|
|
|
+ if (temp.zlkFee != null) {
|
|
|
+ blbFee = blbFee + temp.zlkFee;
|
|
|
+ }
|
|
|
+ LODOP.ADD_PRINT_TEXT("52mm", "6mm", "50mm", "3mm", "工本费:" + blbFee);
|
|
|
+ LODOP.ADD_PRINT_TEXT("65mm", "21mm", "60mm", "3mm", res.totalFee + " 元");
|
|
|
+ LODOP.ADD_PRINT_TEXT("72mm", "19mm", "60mm", "3mm", res.totalFeeStr);
|
|
|
+ LODOP.ADD_PRINT_TEXT("79mm", "0mm", "15mm", "3mm", res.year);//年
|
|
|
+ LODOP.ADD_PRINT_TEXT("79mm", "13mm", "10mm", "3mm", res.month);//月
|
|
|
+ LODOP.ADD_PRINT_TEXT("79mm", "25mm", "10mm", "3mm", res.day);//日
|
|
|
+ LODOP.ADD_PRINT_TEXT("79mm", "53mm", "23mm", "3mm", res.user.userName);//收费员
|
|
|
+ }else {
|
|
|
+ LODOP.ADD_PRINT_TEXT("5mm", "3mm", "50mm", "3mm", "姓名:"+temp.name);
|
|
|
+ LODOP.ADD_PRINT_TEXT("9mm", "3mm", "50mm", "3mm", "门诊号:"+patientId);
|
|
|
+ LODOP.ADD_PRINT_TEXT("13mm", "3mm", "50mm", "3mm", "就诊科室:" + temp.unitCode);
|
|
|
+ LODOP.ADD_PRINT_TEXT("17mm", "3mm", "70mm", "3mm", "地点:" + res.officePos);
|
|
|
+ LODOP.ADD_PRINT_TEXT("21mm", "3mm", "50mm", "3mm", "看诊医生:" + temp.doctorCode);
|
|
|
+ LODOP.ADD_PRINT_TEXT("25mm", "3mm", "50mm", "3mm", "号段:" + temp.ampm);
|
|
|
+ LODOP.ADD_PRINT_TEXT("29mm", "3mm", "50mm", "3mm", "号别:" + temp.chargeType);
|
|
|
+ LODOP.ADD_PRINT_TEXT("33mm", "3mm", "50mm", "3mm", "收费员:"+res.user.userName);//收费员
|
|
|
}
|
|
|
- LODOP.ADD_PRINT_TEXT("52mm", "6mm", "50mm", "3mm", "工本费:" + blbFee);
|
|
|
- LODOP.ADD_PRINT_TEXT("65mm", "21mm", "60mm", "3mm", res.totalFee + " 元");
|
|
|
- LODOP.ADD_PRINT_TEXT("72mm", "19mm", "60mm", "3mm", res.totalFeeStr);
|
|
|
- LODOP.ADD_PRINT_TEXT("79mm", "0mm", "15mm", "3mm", res.year);//年
|
|
|
- LODOP.ADD_PRINT_TEXT("79mm", "13mm", "10mm", "3mm", res.month);//月
|
|
|
- LODOP.ADD_PRINT_TEXT("79mm", "25mm", "10mm", "3mm", res.day);//日
|
|
|
- LODOP.ADD_PRINT_TEXT("79mm", "53mm", "23mm", "3mm", res.user.userName);//收费员
|
|
|
- //LODOP.PREVIEW();
|
|
|
LODOP.PRINT();
|
|
|
+ if(fpVsesionNo == 1){
|
|
|
+ //上传电子发票
|
|
|
+ uploadBlueInvoice(patientId, times)
|
|
|
+ }
|
|
|
if (times > 0) {
|
|
|
loadTableCount();
|
|
|
loadRegistrationList(true);
|