appealExamine.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. const $ = require('jquery');
  2. require("../css/appealExamine.less");
  3. require('./modal.js');
  4. require('jquery-templates');
  5. const { api } = require('./api.js')
  6. const { post, getCookie, getLocal, getUrlArgObjectNew, emptyBox, downloadExportedData, expJson, getLogoParam, listenScroll, getPickerDate, exportTimeLimit } = require('./utils.js')
  7. require('./../resource/jquery-ui/jquery-ui.min.js');
  8. require('./../resource/jquery-ui/jquery-ui.min.css');
  9. const iconCheck = require("./../images/icon_check.png")
  10. const iconUnCheck = require("./../images/icon_unchecked.png")
  11. const iconCalenBlue = require("./../images/icon_calen_blue.png")
  12. const iconCalenGrey = require("./../images/icon_calen_grey.png")
  13. const iconDown = require("./../images/arrow_down.png")
  14. const iconUp = require("./../images/arrow_up.png")
  15. const loadingImg = require("./../images/loading.gif")
  16. const arrowLeft = require("./../images/arrow_left.png")
  17. const arrowRight = require("./../images/arrow_right.png")
  18. const goUpG = require("./../images/arrow_up_grey.png")
  19. const goUpB = require("./../images/arrow_up_blue.png")
  20. const goDownG = require("./../images/arrow_down_grey.png")
  21. const goDownB = require("./../images/arrow_down_blue.png")
  22. listenScroll()
  23. let srcUrl = $("#contentIframe", parent.document).attr("src")
  24. const id = getUrlArgObjectNew("id", srcUrl) || "";
  25. const hospitalId = getUrlArgObjectNew("hospitalId", srcUrl) || "";
  26. const behospitalCode = getUrlArgObjectNew("behospitalCode", srcUrl) || "";
  27. const casesEntryId = getUrlArgObjectNew("casesEntryId", srcUrl) || "";
  28. const qcresultDetailId = getUrlArgObjectNew("qcresultDetailId", srcUrl) || "";
  29. const appealOperationType = getUrlArgObjectNew("appealOperationType", srcUrl) || "";
  30. const form = getUrlArgObjectNew("form", srcUrl) || "";
  31. let appealInfo, appealExamineRecordDTOList;
  32. (function () {
  33. getApprovedView()
  34. if (form == 2) {
  35. $(".bot").hide();
  36. $('.appealExamine h2').html('申诉信息 > 申诉审核 > 查看');
  37. } else if (form == 3) {
  38. $(".bot").hide();
  39. $('.appealExamine h2').html('申诉信息 > 申诉记录 > 查看');
  40. }
  41. })();
  42. //获取审核详情
  43. function getApprovedView() {
  44. const param = {
  45. id: id,
  46. behospitalCode: behospitalCode,
  47. casesEntryId: casesEntryId,
  48. hospitalId: hospitalId,
  49. qcresultDetailId: qcresultDetailId,
  50. }
  51. return post(api.getApprovedView, param).then(res => {
  52. if (res.data.code == '0') {
  53. data = res.data.data.data
  54. appealExamineRecordDTOList = data.appealExamineRecordDTOList,
  55. appealInfo = {
  56. exampleOperation: 2,
  57. casesEntryName: data.casesEntryName,
  58. casesEntryMsg: data.casesEntryMsg,
  59. remark: data.remark,
  60. behospitalCode: data.behospitalCode,
  61. qcResultAlgVO: {
  62. casesEntryId: casesEntryId,
  63. casesId: data.casesId,
  64. id: data.qcresultDetailId,
  65. casesScore: appealExamineRecordDTOList[0].casesScore,
  66. msg: appealExamineRecordDTOList[0].msg,
  67. score: appealExamineRecordDTOList[0].qcresultDetaiValue,
  68. isReject: appealExamineRecordDTOList[0].isReject,
  69. explainInfo:appealExamineRecordDTOList[0].explainInfo,
  70. }
  71. }
  72. getInfo(data)
  73. getCon(data)
  74. getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId)
  75. } else {
  76. const token = localStorage.getItem('accessToken');
  77. if (!token && window.location.href.indexOf('login') == -1) {
  78. //alert('无token判断,跳回登录')
  79. } else {
  80. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  81. }
  82. }
  83. }).catch((e) => {
  84. })
  85. }
  86. function getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId) {
  87. const param = {
  88. id: id,
  89. behospitalCode: behospitalCode,
  90. casesEntryId: casesEntryId,
  91. hospitalId: hospitalId,
  92. qcresultDetailId: qcresultDetailId,
  93. }
  94. return post(api.getAppealInfo, param).then(res => {
  95. if (res.data.code == '0') {
  96. data = res.data.data.appealExamineRecordDTOList
  97. getHistory(data)
  98. } else {
  99. const token = localStorage.getItem('accessToken');
  100. if (!token && window.location.href.indexOf('login') == -1) {
  101. //alert('无token判断,跳回登录')
  102. } else {
  103. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  104. }
  105. }
  106. }).catch((e) => {
  107. })
  108. }
  109. function getInfo(data) {
  110. let str = ''
  111. str += `<span class="info-title">病案号:${data.behospitalCode || '-'}</span>
  112. <span class="info-title">姓名:${data.name || '-'}</span>
  113. <span class="info-title">性别:${data.sex || '-'}</span>
  114. <span class="info-title">年龄:${data.age || '-'}</span>
  115. <span class="info-title">科室:${data.behDeptName || '-'}</span>
  116. <span class="info-title">主管医生:${data.doctorName || '-'}</span>
  117. <span class="info-title">入院时间:${data.behospitalDate || '-'}</span>
  118. <span class="info-title">出院时间:${data.leaveHospitalDate || '-'}</span>`;
  119. $('.info').append(str);
  120. }
  121. function getCon(data) {
  122. console.log(data);
  123. let str = ''
  124. str += `<p class="con-title">申述模块:${data.casesName || '-'}</p>
  125. <p class="con-title">病历内容:${data.defectContent || '-'}</p>
  126. <p class="con-title">缺陷详情:${data.qcresultDetailMsg || '-'}</p>
  127. <p class="con-title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 评分:${data.qcresultDetaiValue || '-'}</p>
  128. <p class="con-title">病案详情:<span class="goDetail">查看</span></p>`;
  129. $('.content').append(str);
  130. $('.goDetail').on('click', function (e) {
  131. scoreDetail(data.behospitalCode, data.age, 'YH-BLZK-ZKSSKS', data.name)
  132. })
  133. }
  134. function getHistory(data) {
  135. let str = ''
  136. for (let i = 0; i < data.length; i++) {
  137. const item = data[i]
  138. str += `<div class="box">
  139. <p class="con-title"><span>申述时间:${item.appealCreateDate || '-'}</span><span>申述人:${item.claimantName || '-'}</span><span>审核人:${item.checkName || '-'}</span></p>
  140. <p class="con-title">操作类型:${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}</p>
  141. <p class="con-title">申述说明:${item.appealExplain || '-'}</p>
  142. ${item.exampleStatus == 2 ?
  143. `<p class="con-title" style="border-top: 1px solid #333;margin-top: 10px;padding-top: 10px;">审核时间:${item.appealExamineDate || '-'}</p>
  144. <p class="con-title">申述结果:审核通过</p>
  145. <p class="con-title">处理方式:${item.exampleOperation == 1 ? '修改' : item.exampleOperation == 2 ? '删除' : item.exampleOperation == 3 ? '新增已有' : item.exampleOperation == 4 ? '新增缺失' : '恢复条目'}</p>
  146. <p class="con-title">质控条目:${item.casesEntryName || '-'}</p>
  147. <p class="con-title">提示信息:${item.msg || '-'}</p>
  148. <p class="con-title">分值:${item.score || '-'}</p>
  149. <p class="con-title">备注:${item.exampleRemark || '-'}</p>`
  150. : item.exampleStatus == 1 ?
  151. `<p class="con-title" style="border-top: 1px solid #333;margin-top: 10px;padding-top: 10px;">审核时间:${item.appealExamineDate || '-'}</p>
  152. <p class="con-title">申述结果:审核通过</p>
  153. <p class="con-title">驳回理由:${item.rejectReason || '-'}</p>`
  154. : ""}
  155. </div>`;
  156. }
  157. $('.history').append(str);
  158. }
  159. function scoreDetail(id, age, code, name) {
  160. const logoParam = getLogoParam();
  161. window.open(`./appealUserPage.html?id=${id}&age=${age}&code=${code}&hid=${getCookie('hospitalid')}&name=${name}&form=44` + logoParam)
  162. }
  163. $(document).on("click", "input[type=radio][value=1]", (e) => {
  164. $(".endis").attr("disabled", false);
  165. });
  166. $(document).on("click", "input[type=radio][value=2]", (e) => {
  167. $(".endis").attr("disabled", true);
  168. });
  169. $(document).on("click", ".btn-sure", (e) => {
  170. $("#delModal .modal-body").html("");
  171. $("#delModal").show();
  172. if (appealOperationType == 0) {
  173. $("#appealDel").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body");
  174. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  175. approved(1)
  176. });
  177. } else if (appealOperationType == 1) {
  178. console.log(appealInfo);
  179. $("#appealAdd").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body");
  180. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  181. approved(2)
  182. });
  183. } else if (appealOperationType == 2) {
  184. $("#appealDef").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body");
  185. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  186. approved(3)
  187. });
  188. }
  189. });
  190. $(document).on("click", ".btn-cancel", (e) => {
  191. $("#delModal .modal-body").html("");
  192. $('.bot ul').css({
  193. "display": 'none',
  194. });
  195. $("#delModal").show();
  196. $("#delModal .modal-header .title").html('驳回');
  197. $("#appealReject").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body");
  198. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  199. rejected()
  200. });
  201. });
  202. //审核
  203. function approved(type) {
  204. if (type == 1) {
  205. appealInfo.exampleOperation = $('input:radio:checked').val()
  206. if ($('input:radio:checked').val() == 2) {
  207. appealInfo.delStatus == 0
  208. } else {
  209. appealInfo.casesEntryMsg == $(".case").val()
  210. appealInfo.qcResultAlgVO.score = $('.score').val()
  211. appealInfo.qcResultAlgVO.explainInfo = $('.explainInfo').val()
  212. }
  213. } else if (type == 2) {
  214. appealInfo.exampleOperation = 3
  215. appealInfo.qcResultAlgVO.score = $('.score').val()
  216. appealInfo.qcResultAlgVO.explainInfo = $('.explainInfo').val()
  217. } else if (type == 3) {
  218. appealInfo.exampleOperation = 4
  219. appealInfo.processResult = $(".textarea").val()
  220. let val = $(".textarea").val()
  221. let num = 500
  222. if (!val) {
  223. $(".appealDef .warning .red").text("处理结果不能为空~");
  224. $(".appealDef .warning").show();
  225. return
  226. } else if (val.length > num) {
  227. $(".appealDef .warning .red").text("处理结果不能超过" + num + "个字~");
  228. $(".appealDef .warning").show();
  229. return
  230. }
  231. }
  232. console.log(appealInfo);
  233. const param = {
  234. ...appealInfo,
  235. 'id': id,
  236. };
  237. post(api.approved, param).then(function (res) {
  238. if (res.data.code === '0') {
  239. $("#delModal").hide();
  240. $.alerModal({ "message": "审核成功", type: "tip", time: '1000', win: true });
  241. } else {
  242. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  243. }
  244. }).catch(() => {
  245. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  246. });
  247. }
  248. //驳回
  249. function rejected() {
  250. let val = $(".textarea2").val()
  251. let num = 500
  252. if (!val) {
  253. $(".appealReject .warning .red").text("驳回理由不能为空~");
  254. $(".appealReject .warning").show();
  255. return
  256. } else if (val.length > num) {
  257. $(".appealReject .warning .red").text("驳回理由不能超过" + num + "个字~");
  258. $(".appealReject .warning").show();
  259. return
  260. }
  261. const param = {
  262. 'behospitalCode': behospitalCode,
  263. 'id': id,
  264. rejectedReason: $(".textarea2").val()
  265. };
  266. post(api.rejected, param).then(function (res) {
  267. console.log(res.data.data.code);
  268. if (res.data.data.code === '0') {
  269. $("#delModal").hide();
  270. $.alerModal({ "message": "驳回成功", type: "tip", time: '1000', win: true });
  271. } else {
  272. console.log(123);
  273. $.alerModal({ "message": res.data.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  274. }
  275. }).catch(() => {
  276. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  277. });
  278. }