1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969 |
- //@ sourceURL=registration_list.js
- var $dataTableHot;
- //病人下拉选当前页记录
- var pageIndex = 0;
- //判断病人列表是否在加载中,防止重复加载
- var msg_list_loading = false;
- //挂号卡片列表页面下标
- var pageIndex = 0;
- //判断表格列表是否已经初始化
- var isTableListInit = false;
- var LODOP; //声明为全局变量pageIndex
- //默认打印机下标
- var printIndex = -1;
- var TableInit = function () {
- var oTableInit = new Object();
- //初始化Table
- oTableInit.Init = function () {
- $dataTableHot = $('#tb_fee_info').bootstrapTable({
- url: '', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- //queryParams: oTableInit.queryParams,//传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- // {
- // checkbox: true
- // },
- {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- //sortable: true
- }, {
- field: 'money',
- title: '金额(元)',
- align: "center",
- valign: 'middle',
- //sortable: true
- }, {
- field: 'moneyReceived',
- title: '实收金额(元)',
- align: "center",
- valign: 'middle',
- // sortable: true
- }],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.pageViewVO.total,//总页数
- "rows": ress.pageViewVO.data //数据
- };
- },
- });
- };
- return oTableInit;
- };
- $(function () {
- initGenderSelect();
- initResponceTypeSelect();
- //设置挂号窗口的高度
- var width = $('#confirmFee').css("width");
- var widthNum = parseInt(width);
- widthNum -= 24;
- $("#confirmFee").css("width", widthNum + "px");
- init_daterangepicker();
- //1.初始化Table
- var oTable = new TableInit();
- oTable.Init();
- formatCheck();
- //数据校验
- init_validator();
- //初始门诊收银方式下拉选
- initChequeType("payType");
- //初始修改收费方式 收银方式下拉选
- initChequeType("payTypeEditPayMode");
- /**
- * 增加收款方式按钮事件
- */
- $("#addPayType").on("click", function (t) {
- var payTypeIndex = $("#payTypeIndex").val();
- var payTypeId = "payType_" + payTypeIndex;
- var html = '<div class="item form-group"><div class="col-md-12 col-sm-12 col-xs-12"><div class="col-md-2 col-sm-2 col-xs-12"></div><label class="col-md-3 col-sm-3 col-xs-12"><select class="form-control selectpicker show-tick" required="true" id="' + payTypeId + '"></select></label><div class="col-md-3 col-sm-3 col-xs-12"><input class="form-control col-md-5 col-xs-12" type="number" data-placement="bottom-right" min="0"></div><a style="line-height: 34px;cursor: pointer;" onclick="closeThisParent(this)"><i class="fa fa-close"></i></a></div></div>';
- $("#changeAmountParent").before(html);
- initChequeType(payTypeId)
- payTypeIndex = payTypeIndex + 1;
- $("#payTypeIndex").val(payTypeIndex);
- });
- /**
- * 退费重收事件
- */
- $("#saveConfirmFee").on("click", function (t) {
- var serialNo = $("#serialNo").val();
- if (!confirm("确定要将流水号【" + serialNo + "】的挂号记录退费重收吗?")) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/chargeFeeForByjz?serialNo=' + serialNo + "&paymode=" + $("#payType").val(),
- 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) {
- $('#confirmFeeModal').modal('hide');
- $("#serialNo").val(null);
- prn1Print(res.data.patientId, res.data.times);
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- });
- /**
- * 患者信息修改
- */
- $("#saveEditUser").on("click", function (t) {
- modifyPatient();
- });
- /**
- * 挂号列表中的科室和医生列表初始化
- */
- initListSelect();
- $("#queryListButton").on("click", function (t) {
- loadTableCount();
- loadRegistrationList(true);
- });
- loadTableCount();
- loadRegistrationList(true);
- initCertificateTypeSelect();
- //初始化省份
- initProvince(2);
- //初始化页面上面的按钮事件
- $("#btn_excel").click(function (t) {
- exportExcel();
- });
- });
- /**
- * 初始化证件类型下拉选
- */
- function initCertificateTypeSelect() {
- $.ajax({
- type: "GET",
- url: '/thmz/listCertificateType',
- 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) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#editUserCertificateType').append(html);
- });
- $('#editUserCertificateType').selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 初始化性别下拉选
- */
- function initGenderSelect() {
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
- $('#gender').html(gender);
- $('#gender').selectpicker('refresh');
- $('#editUserGender').html(gender);
- $('#editUserGender').selectpicker('refresh');
- }
- /**
- * 初始化病人身份类别下拉选
- */
- function initResponceTypeSelect() {
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- $.ajax({
- type: "GET",
- url: '/thmz/getMzResponceType',
- 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) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#patientsNature').append(html);
- $('#editUserPatientsNature').append(html);
- });
- $('#patientsNature').selectpicker('refresh');
- $('#editUserPatientsNature').selectpicker('refresh');
- } else {
- errorMesage(res.message);
- }
- }
- });
- }
- /**
- * 初始科室下拉选
- * @param ampm 时间段区间
- */
- function initDeptPlus() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByRequestDay?ampm=' + $("#ampm").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#deptNo').empty();
- $('#deptNo').html(html);
- $('#deptNo').selectpicker('refresh');
- $('#chargeType').empty();
- $('#chargeType').selectpicker('refresh');
- emptyInput();
- }
- });
- }
- /**
- * 初始门诊收银方式下拉选
- */
- function initChequeType(payType) {
- $.ajax({
- type: "GET",
- url: '/thmz/getAllZdChequeTypeForMz',
- 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;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#' + payType).empty();
- $('#' + payType).html(html);
- $('#' + payType).selectpicker('refresh');
- }
- });
- }
- /**
- * 日期值改变修改年龄字段
- * @param ev
- */
- function changeDate(ev) {
- }
- /**
- * 列表类型按钮切换事件
- * @param object
- */
- function titleButtonChange(object) {
- $("#regi_List_btn_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- loadRegistrationList(true);
- }
- /**
- * 表格类型切换事件 卡片展示或者列表形式
- */
- function listTypeChange(object) {
- //var indexNum = 0;
- $("#regi_List_type").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- // if (object == element) {
- // indexNum = index;
- // }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- loadRegistrationList(true);
- }
- /**
- * 打开编辑用户信息窗口
- * @param data
- */
- function editUserModal(data) {
- $("#editUserModal").modal();
- if (data == null) {
- data = $("#patientId").val();
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + data,
- 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 != null) {
- //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
- setTimeout(function () {
- fillPlusPatinet(res.data);
- }, 400);
- }
- } else {
- errorMesage(res.message);
- }
- }
- });
- }
- /**
- * 打开退费信息窗口
- * @param patientId
- * @param times
- */
- function backNoModal(patientId, times) {
- $.ajax({
- type: "POST",
- url: '/thmz/getMzyReqrecByPatientIdAndTimes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": patientId, "times": times}),
- 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 != null) {
- $("#backNoPatientId").val(patientId);
- $("#backNoTimes").val(times);
- $("#backNoSickName").text(res.data.mzyReqrec.name);
- $("#backNoPayType").text(res.data.mzyReqrec.paymode);
- $("#backNoPhone").text(res.data.mzPatientMi.phoneNo);
- $("#backNoAmpm").text(res.data.mzyReqrec.ampm);
- $("#backNoDeptName").text(res.data.mzyReqrec.unitCode);
- $("#backNoChargeType").text(res.data.mzyReqrec.chargeType);
- $("#backNoDoctorName").text(res.data.mzyReqrec.doctorCode);
- $("#backNoRegiDate").text(format(res.data.mzyReqrec.requestDay, "yyyy-MM-dd HH:mm:ss"));
- var index = 0;
- var trHtml = '';
- if (res.data.mzyReqrec.reqFee != null && res.data.mzyReqrec.reqFee != "" && res.data.mzyReqrec.reqFee > 0) {
- trHtml = '<tr data-index="' + index + '"><td style="text-align: center; vertical-align: middle; ">挂号费</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.reqFee + '</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.reqFee + '</td></tr>';
- index++;
- }
- if (res.data.mzyReqrec.clinicFee != null && res.data.mzyReqrec.clinicFee != "" && res.data.mzyReqrec.clinicFee > 0) {
- trHtml += '<tr data-index="' + index + '"><td style="text-align: center; vertical-align: middle; ">诊查费</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.clinicFee + '</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.clinicFee + '</td></tr>';
- index++;
- }
- if (res.data.mzyReqrec.othFee != null && res.data.mzyReqrec.othFee != "" && res.data.mzyReqrec.othFee > 0) {
- trHtml += '<tr data-index="' + index + '"><td style="text-align: center; vertical-align: middle; ">检查费</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.othFee + '</td><td style="text-align: center; vertical-align: middle; ">' + res.data.mzyReqrec.othFee + '</td></tr>';
- }
- $("#tb_fee_info").find("tbody").empty();
- $("#tb_fee_info").find("tbody").append(trHtml);
- }
- } else {
- errorMesage(res.message);
- }
- }
- });
- $("#backNoModal").modal();
- }
- /**
- * 打开打印内容窗口
- * @param data
- */
- function printModal(data) {
- $("#printOrPreviewModal").modal("hide");
- $("#printModal").modal();
- }
- /**
- * checkBox样式
- */
- function formatCheck() {
- if ($("input.flat")[0]) {
- $(document).ready(function () {
- $('input.flat').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- }
- /**
- * 校验收款金额
- */
- function checkFee() {
- var cash = parseFloat($("#cash").val());
- var realMoney = parseFloat($("#realMoney").val());
- realMoney = realMoney.toFixed(2);
- $("#realMoney").val(realMoney)
- if (cash < realMoney) {
- errorMesageSimaple("收款金额不能少于实收金额!");
- return;
- } else if (cash > realMoney) {
- if ($("#payType").val() == 1) {
- var changeAmount = cash - realMoney;
- $("#changeAmount").val(changeAmount.toFixed(2));
- } else {
- errorMesageSimaple("非现金收款金额不能大于实收金额!");
- return;
- }
- }
- //计算和设置折扣比例
- var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
- var discount = 100;
- if (realMoney < amountMoneyConfirm) {
- discount = realMoney / amountMoneyConfirm * 100;
- }
- $("#discount").text(discount.toFixed(2))
- }
- /**
- * 将病人信息填入患者信息修改form
- * @param patinet
- */
- function fillPlusPatinet(patinet) {
- if (patinet != null) {
- $("#editUserCode").val(patinet.patientId);
- $("#editUserName").val(patinet.name);
- $("#editUserName").blur();
- $("#editUserAge").val(patinet.age);
- $("#editUserAge").blur();
- $("#editUserGender").selectpicker('val', patinet.sex);
- $("#editUserGender").selectpicker('refresh');
- $("#editUserGender").blur();
- $("#editUserBirthDay").val(patinet.birthDayStr);
- $("#editUserBirthDay").blur();
- $('#editUserCertificateType').selectpicker('val', patinet.certificateType);
- $('#editUserCertificateType').selectpicker('refresh');
- $("#editUserCardNo").val(patinet.icCardNo);
- $("#editUserCardNo").attr("title", patinet.icCardNo);
- $("#editUserCardNo").blur();
- $("#editUserPhoneNum").val(patinet.phoneNo);
- $("#editUserPhoneNum").attr("title", patinet.phoneNo);
- $("#editUserPhoneNum").blur();
- $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserPatientsNature").blur();
- $("#editUserIdCard").val(patinet.socialNo);
- $("#editUserIdCard").attr("title", patinet.socialNo);
- $("#editUserIdCard").blur();
- $('#editUserProvinceCode').selectpicker('val', patinet.provinceCode);
- $('#editUserProvinceCode').selectpicker('refresh');
- initCity(2, patinet.cityCode);
- initDistrict(2, patinet.cityCode, patinet.districtCode);
- $("#editUserDetail").val(patinet.detail);
- $("#editUserDetail").blur();
- $("#editUserContact").val(patinet.relName);
- $("#editUserContactPhone").val(patinet.contractName);
- }
- }
- /**
- * 关闭当前这个付款方式
- */
- function closeThisParent(obj) {
- $(obj).parent().parent().remove();
- }
- /**
- * 科室与时间区间下拉选改变时清空输入框内容
- */
- function emptyInput() {
- $('#doctor').empty();
- $('#doctor').selectpicker('refresh');
- $("#registrationFee").val(0.00);
- $("#hospitalFee").val(0.00);
- $("#checkFee").val(0.00);
- $("#amountMoney").text(0.00);
- $("#amountMoneyConfirm").text(0.00);
- $("#realMoney").val(0.00);
- }
- /**
- * 给某些域增加title或者清除title
- * @param obj
- */
- function clearTextOrTitle(obj) {
- if ($(obj).val() == null || $(obj).val().length == 0) {
- $(obj).attr("title", null);
- } else {
- $(obj).attr("title", $(obj).val());
- if ($(obj).attr("id") == "birthDay") {
- $(obj).blur()
- }
- }
- }
- /**
- * 查询默认打印机
- */
- 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.printIndex;
- } else {
- printIndex = -1;
- }
- }
- });
- }
- /**
- * 修改病人信息
- */
- function modifyPatient() {
- $.ajax({
- type: "POST",
- url: '/thmz/modifyPatient',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "name": $("#editUserName").val(),
- "age": $("#editUserAge").val(),
- "sex": $("#editUserGender").val(),
- "birthDay": $("#editUserBirthDay").val(),
- "certificateType": $("#editUserCertificateType").val(),
- "icCardNo": $("#editUserCardNo").val(),
- "phoneNo": $("#editUserPhoneNum").val(),
- "responseType": $("#editUserPatientsNature").val(),
- "socialNo": $("#editUserIdCard").val(),
- "provinceCode": $("#editUserProvinceCode").val(),
- "cityCode": $("#editCityCode").val(),
- "districtCode": $("#editUserDistrictCode").val(),
- "detail": $("#editUserDetail").val(),
- "patientId": $("#editUserCode").val(),
- "relName": $("#editUserContact").val(),
- "contractName": $("#editUserContactPhone").val()
- }),
- 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) {
- $('#editUserModal').modal('hide');
- //fillPatinet($("#patientId").val());
- clearPlusPatinet();
- } else {
- errorMesage(res.message);
- }
- }
- });
- }
- /**
- * 将病人信息修改域置空
- * @param patinet
- */
- function clearPlusPatinet() {
- $("#editUserCode").val(null);
- $("#editUserName").val(null);
- $("#editUserAge").val(null);
- $("#editUserGender").selectpicker('val', '1');
- $("#editUserGender").selectpicker('refresh');
- $("#editUserBirthDay").val(null);
- $('#editUserCertificateType').selectpicker('val', '01');
- $('#editUserCertificateType').selectpicker('refresh');
- $("#editUserCardNo").val(null);
- $("#editUserCardNo").attr("title", null);
- $("#editUserPhoneNum").val(null);
- $("#editUserPhoneNum").attr("title", null);
- $("#editUserPatientsNature").selectpicker('val', '01');//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserIdCard").val(null);
- $("#editUserIdCard").attr("title", null);
- $('#editUserProvinceCode').selectpicker('val', null);
- $('#editUserProvinceCode').selectpicker('refresh');
- $('#editCityCode').selectpicker('val', null);
- $('#editCityCode').selectpicker('refresh');
- $('#editUserDistrictCode').selectpicker('val', null);
- $('#editUserDistrictCode').selectpicker('refresh');
- $("#editUserDetail").val(null);
- $("#editUserContact").val(null);
- $("#editUserContactPhone").val(null);
- }
- /**
- * 挂号列表中的科室和医生列表初始化
- */
- function initListSelect() {
- initListDeptSelect();
- initListDoctorSelect();
- }
- /**
- * 挂号列表中的科室列表
- */
- function initListDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allMzUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#deptNoParam').empty();
- $('#deptNoParam').html(html);
- $('#deptNoParam').selectpicker('refresh');
- }
- });
- }
- /**
- * 挂号列表中的医生列表初始化
- */
- function initListDoctorSelect() {
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').val(),
- 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;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
- });
- $('#doctorParam').empty();
- $('#doctorParam').html(html);
- // $("#doctorParam").selectpicker({
- // size: 10
- // });
- $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 加载挂号列表统计数据
- */
- function loadTableCount() {
- var rePortRangeArr = getRePortRangeArr();
- $.ajax({
- type: "POST",
- url: '/thmz/getCountByParams',
- dataType: "json",
- contentType: "application/json;charset=UTF-8",
- data: JSON.stringify({
- "mzyReqrec": {
- "unitCode": $("#deptNoParam").val(),
- "doctorCode": $("#doctorParam").val(),
- "name": $("#userNameParam").val(),
- "serialNo": $("#serialNoParams").val()
- },
- "beginTime": new Date(rePortRangeArr[0]),
- "endTime": new Date(rePortRangeArr[1]),
- "phoneNo": $("#phoneParam").val()
- }),
- 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) {
- $("#unPayNum").text(res.unPayNum);
- $("#registrationNum").text(res.registrationNum);
- $("#haveClinicalNum").text(res.haveClinicalNum);
- $("#backNoNum").text(res.backNoNum);
- }
- }
- });
- }
- /**
- * 加载挂号列表
- * @param flag 是否清空挂号卡片列表区域
- */
- function loadRegistrationList(flag) {
- if (flag) {
- pageIndex = 0;
- $("#card_regi_list").empty();
- $("div.page").removeClass("in").addClass("hide");
- }
- var regiListType = getIndex("regi_List_type");
- if (regiListType == 0) {
- loadCardList();
- } else if (regiListType == 1) {
- loadTableList();
- }
- }
- /**
- * 加载卡片列表
- */
- function loadCardList() {
- $('#tb_regi_list').bootstrapTable("destroy");
- isTableListInit = false;
- var rePortRangeArr = getRePortRangeArr();
- var regiListBtnGroup = getIndex("regi_List_btn_group");
- var dataParams = JSON.stringify({
- "mzyReqrec": {
- "unitCode": $("#deptNoParam").val(),
- "doctorCode": $("#doctorParam").val(),
- "name": $("#userNameParam").val(),
- "serialNo": $("#serialNoParams").val()
- },
- "beginTime": new Date(rePortRangeArr[0]),
- "endTime": new Date(rePortRangeArr[1]),
- "pageSize": 8,
- "pageIndex": pageIndex,
- "phoneNo": $("#phoneParam").val(),
- "payMark": "-1"
- });
- if (regiListBtnGroup == 1) {
- dataParams = JSON.stringify({
- "mzyReqrec": {
- "unitCode": $("#deptNoParam").val(),
- "doctorCode": $("#doctorParam").val(),
- "name": $("#userNameParam").val(),
- "serialNo": $("#serialNoParams").val(),
- "visitedMark": 0,
- "cancelMark": 0
- },
- "beginTime": new Date(rePortRangeArr[0]),
- "endTime": new Date(rePortRangeArr[1]),
- "pageSize": 8,
- "pageIndex": pageIndex,
- "phoneNo": $("#phoneParam").val(),
- "payMark": "5"
- });
- } else if (regiListBtnGroup == 2) {
- dataParams = JSON.stringify({
- "mzyReqrec": {
- "unitCode": $("#deptNoParam").val(),
- "doctorCode": $("#doctorParam").val(),
- "name": $("#userNameParam").val(),
- "serialNo": $("#serialNoParams").val(),
- "visitedMark": 0,
- "cancelMark": 0
- },
- "beginTime": new Date(rePortRangeArr[0]),
- "endTime": new Date(rePortRangeArr[1]),
- "pageSize": 8,
- "pageIndex": pageIndex,
- "phoneNo": $("#phoneParam").val()
- });
- } else if (regiListBtnGroup == 3) {
- dataParams = JSON.stringify({
- "mzyReqrec": {
- "unitCode": $("#deptNoParam").val(),
- "doctorCode": $("#doctorParam").val(),
- "name": $("#userNameParam").val(),
- "serialNo": $("#serialNoParams").val(),
- "visitedMark": 1,
- "cancelMark": 0
- },
- "beginTime": new Date(rePortRangeArr[0]),
- "endTime": new Date(rePortRangeArr[1]),
- "pageSize": 8,
- "pageIndex": pageIndex,
- "phoneNo": $("#phoneParam").val()
- });
- } else if (regiListBtnGroup == 4) {
- dataParams = JSON.stringify({
- "mzyReqrec": {
- "unitCode": $("#deptNoParam").val(),
- "doctorCode": $("#doctorParam").val(),
- "name": $("#userNameParam").val(),
- "serialNo": $("#serialNoParams").val(),
- "cancelMark": 1
- },
- "beginTime": new Date(rePortRangeArr[0]),
- "endTime": new Date(rePortRangeArr[1]),
- "pageSize": 8,
- "pageIndex": pageIndex,
- "phoneNo": $("#phoneParam").val()
- });
- }
- var buttonCodes = localStorage.getItem("buttonCodes");
- $.ajax({
- type: "POST",
- url: '/thmz/listMzyReqrec',
- dataType: "json",
- contentType: "application/json;charset=UTF-8",
- data: dataParams,
- 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) {
- pageIndex++;
- $("#totalNum").text(res.pageViewVo.remainder);
- if (res.pageViewVo.remainder <= 0) {
- $("div.page").removeClass("in").addClass("hide");
- } else {
- $("div.page").removeClass("hide").addClass("in");
- }
- var data = res.pageViewVo.data;
- for (var i = 0; i < data.length; i++) {
- var mzyReqrecVo = data[i];
- var color = "registration-not-pay-no-color";
- var text = '未缴费</label>/<label>挂号</label>';
- if (mzyReqrecVo.mzyReqrec.paymode != null && mzyReqrecVo.mzyReqrec.paymode != "") {
- text = '挂号</label>/<label>挂号</label>';
- color = "registration-no-color";
- if (mzyReqrecVo.mzyReqrec.cancelMark == 0) {
- if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
- text = '已诊</label>/<label>挂号</label>';
- color = "haveClinical-no-color";
- }
- } else if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
- text = '退号</label>/<label>挂号</label>';
- color = "back-no-color";
- }
- }
- var sex = "未知";
- var html = '<div class="col-md-3 col-sm-3 col-xs-12 cardList"><div class="card__body"><div class="patient-card-main ' + color + '"><div class="patient-card-main-left"><div class="img-row">';
- if (mzyReqrecVo.mzPatientMi.sex == 0) {
- html += '<img src="/thmz/images/girl_or_boy.png"/>';
- } else if (mzyReqrecVo.mzPatientMi.sex == 1) {
- sex = "男";
- html += '<img src="/thmz/images/boy.png"/>';
- } else if (mzyReqrecVo.mzPatientMi.sex == 2) {
- sex = "女";
- html += '<img src="/thmz/images/girl.png"/>';
- }
- html += '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.name + '">' + mzyReqrecVo.mzyReqrec.name + '</div>';
- if (mzyReqrecVo.mzPatientMi.responseType.length > 2) {
- html += '<div class="el-row" style="font-size: 1px;height: 25%;">';
- } else {
- html += '<div class="el-row" style="font-size: 1px;">';
- }
- html += mzyReqrecVo.mzPatientMi.responseType + '</div></div><div class="patient-card-main-right"><div></div> <div class="el-row"><label>';
- html += text;
- html += '</div><div class="el-row" title="' + mzyReqrecVo.mzPatientMi.phoneNo + '">' + sex + ' / ' + mzyReqrecVo.mzPatientMi.ageString + ' / ' + mzyReqrecVo.mzPatientMi.phoneNo + '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.ampm + '">' + mzyReqrecVo.mzyReqrec.ampm + ' / ' + mzyReqrecVo.mzyReqrec.chargeType + '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.chargeType + '">' + mzyReqrecVo.mzyReqrec.unitCode + ' / ' + mzyReqrecVo.mzyReqrec.doctorCode + '</div><div class="el-row">' + format(mzyReqrecVo.mzyReqrec.requestDay, "yyyy-MM-dd HH:mm:ss") + '</div></div></div>';
- if (mzyReqrecVo.mzyReqrec.paymode == null || mzyReqrecVo.mzyReqrec.paymode == "") {
- html += '<div class="patient-card-foot">' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="修改挂号">' +
- ' <i class="fa fa-edit"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
- ' <i class="fa fa-user"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="收费" onclick="chargeRegistration(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
- ' <i class="fa fa-rmb"></i>' +
- ' </button>' +
- ' </div>';
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="取消接诊">' +
- ' <i class="fa fa-mail-reply"></i>' +
- ' </button>' +
- ' </div>';
- }
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="退号">' +
- ' <i class="fa fa-minus-square-o"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="打印">' +
- ' <i class="fa fa-print"></i>' +
- ' </button>' +
- ' </div>' +
- ' </div>';
- } else {
- if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
- html += '<div class="patient-card-foot">' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="修改挂号">' +
- ' <i class="fa fa-edit"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
- ' <i class="fa fa-user"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="收费">' +
- ' <i class="fa fa-rmb"></i>' +
- ' </button>' +
- ' </div>';
- // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- // ' <button type="button" class="registration-no-color-foot-button"' +
- // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
- // ' <i class="fa fa-credit-card"></i>' +
- // ' </button>' +
- // ' </div>' +
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="取消接诊">' +
- ' <i class="fa fa-mail-reply"></i>' +
- ' </button>' +
- ' </div>';
- }
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="退号">' +
- ' <i class="fa fa-minus-square-o"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="打印">' +
- ' <i class="fa fa-print"></i>' +
- ' </button>' +
- ' </div>' +
- ' </div>';
- }
- if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
- html += '<div class="patient-card-foot">' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="修改挂号">' +
- ' <i class="fa fa-edit"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
- ' <i class="fa fa-user"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="收费">' +
- ' <i class="fa fa-rmb"></i>' +
- ' </button>' +
- ' </div>';
- // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- // ' <button type="button" class="registration-no-color-foot-button"' +
- // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
- // ' <i class="fa fa-credit-card"></i>' +
- // ' </button>' +
- // ' </div>' +
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="取消接诊" onclick="cancelClinic(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
- ' <i class="fa fa-mail-reply"></i>' +
- ' </button>' +
- ' </div>';
- }
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="退号">' +
- ' <i class="fa fa-minus-square-o"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">';
- if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
- html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
- html += ' <i class="fa fa-rmb"></i>';
- } else {
- var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
- if (printFlag) {
- 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="打印">';
- }
- html += ' <i class="fa fa-print"></i>';
- }
- html += ' </button>' +
- ' </div>' +
- ' </div>';
- } else {
- html += '<div class="patient-card-foot">' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="修改挂号">' +
- ' <i class="fa fa-edit"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
- ' <i class="fa fa-user"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="收费">' +
- ' <i class="fa fa-rmb"></i>' +
- ' </button>' +
- ' </div>';
- // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- // ' <button type="button" class="registration-no-color-foot-button"' +
- // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
- // ' <i class="fa fa-credit-card"></i>' +
- // ' </button>' +
- // ' </div>' +
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="can-not-used"' +
- ' title="取消接诊">' +
- ' <i class="fa fa-mail-reply"></i>' +
- ' </button>' +
- ' </div>';
- }
- html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
- ' <button type="button" class="registration-no-color-foot-button"' +
- ' title="退号" onclick="backNoModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
- ' <i class="fa fa-minus-square-o"></i>' +
- ' </button>' +
- ' </div>' +
- ' <div class="col-md-2 col-sm-2 col-xs-12">';
- if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
- html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
- html += ' <i class="fa fa-rmb"></i>';
- } else {
- var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
- if (printFlag) {
- 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="打印">';
- }
- html += ' <i class="fa fa-print"></i>';
- }
- html += ' </button>' +
- ' </div>' +
- ' </div>';
- }
- }
- html += '</div></div>';
- $("#card_regi_list").append(html);
- }
- }
- }
- });
- }
- /**
- * 加载表格列表
- */
- function loadTableList() {
- var buttonCodes = localStorage.getItem("buttonCodes");
- if (isTableListInit) {
- $('#tb_regi_list').bootstrapTable('refresh');
- } else {
- isTableListInit = true;
- $('#tb_regi_list').bootstrapTable({
- url: '/thmz/listMzyReqrec', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'mzyReqrec.patientId',
- title: '病人ID',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzyReqrec.times',
- title: '就诊次数',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzyReqrec.name',
- title: '病人姓名',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzPatientMi.responseType',
- title: '病人性质',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzPatientMi.sex',
- title: '性别',
- align: "center",
- valign: 'middle',
- //sortable: true,
- formatter: function (value, row, index) {
- if (value == '1') {
- return "男";
- } else if (value == '2') {
- return "女";
- } else if (value == '0') {
- return "未知";
- }
- }
- },
- // {
- // field: 'mzPatientMi.age',
- // title: '年龄',
- // align: "center",
- // valign: 'middle',
- // // sortable: true
- // }, {
- // field: 'mzPatientMi.phoneNo',
- // title: '电话',
- // align: "center",
- // valign: 'middle',
- // // sortable: true,
- // },
- {
- field: 'mzyReqrec.cancelMark',
- title: '就诊状态',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- var text = '<span style="color:#769F0E">挂号未缴费</span>';
- if (row.mzyReqrec.paymode != null && row.mzyReqrec.paymode != "") {
- text = '<span style="color:#26c175">挂号</span>';
- if (value == 0) {
- if (row.mzyReqrec.visitedMark == 1) {
- text = '<span style="color:#6778ed">已诊</span>';
- }
- } else if (value == 1) {
- text = '<span style="color:#ff6b91">退号</span>';
- }
- }
- return text;
- }
- }, {
- field: 'mzyReqrec.requestDayStr',
- title: '号源日期',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- return format(value, "yyyy-MM-dd");
- }
- }, {
- field: 'mzyReqrec.ampm',
- title: '号段',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzyReqrec.unitCode',
- title: '挂号科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzyReqrec.chargeType',
- title: '号别',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzyReqrec.doctorCode',
- title: '挂号医生',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'mzyReqrec.opDay',
- title: '挂号时间',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- return format(value, "yyyy-MM-dd HH:mm:ss");
- }
- }, {
- field: 'mzyReqrec.opId',
- title: '挂号渠道',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- if (value == '99999') {
- return '公众号';
- }
- if (value == '99996') {
- return '互联网医院平台';
- }
- return '院内窗口';
- }
- }, {
- field: 'mzyReqrec.paymode',
- title: '支付方式',
- align: "center",
- valign: 'middle'
- // sortable: true,
- }, {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.mzyReqrec.paymode == null || row.mzyReqrec.paymode == "") {
- var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
- html += '<button type="button" class="registration-no-color-foot-button" title="收费" onclick="chargeRegistration(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-rmb"></i></button>';
- // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></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>';
- return html;
- }
- if (row.mzyReqrec.cancelMark == 1) {
- var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
- html += '<button type="button" class="can-not-used" title="收费" ><i class="fa fa-rmb"></i></button>';
- // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></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>';
- return html;
- }
- if (row.mzyReqrec.visitedMark == 1) {
- var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
- html += '<button type="button" class="can-not-used" title="收费"><i class="fa fa-rmb"></i></button>';
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- 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>';
- }
- // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\',\''+row.mzyReqrec.times+','+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
- html += '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button>';
- if (row.mzyReqrec.paymode == "本院记账") {
- html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
- html += '<i class="fa fa-rmb"></i></button>';
- } else {
- var printFlag = isEmpty(row.mzyReqrec.printerId);
- if (printFlag) {
- 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>';
- }
- // 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;
- }
- var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button>';
- html += '<button type="button" class="can-not-used" title="收费" ><i class="fa fa-rmb"></i></button>';
- // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
- if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
- html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
- }
- html += '<button type="button" class="registration-no-color-foot-button" title="退号" onclick="backNoModal(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-minus-square-o"></i></button>';
- if (row.mzyReqrec.paymode == "本院记账") {
- html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
- html += '<i class="fa fa-rmb"></i></button>';
- } else {
- var printFlag = isEmpty(row.mzyReqrec.printerId);
- if (printFlag) {
- 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>';
- }
- //html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
- return html;
- }
- }],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.pageViewVo.total,//总页数
- "rows": ress.pageViewVo.data //数据
- };
- },
- });
- }
- }
- /**
- * 得到查询的参数
- * @param params
- * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParams(params) {
- var rePortRangeArr = getRePortRangeArr();
- var regiListBtnGroup = getIndex("regi_List_btn_group");
- var temp = {
- mzyReqrec: {
- unitCode: $("#deptNoParam").val(),
- doctorCode: $("#doctorParam").val(),
- name: $("#userNameParam").val(),
- serialNo: $("#serialNoParams").val()
- },
- beginTime: new Date(rePortRangeArr[0]),
- endTime: new Date(rePortRangeArr[1]),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- phoneNo: $("#phoneParam").val(),
- payMark: -1
- };
- if (regiListBtnGroup == 1) {
- temp = {
- mzyReqrec: {
- unitCode: $("#deptNoParam").val(),
- doctorCode: $("#doctorParam").val(),
- name: $("#userNameParam").val(),
- serialNo: $("#serialNoParams").val(),
- visitedMark: 0,
- cancelMark: 0
- },
- beginTime: new Date(rePortRangeArr[0]),
- endTime: new Date(rePortRangeArr[1]),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- payMark: 5
- };
- } else if (regiListBtnGroup == 2) {
- temp = {
- mzyReqrec: {
- unitCode: $("#deptNoParam").val(),
- doctorCode: $("#doctorParam").val(),
- name: $("#userNameParam").val(),
- serialNo: $("#serialNoParams").val(),
- visitedMark: 0,
- cancelMark: 0
- },
- beginTime: new Date(rePortRangeArr[0]),
- endTime: new Date(rePortRangeArr[1]),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- } else if (regiListBtnGroup == 3) {
- temp = {
- mzyReqrec: {
- unitCode: $("#deptNoParam").val(),
- doctorCode: $("#doctorParam").val(),
- name: $("#userNameParam").val(),
- serialNo: $("#serialNoParams").val(),
- visitedMark: 1,
- cancelMark: 0
- },
- beginTime: new Date(rePortRangeArr[0]),
- endTime: new Date(rePortRangeArr[1]),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- } else if (regiListBtnGroup == 4) {
- temp = {
- mzyReqrec: {
- unitCode: $("#deptNoParam").val(),
- doctorCode: $("#doctorParam").val(),
- name: $("#userNameParam").val(),
- serialNo: $("#serialNoParams").val(),
- cancelMark: 1
- },
- beginTime: new Date(rePortRangeArr[0]),
- endTime: new Date(rePortRangeArr[1]),
- pageSize: params.limit, //页面大小
- pageIndex: params.offset / params.limit, //页码
- };
- }
- return temp;
- };
- /**
- * 根据是挂号还是已诊或是退号 设置行的颜色
- * @param row
- * @param index
- * @returns {*}
- */
- function rowStyle(row, index) {
- var style = {css: {'background': 'linear-gradient(130deg, #06c7d6, #26c175) !important;'}};
- if (row.mzyReqrec.cancelMark == 0) {
- if (row.mzyReqrec.visitedMark == 1) {
- style = {css: {'background': 'linear-gradient(130deg, #41a6f5, #6778ed) !important;'}};
- }
- } else if (row.mzyReqrec.cancelMark == 1) {
- style = {css: {'background': 'linear-gradient(130deg, #ff9e70, #ff6b91) !important;'}};
- }
- return style;
- }
- /**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
- function getIndex(id) {
- var index = 0;
- var item = $("#" + id).find("button");
- for (var i = 0; i <= item.length; i++) {
- if ($(item[i]).hasClass("btn-primary")) {
- index = i;
- break;
- }
- }
- return index;
- }
- /**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
- function getRePortRangeArr() {
- var rePortRange = $('#reportrange span').html();
- var rePortRangeArr = rePortRange.split(" - ");
- rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
- rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
- return rePortRangeArr;
- }
- /**
- * 清空搜索参数
- */
- function clearParams() {
- $("#deptNoParam").selectpicker('val', null);
- $("#deptNoParam").selectpicker('refresh');
- $("#doctorParam").selectpicker('val', null);
- $("#deptNoParam").selectpicker('refresh');
- $("#userNameParam").val(null);
- $("#phoneParam").val(null);
- $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
- }
- /**
- * 保存退号信息
- */
- function saveBackNo() {
- $.ajax({
- type: "POST",
- url: '/thmz/updateReqrec',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": $("#backNoPatientId").val(),
- "times": $("#backNoTimes").val(),
- "cancelMark": 1
- }),
- 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) {
- new PNotify({
- title: '操作提示',
- text: res.message,
- type: 'success',
- hide: true,
- styling: 'bootstrap3'
- });
- loadTableCount();
- loadRegistrationList(true);
- $("#backNoModal").modal("hide");
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 打开退费重收确认弹框
- * @param serialNo
- */
- function chargeFeeForByjz(serialNo) {
- $("#serialNo").val(serialNo);
- $("#confirmFeeModal").modal();
- }
- /**
- * 直接打印发票
- * @param patientId
- */
- 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,
- 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) {
- if (res.data == null || res.data.length == 0) {
- return;
- }
- // countReceiot++;
- LODOP = getLodop();
- var temp = res.data;
- LODOP.PRINT_INITA(6, 0, "120mm", height, "泰和门诊发票打印");
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "120mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
- LODOP.SET_PRINT_PAGESIZE(1, "120mm", height, "CreateCustomPage");
- 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.reqOrder);
- LODOP.ADD_PRINT_TEXT("47mm", "6mm", "50mm", "3mm", "挂号费:" + temp.reqFee);
- LODOP.ADD_PRINT_TEXT("47mm", "56mm", "50mm", "3mm", "诊查费:" + temp.clinicFee);
- LODOP.ADD_PRINT_TEXT("52mm", "6mm", "50mm", "3mm", "其他:" + temp.othFee);
- LODOP.ADD_PRINT_TEXT("52mm", "56mm", "50mm", "3mm", "工本费:" + temp.brochureFee);
- 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 (times > 0) {
- loadTableCount();
- loadRegistrationList(true);
- }
- } else if (res.code == -1) {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- };
- /**
- * 取消接诊
- * @param patientId
- */
- function cancelClinic(patientId, times) {
- $("#messageModal").modal();
- $("#messageContent").html("确认取消当前病人的接诊记录吗?");
- $("#messageButton").off("click").on("click", function (t) {
- $("#messageModal").modal("hide");
- $.ajax({
- type: "GET",
- url: '/thmz/cancelClinic?patientId=' + patientId + "×=" + times,
- 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 == null || res.data.length == 0) {
- return;
- }
- successMesage(res);
- if (times > 0) {
- loadTableCount();
- loadRegistrationList(true);
- }
- } else if (res.code == -1) {
- errorMesage(res);
- }
- }
- });
- });
- };
- //判断字符是否为空的方法
- function isEmpty(obj) {
- if (typeof obj == "undefined" || obj == null || obj == "") {
- return true;
- } else {
- return false;
- }
- }
- /**
- * 导出excel
- */
- function exportExcel() {
- var rePortRangeArr = getRePortRangeArr();
- var regiListBtnGroup = getIndex("regi_List_btn_group");
- var visitedMark = "";
- var cancelMark = "";
- if (regiListBtnGroup == 1) {
- visitedMark = 0;
- cancelMark = 0;
- } else if (regiListBtnGroup == 2) {
- visitedMark = 1;
- cancelMark = 0;
- } else if (regiListBtnGroup == 3) {
- cancelMark = 1;
- }
- window.location.href = "/thmz/exportListMzyReqrec?beginTime=" + rePortRangeArr[0] + "&endTime=" + rePortRangeArr[1] + "&name=" + $("#userNameParam").val()
- + "&unitCode=" + $("#deptNoParam").val() + "&doctorCode=" + $("#doctorParam").val() + "&phoneNo=" + $("#phoneParam").val() + "&serialNo=" + $("#serialNoParams").val() + "&visitedMark="
- + visitedMark + "&cancelMark=" + cancelMark;
- }
- /**
- * 修改收款方式
- * @param patientId
- * @param times
- * @param paymode
- */
- function editPayMode(patientId, times, paymode, dcountNo) {
- var message = "当前病人本次挂号的收费方式为【" + paymode + "】,确定需要修改吗?";
- if (dcountNo == 1) {
- message = "当前病人本次挂号的收费方式为【" + paymode + "】,且本次挂号已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次挂号所在日期的【日结报表】!";
- }
- $("#editPayModeTip").html(message);
- $("#patientId").val(patientId);
- $("#times").val(times);
- $('#payTypeEditPayMode').selectpicker('val', 1);
- $('#payTypeEditPayMode').selectpicker('refresh');
- $("#editPayModeModal").modal();
- }
- /**
- * 提交修改收款方式
- */
- function saveEditPayMode() {
- $.ajax({
- type: "GET",
- url: '/thmz/updatePayMode?patientId=' + $("#patientId").val() + "×=" + $("#times").val() + "&payMode=" + $("#payTypeEditPayMode").val(),
- 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) {
- successMesage(res);
- clearEditPayMode();
- $("#editPayModeModal").modal("hide");
- loadRegistrationList(true);
- } else if (res.code == -1) {
- errorMesage(res.message);
- }
- }
- });
- }
- /**
- * 清空
- */
- function clearEditPayMode() {
- $("#patientId").val(null);
- $("#times").val(null);
- }
- /**
- * 未支付的挂号记录缴费
- * @param patientId
- * @param times
- */
- function chargeRegistration(patientId, times) {
- clearRegistrationModal();
- $.ajax({
- type: "POST",
- url: '/thmz/getMzyReqrecByPatientIdAndTimes',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"patientId": patientId, "times": times}),
- 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 != null) {
- $("#patientIdRegistration").val(patientId);
- $("#timesRegistration").val(times);
- $("#realMoney").val(res.totalAmount);
- $("#cash").val(res.totalAmount);
- $("#amountMoneyConfirm").text(res.totalAmount);
- $("#chargeRegistrationModal").modal();
- }
- } else {
- errorMesage(res.message);
- }
- }
- });
- }
- /**
- * 支付未缴费的挂号信息
- */
- function payRegistration() {
- $("#chargeRegistrationModal").modal('hide');
- $("#messageModal").modal();
- $("#messageContent").html("确定提交本次预约挂号缴费操作吗?");
- $("#messageButton").off("click").bind("click", function (t) {
- $("#messageModal").modal('hide');
- $.ajax({
- type: "POST",
- url: '/thmz/payRegistration',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": $("#patientIdRegistration").val(),
- "times": $("#timesRegistration").val(),
- "paymode": $("#payType").val(),
- "amount": $("#cash").val()
- }),
- 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) {
- successMesage(res);
- $("#chargeRegistrationModal").modal('hide');
- clearRegistrationModal();
- loadTableCount();
- loadRegistrationList(true);
- } else {
- errorMesage(res.message);
- }
- }
- });
- });
- $("#cancelButton").off("click").bind("click", function (t) {
- $("#messageModal").modal('hide');
- $("#chargeRegistrationModal").modal();
- });
- }
- /**
- * 清空缴费区域
- */
- function clearRegistrationModal() {
- $("#patientIdRegistration").val(null);
- $("#timesRegistration").val(null);
- $("#realMoney").val(null);
- $("#cash").val(null);
- $("#amountMoneyConfirm").text("");
- }
|