" + res.data[i].receiptBill + " |
").appendTo("#repPrintTable").bind('click', function () {
$("#repPrintModal").modal("hide");
var message = "确定要重新打印发票号码为【" + $(this).text() + "】的发票吗?请确认发票打印机即将要打印的发票编号";
var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=0&receiptBill=" + $(this).text();
confirmMessage(patientId, times, message, url);
});
}
}
}
}
});
}
/**
* 发票重打提示
* @param patientId
* @param times
* @param name
*/
function confirmMessage(patientId, times, message, url) {
if (!confirm(message)) {
return;
}
//var url='/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=0" + "&receiptBill="+receiptBill;
printCommon(url, patientId, times, true);
}
/**
* 作废重打发票
* @param patientId
* @param times
*/
function obsoleteAndRepPrint(patientId, times, receiptNo) {
$.ajax({
type: "GET",
url: '/thmz/getReceiptForThisTime?patientId=' + patientId + "×=" + times + "&receiptNo=" + receiptNo,
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) {
if (res.data.length == 1) {
var message = "确定要作废发票号码为【" + res.data[0].receiptBill + "】的发票吗?请确认需要作废发票编号";
var url = '/thmz/repPrintForThisTime?patientId=' + patientId + "×=" + times + "&obsolete=1&receiptBill=" + res.data[0].receiptBill;
confirmMessage(patientId, times, message, url);
} else {
$("#tip_message").text("请选择需要作废的发票号");
$("#repPrintModal").modal();
$("#repPrintTable").html(null);
for (var i = 0; i < res.data.length; i++) {
$("