registration_list.js 98 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365
  1. //@ sourceURL=registration_list.js
  2. var $dataTableHot;
  3. //病人下拉选当前页记录
  4. var pageIndex = 0;
  5. //判断病人列表是否在加载中,防止重复加载
  6. var msg_list_loading = false;
  7. //挂号卡片列表页面下标
  8. var pageIndex = 0;
  9. //判断表格列表是否已经初始化
  10. var isTableListInit = false;
  11. var LODOP; //声明为全局变量pageIndex
  12. //默认打印机下标
  13. var printIndex = -1;
  14. var TableInit = function () {
  15. var oTableInit = new Object();
  16. //初始化Table
  17. oTableInit.Init = function () {
  18. $dataTableHot = $('#tb_fee_info').bootstrapTable({
  19. url: '', //请求后台的URL(*)
  20. method: 'post', //请求方式(*)
  21. toolbar: '#toolbar', //工具按钮用哪个容器
  22. striped: true, //是否显示行间隔色
  23. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  24. pagination: false, //是否显示分页(*)
  25. sortable: true, //是否启用排序
  26. sortOrder: "asc", //排序方式
  27. //queryParams: oTableInit.queryParams,//传递参数(*)
  28. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  29. pageNumber: 1, //初始化加载第一页,默认第一页
  30. pageSize: 10, //每页的记录行数(*)
  31. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  32. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  33. strictSearch: true,
  34. showColumns: false, //是否显示所有的列
  35. showRefresh: false, //是否显示刷新按钮
  36. minimumCountColumns: 2, //最少允许的列数
  37. clickToSelect: true, //是否启用点击选中行
  38. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  39. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  40. cardView: false, //是否显示详细视图
  41. detailView: false,
  42. ajaxOptions: {
  43. headers: {
  44. 'Accept': 'application/json',
  45. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  46. }
  47. },
  48. columns: [
  49. // {
  50. // checkbox: true
  51. // },
  52. {
  53. field: 'name',
  54. title: '名称',
  55. align: "center",
  56. valign: 'middle',
  57. //sortable: true
  58. }, {
  59. field: 'money',
  60. title: '金额(元)',
  61. align: "center",
  62. valign: 'middle',
  63. //sortable: true
  64. }, {
  65. field: 'moneyReceived',
  66. title: '实收金额(元)',
  67. align: "center",
  68. valign: 'middle',
  69. // sortable: true
  70. }],
  71. responseHandler: function (res) {
  72. if (res == '401' || res == 401) {
  73. window.location.href = '/thmz/login/view'
  74. return;
  75. }
  76. var ress = eval(res);
  77. if (ress.code == -1) {
  78. new PNotify({
  79. title: '错误提示',
  80. text: ress.message,
  81. type: 'error',
  82. hide: true,
  83. styling: 'bootstrap3'
  84. });
  85. return {
  86. "total": 0,//总页数
  87. "rows": {} //数据
  88. };
  89. }
  90. return {
  91. "total": ress.pageViewVO.total,//总页数
  92. "rows": ress.pageViewVO.data //数据
  93. };
  94. },
  95. });
  96. };
  97. return oTableInit;
  98. };
  99. $(function () {
  100. initGenderSelect();
  101. initResponceTypeSelect();
  102. //设置挂号窗口的高度
  103. var width = $('#confirmFee').css("width");
  104. var widthNum = parseInt(width);
  105. widthNum -= 24;
  106. $("#confirmFee").css("width", widthNum + "px");
  107. init_daterangepicker();
  108. //1.初始化Table
  109. var oTable = new TableInit();
  110. oTable.Init();
  111. formatCheck();
  112. //默认光标在卡号输入框
  113. $("#cardNo").focus();
  114. //根据病人姓名输入框内容动态加载病人列表
  115. initUserList();
  116. //卡号输入改变事件
  117. cardNoChange();
  118. //卡号输入改变事件
  119. userNameChange();
  120. //数据校验
  121. init_validator();
  122. //时间区间
  123. initMzWorkTime();
  124. //初始门诊收银方式下拉选
  125. initChequeType("payType");
  126. //初始修改收费方式 收银方式下拉选
  127. initChequeType("payTypeEditPayMode");
  128. /**
  129. * 清空
  130. */
  131. $("#clearRegistration").on("click", function (t) {
  132. clearRegistration();
  133. });
  134. /**
  135. * 增加收款方式按钮事件
  136. */
  137. $("#addPayType").on("click", function (t) {
  138. var payTypeIndex = $("#payTypeIndex").val();
  139. var payTypeId = "payType_" + payTypeIndex;
  140. 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>';
  141. $("#changeAmountParent").before(html);
  142. initChequeType(payTypeId)
  143. payTypeIndex = payTypeIndex + 1;
  144. $("#payTypeIndex").val(payTypeIndex);
  145. });
  146. // //当ic卡号输入框失去光标后,重置光标到卡号输入框
  147. // $("#cardNo").blur(function () {
  148. // var focus = !($("#userName").is(":focus") || $("#age").is(":focus") || $("#birthDay").is(":focus") || $("#phoneNum").is(":focus") || $("#idCard").is(":focus") || $("#address").is(":focus"));
  149. // if (focus && $("#cardNo").val() == null || $("#cardNo").val() == "") {
  150. // //默认光标在卡号输入框
  151. // $("#cardNo").focus();
  152. // }
  153. // });
  154. // /**
  155. // * 设置窗口号
  156. // */
  157. // $("#editWindows").on("click", function (t) {
  158. // $.ajax({
  159. // type: "GET",
  160. // url: '/thmz/getLastWindowsByCurrentUser',
  161. // contentType: "application/json;charset=UTF-8",
  162. // dataType: "json",
  163. // headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  164. // success: function (res) {
  165. // if (res == '401' || res == 401) {
  166. // window.location.href = '/thmz/login/view'
  167. // return;
  168. // }
  169. // if (res.code == 0) {
  170. // $("#windowsNum").val(res.data.windowsNo)
  171. // } else {
  172. // new PNotify({
  173. // title: '错误提示',
  174. // text: res.message,
  175. // type: 'error',
  176. // hide: true,
  177. // styling: 'bootstrap3'
  178. // });
  179. // }
  180. // }
  181. // });
  182. // $("#editWindowsModal").modal();
  183. // });
  184. /**
  185. * 退费重收事件
  186. */
  187. $("#saveConfirmFee").on("click", function (t) {
  188. var serialNo = $("#serialNo").val();
  189. if (!confirm("确定要将流水号【" + serialNo + "】的挂号记录退费重收吗?")) {
  190. return;
  191. }
  192. $.ajax({
  193. type: "GET",
  194. url: '/thmz/chargeFeeForByjz?serialNo=' + serialNo + "&paymode=" + $("#payType").val(),
  195. contentType: "application/json;charset=UTF-8",
  196. dataType: "json",
  197. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  198. success: function (res) {
  199. if (res == '401' || res == 401) {
  200. window.location.href = '/thmz/login/view'
  201. return;
  202. }
  203. if (res.code == 0) {
  204. $('#confirmFeeModal').modal('hide');
  205. $("#serialNo").val(null);
  206. prn1Print(res.data.patientId, res.data.times);
  207. } else {
  208. new PNotify({
  209. title: '错误提示',
  210. text: res.message,
  211. type: 'error',
  212. hide: true,
  213. styling: 'bootstrap3'
  214. });
  215. }
  216. }
  217. });
  218. });
  219. /**
  220. * 患者信息修改
  221. */
  222. $("#saveEditUser").on("click", function (t) {
  223. modifyPatient();
  224. });
  225. /**
  226. * 挂号列表中的科室和医生列表初始化
  227. */
  228. initListSelect();
  229. $("#queryListButton").on("click", function (t) {
  230. loadTableCount();
  231. loadRegistrationList(true);
  232. });
  233. loadTableCount();
  234. loadRegistrationList(true);
  235. // $("#editPrint").on("click", function (t) {
  236. // CreatePrinterList();
  237. // $("#editPrintModal").modal();
  238. // });
  239. //初始化页面上面的按钮事件
  240. $("#btn_excel").click(function (t) {
  241. exportExcel();
  242. });
  243. });
  244. // function CreatePageList() {
  245. // LODOP = getLodop();
  246. // LODOP.PRINT_INITA(6, 0, "92mm", "120mm", "泰和门诊发票打印");
  247. // //获取纸张大小数,用于进行遍历
  248. // var strPageSizeList = LODOP.GET_PAGESIZES_LIST($('#printSelect').val(), "\n");
  249. // var html = "";
  250. // var arr = strPageSizeList.split("\n");
  251. // for (var i = 0; i < arr.length; i++) {
  252. // html += "<option value='" + arr[i] + "'>" + arr[i] + "</option>";
  253. // }
  254. // $('#pageSelect').html(html);
  255. // $('#pageSelect').selectpicker('refresh');
  256. // }
  257. /**
  258. * 初始化性别下拉选
  259. */
  260. function initGenderSelect() {
  261. $(".selectpicker").selectpicker({
  262. dropuAuto: false
  263. });
  264. var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
  265. $('#gender').html(gender);
  266. $('#gender').selectpicker('refresh');
  267. $('#editUserGender').html(gender);
  268. $('#editUserGender').selectpicker('refresh');
  269. }
  270. /**
  271. * 初始化病人身份类别下拉选
  272. */
  273. function initResponceTypeSelect() {
  274. $(".selectpicker").selectpicker({
  275. dropuAuto: false
  276. });
  277. $.ajax({
  278. type: "GET",
  279. url: '/thmz/getMzResponceType',
  280. contentType: "application/json;charset=UTF-8",
  281. dataType: "json",
  282. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  283. success: function (res) {
  284. if (res == '401' || res == 401) {
  285. window.location.href = '/thmz/login/view'
  286. return;
  287. }
  288. if (res.code == 0) {
  289. res.data.forEach(function (item, index) {
  290. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  291. $('#patientsNature').append(html);
  292. $('#editUserPatientsNature').append(html);
  293. });
  294. $('#patientsNature').selectpicker('refresh');
  295. $('#editUserPatientsNature').selectpicker('refresh');
  296. } else {
  297. new PNotify({
  298. title: '错误提示',
  299. text: res.message,
  300. type: 'error',
  301. hide: true,
  302. styling: 'bootstrap3'
  303. });
  304. }
  305. }
  306. });
  307. }
  308. /**
  309. * 初始科室下拉选
  310. * @param ampm 时间段区间
  311. */
  312. function initDeptPlus() {
  313. //科室列表
  314. $.ajax({
  315. type: "GET",
  316. url: '/thmz/getUnitCodeByRequestDay?ampm=' + $("#ampm").val(),
  317. dataType: "json",
  318. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  319. success: function (data) {
  320. if (data == '401' || data == 401) {
  321. window.location.href = '/thmz/login/view'
  322. return;
  323. }
  324. var html = '';
  325. $.each(data.data, function (commentIndex, comment) {
  326. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  327. });
  328. $('#deptNo').empty();
  329. $('#deptNo').html(html);
  330. $('#deptNo').selectpicker('refresh');
  331. $('#chargeType').empty();
  332. $('#chargeType').selectpicker('refresh');
  333. emptyInput();
  334. }
  335. });
  336. }
  337. /**
  338. * 初始医生下拉选
  339. * @param ampm 时间段区间
  340. */
  341. function initEmployee() {
  342. //医生列表
  343. $.ajax({
  344. type: "GET",
  345. url: '/thmz/getDoctorCodeByRequestDay?unitCode=' + $('#deptNo').val() + "&ampm=" + $("#ampm").val() + "&chargeType=" + $("#chargeType").val(),
  346. dataType: "json",
  347. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  348. success: function (res) {
  349. if (res == '401' || res == 401) {
  350. window.location.href = '/thmz/login/view'
  351. return;
  352. }
  353. var html = '';
  354. var defaultCode = null;
  355. $.each(res.data, function (commentIndex, comment) {
  356. html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + comment.employee.employeeName + '</option>';
  357. if (res.data.length == 1) {
  358. //如果只有一个号别,默认选中
  359. defaultCode = comment.employee.employeeCode;
  360. }
  361. });
  362. $('#doctor').empty();
  363. $('#doctor').html(html);
  364. $('#doctor').selectpicker('refresh');
  365. validator.checkAll($("#regi_form"));
  366. if (defaultCode != null) {
  367. //如果有无需选择医生的选项,默认选择
  368. $('#doctor').selectpicker('val', defaultCode);
  369. $('#doctor').selectpicker('refresh');
  370. fitFee();
  371. }
  372. }
  373. });
  374. }
  375. /**
  376. * 初始门诊时间区间下拉选
  377. */
  378. function initMzWorkTime() {
  379. $.ajax({
  380. type: "GET",
  381. url: '/thmz/getMzWorkTime',
  382. dataType: "json",
  383. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  384. success: function (res) {
  385. if (res == '401' || res == 401) {
  386. window.location.href = '/thmz/login/view'
  387. return;
  388. }
  389. var html = '';
  390. var ampm = null;
  391. $.each(res.data, function (commentIndex, comment) {
  392. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  393. if (ampm == null || (ampm != "a" && ampm != "p")) {
  394. var startTime = paseToFullTime(comment.startTime);
  395. var endTime = paseToFullTime(comment.endTime);
  396. if (range(startTime, endTime)) {
  397. ampm = comment.code;
  398. }
  399. }
  400. });
  401. $('#ampm').empty(); //清空resText里面的所有内容
  402. $('#ampm').html(html);
  403. $('#ampm').selectpicker('refresh');
  404. $("#ampm").selectpicker('val', ampm);
  405. $('#ampm').selectpicker('refresh');
  406. initDeptPlus();
  407. }
  408. });
  409. }
  410. /**
  411. * 初始门诊号别下拉选
  412. */
  413. function initChargeType() {
  414. $.ajax({
  415. type: "GET",
  416. url: '/thmz/getChargeTypeByRequestDay?unitCode=' + $('#deptNo').val() + "&ampm=" + $("#ampm").val(),
  417. dataType: "json",
  418. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  419. success: function (res) {
  420. if (res == '401' || res == 401) {
  421. window.location.href = '/thmz/login/view'
  422. return;
  423. }
  424. var html = '';
  425. var defaultCode = null;
  426. $.each(res.data, function (commentIndex, comment) {
  427. if (res.data.length == 1) {
  428. //如果只有一个号别,默认选中
  429. defaultCode = comment.code;
  430. }
  431. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  432. });
  433. $('#chargeType').empty(); //清空resText里面的所有内容
  434. $('#chargeType').html(html);
  435. $('#chargeType').selectpicker('refresh');
  436. if (defaultCode != null) {
  437. //如果有默认选项,默认选择
  438. $('#chargeType').selectpicker('val', defaultCode);
  439. $('#chargeType').selectpicker('refresh');
  440. initEmployee();
  441. }
  442. validator.checkAll($("#regi_form"));
  443. emptyInput();
  444. }
  445. });
  446. }
  447. /**
  448. * 设置挂号费等费用
  449. */
  450. function fitFee() {
  451. var chargeType = $('#doctor').find("option:selected").attr('data-chargeType');
  452. var checkFee = $('#doctor').find("option:selected").attr('data-checkFee');
  453. $("#checkFee").val(checkFee);
  454. $("#amountMoney").text(checkFee);
  455. $("#amountMoneyConfirm").text(checkFee);
  456. $("#realMoney").val(checkFee);
  457. $("#cash").val(checkFee);
  458. $("#changeAmount").val(0);
  459. $.ajax({
  460. type: "GET",
  461. url: '/thmz/getMzChargeTypeByCode?code=' + chargeType,
  462. dataType: "json",
  463. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  464. success: function (res) {
  465. if (res == '401' || res == 401) {
  466. window.location.href = '/thmz/login/view'
  467. return;
  468. }
  469. $("#registrationFee").val(res.data.reqFee);
  470. $("#hospitalFee").val(res.data.clinicFee);
  471. checkFee = parseFloat(checkFee) + parseFloat(res.data.reqFee) + parseFloat(res.data.clinicFee);
  472. $("#amountMoney").text(checkFee);
  473. $("#amountMoneyConfirm").text(checkFee);
  474. $("#realMoney").val(checkFee);
  475. $("#cash").val(checkFee);
  476. validator.checkAll($("#regi_form"));
  477. }
  478. });
  479. }
  480. /**
  481. * 初始门诊收银方式下拉选
  482. */
  483. function initChequeType(payType) {
  484. $.ajax({
  485. type: "GET",
  486. url: '/thmz/getAllZdChequeTypeForMz',
  487. dataType: "json",
  488. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  489. success: function (res) {
  490. if (res == '401' || res == 401) {
  491. window.location.href = '/thmz/login/view'
  492. return;
  493. }
  494. var html = '';
  495. $.each(res.data, function (commentIndex, comment) {
  496. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  497. });
  498. $('#' + payType).empty();
  499. $('#' + payType).html(html);
  500. $('#' + payType).selectpicker('refresh');
  501. }
  502. });
  503. }
  504. /**
  505. * 日期值改变修改年龄字段
  506. * @param ev
  507. */
  508. function changeDate(ev) {
  509. }
  510. /**
  511. * 列表类型按钮切换事件
  512. * @param object
  513. */
  514. function titleButtonChange(object) {
  515. $("#regi_List_btn_group").find("button").each(function (index, element) {
  516. if ($(element).hasClass("btn-primary")) {
  517. $(element).removeClass("btn-primary").addClass("btn-default");
  518. }
  519. });
  520. $(object).removeClass("btn-default").addClass("btn-primary");
  521. loadRegistrationList(true);
  522. }
  523. /**
  524. * 表格类型切换事件 卡片展示或者列表形式
  525. */
  526. function listTypeChange(object) {
  527. //var indexNum = 0;
  528. $("#regi_List_type").find("button").each(function (index, element) {
  529. if ($(element).hasClass("btn-primary")) {
  530. $(element).removeClass("btn-primary").addClass("btn-default");
  531. }
  532. // if (object == element) {
  533. // indexNum = index;
  534. // }
  535. });
  536. $(object).removeClass("btn-default").addClass("btn-primary");
  537. loadRegistrationList(true);
  538. }
  539. /**
  540. * 打开编辑用户信息窗口
  541. * @param data
  542. */
  543. function editUserModal(data) {
  544. $("#editUserModal").modal();
  545. if (data == null) {
  546. data = $("#patientId").val();
  547. }
  548. $.ajax({
  549. type: "GET",
  550. url: '/thmz/getByPatientId?patientId=' + data,
  551. contentType: "application/json;charset=UTF-8",
  552. dataType: "json",
  553. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  554. success: function (res) {
  555. if (res == '401' || res == 401) {
  556. window.location.href = '/thmz/login/view'
  557. return;
  558. }
  559. if (res.code == 0) {
  560. if (res.data != null) {
  561. //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
  562. setTimeout(function () {
  563. fillPlusPatinet(res.data);
  564. }, 400);
  565. }
  566. } else {
  567. new PNotify({
  568. title: '错误提示',
  569. text: res.message,
  570. type: 'error',
  571. hide: true,
  572. styling: 'bootstrap3'
  573. });
  574. }
  575. }
  576. });
  577. }
  578. /**
  579. * 打开退费信息窗口
  580. * @param patientId
  581. * @param times
  582. */
  583. function backNoModal(patientId, times) {
  584. $.ajax({
  585. type: "POST",
  586. url: '/thmz/getMzyReqrecByPatientIdAndTimes',
  587. contentType: "application/json;charset=UTF-8",
  588. dataType: "json",
  589. data: JSON.stringify({"patientId": patientId, "times": times}),
  590. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  591. success: function (res) {
  592. if (res == '401' || res == 401) {
  593. window.location.href = '/thmz/login/view'
  594. return;
  595. }
  596. if (res.code == 0) {
  597. if (res.data != null) {
  598. $("#backNoPatientId").val(patientId);
  599. $("#backNoTimes").val(times);
  600. $("#backNoSickName").text(res.data.mzyReqrec.name);
  601. $("#backNoPayType").text(res.data.mzyReqrec.paymode);
  602. $("#backNoPhone").text(res.data.mzPatientMi.phoneNo);
  603. $("#backNoAmpm").text(res.data.mzyReqrec.ampm);
  604. $("#backNoDeptName").text(res.data.mzyReqrec.unitCode);
  605. $("#backNoChargeType").text(res.data.mzyReqrec.chargeType);
  606. $("#backNoDoctorName").text(res.data.mzyReqrec.doctorCode);
  607. $("#backNoRegiDate").text(format(res.data.mzyReqrec.requestDay, "yyyy-MM-dd HH:mm:ss"));
  608. var index = 0;
  609. var trHtml = '';
  610. if (res.data.mzyReqrec.reqFee != null && res.data.mzyReqrec.reqFee != "" && res.data.mzyReqrec.reqFee > 0) {
  611. 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>';
  612. index++;
  613. }
  614. if (res.data.mzyReqrec.clinicFee != null && res.data.mzyReqrec.clinicFee != "" && res.data.mzyReqrec.clinicFee > 0) {
  615. 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>';
  616. index++;
  617. }
  618. if (res.data.mzyReqrec.othFee != null && res.data.mzyReqrec.othFee != "" && res.data.mzyReqrec.othFee > 0) {
  619. 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>';
  620. }
  621. $("#tb_fee_info").find("tbody").empty();
  622. $("#tb_fee_info").find("tbody").append(trHtml);
  623. }
  624. } else {
  625. new PNotify({
  626. title: '错误提示',
  627. text: res.message,
  628. type: 'error',
  629. hide: true,
  630. styling: 'bootstrap3'
  631. });
  632. }
  633. }
  634. });
  635. $("#backNoModal").modal();
  636. }
  637. /**
  638. * 打开打印内容窗口
  639. * @param data
  640. */
  641. function printModal(data) {
  642. $("#printOrPreviewModal").modal("hide");
  643. $("#printModal").modal();
  644. }
  645. /**
  646. * 打开收费窗口
  647. * @param data
  648. */
  649. function confirmFeeModal() {
  650. var validatorResult = validator.checkAll($("#regi_form"));
  651. if (!validatorResult) {
  652. return;
  653. }
  654. var prevAll = $("#changeAmountParent").prevAll();
  655. while (prevAll.length > 2) {
  656. $("#changeAmountParent").prev().remove();
  657. prevAll = $("#changeAmountParent").prevAll();
  658. }
  659. $("#realMoney").val($("#amountMoneyConfirm").text());
  660. $("#cash").val($("#amountMoneyConfirm").text());
  661. $("#confirmFeeModal").modal();
  662. }
  663. /**
  664. * checkBox样式
  665. */
  666. function formatCheck() {
  667. if ($("input.flat")[0]) {
  668. $(document).ready(function () {
  669. $('input.flat').iCheck({
  670. checkboxClass: 'icheckbox_flat-blue',
  671. radioClass: 'iradio_flat-blue'
  672. });
  673. });
  674. }
  675. }
  676. /**
  677. * 卡号有变化后查询病人信息
  678. */
  679. function queryUserInfoByCardNo() {
  680. var cardNo = $("#cardNo").val();
  681. var index = cardNo.indexOf("-");
  682. if ((index > 0 && index == cardNo.length - 2) || cardNo.length == 8) {
  683. $("#cardNo").attr("title", cardNo);
  684. $.ajax({
  685. type: "GET",
  686. url: '/thmz/getByIcCardNo?icCardNo=' + cardNo,
  687. contentType: "application/json;charset=UTF-8",
  688. dataType: "json",
  689. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  690. success: function (res) {
  691. if (res == '401' || res == 401) {
  692. window.location.href = '/thmz/login/view'
  693. return;
  694. }
  695. if (res.code == 0) {
  696. if (res.data != null) {
  697. $("#cardNo").blur();
  698. $("#userName").val(res.data.name);
  699. $("#userName").blur();
  700. $("#userNameReadOnly").val(res.data.name);
  701. $("#age").val(res.data.age);
  702. $("#age").blur();
  703. $("#gender").selectpicker('val', res.data.sex);
  704. $("#gender").selectpicker('refresh');
  705. $("#gender").blur();
  706. $("#birthDayReadonly").val(res.data.birthDayStr);
  707. $("#birthDayReadonly").attr("title", res.data.birthDayStr);
  708. $("#birthDay").val(res.data.birthDayStr);
  709. $("#birthDay").blur();
  710. $("#phoneNum").val(res.data.phoneNo);
  711. $("#phoneNum").attr("title", res.data.phoneNo);
  712. $("#phoneNum").blur();
  713. $("#patientsNature").selectpicker('val', res.data.responseType);//默认选中
  714. $('#patientsNature').selectpicker('refresh');
  715. $("#patientsNature").blur();
  716. $("#idCard").val(res.data.socialNo);
  717. $("#idCard").attr("title", res.data.socialNo);
  718. $("#idCard").blur();
  719. $("#address").val(res.data.address);
  720. $("#address").blur();
  721. $("#patientId").val(res.data.patientId);
  722. if (res.data.name != null && res.data.name != "") {
  723. $("#editUser").show();
  724. }
  725. readonlyOrNot(true);
  726. } else {
  727. $("#newCardModal").modal();
  728. }
  729. } else {
  730. new PNotify({
  731. title: '错误提示',
  732. text: res.message,
  733. type: 'error',
  734. hide: true,
  735. styling: 'bootstrap3'
  736. });
  737. }
  738. }
  739. });
  740. }
  741. }
  742. /**
  743. * 卡号输入改变事件
  744. */
  745. function cardNoChange() {
  746. if (window.ActiveXObject || "ActiveXObject" in window) {
  747. $("#cardNo").on('input propertychange', function () {
  748. queryUserInfoByCardNo();
  749. });
  750. } else {
  751. $("#cardNo").on('input οninput', function () {
  752. queryUserInfoByCardNo();
  753. });
  754. }
  755. }
  756. /**
  757. * 病人姓名输入改变事件
  758. */
  759. function userNameChange() {
  760. if (window.ActiveXObject || "ActiveXObject" in window) {
  761. $("#userName").on('input propertychange', function () {
  762. refeshPatinetList(true);
  763. });
  764. } else {
  765. $("#userName").on('input οninput', function () {
  766. refeshPatinetList(true);
  767. });
  768. }
  769. }
  770. /**
  771. * 校验收款金额
  772. */
  773. function checkFee() {
  774. var cash = parseFloat($("#cash").val());
  775. var realMoney = parseFloat($("#realMoney").val());
  776. realMoney = realMoney.toFixed(2);
  777. $("#realMoney").val(realMoney)
  778. if (cash < realMoney) {
  779. new PNotify({
  780. title: '错误提示',
  781. text: "收款金额不能少于实收金额!",
  782. type: 'error',
  783. hide: true,
  784. styling: 'bootstrap3'
  785. });
  786. return;
  787. } else if (cash > realMoney) {
  788. if ($("#payType").val() == 1) {
  789. var changeAmount = cash - realMoney;
  790. $("#changeAmount").val(changeAmount.toFixed(2));
  791. } else {
  792. new PNotify({
  793. title: '错误提示',
  794. text: "非现金收款金额不能大于实收金额!",
  795. type: 'error',
  796. hide: true,
  797. styling: 'bootstrap3'
  798. });
  799. return;
  800. }
  801. }
  802. //计算和设置折扣比例
  803. var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
  804. var discount = 100;
  805. if (realMoney < amountMoneyConfirm) {
  806. discount = realMoney / amountMoneyConfirm * 100;
  807. }
  808. $("#discount").text(discount.toFixed(2))
  809. }
  810. /**
  811. * 根据病人姓名输入框内容动态加载病人列表
  812. */
  813. function initUserList() {
  814. //var width=$("#userName").css("width");
  815. var settings = {
  816. trigger: 'click',
  817. content: '',
  818. width: 170,
  819. multi: true,
  820. closeable: false,
  821. style: '',
  822. delay: 300,
  823. padding: true,
  824. height: 300
  825. };
  826. var webuiPopover = $('#userName').webuiPopover('destroy').webuiPopover(settings);
  827. //用户姓名选中事件
  828. $("#userName").on("click", function (t) {
  829. if ($(webuiPopover).css("display") == "block") {
  830. refeshPatinetList(true);
  831. }
  832. });
  833. }
  834. /**
  835. * 刷新病人列表
  836. */
  837. function refeshPatinetList(flag) {
  838. //如果是重新加载病人列表,需要重置下标
  839. if (flag) {
  840. //重置下标
  841. pageIndex = 0;
  842. msg_list_loading = true;
  843. }
  844. var userName = $('#userName').val();
  845. if (!(userName == null || userName == "" || isChinese(userName))) {
  846. return;
  847. }
  848. $.ajax({
  849. type: "GET",
  850. url: '/thmz/getPatientMiByName?name=' + userName + "&pageIndex=" + pageIndex,
  851. contentType: "application/json;charset=UTF-8",
  852. dataType: "json",
  853. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  854. success: function (res) {
  855. if (res == '401' || res == 401) {
  856. window.location.href = '/thmz/login/view'
  857. return;
  858. }
  859. if (res.code == 0) {
  860. if (res.data != null && res.data.length > 0) {
  861. $("#webuiPopover0").css("display", "block");
  862. var html = '<div class="list-group">';
  863. for (var i = 0; i < res.data.length; i++) {
  864. var mzPatientMi = res.data[i];
  865. html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillPatinet(\'' + mzPatientMi.patientId + '\')">';
  866. var sex = "未知";
  867. if (mzPatientMi.sex == 1) {
  868. html += '<img src="/thmz/images/boy.png"/>'
  869. sex = "男";
  870. } else if (mzPatientMi.sex == 2) {
  871. html += '<img src="/thmz/images/girl.png"/>'
  872. sex = "女";
  873. } else if (mzPatientMi.sex == 0 || mzPatientMi.sex == null) {
  874. html += '<img src="/thmz/images/girl_or_boy.png"/>'
  875. sex = "未知";
  876. }
  877. html += '<div>' + mzPatientMi.name + '&nbsp;' + sex + '&nbsp;';
  878. if (mzPatientMi.age != null && mzPatientMi.age != "") {
  879. html += mzPatientMi.age + '岁';
  880. } else {
  881. html += '**岁';
  882. }
  883. if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
  884. html += '<span>' + mzPatientMi.phoneNo + '</span>';
  885. }
  886. html += '</div></a>';
  887. }
  888. html += '</div>';
  889. if (flag) {
  890. $("div.webui-popover-content").html("");
  891. }
  892. $("div.webui-popover-content").append(html);
  893. $("div.arrow").css("left", "23px");
  894. refeshPatinetListScrollEvent();
  895. } else {
  896. $("#webuiPopover0").css("display", "none");
  897. }
  898. }
  899. //查询完成,设置加载完成
  900. msg_list_loading = false;
  901. }
  902. });
  903. }
  904. /**
  905. * 病人下拉列表滚动条滚动到底部时继续加载新纪录
  906. */
  907. function refeshPatinetListScrollEvent() {
  908. $('.webui-popover-content').scroll(function (event) {
  909. var top = $(this).scrollTop();
  910. var height = $(this).height();
  911. var scrollHeight = $(this).get(0).scrollHeight;
  912. if (scrollHeight <= top + height) {
  913. if (!msg_list_loading) {
  914. msg_list_loading = true;
  915. pageIndex = pageIndex + 1;
  916. refeshPatinetList(false);
  917. }
  918. }
  919. });
  920. }
  921. /**
  922. * 按照病人id查询病人信息
  923. * @param patientId
  924. */
  925. function fillPatinet(patientId) {
  926. if (patientId == null || patientId == "") {
  927. return;
  928. }
  929. $.ajax({
  930. type: "GET",
  931. url: '/thmz/getByPatientId?patientId=' + patientId,
  932. contentType: "application/json;charset=UTF-8",
  933. dataType: "json",
  934. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  935. success: function (res) {
  936. if (res == '401' || res == 401) {
  937. window.location.href = '/thmz/login/view'
  938. return;
  939. }
  940. if (res.code == 0) {
  941. if (res.data != null) {
  942. $("#cardNo").val(res.data.icCardNo);
  943. $("#cardNo").attr("title", res.data.icCardNo);
  944. $("#cardNo").blur();
  945. $("#userName").val(res.data.name);
  946. $("#userName").blur();
  947. $("#userNameReadOnly").val(res.data.name);
  948. $("#age").val(res.data.age);
  949. $("#age").blur();
  950. $("#gender").selectpicker('val', res.data.sex);
  951. $("#gender").selectpicker('refresh');
  952. $("#gender").blur();
  953. $("#birthDayReadonly").val(res.data.birthDayStr);
  954. $("#birthDayReadonly").attr("title", res.data.birthDayStr);
  955. $("#birthDayReadonly").blur();
  956. $("#birthDay").val(res.data.birthDayStr);
  957. $("#birthDay").blur();
  958. $("#phoneNum").val(res.data.phoneNo);
  959. $("#phoneNum").attr("title", res.data.phoneNo);
  960. $("#phoneNum").blur();
  961. $("#patientsNature").selectpicker('val', res.data.responseType);//默认选中
  962. $('#patientsNature').selectpicker('refresh');
  963. $("#patientsNature").blur();
  964. $("#idCard").val(res.data.socialNo);
  965. $("#idCard").attr("title", res.data.socialNo);
  966. $("#idCard").blur();
  967. $("#address").val(res.data.address);
  968. $("#address").blur();
  969. $("#patientId").val(res.data.patientId);
  970. if (res.data.name != null && res.data.name != "") {
  971. $("#editUser").show();
  972. }
  973. readonlyOrNot(true);
  974. }
  975. } else {
  976. new PNotify({
  977. title: '错误提示',
  978. text: res.message,
  979. type: 'error',
  980. hide: true,
  981. styling: 'bootstrap3'
  982. });
  983. }
  984. }
  985. });
  986. }
  987. /**
  988. * 将病人信息填入患者信息修改form
  989. * @param patinet
  990. */
  991. function fillPlusPatinet(patinet) {
  992. if (patinet != null) {
  993. $("#editUserCode").val(patinet.patientId);
  994. $("#editUserName").val(patinet.name);
  995. $("#editUserName").blur();
  996. $("#editUserAge").val(patinet.age);
  997. $("#editUserAge").blur();
  998. $("#editUserGender").selectpicker('val', patinet.sex);
  999. $("#editUserGender").selectpicker('refresh');
  1000. $("#editUserGender").blur();
  1001. $("#editUserBirthDay").val(patinet.birthDayStr);
  1002. $("#editUserBirthDay").blur();
  1003. $("#editUserCardNo").val(patinet.icCardNo);
  1004. $("#editUserCardNo").attr("title", patinet.icCardNo);
  1005. $("#editUserCardNo").blur();
  1006. $("#editUserPhoneNum").val(patinet.phoneNo);
  1007. $("#editUserPhoneNum").attr("title", patinet.phoneNo);
  1008. $("#editUserPhoneNum").blur();
  1009. $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
  1010. $('#editUserPatientsNature').selectpicker('refresh');
  1011. $("#editUserPatientsNature").blur();
  1012. $("#editUserIdCard").val(patinet.socialNo);
  1013. $("#editUserIdCard").attr("title", patinet.socialNo);
  1014. $("#editUserIdCard").blur();
  1015. $("#editUserAddress").val(patinet.address);
  1016. $("#editUserAddress").blur();
  1017. $("#editUserContact").val(patinet.relName);
  1018. $("#editUserContactPhone").val(patinet.contractName);
  1019. }
  1020. }
  1021. /**
  1022. * 关闭当前这个付款方式
  1023. */
  1024. function closeThisParent(obj) {
  1025. $(obj).parent().parent().remove();
  1026. }
  1027. /**
  1028. * 科室与时间区间下拉选改变时清空输入框内容
  1029. */
  1030. function emptyInput() {
  1031. $('#doctor').empty();
  1032. $('#doctor').selectpicker('refresh');
  1033. $("#registrationFee").val(0.00);
  1034. $("#hospitalFee").val(0.00);
  1035. $("#checkFee").val(0.00);
  1036. $("#amountMoney").text(0.00);
  1037. $("#amountMoneyConfirm").text(0.00);
  1038. $("#realMoney").val(0.00);
  1039. }
  1040. /**
  1041. * 给某些域增加title或者清除title
  1042. * @param obj
  1043. */
  1044. function clearTextOrTitle(obj) {
  1045. if ($(obj).val() == null || $(obj).val().length == 0) {
  1046. $(obj).attr("title", null);
  1047. } else {
  1048. $(obj).attr("title", $(obj).val());
  1049. if ($(obj).attr("id") == "birthDay") {
  1050. $(obj).blur()
  1051. }
  1052. }
  1053. }
  1054. /**
  1055. * 当按照卡号查询时,病人信息输入框不可编辑,当清空输入框时可编辑
  1056. * @param flag
  1057. */
  1058. function readonlyOrNot(flag) {
  1059. if (flag) {
  1060. $("#cardNo").attr("readonly", "readonly");
  1061. $("#userName").attr("readonly", "readonly");
  1062. $("#age").attr("readonly", "readonly");
  1063. $("#gender").attr("disabled", "disabled");
  1064. $("#phoneNum").attr("readonly", "readonly");
  1065. $("#patientsNature").attr("disabled", "disabled");
  1066. $("#idCard").attr("readonly", "readonly");
  1067. $("#address").attr("readonly", "readonly");
  1068. $("#birthDayReadonly").removeClass("hide").addClass("in");
  1069. $("#birthDayGroup").removeClass("in").addClass("hide");
  1070. $("#userName").removeClass("in").addClass("hide");
  1071. $("#userNameReadOnly").removeClass("hide").addClass("in");
  1072. $("#webuiPopover0").css("display", "none");
  1073. } else {
  1074. $("#cardNo").removeAttr("readonly");
  1075. $("#userName").removeAttr("readonly");
  1076. $("#age").removeAttr("readonly");
  1077. $("#gender").removeAttr("disabled");
  1078. $("#gender").next().removeClass("disabled");
  1079. $("#phoneNum").removeAttr("readonly");
  1080. $("#patientsNature").removeAttr("disabled");
  1081. $("#patientsNature").next().removeClass("disabled");
  1082. $("#idCard").removeAttr("readonly");
  1083. $("#address").removeAttr("readonly");
  1084. $("#birthDayReadonly").removeClass("in").addClass("hide");
  1085. $("#birthDayGroup").removeClass("hide").addClass("in");
  1086. $("#userName").removeClass("hide").addClass("in");
  1087. $("#userNameReadOnly").removeClass("in").addClass("hide");
  1088. //$("#webuiPopover0").css("display", "block");
  1089. }
  1090. }
  1091. /**
  1092. * 查询默认打印机
  1093. */
  1094. function setPrint() {
  1095. if (printIndex >= 0) {
  1096. return;
  1097. }
  1098. $.ajax({
  1099. type: "GET",
  1100. url: '/thmz/getLastWindowsByCurrentUser',
  1101. contentType: "application/json;charset=UTF-8",
  1102. dataType: "json",
  1103. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1104. async: false,
  1105. success: function (res) {
  1106. if (res == '401' || res == 401) {
  1107. window.location.href = '/thmz/login/view'
  1108. return;
  1109. }
  1110. if (res.code == 0) {
  1111. printIndex = res.data.printIndex;
  1112. } else {
  1113. printIndex = -1;
  1114. }
  1115. }
  1116. });
  1117. }
  1118. /**
  1119. * 保存病人信息
  1120. */
  1121. function savePatient() {
  1122. $.ajax({
  1123. type: "POST",
  1124. url: '/thmz/savePatient',
  1125. contentType: "application/json;charset=UTF-8",
  1126. dataType: "json",
  1127. data: JSON.stringify({
  1128. "name": $("#userName").val(),
  1129. "age": $("#age").val(),
  1130. "sex": $("#gender").val(),
  1131. "birthDay": $("#birthDay").val(),
  1132. "icCardNo": $("#cardNo").val(),
  1133. "phoneNo": $("#phoneNum").val(),
  1134. "responseType": $("#patientsNature").val(),
  1135. "socialNo": $("#idCard").val(),
  1136. "address": $("#address").val()
  1137. }),
  1138. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1139. success: function (res) {
  1140. if (res == '401' || res == 401) {
  1141. window.location.href = '/thmz/login/view'
  1142. return;
  1143. }
  1144. if (res.code == 0) {
  1145. $("#patientId").val(res.data.patientId);
  1146. saveMzyReqrec();
  1147. } else {
  1148. new PNotify({
  1149. title: '错误提示',
  1150. text: res.message,
  1151. type: 'error',
  1152. hide: true,
  1153. styling: 'bootstrap3'
  1154. });
  1155. }
  1156. }
  1157. });
  1158. }
  1159. /**
  1160. * 修改病人信息
  1161. */
  1162. function modifyPatient() {
  1163. $.ajax({
  1164. type: "POST",
  1165. url: '/thmz/modifyPatient',
  1166. contentType: "application/json;charset=UTF-8",
  1167. dataType: "json",
  1168. data: JSON.stringify({
  1169. "name": $("#editUserName").val(),
  1170. "age": $("#editUserAge").val(),
  1171. "sex": $("#editUserGender").val(),
  1172. "birthDay": $("#editUserBirthDay").val(),
  1173. "icCardNo": $("#editUserCardNo").val(),
  1174. "phoneNo": $("#editUserPhoneNum").val(),
  1175. "responseType": $("#editUserPatientsNature").val(),
  1176. "socialNo": $("#editUserIdCard").val(),
  1177. "address": $("#editUserAddress").val(),
  1178. "patientId": $("#editUserCode").val(),
  1179. "relName": $("#editUserContact").val(),
  1180. "contractName": $("#editUserContactPhone").val()
  1181. }),
  1182. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1183. success: function (res) {
  1184. if (res == '401' || res == 401) {
  1185. window.location.href = '/thmz/login/view'
  1186. return;
  1187. }
  1188. if (res.code == 0) {
  1189. $('#editUserModal').modal('hide');
  1190. fillPatinet($("#patientId").val());
  1191. } else {
  1192. new PNotify({
  1193. title: '错误提示',
  1194. text: res.message,
  1195. type: 'error',
  1196. hide: true,
  1197. styling: 'bootstrap3'
  1198. });
  1199. }
  1200. }
  1201. });
  1202. }
  1203. /**
  1204. * 保存挂号信息
  1205. */
  1206. function saveMzyReqrec() {
  1207. var mzyRequestId = $('#doctor').find("option:selected").attr('data-mzyRequestId');
  1208. var patientId = $("#patientId").val();
  1209. $.ajax({
  1210. type: "POST",
  1211. url: '/thmz/saveMzyReqrec',
  1212. contentType: "application/json;charset=UTF-8",
  1213. dataType: "json",
  1214. data: JSON.stringify({
  1215. "mzyReqrec": {
  1216. "patientId": patientId,
  1217. "ampm": $("#ampm").val(),
  1218. "unitCode": $("#deptNo").val(),
  1219. "chargeType": $("#chargeType").val(),
  1220. "paymode": $("#payType").val()
  1221. }, "responceType": $("#patientsNature").val(), "mzyRequestId": mzyRequestId
  1222. }),
  1223. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1224. success: function (res) {
  1225. if (res == '401' || res == 401) {
  1226. window.location.href = '/thmz/login/view'
  1227. return;
  1228. }
  1229. if (res.code == 0) {
  1230. new PNotify({
  1231. title: '操作提示',
  1232. text: res.message,
  1233. type: 'success',
  1234. hide: true,
  1235. styling: 'bootstrap3'
  1236. });
  1237. $('#confirmFeeModal').modal('hide');
  1238. prn1Print(patientId, -1);
  1239. loadTableCount();
  1240. loadRegistrationList(true);
  1241. clearRegistration();
  1242. } else {
  1243. new PNotify({
  1244. title: '错误提示',
  1245. text: res.message,
  1246. type: 'error',
  1247. hide: true,
  1248. styling: 'bootstrap3'
  1249. });
  1250. }
  1251. }
  1252. });
  1253. }
  1254. /**
  1255. * 挂号列表中的科室和医生列表初始化
  1256. */
  1257. function initListSelect() {
  1258. initListDeptSelect();
  1259. initListDoctorSelect();
  1260. }
  1261. /**
  1262. * 挂号列表中的科室列表
  1263. */
  1264. function initListDeptSelect() {
  1265. //科室列表
  1266. $.ajax({
  1267. type: "GET",
  1268. url: '/thmz/allMzUnitCode',
  1269. dataType: "json",
  1270. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1271. success: function (data) {
  1272. if (data == '401' || data == 401) {
  1273. window.location.href = '/thmz/login/view'
  1274. return;
  1275. }
  1276. var html = '';
  1277. $.each(data.data, function (commentIndex, comment) {
  1278. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  1279. });
  1280. $('#deptNoParam').empty();
  1281. $('#deptNoParam').html(html);
  1282. $('#deptNoParam').selectpicker('refresh');
  1283. }
  1284. });
  1285. }
  1286. /**
  1287. * 挂号列表中的医生列表初始化
  1288. */
  1289. function initListDoctorSelect() {
  1290. //医生列表
  1291. $.ajax({
  1292. type: "GET",
  1293. url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').val(),
  1294. dataType: "json",
  1295. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1296. success: function (res) {
  1297. if (res == '401' || res == 401) {
  1298. window.location.href = '/thmz/login/view'
  1299. return;
  1300. }
  1301. var html = '';
  1302. $.each(res.data, function (commentIndex, comment) {
  1303. html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
  1304. });
  1305. $('#doctorParam').empty();
  1306. $('#doctorParam').html(html);
  1307. // $("#doctorParam").selectpicker({
  1308. // size: 10
  1309. // });
  1310. $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
  1311. }
  1312. });
  1313. }
  1314. /**
  1315. * 加载挂号列表统计数据
  1316. */
  1317. function loadTableCount() {
  1318. var rePortRangeArr = getRePortRangeArr();
  1319. $.ajax({
  1320. type: "POST",
  1321. url: '/thmz/getCountByParams',
  1322. dataType: "json",
  1323. contentType: "application/json;charset=UTF-8",
  1324. data: JSON.stringify({
  1325. "mzyReqrec": {
  1326. "unitCode": $("#deptNoParam").val(),
  1327. "doctorCode": $("#doctorParam").val(),
  1328. "name": $("#userNameParam").val(),
  1329. "serialNo": $("#serialNoParams").val()
  1330. },
  1331. "beginTime": new Date(rePortRangeArr[0]),
  1332. "endTime": new Date(rePortRangeArr[1]),
  1333. "phoneNo": $("#phoneParam").val()
  1334. }),
  1335. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1336. success: function (res) {
  1337. if (res == '401' || res == 401) {
  1338. window.location.href = '/thmz/login/view'
  1339. return;
  1340. }
  1341. if (res.code == 0) {
  1342. $("#registrationNum").text(res.registrationNum);
  1343. $("#haveClinicalNum").text(res.haveClinicalNum);
  1344. $("#backNoNum").text(res.backNoNum);
  1345. }
  1346. }
  1347. });
  1348. }
  1349. /**
  1350. * 加载挂号列表
  1351. * @param flag 是否清空挂号卡片列表区域
  1352. */
  1353. function loadRegistrationList(flag) {
  1354. if (flag) {
  1355. pageIndex = 0;
  1356. $("#card_regi_list").empty();
  1357. $("div.page").removeClass("in").addClass("hide");
  1358. }
  1359. var regiListType = getIndex("regi_List_type");
  1360. if (regiListType == 0) {
  1361. loadCardList();
  1362. } else if (regiListType == 1) {
  1363. loadTableList();
  1364. }
  1365. }
  1366. /**
  1367. * 加载卡片列表
  1368. */
  1369. function loadCardList() {
  1370. $('#tb_regi_list').bootstrapTable("destroy");
  1371. isTableListInit = false;
  1372. var rePortRangeArr = getRePortRangeArr();
  1373. var regiListBtnGroup = getIndex("regi_List_btn_group");
  1374. var dataParams = JSON.stringify({
  1375. "mzyReqrec": {
  1376. "unitCode": $("#deptNoParam").val(),
  1377. "doctorCode": $("#doctorParam").val(),
  1378. "name": $("#userNameParam").val(),
  1379. "serialNo": $("#serialNoParams").val()
  1380. },
  1381. "beginTime": new Date(rePortRangeArr[0]),
  1382. "endTime": new Date(rePortRangeArr[1]),
  1383. "pageSize": 8,
  1384. "pageIndex": pageIndex,
  1385. "phoneNo": $("#phoneParam").val()
  1386. });
  1387. if (regiListBtnGroup == 1) {
  1388. dataParams = JSON.stringify({
  1389. "mzyReqrec": {
  1390. "unitCode": $("#deptNoParam").val(),
  1391. "doctorCode": $("#doctorParam").val(),
  1392. "name": $("#userNameParam").val(),
  1393. "serialNo": $("#serialNoParams").val(),
  1394. "visitedMark": 0,
  1395. "cancelMark": 0
  1396. },
  1397. "beginTime": new Date(rePortRangeArr[0]),
  1398. "endTime": new Date(rePortRangeArr[1]),
  1399. "pageSize": 8,
  1400. "pageIndex": pageIndex,
  1401. "phoneNo": $("#phoneParam").val()
  1402. });
  1403. } else if (regiListBtnGroup == 2) {
  1404. dataParams = JSON.stringify({
  1405. "mzyReqrec": {
  1406. "unitCode": $("#deptNoParam").val(),
  1407. "doctorCode": $("#doctorParam").val(),
  1408. "name": $("#userNameParam").val(),
  1409. "serialNo": $("#serialNoParams").val(),
  1410. "visitedMark": 1,
  1411. "cancelMark": 0
  1412. },
  1413. "beginTime": new Date(rePortRangeArr[0]),
  1414. "endTime": new Date(rePortRangeArr[1]),
  1415. "pageSize": 8,
  1416. "pageIndex": pageIndex,
  1417. "phoneNo": $("#phoneParam").val()
  1418. });
  1419. } else if (regiListBtnGroup == 3) {
  1420. dataParams = JSON.stringify({
  1421. "mzyReqrec": {
  1422. "unitCode": $("#deptNoParam").val(),
  1423. "doctorCode": $("#doctorParam").val(),
  1424. "name": $("#userNameParam").val(),
  1425. "serialNo": $("#serialNoParams").val(),
  1426. "cancelMark": 1
  1427. },
  1428. "beginTime": new Date(rePortRangeArr[0]),
  1429. "endTime": new Date(rePortRangeArr[1]),
  1430. "pageSize": 8,
  1431. "pageIndex": pageIndex,
  1432. "phoneNo": $("#phoneParam").val()
  1433. });
  1434. }
  1435. $.ajax({
  1436. type: "POST",
  1437. url: '/thmz/listMzyReqrec',
  1438. dataType: "json",
  1439. contentType: "application/json;charset=UTF-8",
  1440. data: dataParams,
  1441. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1442. success: function (res) {
  1443. if (res == '401' || res == 401) {
  1444. window.location.href = '/thmz/login/view'
  1445. return;
  1446. }
  1447. if (res.code == 0) {
  1448. pageIndex++;
  1449. $("#totalNum").text(res.pageViewVo.remainder);
  1450. if (res.pageViewVo.remainder <= 0) {
  1451. $("div.page").removeClass("in").addClass("hide");
  1452. } else {
  1453. $("div.page").removeClass("hide").addClass("in");
  1454. }
  1455. var data = res.pageViewVo.data;
  1456. for (var i = 0; i < data.length; i++) {
  1457. var mzyReqrecVo = data[i];
  1458. var color = "registration-no-color";
  1459. var text = '挂号</label>/<label>挂号</label>';
  1460. if (mzyReqrecVo.mzyReqrec.cancelMark == 0) {
  1461. if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
  1462. text = '已诊</label>/<label>挂号</label>';
  1463. color = "haveClinical-no-color";
  1464. }
  1465. } else if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
  1466. text = '退号</label>/<label>挂号</label>';
  1467. color = "back-no-color";
  1468. }
  1469. var sex = "未知";
  1470. 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">';
  1471. if (mzyReqrecVo.mzPatientMi.sex == 0) {
  1472. html += '<img src="/thmz/images/girl_or_boy.png"/>';
  1473. } else if (mzyReqrecVo.mzPatientMi.sex == 1) {
  1474. sex = "男";
  1475. html += '<img src="/thmz/images/boy.png"/>';
  1476. } else if (mzyReqrecVo.mzPatientMi.sex == 2) {
  1477. sex = "女";
  1478. html += '<img src="/thmz/images/girl.png"/>';
  1479. }
  1480. html += '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.name + '">' + mzyReqrecVo.mzyReqrec.name + '</div>';
  1481. if (mzyReqrecVo.mzPatientMi.responseType.length > 2) {
  1482. html += '<div class="el-row" style="font-size: 1px;height: 25%;">';
  1483. } else {
  1484. html += '<div class="el-row" style="font-size: 1px;">';
  1485. }
  1486. html += mzyReqrecVo.mzPatientMi.responseType + '</div></div><div class="patient-card-main-right"><div></div> <div class="el-row"><label>';
  1487. html += text;
  1488. html += '</div><div class="el-row" title="' + mzyReqrecVo.mzPatientMi.phoneNo + '">' + sex + ' / ' + mzyReqrecVo.mzPatientMi.age + '岁 / ' + 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>';
  1489. if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
  1490. html += '<div class="patient-card-foot">' +
  1491. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1492. ' <button type="button" class="can-not-used"' +
  1493. ' title="修改挂号">' +
  1494. ' <i class="fa fa-edit"></i>' +
  1495. ' </button>' +
  1496. ' </div>' +
  1497. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1498. ' <button type="button" class="registration-no-color-foot-button"' +
  1499. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  1500. ' <i class="fa fa-user"></i>' +
  1501. ' </button>' +
  1502. ' </div>' +
  1503. // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1504. // ' <button type="button" class="registration-no-color-foot-button"' +
  1505. // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
  1506. // ' <i class="fa fa-credit-card"></i>' +
  1507. // ' </button>' +
  1508. // ' </div>' +
  1509. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1510. ' <button type="button" class="can-not-used"' +
  1511. ' title="取消接诊">' +
  1512. ' <i class="fa fa-mail-reply"></i>' +
  1513. ' </button>' +
  1514. ' </div>' +
  1515. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1516. ' <button type="button" class="can-not-used"' +
  1517. ' title="退号">' +
  1518. ' <i class="fa fa-minus-square-o"></i>' +
  1519. ' </button>' +
  1520. ' </div>' +
  1521. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1522. ' <button type="button" class="can-not-used"' +
  1523. ' title="打印">' +
  1524. ' <i class="fa fa-print"></i>' +
  1525. ' </button>' +
  1526. ' </div>' +
  1527. ' </div>';
  1528. }
  1529. if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
  1530. html += '<div class="patient-card-foot">' +
  1531. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1532. ' <button type="button" class="can-not-used"' +
  1533. ' title="修改挂号">' +
  1534. ' <i class="fa fa-edit"></i>' +
  1535. ' </button>' +
  1536. ' </div>' +
  1537. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1538. ' <button type="button" class="registration-no-color-foot-button"' +
  1539. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  1540. ' <i class="fa fa-user"></i>' +
  1541. ' </button>' +
  1542. ' </div>' +
  1543. // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1544. // ' <button type="button" class="registration-no-color-foot-button"' +
  1545. // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
  1546. // ' <i class="fa fa-credit-card"></i>' +
  1547. // ' </button>' +
  1548. // ' </div>' +
  1549. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1550. ' <button type="button" class="registration-no-color-foot-button"' +
  1551. ' title="取消接诊" onclick="cancelClinic(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
  1552. ' <i class="fa fa-mail-reply"></i>' +
  1553. ' </button>' +
  1554. ' </div>' +
  1555. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1556. ' <button type="button" class="can-not-used"' +
  1557. ' title="退号">' +
  1558. ' <i class="fa fa-minus-square-o"></i>' +
  1559. ' </button>' +
  1560. ' </div>' +
  1561. ' <div class="col-md-2 col-sm-2 col-xs-12">';
  1562. if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
  1563. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
  1564. html += ' <i class="fa fa-rmb"></i>';
  1565. } else {
  1566. var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
  1567. if (printFlag) {
  1568. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
  1569. } else {
  1570. html += ' <button type="button" class="can-not-used" title="打印">';
  1571. }
  1572. html += ' <i class="fa fa-print"></i>';
  1573. }
  1574. html += ' </button>' +
  1575. ' </div>' +
  1576. ' </div>';
  1577. } else {
  1578. html += '<div class="patient-card-foot">' +
  1579. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1580. ' <button type="button" class="can-not-used"' +
  1581. ' title="修改挂号">' +
  1582. ' <i class="fa fa-edit"></i>' +
  1583. ' </button>' +
  1584. ' </div>' +
  1585. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1586. ' <button type="button" class="registration-no-color-foot-button"' +
  1587. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  1588. ' <i class="fa fa-user"></i>' +
  1589. ' </button>' +
  1590. ' </div>' +
  1591. // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1592. // ' <button type="button" class="registration-no-color-foot-button"' +
  1593. // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
  1594. // ' <i class="fa fa-credit-card"></i>' +
  1595. // ' </button>' +
  1596. // ' </div>' +
  1597. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1598. ' <button type="button" class="can-not-used"' +
  1599. ' title="取消接诊">' +
  1600. ' <i class="fa fa-mail-reply"></i>' +
  1601. ' </button>' +
  1602. ' </div>' +
  1603. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1604. ' <button type="button" class="registration-no-color-foot-button"' +
  1605. ' title="退号" onclick="backNoModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
  1606. ' <i class="fa fa-minus-square-o"></i>' +
  1607. ' </button>' +
  1608. ' </div>' +
  1609. ' <div class="col-md-2 col-sm-2 col-xs-12">';
  1610. if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
  1611. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
  1612. html += ' <i class="fa fa-rmb"></i>';
  1613. } else {
  1614. var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
  1615. if (printFlag) {
  1616. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
  1617. } else {
  1618. html += ' <button type="button" class="can-not-used" title="打印">';
  1619. }
  1620. html += ' <i class="fa fa-print"></i>';
  1621. }
  1622. html += ' </button>' +
  1623. ' </div>' +
  1624. ' </div>';
  1625. }
  1626. html += '</div></div>';
  1627. $("#card_regi_list").append(html);
  1628. }
  1629. }
  1630. }
  1631. });
  1632. }
  1633. /**
  1634. * 加载表格列表
  1635. */
  1636. function loadTableList() {
  1637. if (isTableListInit) {
  1638. $('#tb_regi_list').bootstrapTable('refresh');
  1639. } else {
  1640. isTableListInit = true;
  1641. $('#tb_regi_list').bootstrapTable({
  1642. url: '/thmz/listMzyReqrec', //请求后台的URL(*)
  1643. method: 'post', //请求方式(*)
  1644. toolbar: '#toolbar', //工具按钮用哪个容器
  1645. striped: true, //是否显示行间隔色
  1646. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1647. pagination: true, //是否显示分页(*)
  1648. sortable: true, //是否启用排序
  1649. sortOrder: "asc", //排序方式
  1650. queryParams: queryParams, //传递参数(*)
  1651. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  1652. pageNumber: 1, //初始化加载第一页,默认第一页
  1653. pageSize: 10, //每页的记录行数(*)
  1654. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  1655. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1656. strictSearch: true,
  1657. showColumns: false, //是否显示所有的列
  1658. showRefresh: false, //是否显示刷新按钮
  1659. minimumCountColumns: 2, //最少允许的列数
  1660. clickToSelect: true, //是否启用点击选中行
  1661. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1662. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1663. cardView: false, //是否显示详细视图
  1664. detailView: false,
  1665. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1666. ajaxOptions: {
  1667. headers: {
  1668. 'Accept': 'application/json',
  1669. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1670. }
  1671. },
  1672. columns: [
  1673. {
  1674. field: 'mzyReqrec.patientId',
  1675. title: '病人ID',
  1676. align: "center",
  1677. valign: 'middle',
  1678. // sortable: true
  1679. }, {
  1680. field: 'mzyReqrec.times',
  1681. title: '就诊次数',
  1682. align: "center",
  1683. valign: 'middle',
  1684. // sortable: true
  1685. }, {
  1686. field: 'mzyReqrec.name',
  1687. title: '病人姓名',
  1688. align: "center",
  1689. valign: 'middle',
  1690. // sortable: true
  1691. }, {
  1692. field: 'mzPatientMi.responseType',
  1693. title: '病人性质',
  1694. align: "center",
  1695. valign: 'middle',
  1696. // sortable: true
  1697. }, {
  1698. field: 'mzPatientMi.sex',
  1699. title: '性别',
  1700. align: "center",
  1701. valign: 'middle',
  1702. //sortable: true,
  1703. formatter: function (value, row, index) {
  1704. if (value == '1') {
  1705. return "男";
  1706. } else if (value == '2') {
  1707. return "女";
  1708. } else if (value == '0') {
  1709. return "未知";
  1710. }
  1711. }
  1712. },
  1713. // {
  1714. // field: 'mzPatientMi.age',
  1715. // title: '年龄',
  1716. // align: "center",
  1717. // valign: 'middle',
  1718. // // sortable: true
  1719. // }, {
  1720. // field: 'mzPatientMi.phoneNo',
  1721. // title: '电话',
  1722. // align: "center",
  1723. // valign: 'middle',
  1724. // // sortable: true,
  1725. // },
  1726. {
  1727. field: 'mzyReqrec.cancelMark',
  1728. title: '就诊状态',
  1729. align: "center",
  1730. valign: 'middle',
  1731. // sortable: true,
  1732. formatter: function (value, row, index) {
  1733. var text = '<span style="color:#26c175">挂号</span>';
  1734. if (value == 0) {
  1735. if (row.mzyReqrec.visitedMark == 1) {
  1736. text = '<span style="color:#6778ed">已诊</span>';
  1737. }
  1738. } else if (value == 1) {
  1739. text = '<span style="color:#ff6b91">退号</span>';
  1740. }
  1741. return text;
  1742. }
  1743. }, {
  1744. field: 'mzyReqrec.ampm',
  1745. title: '号段',
  1746. align: "center",
  1747. valign: 'middle',
  1748. // sortable: true
  1749. }, {
  1750. field: 'mzyReqrec.unitCode',
  1751. title: '挂号科室',
  1752. align: "center",
  1753. valign: 'middle',
  1754. // sortable: true
  1755. }, {
  1756. field: 'mzyReqrec.chargeType',
  1757. title: '号别',
  1758. align: "center",
  1759. valign: 'middle',
  1760. // sortable: true
  1761. }, {
  1762. field: 'mzyReqrec.doctorCode',
  1763. title: '挂号医生',
  1764. align: "center",
  1765. valign: 'middle',
  1766. // sortable: true
  1767. }, {
  1768. field: 'mzyReqrec.requestDay',
  1769. title: '挂号时间',
  1770. align: "center",
  1771. valign: 'middle',
  1772. // sortable: true,
  1773. formatter: function (value, row, index) {
  1774. return format(value, "yyyy-MM-dd HH:mm:ss");
  1775. }
  1776. }, {
  1777. title: '操作',
  1778. align: "center",
  1779. valign: 'middle',
  1780. // sortable: true,
  1781. formatter: function (value, row, index) {
  1782. if (row.mzyReqrec.cancelMark == 1) {
  1783. return '<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>' +
  1784. // '<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>' +
  1785. '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>'+
  1786. '<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>';
  1787. }
  1788. if (row.mzyReqrec.visitedMark == 1) {
  1789. 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>' +
  1790. // '<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>' +
  1791. '<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>'+
  1792. '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button>';
  1793. if (row.mzyReqrec.paymode == "本院记账") {
  1794. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
  1795. html += '<i class="fa fa-rmb"></i></button>';
  1796. } else {
  1797. var printFlag = isEmpty(row.mzyReqrec.printerId);
  1798. if (printFlag) {
  1799. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
  1800. } else {
  1801. html += ' <button type="button" class="can-not-used" title="打印">';
  1802. }
  1803. html += '<i class="fa fa-print"></i></button>';
  1804. }
  1805. // 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>';
  1806. return html;
  1807. }
  1808. 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>' +
  1809. // '<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>' +
  1810. '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>'+
  1811. '<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>';
  1812. if (row.mzyReqrec.paymode == "本院记账") {
  1813. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
  1814. html += '<i class="fa fa-rmb"></i></button>';
  1815. } else {
  1816. var printFlag = isEmpty(row.mzyReqrec.printerId);
  1817. if (printFlag) {
  1818. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
  1819. } else {
  1820. html += ' <button type="button" class="can-not-used" title="打印">';
  1821. }
  1822. html += '<i class="fa fa-print"></i></button>';
  1823. }
  1824. //html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
  1825. return html;
  1826. }
  1827. }],
  1828. responseHandler: function (res) {
  1829. if (res == '401' || res == 401) {
  1830. window.location.href = '/thmz/login/view'
  1831. return;
  1832. }
  1833. var ress = eval(res);
  1834. if (ress.code == -1) {
  1835. new PNotify({
  1836. title: '错误提示',
  1837. text: ress.message,
  1838. type: 'error',
  1839. hide: true,
  1840. styling: 'bootstrap3'
  1841. });
  1842. return {
  1843. "total": 0,//总页数
  1844. "rows": {} //数据
  1845. };
  1846. }
  1847. return {
  1848. "total": ress.pageViewVo.total,//总页数
  1849. "rows": ress.pageViewVo.data //数据
  1850. };
  1851. },
  1852. });
  1853. }
  1854. }
  1855. /**
  1856. * 得到查询的参数
  1857. * @param params
  1858. * @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}}
  1859. */
  1860. function queryParams(params) {
  1861. var rePortRangeArr = getRePortRangeArr();
  1862. var regiListBtnGroup = getIndex("regi_List_btn_group");
  1863. var temp = {
  1864. mzyReqrec: {
  1865. unitCode: $("#deptNoParam").val(),
  1866. doctorCode: $("#doctorParam").val(),
  1867. name: $("#userNameParam").val(),
  1868. serialNo: $("#serialNoParams").val()
  1869. },
  1870. beginTime: new Date(rePortRangeArr[0]),
  1871. endTime: new Date(rePortRangeArr[1]),
  1872. pageSize: params.limit, //页面大小
  1873. pageIndex: params.offset / params.limit, //页码
  1874. phoneNo: $("#phoneParam").val()
  1875. };
  1876. if (regiListBtnGroup == 1) {
  1877. temp = {
  1878. mzyReqrec: {
  1879. unitCode: $("#deptNoParam").val(),
  1880. doctorCode: $("#doctorParam").val(),
  1881. name: $("#userNameParam").val(),
  1882. serialNo: $("#serialNoParams").val(),
  1883. visitedMark: 0,
  1884. cancelMark: 0
  1885. },
  1886. beginTime: new Date(rePortRangeArr[0]),
  1887. endTime: new Date(rePortRangeArr[1]),
  1888. pageSize: params.limit, //页面大小
  1889. pageIndex: params.offset / params.limit, //页码
  1890. };
  1891. } else if (regiListBtnGroup == 2) {
  1892. temp = {
  1893. mzyReqrec: {
  1894. unitCode: $("#deptNoParam").val(),
  1895. doctorCode: $("#doctorParam").val(),
  1896. name: $("#userNameParam").val(),
  1897. serialNo: $("#serialNoParams").val(),
  1898. visitedMark: 1,
  1899. cancelMark: 0
  1900. },
  1901. beginTime: new Date(rePortRangeArr[0]),
  1902. endTime: new Date(rePortRangeArr[1]),
  1903. pageSize: params.limit, //页面大小
  1904. pageIndex: params.offset / params.limit, //页码
  1905. };
  1906. } else if (regiListBtnGroup == 3) {
  1907. temp = {
  1908. mzyReqrec: {
  1909. unitCode: $("#deptNoParam").val(),
  1910. doctorCode: $("#doctorParam").val(),
  1911. name: $("#userNameParam").val(),
  1912. serialNo: $("#serialNoParams").val(),
  1913. cancelMark: 1
  1914. },
  1915. beginTime: new Date(rePortRangeArr[0]),
  1916. endTime: new Date(rePortRangeArr[1]),
  1917. pageSize: params.limit, //页面大小
  1918. pageIndex: params.offset / params.limit, //页码
  1919. };
  1920. }
  1921. return temp;
  1922. };
  1923. /**
  1924. * 根据是挂号还是已诊或是退号 设置行的颜色
  1925. * @param row
  1926. * @param index
  1927. * @returns {*}
  1928. */
  1929. function rowStyle(row, index) {
  1930. var style = {css: {'background': 'linear-gradient(130deg, #06c7d6, #26c175) !important;'}};
  1931. if (row.mzyReqrec.cancelMark == 0) {
  1932. if (row.mzyReqrec.visitedMark == 1) {
  1933. style = {css: {'background': 'linear-gradient(130deg, #41a6f5, #6778ed) !important;'}};
  1934. }
  1935. } else if (row.mzyReqrec.cancelMark == 1) {
  1936. style = {css: {'background': 'linear-gradient(130deg, #ff9e70, #ff6b91) !important;'}};
  1937. }
  1938. return style;
  1939. }
  1940. /**
  1941. * 获取按钮组选择的下标
  1942. * @param id
  1943. * @returns {number}
  1944. */
  1945. function getIndex(id) {
  1946. var index = 0;
  1947. var item = $("#" + id).find("button");
  1948. for (var i = 0; i <= item.length; i++) {
  1949. if ($(item[i]).hasClass("btn-primary")) {
  1950. index = i;
  1951. break;
  1952. }
  1953. }
  1954. return index;
  1955. }
  1956. /**
  1957. * 获取时间选择器的时间数组
  1958. * @returns {string[]}
  1959. */
  1960. function getRePortRangeArr() {
  1961. var rePortRange = $('#reportrange span').html();
  1962. var rePortRangeArr = rePortRange.split(" - ");
  1963. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  1964. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  1965. return rePortRangeArr;
  1966. }
  1967. /**
  1968. * 清空搜索参数
  1969. */
  1970. function clearParams() {
  1971. $("#deptNoParam").selectpicker('val', null);
  1972. $("#deptNoParam").selectpicker('refresh');
  1973. $("#doctorParam").selectpicker('val', null);
  1974. $("#deptNoParam").selectpicker('refresh');
  1975. $("#userNameParam").val(null);
  1976. $("#phoneParam").val(null);
  1977. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  1978. }
  1979. /**
  1980. * 保存退号信息
  1981. */
  1982. function saveBackNo() {
  1983. $.ajax({
  1984. type: "POST",
  1985. url: '/thmz/updateReqrec',
  1986. contentType: "application/json;charset=UTF-8",
  1987. dataType: "json",
  1988. data: JSON.stringify({
  1989. "patientId": $("#backNoPatientId").val(),
  1990. "times": $("#backNoTimes").val(),
  1991. "cancelMark": 1
  1992. }),
  1993. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1994. success: function (res) {
  1995. if (res == '401' || res == 401) {
  1996. window.location.href = '/thmz/login/view'
  1997. return;
  1998. }
  1999. if (res.code == 0) {
  2000. new PNotify({
  2001. title: '操作提示',
  2002. text: res.message,
  2003. type: 'success',
  2004. hide: true,
  2005. styling: 'bootstrap3'
  2006. });
  2007. loadTableCount();
  2008. loadRegistrationList(true);
  2009. $("#backNoModal").modal("hide");
  2010. } else {
  2011. new PNotify({
  2012. title: '错误提示',
  2013. text: res.message,
  2014. type: 'error',
  2015. hide: true,
  2016. styling: 'bootstrap3'
  2017. });
  2018. }
  2019. }
  2020. });
  2021. }
  2022. /**
  2023. * 清空挂号信息
  2024. */
  2025. function clearRegistration() {
  2026. $("#cardNo").val(null);
  2027. $("#cardNo").attr("title", null);
  2028. $("#userName").val(null);
  2029. $("#age").val(null);
  2030. $("#gender").selectpicker('val', 1);
  2031. $("#gender").selectpicker('refresh');
  2032. $("#birthDay").val(null);
  2033. $("#birthDay").attr("title", null);
  2034. $("#phoneNum").val(null);
  2035. $("#phoneNum").attr("title", null);
  2036. $("#patientsNature").selectpicker('val', '01');//默认选中
  2037. $('#patientsNature').selectpicker('refresh');
  2038. $("#idCard").val(null);
  2039. $("#idCard").attr("title", null);
  2040. $("#address").val(null);
  2041. $("#patientId").val(null);
  2042. $("#editUser").hide();
  2043. //默认光标在卡号输入框
  2044. $("#cardNo").focus();
  2045. initMzWorkTime();
  2046. readonlyOrNot(false);
  2047. }
  2048. /**
  2049. * 打开退费重收确认弹框
  2050. * @param serialNo
  2051. */
  2052. function chargeFeeForByjz(serialNo) {
  2053. $("#serialNo").val(serialNo);
  2054. $("#confirmFeeModal").modal();
  2055. }
  2056. /**
  2057. * 直接打印发票
  2058. * @param patientId
  2059. */
  2060. function prn1Print(patientId, times) {
  2061. setPrint();
  2062. var height = "93.15mm";
  2063. // if(countReceiot%2==0){
  2064. // height ="93.2mm";
  2065. // }
  2066. $.ajax({
  2067. type: "GET",
  2068. url: '/thmz/printMzyReqrecRecept?patientId=' + patientId + "&times=" + times,
  2069. contentType: "application/json;charset=UTF-8",
  2070. dataType: "json",
  2071. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2072. success: function (res) {
  2073. if (res == '401' || res == 401) {
  2074. window.location.href = '/thmz/login/view'
  2075. return;
  2076. }
  2077. if (res.code == 0) {
  2078. if (res.data == null || res.data.length == 0) {
  2079. return;
  2080. }
  2081. // countReceiot++;
  2082. LODOP = getLodop();
  2083. var temp = res.data;
  2084. LODOP.PRINT_INITA(6, 0, "120mm", height, "泰和门诊发票打印");
  2085. //设置默认打印机
  2086. LODOP.SET_PRINTER_INDEX(printIndex);
  2087. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "120mm");
  2088. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
  2089. LODOP.SET_PRINT_PAGESIZE(1, "120mm", height, "CreateCustomPage");
  2090. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
  2091. LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
  2092. LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", "湖南泰和医院管理有限公司");
  2093. LODOP.ADD_PRINT_TEXT("6mm", "59mm", "30mm", "3mm", "流水号:");
  2094. LODOP.ADD_PRINT_TEXT("6mm", "72mm", "20mm", "3mm", temp.serialNo);
  2095. LODOP.ADD_PRINT_TEXT("19mm", "0mm", "35mm", "3mm", temp.receiptBill);
  2096. LODOP.ADD_PRINT_TEXT("25mm", "7mm", "50mm", "3mm", temp.name);
  2097. LODOP.ADD_PRINT_TEXT("25mm", "61mm", "27mm", "3mm", patientId);
  2098. LODOP.ADD_PRINT_TEXT("32mm", "6mm", "50mm", "3mm", "就诊科室:" + temp.unitCode);
  2099. LODOP.ADD_PRINT_TEXT("32mm", "56mm", "50mm", "3mm", "地点:" + res.officePos);
  2100. LODOP.ADD_PRINT_TEXT("37mm", "6mm", "50mm", "3mm", "看诊医生:" + temp.doctorCode);
  2101. LODOP.ADD_PRINT_TEXT("37mm", "56mm", "50mm", "3mm", "号段:" + temp.ampm);
  2102. LODOP.ADD_PRINT_TEXT("42mm", "6mm", "50mm", "3mm", "号别:" + temp.chargeType);
  2103. LODOP.ADD_PRINT_TEXT("42mm", "56mm", "50mm", "3mm", "就诊号:" + temp.reqOrder);
  2104. LODOP.ADD_PRINT_TEXT("47mm", "6mm", "50mm", "3mm", "挂号费:" + temp.reqFee);
  2105. LODOP.ADD_PRINT_TEXT("47mm", "56mm", "50mm", "3mm", "诊查费:" + temp.clinicFee);
  2106. LODOP.ADD_PRINT_TEXT("52mm", "6mm", "50mm", "3mm", "其他:" + temp.othFee);
  2107. LODOP.ADD_PRINT_TEXT("52mm", "56mm", "50mm", "3mm", "工本费:" + temp.brochureFee);
  2108. LODOP.ADD_PRINT_TEXT("65mm", "21mm", "60mm", "3mm", res.totalFee + " 元");
  2109. LODOP.ADD_PRINT_TEXT("72mm", "19mm", "60mm", "3mm", res.totalFeeStr);
  2110. LODOP.ADD_PRINT_TEXT("79mm", "0mm", "15mm", "3mm", res.year);//年
  2111. LODOP.ADD_PRINT_TEXT("79mm", "13mm", "10mm", "3mm", res.month);//月
  2112. LODOP.ADD_PRINT_TEXT("79mm", "25mm", "10mm", "3mm", res.day);//日
  2113. LODOP.ADD_PRINT_TEXT("79mm", "53mm", "23mm", "3mm", res.user.userName);//收费员
  2114. //LODOP.PREVIEW();
  2115. LODOP.PRINT();
  2116. if (times > 0) {
  2117. loadTableCount();
  2118. loadRegistrationList(true);
  2119. }
  2120. } else if (res.code == -1) {
  2121. new PNotify({
  2122. title: '错误提示',
  2123. text: res.message,
  2124. type: 'error',
  2125. hide: true,
  2126. styling: 'bootstrap3'
  2127. });
  2128. }
  2129. }
  2130. });
  2131. };
  2132. /**
  2133. * 取消接诊
  2134. * @param patientId
  2135. */
  2136. function cancelClinic(patientId, times) {
  2137. $("#messageModal").modal();
  2138. $("#messageContent").html("确认取消当前病人的接诊记录吗?");
  2139. $("#messageButton").off("click").on("click", function (t) {
  2140. $("#messageModal").modal("hide");
  2141. $.ajax({
  2142. type: "GET",
  2143. url: '/thmz/cancelClinic?patientId=' + patientId + "&times=" + times,
  2144. contentType: "application/json;charset=UTF-8",
  2145. dataType: "json",
  2146. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2147. success: function (res) {
  2148. if (res == '401' || res == 401) {
  2149. window.location.href = '/thmz/login/view'
  2150. return;
  2151. }
  2152. if (res.code == 0) {
  2153. if (res.data == null || res.data.length == 0) {
  2154. return;
  2155. }
  2156. successMesage(res);
  2157. if (times > 0) {
  2158. loadTableCount();
  2159. loadRegistrationList(true);
  2160. }
  2161. } else if (res.code == -1) {
  2162. errorMesage(res);
  2163. }
  2164. }
  2165. });
  2166. });
  2167. };
  2168. //判断字符是否为空的方法
  2169. function isEmpty(obj) {
  2170. if (typeof obj == "undefined" || obj == null || obj == "") {
  2171. return true;
  2172. } else {
  2173. return false;
  2174. }
  2175. }
  2176. /**
  2177. * 导出excel
  2178. */
  2179. function exportExcel() {
  2180. var rePortRangeArr = getRePortRangeArr();
  2181. var regiListBtnGroup = getIndex("regi_List_btn_group");
  2182. var visitedMark = "";
  2183. var cancelMark = "";
  2184. if (regiListBtnGroup == 1) {
  2185. visitedMark = 0;
  2186. cancelMark = 0;
  2187. } else if (regiListBtnGroup == 2) {
  2188. visitedMark = 1;
  2189. cancelMark = 0;
  2190. } else if (regiListBtnGroup == 3) {
  2191. cancelMark = 1;
  2192. }
  2193. window.location.href = "/thmz/exportListMzyReqrec?beginTime=" + rePortRangeArr[0] + "&endTime=" + rePortRangeArr[1] + "&name=" + $("#userNameParam").val()
  2194. + "&unitCode=" + $("#deptNoParam").val() + "&doctorCode=" + $("#doctorParam").val() + "&phoneNo=" + $("#phoneParam").val() + "&serialNo=" + $("#serialNoParams").val() + "&visitedMark="
  2195. + visitedMark + "&cancelMark=" + cancelMark;
  2196. }
  2197. /**
  2198. * 修改收款方式
  2199. * @param patientId
  2200. * @param times
  2201. * @param paymode
  2202. */
  2203. function editPayMode(patientId, times, paymode, dcountNo) {
  2204. var message = "当前病人本次挂号的收费方式为【" + paymode + "】,确定需要修改吗?";
  2205. if (dcountNo == 1) {
  2206. message = "当前病人本次挂号的收费方式为【" + paymode + "】,且本次挂号已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次挂号所在日期的【日结报表】!";
  2207. }
  2208. $("#editPayModeTip").html(message);
  2209. $("#patientId").val(patientId);
  2210. $("#times").val(times);
  2211. $('#payTypeEditPayMode').selectpicker('val', 1);
  2212. $('#payTypeEditPayMode').selectpicker('refresh');
  2213. $("#editPayModeModal").modal();
  2214. }
  2215. /**
  2216. * 提交修改收款方式
  2217. */
  2218. function saveEditPayMode() {
  2219. $.ajax({
  2220. type: "GET",
  2221. url: '/thmz/updatePayMode?patientId=' + $("#patientId").val() + "&times=" + $("#times").val() + "&payMode=" + $("#payTypeEditPayMode").val(),
  2222. contentType: "application/json;charset=UTF-8",
  2223. dataType: "json",
  2224. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2225. success: function (res) {
  2226. if (res == '401' || res == 401) {
  2227. window.location.href = '/thmz/login/view'
  2228. return;
  2229. }
  2230. if (res.code == 0) {
  2231. successMesage(res);
  2232. clearEditPayMode();
  2233. $("#editPayModeModal").modal("hide");
  2234. loadRegistrationList(true);
  2235. } else if (res.code == -1) {
  2236. new PNotify({
  2237. title: '错误提示',
  2238. text: res.message,
  2239. type: 'error',
  2240. hide: true,
  2241. styling: 'bootstrap3'
  2242. });
  2243. }
  2244. }
  2245. });
  2246. }
  2247. /**
  2248. * 清空
  2249. */
  2250. function clearEditPayMode() {
  2251. $("#patientId").val(null);
  2252. $("#times").val(null);
  2253. }