registration_list.js 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969
  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. init_validator();
  114. //初始门诊收银方式下拉选
  115. initChequeType("payType");
  116. //初始修改收费方式 收银方式下拉选
  117. initChequeType("payTypeEditPayMode");
  118. /**
  119. * 增加收款方式按钮事件
  120. */
  121. $("#addPayType").on("click", function (t) {
  122. var payTypeIndex = $("#payTypeIndex").val();
  123. var payTypeId = "payType_" + payTypeIndex;
  124. 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>';
  125. $("#changeAmountParent").before(html);
  126. initChequeType(payTypeId)
  127. payTypeIndex = payTypeIndex + 1;
  128. $("#payTypeIndex").val(payTypeIndex);
  129. });
  130. /**
  131. * 退费重收事件
  132. */
  133. $("#saveConfirmFee").on("click", function (t) {
  134. var serialNo = $("#serialNo").val();
  135. if (!confirm("确定要将流水号【" + serialNo + "】的挂号记录退费重收吗?")) {
  136. return;
  137. }
  138. $.ajax({
  139. type: "GET",
  140. url: '/thmz/chargeFeeForByjz?serialNo=' + serialNo + "&paymode=" + $("#payType").val(),
  141. contentType: "application/json;charset=UTF-8",
  142. dataType: "json",
  143. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  144. success: function (res) {
  145. if (res == '401' || res == 401) {
  146. window.location.href = '/thmz/login/view'
  147. return;
  148. }
  149. if (res.code == 0) {
  150. $('#confirmFeeModal').modal('hide');
  151. $("#serialNo").val(null);
  152. prn1Print(res.data.patientId, res.data.times);
  153. } else {
  154. new PNotify({
  155. title: '错误提示',
  156. text: res.message,
  157. type: 'error',
  158. hide: true,
  159. styling: 'bootstrap3'
  160. });
  161. }
  162. }
  163. });
  164. });
  165. /**
  166. * 患者信息修改
  167. */
  168. $("#saveEditUser").on("click", function (t) {
  169. modifyPatient();
  170. });
  171. /**
  172. * 挂号列表中的科室和医生列表初始化
  173. */
  174. initListSelect();
  175. $("#queryListButton").on("click", function (t) {
  176. loadTableCount();
  177. loadRegistrationList(true);
  178. });
  179. loadTableCount();
  180. loadRegistrationList(true);
  181. initCertificateTypeSelect();
  182. //初始化省份
  183. initProvince(2);
  184. //初始化页面上面的按钮事件
  185. $("#btn_excel").click(function (t) {
  186. exportExcel();
  187. });
  188. });
  189. /**
  190. * 初始化证件类型下拉选
  191. */
  192. function initCertificateTypeSelect() {
  193. $.ajax({
  194. type: "GET",
  195. url: '/thmz/listCertificateType',
  196. contentType: "application/json;charset=UTF-8",
  197. dataType: "json",
  198. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  199. success: function (res) {
  200. if (res == '401' || res == 401) {
  201. window.location.href = '/thmz/login/view'
  202. return;
  203. }
  204. if (res.code == 0) {
  205. res.data.forEach(function (item, index) {
  206. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  207. $('#editUserCertificateType').append(html);
  208. });
  209. $('#editUserCertificateType').selectpicker('refresh');
  210. } else {
  211. errorMesage(res);
  212. }
  213. }
  214. });
  215. }
  216. /**
  217. * 初始化性别下拉选
  218. */
  219. function initGenderSelect() {
  220. $(".selectpicker").selectpicker({
  221. dropuAuto: false
  222. });
  223. var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
  224. $('#gender').html(gender);
  225. $('#gender').selectpicker('refresh');
  226. $('#editUserGender').html(gender);
  227. $('#editUserGender').selectpicker('refresh');
  228. }
  229. /**
  230. * 初始化病人身份类别下拉选
  231. */
  232. function initResponceTypeSelect() {
  233. $(".selectpicker").selectpicker({
  234. dropuAuto: false
  235. });
  236. $.ajax({
  237. type: "GET",
  238. url: '/thmz/getMzResponceType',
  239. contentType: "application/json;charset=UTF-8",
  240. dataType: "json",
  241. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  242. success: function (res) {
  243. if (res == '401' || res == 401) {
  244. window.location.href = '/thmz/login/view'
  245. return;
  246. }
  247. if (res.code == 0) {
  248. res.data.forEach(function (item, index) {
  249. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  250. $('#patientsNature').append(html);
  251. $('#editUserPatientsNature').append(html);
  252. });
  253. $('#patientsNature').selectpicker('refresh');
  254. $('#editUserPatientsNature').selectpicker('refresh');
  255. } else {
  256. errorMesage(res.message);
  257. }
  258. }
  259. });
  260. }
  261. /**
  262. * 初始科室下拉选
  263. * @param ampm 时间段区间
  264. */
  265. function initDeptPlus() {
  266. //科室列表
  267. $.ajax({
  268. type: "GET",
  269. url: '/thmz/getUnitCodeByRequestDay?ampm=' + $("#ampm").val(),
  270. dataType: "json",
  271. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  272. success: function (data) {
  273. if (data == '401' || data == 401) {
  274. window.location.href = '/thmz/login/view'
  275. return;
  276. }
  277. var html = '';
  278. $.each(data.data, function (commentIndex, comment) {
  279. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  280. });
  281. $('#deptNo').empty();
  282. $('#deptNo').html(html);
  283. $('#deptNo').selectpicker('refresh');
  284. $('#chargeType').empty();
  285. $('#chargeType').selectpicker('refresh');
  286. emptyInput();
  287. }
  288. });
  289. }
  290. /**
  291. * 初始门诊收银方式下拉选
  292. */
  293. function initChequeType(payType) {
  294. $.ajax({
  295. type: "GET",
  296. url: '/thmz/getAllZdChequeTypeForMz',
  297. dataType: "json",
  298. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  299. success: function (res) {
  300. if (res == '401' || res == 401) {
  301. window.location.href = '/thmz/login/view'
  302. return;
  303. }
  304. var html = '';
  305. $.each(res.data, function (commentIndex, comment) {
  306. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  307. });
  308. $('#' + payType).empty();
  309. $('#' + payType).html(html);
  310. $('#' + payType).selectpicker('refresh');
  311. }
  312. });
  313. }
  314. /**
  315. * 日期值改变修改年龄字段
  316. * @param ev
  317. */
  318. function changeDate(ev) {
  319. }
  320. /**
  321. * 列表类型按钮切换事件
  322. * @param object
  323. */
  324. function titleButtonChange(object) {
  325. $("#regi_List_btn_group").find("button").each(function (index, element) {
  326. if ($(element).hasClass("btn-primary")) {
  327. $(element).removeClass("btn-primary").addClass("btn-default");
  328. }
  329. });
  330. $(object).removeClass("btn-default").addClass("btn-primary");
  331. loadRegistrationList(true);
  332. }
  333. /**
  334. * 表格类型切换事件 卡片展示或者列表形式
  335. */
  336. function listTypeChange(object) {
  337. //var indexNum = 0;
  338. $("#regi_List_type").find("button").each(function (index, element) {
  339. if ($(element).hasClass("btn-primary")) {
  340. $(element).removeClass("btn-primary").addClass("btn-default");
  341. }
  342. // if (object == element) {
  343. // indexNum = index;
  344. // }
  345. });
  346. $(object).removeClass("btn-default").addClass("btn-primary");
  347. loadRegistrationList(true);
  348. }
  349. /**
  350. * 打开编辑用户信息窗口
  351. * @param data
  352. */
  353. function editUserModal(data) {
  354. $("#editUserModal").modal();
  355. if (data == null) {
  356. data = $("#patientId").val();
  357. }
  358. $.ajax({
  359. type: "GET",
  360. url: '/thmz/getByPatientId?patientId=' + data,
  361. contentType: "application/json;charset=UTF-8",
  362. dataType: "json",
  363. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  364. success: function (res) {
  365. if (res == '401' || res == 401) {
  366. window.location.href = '/thmz/login/view'
  367. return;
  368. }
  369. if (res.code == 0) {
  370. if (res.data != null) {
  371. //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
  372. setTimeout(function () {
  373. fillPlusPatinet(res.data);
  374. }, 400);
  375. }
  376. } else {
  377. errorMesage(res.message);
  378. }
  379. }
  380. });
  381. }
  382. /**
  383. * 打开退费信息窗口
  384. * @param patientId
  385. * @param times
  386. */
  387. function backNoModal(patientId, times) {
  388. $.ajax({
  389. type: "POST",
  390. url: '/thmz/getMzyReqrecByPatientIdAndTimes',
  391. contentType: "application/json;charset=UTF-8",
  392. dataType: "json",
  393. data: JSON.stringify({"patientId": patientId, "times": times}),
  394. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  395. success: function (res) {
  396. if (res == '401' || res == 401) {
  397. window.location.href = '/thmz/login/view'
  398. return;
  399. }
  400. if (res.code == 0) {
  401. if (res.data != null) {
  402. $("#backNoPatientId").val(patientId);
  403. $("#backNoTimes").val(times);
  404. $("#backNoSickName").text(res.data.mzyReqrec.name);
  405. $("#backNoPayType").text(res.data.mzyReqrec.paymode);
  406. $("#backNoPhone").text(res.data.mzPatientMi.phoneNo);
  407. $("#backNoAmpm").text(res.data.mzyReqrec.ampm);
  408. $("#backNoDeptName").text(res.data.mzyReqrec.unitCode);
  409. $("#backNoChargeType").text(res.data.mzyReqrec.chargeType);
  410. $("#backNoDoctorName").text(res.data.mzyReqrec.doctorCode);
  411. $("#backNoRegiDate").text(format(res.data.mzyReqrec.requestDay, "yyyy-MM-dd HH:mm:ss"));
  412. var index = 0;
  413. var trHtml = '';
  414. if (res.data.mzyReqrec.reqFee != null && res.data.mzyReqrec.reqFee != "" && res.data.mzyReqrec.reqFee > 0) {
  415. 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>';
  416. index++;
  417. }
  418. if (res.data.mzyReqrec.clinicFee != null && res.data.mzyReqrec.clinicFee != "" && res.data.mzyReqrec.clinicFee > 0) {
  419. 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>';
  420. index++;
  421. }
  422. if (res.data.mzyReqrec.othFee != null && res.data.mzyReqrec.othFee != "" && res.data.mzyReqrec.othFee > 0) {
  423. 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>';
  424. }
  425. $("#tb_fee_info").find("tbody").empty();
  426. $("#tb_fee_info").find("tbody").append(trHtml);
  427. }
  428. } else {
  429. errorMesage(res.message);
  430. }
  431. }
  432. });
  433. $("#backNoModal").modal();
  434. }
  435. /**
  436. * 打开打印内容窗口
  437. * @param data
  438. */
  439. function printModal(data) {
  440. $("#printOrPreviewModal").modal("hide");
  441. $("#printModal").modal();
  442. }
  443. /**
  444. * checkBox样式
  445. */
  446. function formatCheck() {
  447. if ($("input.flat")[0]) {
  448. $(document).ready(function () {
  449. $('input.flat').iCheck({
  450. checkboxClass: 'icheckbox_flat-blue',
  451. radioClass: 'iradio_flat-blue'
  452. });
  453. });
  454. }
  455. }
  456. /**
  457. * 校验收款金额
  458. */
  459. function checkFee() {
  460. var cash = parseFloat($("#cash").val());
  461. var realMoney = parseFloat($("#realMoney").val());
  462. realMoney = realMoney.toFixed(2);
  463. $("#realMoney").val(realMoney)
  464. if (cash < realMoney) {
  465. errorMesageSimaple("收款金额不能少于实收金额!");
  466. return;
  467. } else if (cash > realMoney) {
  468. if ($("#payType").val() == 1) {
  469. var changeAmount = cash - realMoney;
  470. $("#changeAmount").val(changeAmount.toFixed(2));
  471. } else {
  472. errorMesageSimaple("非现金收款金额不能大于实收金额!");
  473. return;
  474. }
  475. }
  476. //计算和设置折扣比例
  477. var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
  478. var discount = 100;
  479. if (realMoney < amountMoneyConfirm) {
  480. discount = realMoney / amountMoneyConfirm * 100;
  481. }
  482. $("#discount").text(discount.toFixed(2))
  483. }
  484. /**
  485. * 将病人信息填入患者信息修改form
  486. * @param patinet
  487. */
  488. function fillPlusPatinet(patinet) {
  489. if (patinet != null) {
  490. $("#editUserCode").val(patinet.patientId);
  491. $("#editUserName").val(patinet.name);
  492. $("#editUserName").blur();
  493. $("#editUserAge").val(patinet.age);
  494. $("#editUserAge").blur();
  495. $("#editUserGender").selectpicker('val', patinet.sex);
  496. $("#editUserGender").selectpicker('refresh');
  497. $("#editUserGender").blur();
  498. $("#editUserBirthDay").val(patinet.birthDayStr);
  499. $("#editUserBirthDay").blur();
  500. $('#editUserCertificateType').selectpicker('val', patinet.certificateType);
  501. $('#editUserCertificateType').selectpicker('refresh');
  502. $("#editUserCardNo").val(patinet.icCardNo);
  503. $("#editUserCardNo").attr("title", patinet.icCardNo);
  504. $("#editUserCardNo").blur();
  505. $("#editUserPhoneNum").val(patinet.phoneNo);
  506. $("#editUserPhoneNum").attr("title", patinet.phoneNo);
  507. $("#editUserPhoneNum").blur();
  508. $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
  509. $('#editUserPatientsNature').selectpicker('refresh');
  510. $("#editUserPatientsNature").blur();
  511. $("#editUserIdCard").val(patinet.socialNo);
  512. $("#editUserIdCard").attr("title", patinet.socialNo);
  513. $("#editUserIdCard").blur();
  514. $('#editUserProvinceCode').selectpicker('val', patinet.provinceCode);
  515. $('#editUserProvinceCode').selectpicker('refresh');
  516. initCity(2, patinet.cityCode);
  517. initDistrict(2, patinet.cityCode, patinet.districtCode);
  518. $("#editUserDetail").val(patinet.detail);
  519. $("#editUserDetail").blur();
  520. $("#editUserContact").val(patinet.relName);
  521. $("#editUserContactPhone").val(patinet.contractName);
  522. }
  523. }
  524. /**
  525. * 关闭当前这个付款方式
  526. */
  527. function closeThisParent(obj) {
  528. $(obj).parent().parent().remove();
  529. }
  530. /**
  531. * 科室与时间区间下拉选改变时清空输入框内容
  532. */
  533. function emptyInput() {
  534. $('#doctor').empty();
  535. $('#doctor').selectpicker('refresh');
  536. $("#registrationFee").val(0.00);
  537. $("#hospitalFee").val(0.00);
  538. $("#checkFee").val(0.00);
  539. $("#amountMoney").text(0.00);
  540. $("#amountMoneyConfirm").text(0.00);
  541. $("#realMoney").val(0.00);
  542. }
  543. /**
  544. * 给某些域增加title或者清除title
  545. * @param obj
  546. */
  547. function clearTextOrTitle(obj) {
  548. if ($(obj).val() == null || $(obj).val().length == 0) {
  549. $(obj).attr("title", null);
  550. } else {
  551. $(obj).attr("title", $(obj).val());
  552. if ($(obj).attr("id") == "birthDay") {
  553. $(obj).blur()
  554. }
  555. }
  556. }
  557. /**
  558. * 查询默认打印机
  559. */
  560. function setPrint() {
  561. if (printIndex >= 0) {
  562. return;
  563. }
  564. $.ajax({
  565. type: "GET",
  566. url: '/thmz/getLastWindowsByCurrentUser',
  567. contentType: "application/json;charset=UTF-8",
  568. dataType: "json",
  569. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  570. async: false,
  571. success: function (res) {
  572. if (res == '401' || res == 401) {
  573. window.location.href = '/thmz/login/view'
  574. return;
  575. }
  576. if (res.code == 0) {
  577. printIndex = res.data.printIndex;
  578. } else {
  579. printIndex = -1;
  580. }
  581. }
  582. });
  583. }
  584. /**
  585. * 修改病人信息
  586. */
  587. function modifyPatient() {
  588. $.ajax({
  589. type: "POST",
  590. url: '/thmz/modifyPatient',
  591. contentType: "application/json;charset=UTF-8",
  592. dataType: "json",
  593. data: JSON.stringify({
  594. "name": $("#editUserName").val(),
  595. "age": $("#editUserAge").val(),
  596. "sex": $("#editUserGender").val(),
  597. "birthDay": $("#editUserBirthDay").val(),
  598. "certificateType": $("#editUserCertificateType").val(),
  599. "icCardNo": $("#editUserCardNo").val(),
  600. "phoneNo": $("#editUserPhoneNum").val(),
  601. "responseType": $("#editUserPatientsNature").val(),
  602. "socialNo": $("#editUserIdCard").val(),
  603. "provinceCode": $("#editUserProvinceCode").val(),
  604. "cityCode": $("#editCityCode").val(),
  605. "districtCode": $("#editUserDistrictCode").val(),
  606. "detail": $("#editUserDetail").val(),
  607. "patientId": $("#editUserCode").val(),
  608. "relName": $("#editUserContact").val(),
  609. "contractName": $("#editUserContactPhone").val()
  610. }),
  611. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  612. success: function (res) {
  613. if (res == '401' || res == 401) {
  614. window.location.href = '/thmz/login/view'
  615. return;
  616. }
  617. if (res.code == 0) {
  618. $('#editUserModal').modal('hide');
  619. //fillPatinet($("#patientId").val());
  620. clearPlusPatinet();
  621. } else {
  622. errorMesage(res.message);
  623. }
  624. }
  625. });
  626. }
  627. /**
  628. * 将病人信息修改域置空
  629. * @param patinet
  630. */
  631. function clearPlusPatinet() {
  632. $("#editUserCode").val(null);
  633. $("#editUserName").val(null);
  634. $("#editUserAge").val(null);
  635. $("#editUserGender").selectpicker('val', '1');
  636. $("#editUserGender").selectpicker('refresh');
  637. $("#editUserBirthDay").val(null);
  638. $('#editUserCertificateType').selectpicker('val', '01');
  639. $('#editUserCertificateType').selectpicker('refresh');
  640. $("#editUserCardNo").val(null);
  641. $("#editUserCardNo").attr("title", null);
  642. $("#editUserPhoneNum").val(null);
  643. $("#editUserPhoneNum").attr("title", null);
  644. $("#editUserPatientsNature").selectpicker('val', '01');//默认选中
  645. $('#editUserPatientsNature').selectpicker('refresh');
  646. $("#editUserIdCard").val(null);
  647. $("#editUserIdCard").attr("title", null);
  648. $('#editUserProvinceCode').selectpicker('val', null);
  649. $('#editUserProvinceCode').selectpicker('refresh');
  650. $('#editCityCode').selectpicker('val', null);
  651. $('#editCityCode').selectpicker('refresh');
  652. $('#editUserDistrictCode').selectpicker('val', null);
  653. $('#editUserDistrictCode').selectpicker('refresh');
  654. $("#editUserDetail").val(null);
  655. $("#editUserContact").val(null);
  656. $("#editUserContactPhone").val(null);
  657. }
  658. /**
  659. * 挂号列表中的科室和医生列表初始化
  660. */
  661. function initListSelect() {
  662. initListDeptSelect();
  663. initListDoctorSelect();
  664. }
  665. /**
  666. * 挂号列表中的科室列表
  667. */
  668. function initListDeptSelect() {
  669. //科室列表
  670. $.ajax({
  671. type: "GET",
  672. url: '/thmz/allMzUnitCode',
  673. dataType: "json",
  674. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  675. success: function (data) {
  676. if (data == '401' || data == 401) {
  677. window.location.href = '/thmz/login/view'
  678. return;
  679. }
  680. var html = '';
  681. $.each(data.data, function (commentIndex, comment) {
  682. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  683. });
  684. $('#deptNoParam').empty();
  685. $('#deptNoParam').html(html);
  686. $('#deptNoParam').selectpicker('refresh');
  687. }
  688. });
  689. }
  690. /**
  691. * 挂号列表中的医生列表初始化
  692. */
  693. function initListDoctorSelect() {
  694. //医生列表
  695. $.ajax({
  696. type: "GET",
  697. url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').val(),
  698. dataType: "json",
  699. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  700. success: function (res) {
  701. if (res == '401' || res == 401) {
  702. window.location.href = '/thmz/login/view'
  703. return;
  704. }
  705. var html = '';
  706. $.each(res.data, function (commentIndex, comment) {
  707. html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
  708. });
  709. $('#doctorParam').empty();
  710. $('#doctorParam').html(html);
  711. // $("#doctorParam").selectpicker({
  712. // size: 10
  713. // });
  714. $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
  715. }
  716. });
  717. }
  718. /**
  719. * 加载挂号列表统计数据
  720. */
  721. function loadTableCount() {
  722. var rePortRangeArr = getRePortRangeArr();
  723. $.ajax({
  724. type: "POST",
  725. url: '/thmz/getCountByParams',
  726. dataType: "json",
  727. contentType: "application/json;charset=UTF-8",
  728. data: JSON.stringify({
  729. "mzyReqrec": {
  730. "unitCode": $("#deptNoParam").val(),
  731. "doctorCode": $("#doctorParam").val(),
  732. "name": $("#userNameParam").val(),
  733. "serialNo": $("#serialNoParams").val()
  734. },
  735. "beginTime": new Date(rePortRangeArr[0]),
  736. "endTime": new Date(rePortRangeArr[1]),
  737. "phoneNo": $("#phoneParam").val()
  738. }),
  739. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  740. success: function (res) {
  741. if (res == '401' || res == 401) {
  742. window.location.href = '/thmz/login/view'
  743. return;
  744. }
  745. if (res.code == 0) {
  746. $("#unPayNum").text(res.unPayNum);
  747. $("#registrationNum").text(res.registrationNum);
  748. $("#haveClinicalNum").text(res.haveClinicalNum);
  749. $("#backNoNum").text(res.backNoNum);
  750. }
  751. }
  752. });
  753. }
  754. /**
  755. * 加载挂号列表
  756. * @param flag 是否清空挂号卡片列表区域
  757. */
  758. function loadRegistrationList(flag) {
  759. if (flag) {
  760. pageIndex = 0;
  761. $("#card_regi_list").empty();
  762. $("div.page").removeClass("in").addClass("hide");
  763. }
  764. var regiListType = getIndex("regi_List_type");
  765. if (regiListType == 0) {
  766. loadCardList();
  767. } else if (regiListType == 1) {
  768. loadTableList();
  769. }
  770. }
  771. /**
  772. * 加载卡片列表
  773. */
  774. function loadCardList() {
  775. $('#tb_regi_list').bootstrapTable("destroy");
  776. isTableListInit = false;
  777. var rePortRangeArr = getRePortRangeArr();
  778. var regiListBtnGroup = getIndex("regi_List_btn_group");
  779. var dataParams = JSON.stringify({
  780. "mzyReqrec": {
  781. "unitCode": $("#deptNoParam").val(),
  782. "doctorCode": $("#doctorParam").val(),
  783. "name": $("#userNameParam").val(),
  784. "serialNo": $("#serialNoParams").val()
  785. },
  786. "beginTime": new Date(rePortRangeArr[0]),
  787. "endTime": new Date(rePortRangeArr[1]),
  788. "pageSize": 8,
  789. "pageIndex": pageIndex,
  790. "phoneNo": $("#phoneParam").val(),
  791. "payMark": "-1"
  792. });
  793. if (regiListBtnGroup == 1) {
  794. dataParams = JSON.stringify({
  795. "mzyReqrec": {
  796. "unitCode": $("#deptNoParam").val(),
  797. "doctorCode": $("#doctorParam").val(),
  798. "name": $("#userNameParam").val(),
  799. "serialNo": $("#serialNoParams").val(),
  800. "visitedMark": 0,
  801. "cancelMark": 0
  802. },
  803. "beginTime": new Date(rePortRangeArr[0]),
  804. "endTime": new Date(rePortRangeArr[1]),
  805. "pageSize": 8,
  806. "pageIndex": pageIndex,
  807. "phoneNo": $("#phoneParam").val(),
  808. "payMark": "5"
  809. });
  810. } else if (regiListBtnGroup == 2) {
  811. dataParams = JSON.stringify({
  812. "mzyReqrec": {
  813. "unitCode": $("#deptNoParam").val(),
  814. "doctorCode": $("#doctorParam").val(),
  815. "name": $("#userNameParam").val(),
  816. "serialNo": $("#serialNoParams").val(),
  817. "visitedMark": 0,
  818. "cancelMark": 0
  819. },
  820. "beginTime": new Date(rePortRangeArr[0]),
  821. "endTime": new Date(rePortRangeArr[1]),
  822. "pageSize": 8,
  823. "pageIndex": pageIndex,
  824. "phoneNo": $("#phoneParam").val()
  825. });
  826. } else if (regiListBtnGroup == 3) {
  827. dataParams = JSON.stringify({
  828. "mzyReqrec": {
  829. "unitCode": $("#deptNoParam").val(),
  830. "doctorCode": $("#doctorParam").val(),
  831. "name": $("#userNameParam").val(),
  832. "serialNo": $("#serialNoParams").val(),
  833. "visitedMark": 1,
  834. "cancelMark": 0
  835. },
  836. "beginTime": new Date(rePortRangeArr[0]),
  837. "endTime": new Date(rePortRangeArr[1]),
  838. "pageSize": 8,
  839. "pageIndex": pageIndex,
  840. "phoneNo": $("#phoneParam").val()
  841. });
  842. } else if (regiListBtnGroup == 4) {
  843. dataParams = JSON.stringify({
  844. "mzyReqrec": {
  845. "unitCode": $("#deptNoParam").val(),
  846. "doctorCode": $("#doctorParam").val(),
  847. "name": $("#userNameParam").val(),
  848. "serialNo": $("#serialNoParams").val(),
  849. "cancelMark": 1
  850. },
  851. "beginTime": new Date(rePortRangeArr[0]),
  852. "endTime": new Date(rePortRangeArr[1]),
  853. "pageSize": 8,
  854. "pageIndex": pageIndex,
  855. "phoneNo": $("#phoneParam").val()
  856. });
  857. }
  858. var buttonCodes = localStorage.getItem("buttonCodes");
  859. $.ajax({
  860. type: "POST",
  861. url: '/thmz/listMzyReqrec',
  862. dataType: "json",
  863. contentType: "application/json;charset=UTF-8",
  864. data: dataParams,
  865. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  866. success: function (res) {
  867. if (res == '401' || res == 401) {
  868. window.location.href = '/thmz/login/view'
  869. return;
  870. }
  871. if (res.code == 0) {
  872. pageIndex++;
  873. $("#totalNum").text(res.pageViewVo.remainder);
  874. if (res.pageViewVo.remainder <= 0) {
  875. $("div.page").removeClass("in").addClass("hide");
  876. } else {
  877. $("div.page").removeClass("hide").addClass("in");
  878. }
  879. var data = res.pageViewVo.data;
  880. for (var i = 0; i < data.length; i++) {
  881. var mzyReqrecVo = data[i];
  882. var color = "registration-not-pay-no-color";
  883. var text = '未缴费</label>/<label>挂号</label>';
  884. if (mzyReqrecVo.mzyReqrec.paymode != null && mzyReqrecVo.mzyReqrec.paymode != "") {
  885. text = '挂号</label>/<label>挂号</label>';
  886. color = "registration-no-color";
  887. if (mzyReqrecVo.mzyReqrec.cancelMark == 0) {
  888. if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
  889. text = '已诊</label>/<label>挂号</label>';
  890. color = "haveClinical-no-color";
  891. }
  892. } else if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
  893. text = '退号</label>/<label>挂号</label>';
  894. color = "back-no-color";
  895. }
  896. }
  897. var sex = "未知";
  898. 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">';
  899. if (mzyReqrecVo.mzPatientMi.sex == 0) {
  900. html += '<img src="/thmz/images/girl_or_boy.png"/>';
  901. } else if (mzyReqrecVo.mzPatientMi.sex == 1) {
  902. sex = "男";
  903. html += '<img src="/thmz/images/boy.png"/>';
  904. } else if (mzyReqrecVo.mzPatientMi.sex == 2) {
  905. sex = "女";
  906. html += '<img src="/thmz/images/girl.png"/>';
  907. }
  908. html += '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.name + '">' + mzyReqrecVo.mzyReqrec.name + '</div>';
  909. if (mzyReqrecVo.mzPatientMi.responseType.length > 2) {
  910. html += '<div class="el-row" style="font-size: 1px;height: 25%;">';
  911. } else {
  912. html += '<div class="el-row" style="font-size: 1px;">';
  913. }
  914. html += mzyReqrecVo.mzPatientMi.responseType + '</div></div><div class="patient-card-main-right"><div></div> <div class="el-row"><label>';
  915. html += text;
  916. 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>';
  917. if (mzyReqrecVo.mzyReqrec.paymode == null || mzyReqrecVo.mzyReqrec.paymode == "") {
  918. html += '<div class="patient-card-foot">' +
  919. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  920. ' <button type="button" class="can-not-used"' +
  921. ' title="修改挂号">' +
  922. ' <i class="fa fa-edit"></i>' +
  923. ' </button>' +
  924. ' </div>' +
  925. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  926. ' <button type="button" class="registration-no-color-foot-button"' +
  927. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  928. ' <i class="fa fa-user"></i>' +
  929. ' </button>' +
  930. ' </div>' +
  931. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  932. ' <button type="button" class="registration-no-color-foot-button"' +
  933. ' title="收费" onclick="chargeRegistration(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
  934. ' <i class="fa fa-rmb"></i>' +
  935. ' </button>' +
  936. ' </div>';
  937. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  938. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  939. ' <button type="button" class="can-not-used"' +
  940. ' title="取消接诊">' +
  941. ' <i class="fa fa-mail-reply"></i>' +
  942. ' </button>' +
  943. ' </div>';
  944. }
  945. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  946. ' <button type="button" class="can-not-used"' +
  947. ' title="退号">' +
  948. ' <i class="fa fa-minus-square-o"></i>' +
  949. ' </button>' +
  950. ' </div>' +
  951. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  952. ' <button type="button" class="can-not-used"' +
  953. ' title="打印">' +
  954. ' <i class="fa fa-print"></i>' +
  955. ' </button>' +
  956. ' </div>' +
  957. ' </div>';
  958. } else {
  959. if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
  960. html += '<div class="patient-card-foot">' +
  961. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  962. ' <button type="button" class="can-not-used"' +
  963. ' title="修改挂号">' +
  964. ' <i class="fa fa-edit"></i>' +
  965. ' </button>' +
  966. ' </div>' +
  967. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  968. ' <button type="button" class="registration-no-color-foot-button"' +
  969. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  970. ' <i class="fa fa-user"></i>' +
  971. ' </button>' +
  972. ' </div>' +
  973. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  974. ' <button type="button" class="can-not-used"' +
  975. ' title="收费">' +
  976. ' <i class="fa fa-rmb"></i>' +
  977. ' </button>' +
  978. ' </div>';
  979. // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  980. // ' <button type="button" class="registration-no-color-foot-button"' +
  981. // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
  982. // ' <i class="fa fa-credit-card"></i>' +
  983. // ' </button>' +
  984. // ' </div>' +
  985. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  986. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  987. ' <button type="button" class="can-not-used"' +
  988. ' title="取消接诊">' +
  989. ' <i class="fa fa-mail-reply"></i>' +
  990. ' </button>' +
  991. ' </div>';
  992. }
  993. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  994. ' <button type="button" class="can-not-used"' +
  995. ' title="退号">' +
  996. ' <i class="fa fa-minus-square-o"></i>' +
  997. ' </button>' +
  998. ' </div>' +
  999. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1000. ' <button type="button" class="can-not-used"' +
  1001. ' title="打印">' +
  1002. ' <i class="fa fa-print"></i>' +
  1003. ' </button>' +
  1004. ' </div>' +
  1005. ' </div>';
  1006. }
  1007. if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
  1008. html += '<div class="patient-card-foot">' +
  1009. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1010. ' <button type="button" class="can-not-used"' +
  1011. ' title="修改挂号">' +
  1012. ' <i class="fa fa-edit"></i>' +
  1013. ' </button>' +
  1014. ' </div>' +
  1015. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1016. ' <button type="button" class="registration-no-color-foot-button"' +
  1017. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  1018. ' <i class="fa fa-user"></i>' +
  1019. ' </button>' +
  1020. ' </div>' +
  1021. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1022. ' <button type="button" class="can-not-used"' +
  1023. ' title="收费">' +
  1024. ' <i class="fa fa-rmb"></i>' +
  1025. ' </button>' +
  1026. ' </div>';
  1027. // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1028. // ' <button type="button" class="registration-no-color-foot-button"' +
  1029. // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
  1030. // ' <i class="fa fa-credit-card"></i>' +
  1031. // ' </button>' +
  1032. // ' </div>' +
  1033. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  1034. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1035. ' <button type="button" class="registration-no-color-foot-button"' +
  1036. ' title="取消接诊" onclick="cancelClinic(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
  1037. ' <i class="fa fa-mail-reply"></i>' +
  1038. ' </button>' +
  1039. ' </div>';
  1040. }
  1041. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1042. ' <button type="button" class="can-not-used"' +
  1043. ' title="退号">' +
  1044. ' <i class="fa fa-minus-square-o"></i>' +
  1045. ' </button>' +
  1046. ' </div>' +
  1047. ' <div class="col-md-2 col-sm-2 col-xs-12">';
  1048. if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
  1049. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
  1050. html += ' <i class="fa fa-rmb"></i>';
  1051. } else {
  1052. var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
  1053. if (printFlag) {
  1054. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
  1055. } else {
  1056. html += ' <button type="button" class="can-not-used" title="打印">';
  1057. }
  1058. html += ' <i class="fa fa-print"></i>';
  1059. }
  1060. html += ' </button>' +
  1061. ' </div>' +
  1062. ' </div>';
  1063. } else {
  1064. html += '<div class="patient-card-foot">' +
  1065. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1066. ' <button type="button" class="can-not-used"' +
  1067. ' title="修改挂号">' +
  1068. ' <i class="fa fa-edit"></i>' +
  1069. ' </button>' +
  1070. ' </div>' +
  1071. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1072. ' <button type="button" class="registration-no-color-foot-button"' +
  1073. ' title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
  1074. ' <i class="fa fa-user"></i>' +
  1075. ' </button>' +
  1076. ' </div>' +
  1077. ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1078. ' <button type="button" class="can-not-used"' +
  1079. ' title="收费">' +
  1080. ' <i class="fa fa-rmb"></i>' +
  1081. ' </button>' +
  1082. ' </div>';
  1083. // ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1084. // ' <button type="button" class="registration-no-color-foot-button"' +
  1085. // ' title="修改收款方式" onclick="editPayMode(\'' + mzyReqrecVo.mzyReqrec.patientId + '\','+mzyReqrecVo.mzyReqrec.times+',\''+mzyReqrecVo.mzyReqrec.paymode+'\','+mzyReqrecVo.mzyReqrec.dcountNo+')">' +
  1086. // ' <i class="fa fa-credit-card"></i>' +
  1087. // ' </button>' +
  1088. // ' </div>' +
  1089. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  1090. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1091. ' <button type="button" class="can-not-used"' +
  1092. ' title="取消接诊">' +
  1093. ' <i class="fa fa-mail-reply"></i>' +
  1094. ' </button>' +
  1095. ' </div>';
  1096. }
  1097. html += ' <div class="col-md-2 col-sm-2 col-xs-12">' +
  1098. ' <button type="button" class="registration-no-color-foot-button"' +
  1099. ' title="退号" onclick="backNoModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
  1100. ' <i class="fa fa-minus-square-o"></i>' +
  1101. ' </button>' +
  1102. ' </div>' +
  1103. ' <div class="col-md-2 col-sm-2 col-xs-12">';
  1104. if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
  1105. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
  1106. html += ' <i class="fa fa-rmb"></i>';
  1107. } else {
  1108. var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
  1109. if (printFlag) {
  1110. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
  1111. } else {
  1112. html += ' <button type="button" class="can-not-used" title="打印">';
  1113. }
  1114. html += ' <i class="fa fa-print"></i>';
  1115. }
  1116. html += ' </button>' +
  1117. ' </div>' +
  1118. ' </div>';
  1119. }
  1120. }
  1121. html += '</div></div>';
  1122. $("#card_regi_list").append(html);
  1123. }
  1124. }
  1125. }
  1126. });
  1127. }
  1128. /**
  1129. * 加载表格列表
  1130. */
  1131. function loadTableList() {
  1132. var buttonCodes = localStorage.getItem("buttonCodes");
  1133. if (isTableListInit) {
  1134. $('#tb_regi_list').bootstrapTable('refresh');
  1135. } else {
  1136. isTableListInit = true;
  1137. $('#tb_regi_list').bootstrapTable({
  1138. url: '/thmz/listMzyReqrec', //请求后台的URL(*)
  1139. method: 'post', //请求方式(*)
  1140. toolbar: '#toolbar', //工具按钮用哪个容器
  1141. striped: true, //是否显示行间隔色
  1142. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  1143. pagination: true, //是否显示分页(*)
  1144. sortable: true, //是否启用排序
  1145. sortOrder: "asc", //排序方式
  1146. queryParams: queryParams, //传递参数(*)
  1147. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  1148. pageNumber: 1, //初始化加载第一页,默认第一页
  1149. pageSize: 10, //每页的记录行数(*)
  1150. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  1151. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  1152. strictSearch: true,
  1153. showColumns: false, //是否显示所有的列
  1154. showRefresh: false, //是否显示刷新按钮
  1155. minimumCountColumns: 2, //最少允许的列数
  1156. clickToSelect: true, //是否启用点击选中行
  1157. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  1158. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  1159. cardView: false, //是否显示详细视图
  1160. detailView: false,
  1161. //rowStyle:rowStyle,//通过自定义函数设置行样式
  1162. ajaxOptions: {
  1163. headers: {
  1164. 'Accept': 'application/json',
  1165. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  1166. }
  1167. },
  1168. columns: [
  1169. {
  1170. field: 'mzyReqrec.patientId',
  1171. title: '病人ID',
  1172. align: "center",
  1173. valign: 'middle',
  1174. // sortable: true
  1175. }, {
  1176. field: 'mzyReqrec.times',
  1177. title: '就诊次数',
  1178. align: "center",
  1179. valign: 'middle',
  1180. // sortable: true
  1181. }, {
  1182. field: 'mzyReqrec.name',
  1183. title: '病人姓名',
  1184. align: "center",
  1185. valign: 'middle',
  1186. // sortable: true
  1187. }, {
  1188. field: 'mzPatientMi.responseType',
  1189. title: '病人性质',
  1190. align: "center",
  1191. valign: 'middle',
  1192. // sortable: true
  1193. }, {
  1194. field: 'mzPatientMi.sex',
  1195. title: '性别',
  1196. align: "center",
  1197. valign: 'middle',
  1198. //sortable: true,
  1199. formatter: function (value, row, index) {
  1200. if (value == '1') {
  1201. return "男";
  1202. } else if (value == '2') {
  1203. return "女";
  1204. } else if (value == '0') {
  1205. return "未知";
  1206. }
  1207. }
  1208. },
  1209. // {
  1210. // field: 'mzPatientMi.age',
  1211. // title: '年龄',
  1212. // align: "center",
  1213. // valign: 'middle',
  1214. // // sortable: true
  1215. // }, {
  1216. // field: 'mzPatientMi.phoneNo',
  1217. // title: '电话',
  1218. // align: "center",
  1219. // valign: 'middle',
  1220. // // sortable: true,
  1221. // },
  1222. {
  1223. field: 'mzyReqrec.cancelMark',
  1224. title: '就诊状态',
  1225. align: "center",
  1226. valign: 'middle',
  1227. // sortable: true,
  1228. formatter: function (value, row, index) {
  1229. var text = '<span style="color:#769F0E">挂号未缴费</span>';
  1230. if (row.mzyReqrec.paymode != null && row.mzyReqrec.paymode != "") {
  1231. text = '<span style="color:#26c175">挂号</span>';
  1232. if (value == 0) {
  1233. if (row.mzyReqrec.visitedMark == 1) {
  1234. text = '<span style="color:#6778ed">已诊</span>';
  1235. }
  1236. } else if (value == 1) {
  1237. text = '<span style="color:#ff6b91">退号</span>';
  1238. }
  1239. }
  1240. return text;
  1241. }
  1242. }, {
  1243. field: 'mzyReqrec.requestDayStr',
  1244. title: '号源日期',
  1245. align: "center",
  1246. valign: 'middle',
  1247. // sortable: true,
  1248. formatter: function (value, row, index) {
  1249. return format(value, "yyyy-MM-dd");
  1250. }
  1251. }, {
  1252. field: 'mzyReqrec.ampm',
  1253. title: '号段',
  1254. align: "center",
  1255. valign: 'middle',
  1256. // sortable: true
  1257. }, {
  1258. field: 'mzyReqrec.unitCode',
  1259. title: '挂号科室',
  1260. align: "center",
  1261. valign: 'middle',
  1262. // sortable: true
  1263. }, {
  1264. field: 'mzyReqrec.chargeType',
  1265. title: '号别',
  1266. align: "center",
  1267. valign: 'middle',
  1268. // sortable: true
  1269. }, {
  1270. field: 'mzyReqrec.doctorCode',
  1271. title: '挂号医生',
  1272. align: "center",
  1273. valign: 'middle',
  1274. // sortable: true
  1275. }, {
  1276. field: 'mzyReqrec.opDay',
  1277. title: '挂号时间',
  1278. align: "center",
  1279. valign: 'middle',
  1280. // sortable: true,
  1281. formatter: function (value, row, index) {
  1282. return format(value, "yyyy-MM-dd HH:mm:ss");
  1283. }
  1284. }, {
  1285. field: 'mzyReqrec.opId',
  1286. title: '挂号渠道',
  1287. align: "center",
  1288. valign: 'middle',
  1289. formatter: function (value, row, index) {
  1290. if (value == '99999') {
  1291. return '公众号';
  1292. }
  1293. if (value == '99996') {
  1294. return '互联网医院平台';
  1295. }
  1296. return '院内窗口';
  1297. }
  1298. }, {
  1299. field: 'mzyReqrec.paymode',
  1300. title: '支付方式',
  1301. align: "center",
  1302. valign: 'middle'
  1303. // sortable: true,
  1304. }, {
  1305. title: '操作',
  1306. align: "center",
  1307. valign: 'middle',
  1308. // sortable: true,
  1309. formatter: function (value, row, index) {
  1310. if (row.mzyReqrec.paymode == null || row.mzyReqrec.paymode == "") {
  1311. 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>';
  1312. 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>';
  1313. // '<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>' +
  1314. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  1315. html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
  1316. }
  1317. 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>';
  1318. return html;
  1319. }
  1320. if (row.mzyReqrec.cancelMark == 1) {
  1321. 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>';
  1322. html += '<button type="button" class="can-not-used" title="收费" ><i class="fa fa-rmb"></i></button>';
  1323. // '<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>' +
  1324. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  1325. html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
  1326. }
  1327. 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>';
  1328. return html;
  1329. }
  1330. if (row.mzyReqrec.visitedMark == 1) {
  1331. 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>';
  1332. html += '<button type="button" class="can-not-used" title="收费"><i class="fa fa-rmb"></i></button>';
  1333. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  1334. 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>';
  1335. }
  1336. // '<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>' +
  1337. html += '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button>';
  1338. if (row.mzyReqrec.paymode == "本院记账") {
  1339. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
  1340. html += '<i class="fa fa-rmb"></i></button>';
  1341. } else {
  1342. var printFlag = isEmpty(row.mzyReqrec.printerId);
  1343. if (printFlag) {
  1344. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
  1345. } else {
  1346. html += ' <button type="button" class="can-not-used" title="打印">';
  1347. }
  1348. html += '<i class="fa fa-print"></i></button>';
  1349. }
  1350. // 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>';
  1351. return html;
  1352. }
  1353. 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>';
  1354. html += '<button type="button" class="can-not-used" title="收费" ><i class="fa fa-rmb"></i></button>';
  1355. // '<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>' +
  1356. if (!(buttonCodes == null || !isInArrayStr("cancel_clinic", buttonCodes))) {
  1357. html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
  1358. }
  1359. 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>';
  1360. if (row.mzyReqrec.paymode == "本院记账") {
  1361. html += ' <button type="button" class="registration-no-color-foot-button" title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
  1362. html += '<i class="fa fa-rmb"></i></button>';
  1363. } else {
  1364. var printFlag = isEmpty(row.mzyReqrec.printerId);
  1365. if (printFlag) {
  1366. html += ' <button type="button" class="registration-no-color-foot-button" title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
  1367. } else {
  1368. html += ' <button type="button" class="can-not-used" title="打印">';
  1369. }
  1370. html += '<i class="fa fa-print"></i></button>';
  1371. }
  1372. //html += '<button type="button" class="can-not-used" title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
  1373. return html;
  1374. }
  1375. }],
  1376. responseHandler: function (res) {
  1377. if (res == '401' || res == 401) {
  1378. window.location.href = '/thmz/login/view'
  1379. return;
  1380. }
  1381. var ress = eval(res);
  1382. if (ress.code == -1) {
  1383. new PNotify({
  1384. title: '错误提示',
  1385. text: ress.message,
  1386. type: 'error',
  1387. hide: true,
  1388. styling: 'bootstrap3'
  1389. });
  1390. return {
  1391. "total": 0,//总页数
  1392. "rows": {} //数据
  1393. };
  1394. }
  1395. return {
  1396. "total": ress.pageViewVo.total,//总页数
  1397. "rows": ress.pageViewVo.data //数据
  1398. };
  1399. },
  1400. });
  1401. }
  1402. }
  1403. /**
  1404. * 得到查询的参数
  1405. * @param params
  1406. * @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}}
  1407. */
  1408. function queryParams(params) {
  1409. var rePortRangeArr = getRePortRangeArr();
  1410. var regiListBtnGroup = getIndex("regi_List_btn_group");
  1411. var temp = {
  1412. mzyReqrec: {
  1413. unitCode: $("#deptNoParam").val(),
  1414. doctorCode: $("#doctorParam").val(),
  1415. name: $("#userNameParam").val(),
  1416. serialNo: $("#serialNoParams").val()
  1417. },
  1418. beginTime: new Date(rePortRangeArr[0]),
  1419. endTime: new Date(rePortRangeArr[1]),
  1420. pageSize: params.limit, //页面大小
  1421. pageIndex: params.offset / params.limit, //页码
  1422. phoneNo: $("#phoneParam").val(),
  1423. payMark: -1
  1424. };
  1425. if (regiListBtnGroup == 1) {
  1426. temp = {
  1427. mzyReqrec: {
  1428. unitCode: $("#deptNoParam").val(),
  1429. doctorCode: $("#doctorParam").val(),
  1430. name: $("#userNameParam").val(),
  1431. serialNo: $("#serialNoParams").val(),
  1432. visitedMark: 0,
  1433. cancelMark: 0
  1434. },
  1435. beginTime: new Date(rePortRangeArr[0]),
  1436. endTime: new Date(rePortRangeArr[1]),
  1437. pageSize: params.limit, //页面大小
  1438. pageIndex: params.offset / params.limit, //页码
  1439. payMark: 5
  1440. };
  1441. } else if (regiListBtnGroup == 2) {
  1442. temp = {
  1443. mzyReqrec: {
  1444. unitCode: $("#deptNoParam").val(),
  1445. doctorCode: $("#doctorParam").val(),
  1446. name: $("#userNameParam").val(),
  1447. serialNo: $("#serialNoParams").val(),
  1448. visitedMark: 0,
  1449. cancelMark: 0
  1450. },
  1451. beginTime: new Date(rePortRangeArr[0]),
  1452. endTime: new Date(rePortRangeArr[1]),
  1453. pageSize: params.limit, //页面大小
  1454. pageIndex: params.offset / params.limit, //页码
  1455. };
  1456. } else if (regiListBtnGroup == 3) {
  1457. temp = {
  1458. mzyReqrec: {
  1459. unitCode: $("#deptNoParam").val(),
  1460. doctorCode: $("#doctorParam").val(),
  1461. name: $("#userNameParam").val(),
  1462. serialNo: $("#serialNoParams").val(),
  1463. visitedMark: 1,
  1464. cancelMark: 0
  1465. },
  1466. beginTime: new Date(rePortRangeArr[0]),
  1467. endTime: new Date(rePortRangeArr[1]),
  1468. pageSize: params.limit, //页面大小
  1469. pageIndex: params.offset / params.limit, //页码
  1470. };
  1471. } else if (regiListBtnGroup == 4) {
  1472. temp = {
  1473. mzyReqrec: {
  1474. unitCode: $("#deptNoParam").val(),
  1475. doctorCode: $("#doctorParam").val(),
  1476. name: $("#userNameParam").val(),
  1477. serialNo: $("#serialNoParams").val(),
  1478. cancelMark: 1
  1479. },
  1480. beginTime: new Date(rePortRangeArr[0]),
  1481. endTime: new Date(rePortRangeArr[1]),
  1482. pageSize: params.limit, //页面大小
  1483. pageIndex: params.offset / params.limit, //页码
  1484. };
  1485. }
  1486. return temp;
  1487. };
  1488. /**
  1489. * 根据是挂号还是已诊或是退号 设置行的颜色
  1490. * @param row
  1491. * @param index
  1492. * @returns {*}
  1493. */
  1494. function rowStyle(row, index) {
  1495. var style = {css: {'background': 'linear-gradient(130deg, #06c7d6, #26c175) !important;'}};
  1496. if (row.mzyReqrec.cancelMark == 0) {
  1497. if (row.mzyReqrec.visitedMark == 1) {
  1498. style = {css: {'background': 'linear-gradient(130deg, #41a6f5, #6778ed) !important;'}};
  1499. }
  1500. } else if (row.mzyReqrec.cancelMark == 1) {
  1501. style = {css: {'background': 'linear-gradient(130deg, #ff9e70, #ff6b91) !important;'}};
  1502. }
  1503. return style;
  1504. }
  1505. /**
  1506. * 获取按钮组选择的下标
  1507. * @param id
  1508. * @returns {number}
  1509. */
  1510. function getIndex(id) {
  1511. var index = 0;
  1512. var item = $("#" + id).find("button");
  1513. for (var i = 0; i <= item.length; i++) {
  1514. if ($(item[i]).hasClass("btn-primary")) {
  1515. index = i;
  1516. break;
  1517. }
  1518. }
  1519. return index;
  1520. }
  1521. /**
  1522. * 获取时间选择器的时间数组
  1523. * @returns {string[]}
  1524. */
  1525. function getRePortRangeArr() {
  1526. var rePortRange = $('#reportrange span').html();
  1527. var rePortRangeArr = rePortRange.split(" - ");
  1528. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  1529. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  1530. return rePortRangeArr;
  1531. }
  1532. /**
  1533. * 清空搜索参数
  1534. */
  1535. function clearParams() {
  1536. $("#deptNoParam").selectpicker('val', null);
  1537. $("#deptNoParam").selectpicker('refresh');
  1538. $("#doctorParam").selectpicker('val', null);
  1539. $("#deptNoParam").selectpicker('refresh');
  1540. $("#userNameParam").val(null);
  1541. $("#phoneParam").val(null);
  1542. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  1543. }
  1544. /**
  1545. * 保存退号信息
  1546. */
  1547. function saveBackNo() {
  1548. $.ajax({
  1549. type: "POST",
  1550. url: '/thmz/updateReqrec',
  1551. contentType: "application/json;charset=UTF-8",
  1552. dataType: "json",
  1553. data: JSON.stringify({
  1554. "patientId": $("#backNoPatientId").val(),
  1555. "times": $("#backNoTimes").val(),
  1556. "cancelMark": 1
  1557. }),
  1558. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1559. success: function (res) {
  1560. if (res == '401' || res == 401) {
  1561. window.location.href = '/thmz/login/view'
  1562. return;
  1563. }
  1564. if (res.code == 0) {
  1565. new PNotify({
  1566. title: '操作提示',
  1567. text: res.message,
  1568. type: 'success',
  1569. hide: true,
  1570. styling: 'bootstrap3'
  1571. });
  1572. loadTableCount();
  1573. loadRegistrationList(true);
  1574. $("#backNoModal").modal("hide");
  1575. } else {
  1576. new PNotify({
  1577. title: '错误提示',
  1578. text: res.message,
  1579. type: 'error',
  1580. hide: true,
  1581. styling: 'bootstrap3'
  1582. });
  1583. }
  1584. }
  1585. });
  1586. }
  1587. /**
  1588. * 打开退费重收确认弹框
  1589. * @param serialNo
  1590. */
  1591. function chargeFeeForByjz(serialNo) {
  1592. $("#serialNo").val(serialNo);
  1593. $("#confirmFeeModal").modal();
  1594. }
  1595. /**
  1596. * 直接打印发票
  1597. * @param patientId
  1598. */
  1599. function prn1Print(patientId, times) {
  1600. setPrint();
  1601. var height = "93.15mm";
  1602. // if(countReceiot%2==0){
  1603. // height ="93.2mm";
  1604. // }
  1605. $.ajax({
  1606. type: "GET",
  1607. url: '/thmz/printMzyReqrecRecept?patientId=' + patientId + "&times=" + times,
  1608. contentType: "application/json;charset=UTF-8",
  1609. dataType: "json",
  1610. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1611. async: false,
  1612. success: function (res) {
  1613. if (res == '401' || res == 401) {
  1614. window.location.href = '/thmz/login/view'
  1615. return;
  1616. }
  1617. if (res.code == 0) {
  1618. if (res.data == null || res.data.length == 0) {
  1619. return;
  1620. }
  1621. // countReceiot++;
  1622. LODOP = getLodop();
  1623. var temp = res.data;
  1624. LODOP.PRINT_INITA(6, 0, "120mm", height, "泰和门诊发票打印");
  1625. //设置默认打印机
  1626. LODOP.SET_PRINTER_INDEX(printIndex);
  1627. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "120mm");
  1628. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", height);
  1629. LODOP.SET_PRINT_PAGESIZE(1, "120mm", height, "CreateCustomPage");
  1630. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "门诊发票");//对新建的纸张重命名
  1631. LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
  1632. LODOP.ADD_PRINT_TEXT("6mm", "0mm", "55mm", "3mm", "湖南泰和医院管理有限公司");
  1633. LODOP.ADD_PRINT_TEXT("6mm", "59mm", "30mm", "3mm", "流水号:");
  1634. LODOP.ADD_PRINT_TEXT("6mm", "72mm", "20mm", "3mm", temp.serialNo);
  1635. LODOP.ADD_PRINT_TEXT("19mm", "0mm", "35mm", "3mm", temp.receiptBill);
  1636. LODOP.ADD_PRINT_TEXT("25mm", "7mm", "50mm", "3mm", temp.name);
  1637. LODOP.ADD_PRINT_TEXT("25mm", "61mm", "27mm", "3mm", patientId);
  1638. LODOP.ADD_PRINT_TEXT("32mm", "6mm", "50mm", "3mm", "就诊科室:" + temp.unitCode);
  1639. LODOP.ADD_PRINT_TEXT("32mm", "56mm", "50mm", "3mm", "地点:" + res.officePos);
  1640. LODOP.ADD_PRINT_TEXT("37mm", "6mm", "50mm", "3mm", "看诊医生:" + temp.doctorCode);
  1641. LODOP.ADD_PRINT_TEXT("37mm", "56mm", "50mm", "3mm", "号段:" + temp.ampm);
  1642. LODOP.ADD_PRINT_TEXT("42mm", "6mm", "50mm", "3mm", "号别:" + temp.chargeType);
  1643. LODOP.ADD_PRINT_TEXT("42mm", "56mm", "50mm", "3mm", "就诊号:" + temp.reqOrder);
  1644. LODOP.ADD_PRINT_TEXT("47mm", "6mm", "50mm", "3mm", "挂号费:" + temp.reqFee);
  1645. LODOP.ADD_PRINT_TEXT("47mm", "56mm", "50mm", "3mm", "诊查费:" + temp.clinicFee);
  1646. LODOP.ADD_PRINT_TEXT("52mm", "6mm", "50mm", "3mm", "其他:" + temp.othFee);
  1647. LODOP.ADD_PRINT_TEXT("52mm", "56mm", "50mm", "3mm", "工本费:" + temp.brochureFee);
  1648. LODOP.ADD_PRINT_TEXT("65mm", "21mm", "60mm", "3mm", res.totalFee + " 元");
  1649. LODOP.ADD_PRINT_TEXT("72mm", "19mm", "60mm", "3mm", res.totalFeeStr);
  1650. LODOP.ADD_PRINT_TEXT("79mm", "0mm", "15mm", "3mm", res.year);//年
  1651. LODOP.ADD_PRINT_TEXT("79mm", "13mm", "10mm", "3mm", res.month);//月
  1652. LODOP.ADD_PRINT_TEXT("79mm", "25mm", "10mm", "3mm", res.day);//日
  1653. LODOP.ADD_PRINT_TEXT("79mm", "53mm", "23mm", "3mm", res.user.userName);//收费员
  1654. //LODOP.PREVIEW();
  1655. LODOP.PRINT();
  1656. if (times > 0) {
  1657. loadTableCount();
  1658. loadRegistrationList(true);
  1659. }
  1660. } else if (res.code == -1) {
  1661. new PNotify({
  1662. title: '错误提示',
  1663. text: res.message,
  1664. type: 'error',
  1665. hide: true,
  1666. styling: 'bootstrap3'
  1667. });
  1668. }
  1669. }
  1670. });
  1671. };
  1672. /**
  1673. * 取消接诊
  1674. * @param patientId
  1675. */
  1676. function cancelClinic(patientId, times) {
  1677. $("#messageModal").modal();
  1678. $("#messageContent").html("确认取消当前病人的接诊记录吗?");
  1679. $("#messageButton").off("click").on("click", function (t) {
  1680. $("#messageModal").modal("hide");
  1681. $.ajax({
  1682. type: "GET",
  1683. url: '/thmz/cancelClinic?patientId=' + patientId + "&times=" + times,
  1684. contentType: "application/json;charset=UTF-8",
  1685. dataType: "json",
  1686. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1687. success: function (res) {
  1688. if (res == '401' || res == 401) {
  1689. window.location.href = '/thmz/login/view'
  1690. return;
  1691. }
  1692. if (res.code == 0) {
  1693. if (res.data == null || res.data.length == 0) {
  1694. return;
  1695. }
  1696. successMesage(res);
  1697. if (times > 0) {
  1698. loadTableCount();
  1699. loadRegistrationList(true);
  1700. }
  1701. } else if (res.code == -1) {
  1702. errorMesage(res);
  1703. }
  1704. }
  1705. });
  1706. });
  1707. };
  1708. //判断字符是否为空的方法
  1709. function isEmpty(obj) {
  1710. if (typeof obj == "undefined" || obj == null || obj == "") {
  1711. return true;
  1712. } else {
  1713. return false;
  1714. }
  1715. }
  1716. /**
  1717. * 导出excel
  1718. */
  1719. function exportExcel() {
  1720. var rePortRangeArr = getRePortRangeArr();
  1721. var regiListBtnGroup = getIndex("regi_List_btn_group");
  1722. var visitedMark = "";
  1723. var cancelMark = "";
  1724. if (regiListBtnGroup == 1) {
  1725. visitedMark = 0;
  1726. cancelMark = 0;
  1727. } else if (regiListBtnGroup == 2) {
  1728. visitedMark = 1;
  1729. cancelMark = 0;
  1730. } else if (regiListBtnGroup == 3) {
  1731. cancelMark = 1;
  1732. }
  1733. window.location.href = "/thmz/exportListMzyReqrec?beginTime=" + rePortRangeArr[0] + "&endTime=" + rePortRangeArr[1] + "&name=" + $("#userNameParam").val()
  1734. + "&unitCode=" + $("#deptNoParam").val() + "&doctorCode=" + $("#doctorParam").val() + "&phoneNo=" + $("#phoneParam").val() + "&serialNo=" + $("#serialNoParams").val() + "&visitedMark="
  1735. + visitedMark + "&cancelMark=" + cancelMark;
  1736. }
  1737. /**
  1738. * 修改收款方式
  1739. * @param patientId
  1740. * @param times
  1741. * @param paymode
  1742. */
  1743. function editPayMode(patientId, times, paymode, dcountNo) {
  1744. var message = "当前病人本次挂号的收费方式为【" + paymode + "】,确定需要修改吗?";
  1745. if (dcountNo == 1) {
  1746. message = "当前病人本次挂号的收费方式为【" + paymode + "】,且本次挂号已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次挂号所在日期的【日结报表】!";
  1747. }
  1748. $("#editPayModeTip").html(message);
  1749. $("#patientId").val(patientId);
  1750. $("#times").val(times);
  1751. $('#payTypeEditPayMode').selectpicker('val', 1);
  1752. $('#payTypeEditPayMode').selectpicker('refresh');
  1753. $("#editPayModeModal").modal();
  1754. }
  1755. /**
  1756. * 提交修改收款方式
  1757. */
  1758. function saveEditPayMode() {
  1759. $.ajax({
  1760. type: "GET",
  1761. url: '/thmz/updatePayMode?patientId=' + $("#patientId").val() + "&times=" + $("#times").val() + "&payMode=" + $("#payTypeEditPayMode").val(),
  1762. contentType: "application/json;charset=UTF-8",
  1763. dataType: "json",
  1764. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1765. success: function (res) {
  1766. if (res == '401' || res == 401) {
  1767. window.location.href = '/thmz/login/view'
  1768. return;
  1769. }
  1770. if (res.code == 0) {
  1771. successMesage(res);
  1772. clearEditPayMode();
  1773. $("#editPayModeModal").modal("hide");
  1774. loadRegistrationList(true);
  1775. } else if (res.code == -1) {
  1776. errorMesage(res.message);
  1777. }
  1778. }
  1779. });
  1780. }
  1781. /**
  1782. * 清空
  1783. */
  1784. function clearEditPayMode() {
  1785. $("#patientId").val(null);
  1786. $("#times").val(null);
  1787. }
  1788. /**
  1789. * 未支付的挂号记录缴费
  1790. * @param patientId
  1791. * @param times
  1792. */
  1793. function chargeRegistration(patientId, times) {
  1794. clearRegistrationModal();
  1795. $.ajax({
  1796. type: "POST",
  1797. url: '/thmz/getMzyReqrecByPatientIdAndTimes',
  1798. contentType: "application/json;charset=UTF-8",
  1799. dataType: "json",
  1800. data: JSON.stringify({"patientId": patientId, "times": times}),
  1801. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1802. success: function (res) {
  1803. if (res == '401' || res == 401) {
  1804. window.location.href = '/thmz/login/view'
  1805. return;
  1806. }
  1807. if (res.code == 0) {
  1808. if (res.data != null) {
  1809. $("#patientIdRegistration").val(patientId);
  1810. $("#timesRegistration").val(times);
  1811. $("#realMoney").val(res.totalAmount);
  1812. $("#cash").val(res.totalAmount);
  1813. $("#amountMoneyConfirm").text(res.totalAmount);
  1814. $("#chargeRegistrationModal").modal();
  1815. }
  1816. } else {
  1817. errorMesage(res.message);
  1818. }
  1819. }
  1820. });
  1821. }
  1822. /**
  1823. * 支付未缴费的挂号信息
  1824. */
  1825. function payRegistration() {
  1826. $("#chargeRegistrationModal").modal('hide');
  1827. $("#messageModal").modal();
  1828. $("#messageContent").html("确定提交本次预约挂号缴费操作吗?");
  1829. $("#messageButton").off("click").bind("click", function (t) {
  1830. $("#messageModal").modal('hide');
  1831. $.ajax({
  1832. type: "POST",
  1833. url: '/thmz/payRegistration',
  1834. contentType: "application/json;charset=UTF-8",
  1835. dataType: "json",
  1836. data: JSON.stringify({
  1837. "patientId": $("#patientIdRegistration").val(),
  1838. "times": $("#timesRegistration").val(),
  1839. "paymode": $("#payType").val(),
  1840. "amount": $("#cash").val()
  1841. }),
  1842. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1843. success: function (res) {
  1844. if (res == '401' || res == 401) {
  1845. window.location.href = '/thmz/login/view'
  1846. return;
  1847. }
  1848. if (res.code == 0) {
  1849. successMesage(res);
  1850. $("#chargeRegistrationModal").modal('hide');
  1851. clearRegistrationModal();
  1852. loadTableCount();
  1853. loadRegistrationList(true);
  1854. } else {
  1855. errorMesage(res.message);
  1856. }
  1857. }
  1858. });
  1859. });
  1860. $("#cancelButton").off("click").bind("click", function (t) {
  1861. $("#messageModal").modal('hide');
  1862. $("#chargeRegistrationModal").modal();
  1863. });
  1864. }
  1865. /**
  1866. * 清空缴费区域
  1867. */
  1868. function clearRegistrationModal() {
  1869. $("#patientIdRegistration").val(null);
  1870. $("#timesRegistration").val(null);
  1871. $("#realMoney").val(null);
  1872. $("#cash").val(null);
  1873. $("#amountMoneyConfirm").text("");
  1874. }