charge_detail.js 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  1. //@ sourceURL=charge_detail.js
  2. //项目类型map
  3. var classCodeMap = null;
  4. //核算码map
  5. var auditCodeMap = null;
  6. //门诊发票码map
  7. var billItemMzMap = null;
  8. //住院发票码map
  9. var billItemZyMap = null;
  10. $(function () {
  11. initSelect();
  12. initZdChargeItemList();
  13. //重置查询参数
  14. $('#btn_clean').click(function () {
  15. $("#name").val(null);
  16. $("#classCode").selectpicker('val', null);//默认选中
  17. $("#classCode").selectpicker('refresh');
  18. $("#auditCode").selectpicker('val', null);//默认选中
  19. $("#auditCode").selectpicker('refresh');
  20. $("#billItemMz").selectpicker('val', null);//默认选中
  21. $("#billItemMz").selectpicker('refresh');
  22. $("#billItemZy").selectpicker('val', null);//默认选中
  23. $("#billItemZy").selectpicker('refresh');
  24. $("#delFlag").selectpicker('val', null);//默认选中
  25. $("#delFlag").selectpicker('refresh');
  26. // $("#clCode").val(null);
  27. initZdChargeItemList();
  28. });
  29. $('#btn_add').click(function () {
  30. $("#myModalLabel").text("新增收费项目");
  31. $("#percentag2Params").val(1);
  32. $("#chargeDetailModal").modal();
  33. });
  34. $("#effectiveTimeParams").change(function (e) {
  35. var effectiveTimeParams=$("#effectiveTimeParams").val();
  36. if (effectiveTimeParams.length == 8 && effectiveTimeParams.indexOf("-") <= 0) {
  37. effectiveTimeParams = effectiveTimeParams.substring(0, 4) + "-" + effectiveTimeParams.substring(4, 6) + "-" + effectiveTimeParams.substring(6);
  38. $("#effectiveTimeParams").val(effectiveTimeParams);
  39. }
  40. var dateFormat = /^(\d{4})-(\d{2})-(\d{2})$/;
  41. if (!dateFormat.test(effectiveTimeParams)) {
  42. new PNotify({
  43. title: '错误提示',
  44. text: '生效日期格式错误,格式为yyyy-mm-dd',
  45. type: 'error',
  46. hide: true,
  47. styling: 'bootstrap3'
  48. });
  49. }
  50. });
  51. //保存收费项目
  52. $('#save').click(function () {
  53. $.ajax({
  54. type: "POST",
  55. url: '/thmz/saveZdChargeItem',
  56. contentType: "application/json;charset=UTF-8",
  57. dataType: "json",
  58. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  59. data: JSON.stringify({"classCode": $("#classCodeParams").val(),
  60. "name": $("#namePamras").val(),"chargeUnit": $("#chargeUnitParams").val(),
  61. "chargeAmount": $("#chargeAmountParams").val(),
  62. "percentag2": $("#percentag2Params").val(),
  63. "auditCode": $("#auditCodeParams").val(),"billItemMz": $("#billItemMzParams").val(),
  64. "billItemZy": $("#billItemZyParams").val(),"execUnit": $("#execUnitParams").val(),"bzCode": $("#bzCodeParams").val(),
  65. "discription": $("#discriptionParams").val(),"clCode": $("#clCodeParams").val(),"co": $("#coParams").val(),"xlCode": $("#xlCodeParams").val(),
  66. "code": $("#code").val(),"ybComment": $("#ybCommentParams").val(),"nationalCode": $("#nationalCodeParams").val(),"nationalName": $("#nationalNameParams").val(),"hnsybCode": $("#hnsybCodeParams").val(),
  67. "descriptions": $("#descriptionsParams").val(),"excludeContent": $("#excludeContentParams").val(),"connotation": $("#connotationParams").val(),
  68. "approvalNumber": $("#approvalNumberParams").val(),"groupNo":$("#groupNoParams").val(),"zdChargeBaClass":$("#zdChargeBaClassParams").val(),"focusMonitorFlag":$("#focusMonitorFlag").val()
  69. ,"genderRestriction":$("#genderRestriction").val(),"minAgeRestriction":$("#minAgeRestriction").val(),"maxAgeRestriction":$("#maxAgeRestriction").val()}),
  70. success: function (res) {
  71. if (res == '401' || res == 401) {
  72. window.location.href = '/thmz/login/view'
  73. return;
  74. }
  75. if (res.code == 0) {
  76. $("#chargeDetailModal").modal("hide");
  77. clearInput();
  78. successMesage(res);
  79. $('#tb_table').bootstrapTable("refresh");
  80. } else {
  81. errorMesage(res);
  82. }
  83. }
  84. });
  85. });
  86. //保存收费项目延迟改价
  87. $('#save_price').click(function () {
  88. $.ajax({
  89. type: "POST",
  90. url: '/thmz/saveEffectivePrice',
  91. contentType: "application/json;charset=UTF-8",
  92. dataType: "json",
  93. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  94. data: JSON.stringify({
  95. "effectivePrice": $("#chargeAmountPriceNeedUpdateParams").val(),
  96. "effectiveTime": $("#effectiveTimeParams").val(),
  97. "code": $("#code_price").val()
  98. }),
  99. success: function (res) {
  100. if (res == '401' || res == 401) {
  101. window.location.href = '/thmz/login/view'
  102. return;
  103. }
  104. if (res.code == 0) {
  105. $("#priceModal").modal("hide");
  106. clearPriceInput();
  107. $('#tb_table').bootstrapTable("refresh");
  108. successMesage(res);
  109. } else {
  110. errorMesage(res);
  111. }
  112. }
  113. });
  114. });
  115. //保存收费项目延迟启用/停用
  116. $('#save_delayToEnableOrStop').click(function () {
  117. var delayToEnableOrStop= $("#delayToEnableOrStop").val();
  118. var name= $("#nameDelayToEnableOrStopParams").val();
  119. if (delayToEnableOrStop == 1 && !confirm("确认要停用项目【"+name+"】信息吗?")) {
  120. return;
  121. }
  122. $.ajax({
  123. type: "GET",
  124. url: '/thmz/updateZdChargeItemDelFlag?code=' + $("#code_delayToEnableOrStopParams").val() + "&delFlag=" + delayToEnableOrStop+"&effectiveDate="+$("#effectiveTimeDelayToEnableOrStopParams").val(),
  125. dataType: "json",
  126. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  127. success: function (res) {
  128. if (res == '401' || res == 401) {
  129. window.location.href = '/thmz/login/view'
  130. return;
  131. }
  132. if (res.code == 0) {
  133. $("#delayToEnableOrStopModal").modal("hide");
  134. clearDelayToEnableOrStopInput();
  135. $('#tb_table').bootstrapTable("refresh");
  136. successMesage(res);
  137. } else {
  138. errorMesage(res);
  139. }
  140. }
  141. });
  142. });
  143. });
  144. /**
  145. * 号别类别列表
  146. */
  147. function initZdChargeItemList() {
  148. $('#tb_table').bootstrapTable("destroy");
  149. $('#tb_table').bootstrapTable({
  150. url: '/thmz/listZdChargeItem', //请求后台的URL(*)
  151. method: 'post', //请求方式(*)
  152. toolbar: '#toolbar', //工具按钮用哪个容器
  153. striped: true, //是否显示行间隔色
  154. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  155. pagination: true, //是否显示分页(*)
  156. sortable: true, //是否启用排序
  157. sortOrder: "desc", //排序方式
  158. queryParams: queryParams, //传递参数(*)
  159. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  160. pageNumber: 1, //初始化加载第一页,默认第一页
  161. pageSize: 5, //每页的记录行数(*)
  162. pageList: [10, 15, 25, 50, 100], //可供选择的每页的行数(*)
  163. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  164. strictSearch: true,
  165. showColumns: false, //是否显示所有的列
  166. showRefresh: false, //是否显示刷新按钮
  167. minimumCountColumns: 2, //最少允许的列数
  168. clickToSelect: true, //是否启用点击选中行
  169. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  170. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  171. cardView: false, //是否显示详细视图
  172. detailView: false,
  173. //rowStyle:rowStyle,//通过自定义函数设置行样式
  174. ajaxOptions: {
  175. headers: {
  176. 'Accept': 'application/json',
  177. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  178. }
  179. },
  180. columns: [
  181. {
  182. title: '操作',
  183. field: 'op',
  184. align: "center",
  185. valign: 'middle',
  186. formatter: function (value, row, index) {
  187. var str = '<button type="button" class="btn btn-primary btn-sm" onclick="updateZdChargeItem(\'' + row.code + '\')">编辑</button>';
  188. str += '<button type="button" class="btn btn-primary btn-sm" onclick="updateZdChargeItemPrice(\'' + row.code + '\')">延时调价</button>';
  189. if(row.effectiveTime!=null){
  190. str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',1)">取消延时调价</button>';
  191. }
  192. if (row.delFlag == 0) {
  193. str += '<button type="button" class="btn btn-warning btn-sm" onclick="updateZdChargeItemDelFlag(\'' + row.code + '\',\'' + row.name + '\',1)">停用</button>';
  194. str += '<button type="button" class="btn btn-warning btn-sm" onclick="delayStopOrToEnable(\'' + row.code + '\',1)">延时停用</button>';
  195. if(row.effectiveDate!=null){
  196. str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',3)">取消延时停用</button>';
  197. }
  198. } else if (row.delFlag == 1) {
  199. str += '<button type="button" class="btn btn-success btn-sm" onclick="updateZdChargeItemDelFlag(\'' + row.code + '\',\'' + row.name + '\',0)">启用</button>';
  200. str += '<button type="button" class="btn btn-success btn-sm" onclick="delayStopOrToEnable(\'' + row.code + '\',0)">延时启用</button>';
  201. if(row.effectiveDate!=null){
  202. str += '<button type="button" class="btn btn-primary btn-sm" onclick="cancelEffective(\'' + row.code + '\',\'' + row.name + '\',2)">取消延时启用</button>';
  203. }
  204. }
  205. return [str].join('');
  206. }
  207. },
  208. {
  209. field: 'classCode',
  210. title: '项目类型',
  211. align: "center",
  212. valign: 'middle',
  213. formatter: function (value, row, index) {
  214. return classCodeMap.get(value);
  215. }
  216. },
  217. // {
  218. // field: 'ybCode',
  219. // title: '医保扩展码',
  220. // align: "center",
  221. // valign: 'middle'
  222. // }, {
  223. // field: 'xnhCode',
  224. // title: '新农合项目编码',
  225. // align: "center",
  226. // valign: 'middle'
  227. // }, {
  228. // field: 'xnhName',
  229. // title: '新农合项目名称',
  230. // align: "center",
  231. // valign: 'middle'
  232. // },
  233. {
  234. field: 'code',
  235. title: '项目编码',
  236. align: "center",
  237. valign: 'middle',
  238. }, {
  239. field: 'name',
  240. title: '项目名称',
  241. align: "center",
  242. valign: 'middle'
  243. }, {
  244. field: 'descriptions',
  245. title: '规格',
  246. align: "center",
  247. valign: 'middle'
  248. }, {
  249. field: 'chargeUnit',
  250. title: '单位',
  251. align: "center",
  252. valign: 'middle'
  253. }, {
  254. field: 'chargeAmount',
  255. title: '收费金额',
  256. align: "center",
  257. valign: 'middle',
  258. formatter: function (value, row, index) {
  259. if (value != null && value != undefined && value!="") {
  260. return value.toFixed(2);
  261. }
  262. return "";
  263. }
  264. },
  265. // {
  266. // field: 'percentag1',
  267. // title: '第一折扣率',
  268. // align: "center",
  269. // valign: 'middle',
  270. // formatter: function (value, row, index) {
  271. // if (value != null && value != undefined && value!="") {
  272. // return value.toFixed(2);
  273. // }
  274. // return "";
  275. // }
  276. // },
  277. {
  278. field: 'percentag2',
  279. title: '第二折扣率',
  280. align: "center",
  281. valign: 'middle',
  282. formatter: function (value, row, index) {
  283. if (value != null && value != undefined && value!="") {
  284. return value.toFixed(2);
  285. }
  286. return "";
  287. }
  288. }
  289. // ,{
  290. // field: 'percentag3',
  291. // title: '第三折扣率',
  292. // align: "center",
  293. // valign: 'middle',
  294. // formatter: function (value, row, index) {
  295. // if (value != null && value != undefined && value!="") {
  296. // return value.toFixed(2);
  297. // }
  298. // return "";
  299. // }
  300. // },
  301. // {
  302. // field: 'percentag4',
  303. // title: '第四折扣率',
  304. // align: "center",
  305. // valign: 'middle',
  306. // formatter: function (value, row, index) {
  307. // if (value != null && value != undefined && value!="") {
  308. // return value.toFixed(2);
  309. // }
  310. // return "";
  311. // }
  312. // },
  313. // {
  314. // field: 'percentag5',
  315. // title: '第五折扣率',
  316. // align: "center",
  317. // valign: 'middle',
  318. // formatter: function (value, row, index) {
  319. // if (value != null && value != undefined && value!="") {
  320. // return value.toFixed(2);
  321. // }
  322. // }
  323. // }
  324. // , {
  325. // field: 'effectiveDate',
  326. // title: '生效日期',
  327. // align: "center",
  328. // valign: 'middle',
  329. // formatter: function (value, row, index) {
  330. // if (value == null || value == "") {
  331. // return "";
  332. // }
  333. // return format(value, "yyyy-MM-dd");
  334. // }
  335. // }
  336. , {
  337. field: 'auditCode',
  338. title: '核算码',
  339. align: "center",
  340. valign: 'middle',
  341. formatter: function (value, row, index) {
  342. return auditCodeMap.get(value);
  343. }
  344. }
  345. , {
  346. field: 'billItemMz',
  347. title: '门诊发票码',
  348. align: "center",
  349. valign: 'middle',
  350. formatter: function (value, row, index) {
  351. return billItemMzMap.get(value);
  352. }
  353. }, {
  354. field: 'billItemZy',
  355. title: '住院发票码',
  356. align: "center",
  357. valign: 'middle',
  358. formatter: function (value, row, index) {
  359. return billItemZyMap.get(value);
  360. }
  361. }
  362. , {
  363. field: 'co',
  364. title: '是否加价',
  365. align: "center",
  366. valign: 'middle',
  367. formatter: function (value, row, index) {
  368. if (value == 0) {
  369. return "否";
  370. }
  371. if (value == 1) {
  372. return "是";
  373. }
  374. }
  375. }, {
  376. field: 'xlCode',
  377. title: '加价率',
  378. align: "center",
  379. valign: 'middle',
  380. formatter: function (value, row, index) {
  381. if (value != null && value != undefined && value!="") {
  382. return parseFloat(value).toFixed(2);
  383. }
  384. return "";
  385. }
  386. }, {
  387. field: 'zdChargeBaClass',
  388. title: '病案统计编码',
  389. align: "center",
  390. valign: 'middle'
  391. }
  392. , {
  393. field: 'execUnitName',
  394. title: '执行科室',
  395. align: "center",
  396. valign: 'middle'
  397. }
  398. , {
  399. field: 'bzCode',
  400. title: '标准编码',
  401. align: "center",
  402. valign: 'middle'
  403. }, {
  404. field: 'discription',
  405. title: '报销类型',
  406. align: "center",
  407. valign: 'middle'
  408. }
  409. , {
  410. field: 'addDate',
  411. title: '创建时间',
  412. align: "center",
  413. valign: 'middle',
  414. formatter: function (value, row, index) {
  415. if (value == null || value == "") {
  416. return "";
  417. }
  418. return format(value, "yyyy-MM-dd HH:mm:ss");
  419. }
  420. }, {
  421. field: 'nationalCode',
  422. title: '国家医保编码',
  423. align: "center",
  424. valign: 'middle'
  425. }, {
  426. field: 'nationalName',
  427. title: '医保通用名称',
  428. align: "center",
  429. valign: 'middle'
  430. }, {
  431. field: 'hnsybCode',
  432. title: '省医保编码',
  433. align: "center",
  434. valign: 'middle'
  435. },{
  436. field: 'ybComment',
  437. title: '生产厂家',
  438. align: "center",
  439. valign: 'middle'
  440. }, {
  441. field: 'clCode',
  442. title: '耗材院内编码',
  443. align: "center",
  444. valign: 'middle'
  445. }, {
  446. field: 'excludeContent',
  447. title: '除外内容',
  448. align: "center",
  449. valign: 'middle'
  450. }, {
  451. field: 'connotation',
  452. title: '项目内涵',
  453. align: "center",
  454. valign: 'middle'
  455. }, {
  456. field: 'approvalNumber',
  457. title: '注册证编号',
  458. align: "center",
  459. valign: 'middle'
  460. }
  461. ],
  462. responseHandler: function (res) {
  463. if (res == '401' || res == 401) {
  464. window.location.href = '/thmz/login/view'
  465. return;
  466. }
  467. var ress = eval(res);
  468. if (ress.code == -1) {
  469. if (ress.message != null && ress.message != '') {
  470. new PNotify({
  471. title: '错误提示',
  472. text: ress.message,
  473. type: 'error',
  474. hide: true,
  475. styling: 'bootstrap3'
  476. });
  477. }
  478. return {
  479. "total": 0,//总页数
  480. "rows": {} //数据
  481. };
  482. }
  483. return {
  484. "total": ress.total,//总页数
  485. "rows": ress.data //数据
  486. };
  487. },
  488. });
  489. }
  490. /**
  491. * 构建列表查询参数
  492. * @param params
  493. * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  494. */
  495. function queryParams(params) {
  496. var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
  497. pageSize: params.limit, //页面大小
  498. pageIndex: params.offset / params.limit, //页码
  499. zdChargeItem: {
  500. name: $("#name").val(),
  501. classCode: $("#classCode").val(),
  502. auditCode: $("#auditCode").val(),
  503. billItemMz: $("#billItemMz").val(),
  504. billItemZy: $("#billItemZy").val(),
  505. delFlag: $("#delFlag").val()
  506. // ,clCode: $("#clCode").val()
  507. }
  508. };
  509. return temp;
  510. }
  511. /**
  512. * 取消延迟改价/取消延时启用或停用
  513. * @param code 项目编码
  514. * @param name 项目名称
  515. * @param type 类型 1 取消延时调价 2 取消延时启用 3 取消延时停用
  516. */
  517. function cancelEffective(code,name,type) {
  518. if (type == 1 && !confirm("确认要取消项目【"+name+"】的延时改价吗?")) {
  519. return;
  520. }
  521. if (type == 2 && !confirm("确认要取消项目【"+name+"】的延时启用吗?")) {
  522. return;
  523. }
  524. if (type == 3 && !confirm("确认要取消项目【"+name+"】的延时停用吗?")) {
  525. type=2;
  526. return;
  527. }
  528. $.ajax({
  529. type: "GET",
  530. url: '/thmz/cancelEffective?code='+code+'&type='+type,
  531. dataType: "json",
  532. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  533. async: false,
  534. success: function (data) {
  535. if (data == '401' || data == 401) {
  536. window.location.href = '/thmz/login/view'
  537. return;
  538. }
  539. if(data.code==0){
  540. successMesage(data);
  541. $('#tb_table').bootstrapTable("refresh");
  542. }else {
  543. errorMesage(data);
  544. }
  545. }
  546. });
  547. }
  548. /**
  549. * 初始化下拉选
  550. */
  551. function initSelect() {
  552. //启动Bootsrap-Select
  553. $(".selectpicker").selectpicker({
  554. dropuAuto: false
  555. });
  556. var yesNo = '<option value="1">是</option><option value="0">否</option>';
  557. $('#delFlag').html(yesNo);
  558. $('#delFlag').selectpicker('refresh');
  559. $('#coParams').html(yesNo);
  560. $('#coParams').selectpicker('refresh');
  561. $('#coParams').selectpicker('val', 0);
  562. $('#coParams').selectpicker('refresh');
  563. var groupNoParams='<option value="00">项目</option><option value="91">医材</option>';
  564. $('#groupNoParams').html(groupNoParams);
  565. $('#groupNoParams').selectpicker('refresh');
  566. $('#groupNoParams').selectpicker('val', '00');
  567. $('#groupNoParams').selectpicker('refresh');
  568. //查询所有收费项目类型
  569. $.ajax({
  570. type: "GET",
  571. url: '/thmz/getAllZdChargeClass',
  572. dataType: "json",
  573. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  574. async: false,
  575. success: function (data) {
  576. if (data == '401' || data == 401) {
  577. window.location.href = '/thmz/login/view'
  578. return;
  579. }
  580. var html = '';
  581. $.each(data.data, function (commentIndex, comment) {
  582. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  583. if (classCodeMap == null) {
  584. classCodeMap = new MyMap()
  585. }
  586. classCodeMap.put(comment.code, comment.name);
  587. });
  588. $('#classCode').empty(); //清空resText里面的所有内容
  589. $('#classCode').html(html);
  590. $('#classCode').selectpicker('refresh');
  591. $('#classCodeParams').empty(); //清空resText里面的所有内容
  592. $('#classCodeParams').html(html);
  593. $('#classCodeParams').selectpicker('refresh');
  594. }
  595. });
  596. //查询所有住院字典 核算码
  597. $.ajax({
  598. type: "GET",
  599. url: '/thmz/getAllZyZdAuditItem',
  600. dataType: "json",
  601. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  602. async: false,
  603. success: function (res) {
  604. if (res == '401' || res == 401) {
  605. window.location.href = '/thmz/login/view'
  606. return;
  607. }
  608. var html = '';
  609. $.each(res.data, function (commentIndex, comment) {
  610. //html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  611. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  612. if (auditCodeMap == null) {
  613. auditCodeMap = new MyMap()
  614. }
  615. auditCodeMap.put(comment.code, comment.name);
  616. });
  617. $('#auditCode').empty(); //清空resText里面的所有内容
  618. $('#auditCode').html(html);
  619. $('#auditCode').selectpicker('refresh');
  620. $('#auditCodeParams').empty(); //清空resText里面的所有内容
  621. $('#auditCodeParams').html(html);
  622. $('#auditCodeParams').selectpicker('refresh');
  623. }
  624. });
  625. //住院发票码
  626. $.ajax({
  627. type: "GET",
  628. url: '/thmz/getZyBillItems',
  629. dataType: "json",
  630. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  631. async: false,
  632. success: function (res) {
  633. if (res == '401' || res == 401) {
  634. window.location.href = '/thmz/login/view'
  635. return;
  636. }
  637. var html = '';
  638. $.each(res.data, function (commentIndex, comment) {
  639. //html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  640. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  641. if (billItemZyMap == null) {
  642. billItemZyMap = new MyMap()
  643. }
  644. billItemZyMap.put(comment.code, comment.name);
  645. });
  646. $('#billItemZy').empty(); //清空resText里面的所有内容
  647. $('#billItemZy').html(html);
  648. $('#billItemZy').selectpicker('refresh');
  649. $('#billItemZyParams').empty(); //清空resText里面的所有内容
  650. $('#billItemZyParams').html(html);
  651. $('#billItemZyParams').selectpicker('refresh');
  652. }
  653. });
  654. //门诊发票码
  655. $.ajax({
  656. type: "GET",
  657. url: '/thmz/getAllBillItems',
  658. dataType: "json",
  659. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  660. async: false,
  661. success: function (res) {
  662. if (res == '401' || res == 401) {
  663. window.location.href = '/thmz/login/view'
  664. return;
  665. }
  666. var html = '';
  667. $.each(res.data, function (commentIndex, comment) {
  668. //html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  669. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  670. if (billItemMzMap == null) {
  671. billItemMzMap = new MyMap()
  672. }
  673. billItemMzMap.put(comment.code, comment.name);
  674. });
  675. $('#billItemMz').empty(); //清空resText里面的所有内容
  676. $('#billItemMz').html(html);
  677. $('#billItemMz').selectpicker('refresh');
  678. $('#billItemMzParams').empty(); //清空resText里面的所有内容
  679. $('#billItemMzParams').html(html);
  680. $('#billItemMzParams').selectpicker('refresh');
  681. }
  682. });
  683. initDeptSelect();
  684. initZdChargeBaClass();
  685. }
  686. /**
  687. * 停用或者启用收费项目
  688. * @param code
  689. */
  690. function updateZdChargeItemDelFlag(code, name,delFlag) {
  691. if (delFlag == 1 && !confirm("确认要停用项目【"+name+"】信息吗?")) {
  692. return;
  693. }
  694. $.ajax({
  695. type: "GET",
  696. url: '/thmz/updateZdChargeItemDelFlag?code=' + code + "&delFlag=" + delFlag+"&effectiveDate=null",
  697. dataType: "json",
  698. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  699. success: function (res) {
  700. if (res == '401' || res == 401) {
  701. window.location.href = '/thmz/login/view'
  702. return;
  703. }
  704. if (res.code == 0) {
  705. successMesage(res);
  706. $('#tb_table').bootstrapTable("refresh");
  707. } else {
  708. errorMesage(res);
  709. }
  710. }
  711. });
  712. }
  713. /**
  714. * 修改收费项目
  715. * @param code
  716. */
  717. function updateZdChargeItem(code) {
  718. $("#myModalLabel").text("编辑收费项目");
  719. $.ajax({
  720. type: "GET",
  721. url: '/thmz/getZdChargeItemByCode?code=' + code,
  722. dataType: "json",
  723. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  724. success: function (res) {
  725. if (res == '401' || res == 401) {
  726. window.location.href = '/thmz/login/view'
  727. return;
  728. }
  729. if (res.code == 0) {
  730. $('#classCodeParams').selectpicker('val', res.data.classCode);
  731. $('#classCodeParams').selectpicker('refresh');
  732. // $("#ybCodeParmas").val(res.data.ybCode);
  733. // $("#xnhCodeParams").val(res.data.xnhCode);
  734. // $("#xnhNameParams").val(res.data.xnhName);
  735. $("#namePamras").val(res.data.name);
  736. $("#chargeUnitParams").val(res.data.chargeUnit);
  737. $("#chargeAmountParams").val(res.data.chargeAmount);
  738. //$("#percentag1Params").val(res.data.percentag1);
  739. $("#percentag2Params").val(res.data.percentag2);
  740. // $("#percentag3Params").val(res.data.percentag3);
  741. // $("#percentag4Params").val(res.data.percentag4);
  742. // $("#percentag5Params").val(res.data.percentag5);
  743. $('#auditCodeParams').selectpicker('val', res.data.auditCode);
  744. $('#auditCodeParams').selectpicker('refresh');
  745. $('#billItemMzParams').selectpicker('val', res.data.billItemMz);
  746. $('#billItemMzParams').selectpicker('refresh');
  747. $('#billItemZyParams').selectpicker('val', res.data.billItemZy);
  748. $('#billItemZyParams').selectpicker('refresh');
  749. $('#execUnitParams').selectpicker('val', res.data.execUnit);
  750. $('#execUnitParams').selectpicker('refresh');
  751. $("#bzCodeParams").val(res.data.bzCode);
  752. $("#discriptionParams").val(res.data.discription);
  753. $("#ybCommentParams").val(res.data.ybComment);
  754. $("#clCodeParams").val(res.data.clCode);
  755. $("#nationalCodeParams").val(res.data.nationalCode);
  756. $("#nationalNameParams").val(res.data.nationalName);
  757. $("#hnsybCodeParams").val(res.data.hnsybCode);
  758. $("#descriptionsParams").val(res.data.descriptions);
  759. $("#excludeContentParams").val(res.data.excludeContent);
  760. $("#connotationParams").val(res.data.connotation);
  761. $("#approvalNumberParams").val(res.data.approvalNumber);
  762. $("#maxAgeRestriction").val(res.data.maxAgeRestriction);
  763. $("#minAgeRestriction").val(res.data.minAgeRestriction);
  764. $("#genderRestriction").val(res.data.genderRestriction);
  765. $('#genderRestriction').selectpicker('refresh');
  766. $('#coParams').selectpicker('val', res.data.co);
  767. if(res.data.co==null || res.data.co==""){
  768. $('#coParams').selectpicker('val', 0);
  769. }
  770. $('#coParams').selectpicker('refresh');
  771. $("#xlCodeParams").val(res.data.xlCode);
  772. if(res.data.co==1 && (res.data.xlCode==null || res.data.xlCode=="")){
  773. $("#xlCodeParams").val(0.5);
  774. }
  775. $('#groupNoParams').selectpicker('val', res.data.groupNo);
  776. $('#groupNoParams').selectpicker('refresh');
  777. $("#code").val(res.data.code);
  778. $('#zdChargeBaClassParams').selectpicker('val', res.data.zdChargeBaClass);
  779. $('#zdChargeBaClassParams').selectpicker('refresh');
  780. $("#focusMonitorFlag").val(!stringNotBlank(res.data.focusMonitorFlag) ? '0' : res.data.focusMonitorFlag );
  781. $('#focusMonitorFlag').selectpicker('refresh');
  782. $("#chargeDetailModal").modal();
  783. } else {
  784. errorMesage(res);
  785. }
  786. }
  787. });
  788. }
  789. /**
  790. * 收费项目延时启用/收费项目延时停用
  791. * @param code
  792. * @param delFlag 1 停用 0 启用
  793. */
  794. function delayStopOrToEnable(code,delFlag) {
  795. $.ajax({
  796. type: "GET",
  797. url: '/thmz/getZdChargeItemByCode?code=' + code,
  798. dataType: "json",
  799. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  800. success: function (res) {
  801. if (res == '401' || res == 401) {
  802. window.location.href = '/thmz/login/view'
  803. return;
  804. }
  805. if (res.code == 0) {
  806. $("#delayToEnableOrStop").val(delFlag);
  807. if(delFlag==0){
  808. $("#delayToEnableOrStopTitle").html("延时启用收费项目");
  809. }else if(delFlag==1){
  810. $("#delayToEnableOrStopTitle").html("延时停用收费项目");
  811. }
  812. $("#nameDelayToEnableOrStopParams").val(res.data.name);
  813. $("#code_delayToEnableOrStopParams").val(res.data.code);
  814. if(res.data.effectiveDate!=null){
  815. $("#effectiveTimeDelayToEnableOrStopParams").val(format(res.data.effectiveDate, "yyyy-MM-dd"));
  816. }
  817. $("#delayToEnableOrStopModal").modal();
  818. } else {
  819. errorMesage(res);
  820. }
  821. }
  822. });
  823. }
  824. /**
  825. * 收费项目延时调价
  826. * @param code
  827. */
  828. function updateZdChargeItemPrice(code) {
  829. $.ajax({
  830. type: "GET",
  831. url: '/thmz/getZdChargeItemByCode?code=' + code,
  832. dataType: "json",
  833. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  834. success: function (res) {
  835. if (res == '401' || res == 401) {
  836. window.location.href = '/thmz/login/view'
  837. return;
  838. }
  839. if (res.code == 0) {
  840. $("#namepPricePamras").val(res.data.name);
  841. $("#chargeAmountPriceParams").val(res.data.chargeAmount);
  842. $("#code_price").val(res.data.code);
  843. $("#chargeAmountPriceNeedUpdateParams").val(res.data.effectivePrice);
  844. if(res.data.effectiveTime!=null){
  845. $("#effectiveTimeParams").val(format(res.data.effectiveTime, "yyyy-MM-dd"));
  846. }
  847. $("#priceModal").modal();
  848. } else {
  849. errorMesage(res);
  850. }
  851. }
  852. });
  853. }
  854. /**
  855. * 挂号列表中的科室列表
  856. */
  857. function initDeptSelect() {
  858. //科室列表
  859. $.ajax({
  860. type: "GET",
  861. url: '/thmz/allUnitCode',
  862. dataType: "json",
  863. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  864. success: function (data) {
  865. if (data == '401' || data == 401) {
  866. window.location.href = '/thmz/login/view'
  867. return;
  868. }
  869. var html = '<option value="-1"></option>';
  870. $.each(data.data, function (commentIndex, comment) {
  871. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  872. });
  873. $('#execUnitParams').empty();
  874. $('#execUnitParams').html(html);
  875. $('#execUnitParams').selectpicker('refresh');
  876. }
  877. });
  878. }
  879. /**
  880. * 病案统计编码
  881. */
  882. function initZdChargeBaClass() {
  883. //科室列表
  884. $.ajax({
  885. type: "GET",
  886. url: '/thmz/getAllZdChargeBaClass',
  887. dataType: "json",
  888. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  889. success: function (data) {
  890. if (data == '401' || data == 401) {
  891. window.location.href = '/thmz/login/view'
  892. return;
  893. }
  894. var html = '<option value="-1"></option>';
  895. $.each(data.data, function (commentIndex, comment) {
  896. html += '<option value="' + comment.code + '">' + comment.name+'</option>';
  897. });
  898. $('#zdChargeBaClassParams').empty();
  899. $('#zdChargeBaClassParams').html(html);
  900. $('#zdChargeBaClassParams').selectpicker('refresh');
  901. }
  902. });
  903. }
  904. /**
  905. * 清空输入框
  906. */
  907. function clearInput() {
  908. $("#namePamras").val(null);
  909. $("#chargeUnitParams").val(null);
  910. $("#chargeAmountParams").val(null);
  911. $("#percentag2Params").val(1);
  912. // $('#classCodeParams').selectpicker('val', null);
  913. // $('#classCodeParams').selectpicker('refresh');
  914. // $('#auditCodeParams').selectpicker('val', null);
  915. // $('#auditCodeParams').selectpicker('refresh');
  916. // $('#billItemMzParams').selectpicker('val', null);
  917. // $('#billItemMzParams').selectpicker('refresh');
  918. // $('#billItemZyParams').selectpicker('val', null);
  919. // $('#billItemZyParams').selectpicker('refresh');
  920. // $('#execUnitParams').selectpicker('val', null);
  921. // $('#execUnitParams').selectpicker('refresh');
  922. $("#bzCodeParams").val(null);
  923. $("#discriptionParams").val(null);
  924. $("#ybCommentParams").val(null);
  925. $("#clCodeParams").val(null);
  926. $("#nationalCodeParams").val(null);
  927. $("#nationalNameParams").val(null);
  928. $("#descriptionsParams").val(null);
  929. $("#excludeContentParams").val(null);
  930. $("#connotationParams").val(null);
  931. $("#approvalNumberParams").val(null);
  932. $('#coParams').selectpicker('val', 0);
  933. $('#coParams').selectpicker('refresh');
  934. $('#focusMonitorFlag').selectpicker('val', '0');
  935. $('#focusMonitorFlag').selectpicker('refresh');
  936. $('#groupNoParams').selectpicker('val', '00');
  937. $('#groupNoParams').selectpicker('refresh');
  938. $("#xlCodeParams").val(null);
  939. $("#code").val(null);
  940. $('#zdChargeBaClassParams').selectpicker('val', null);
  941. $('#zdChargeBaClassParams').selectpicker('refresh');
  942. }
  943. /**
  944. * 清空输入框
  945. */
  946. function clearPriceInput() {
  947. $("#namepPricePamras").val(null);
  948. $("#chargeAmountPriceParams").val(null);
  949. $("#chargeAmountPriceNeedUpdateParams").val(null);
  950. $("#effectiveTimeParams").val(null);
  951. $("#code_price").val(null);
  952. }
  953. /**
  954. * 清空输入框
  955. */
  956. function clearDelayToEnableOrStopInput() {
  957. $("#nameDelayToEnableOrStopParams").val(null);
  958. $("#effectiveTimeDelayToEnableOrStopParams").val(null);
  959. $("#code_delayToEnableOrStopParams").val(null);
  960. $("#delayToEnableOrStop").val(null);
  961. }
  962. /**
  963. * 加价率改变事件
  964. */
  965. function setXlCodeParams() {
  966. var value = $('#coParams').val();
  967. if(value==1){
  968. if($("#xlCodeParams").val()==null || $("#xlCodeParams").val()==""){
  969. $("#xlCodeParams").val(0.5);
  970. }
  971. }else {
  972. $("#xlCodeParams").val(null);
  973. }
  974. }