appealExamine.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  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, auditNumber;
  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
  54. appealExamineRecordDTOList = {
  55. casesEntryName: data.appealExamineRecordDTOList[0].casesEntryName,
  56. value: data.appealExamineRecordDTOList[0].value,
  57. msg: data.appealExamineRecordDTOList[0].casesEntryMsg,
  58. explainInfo: data.appealExamineRecordDTOList[0].appealExplain,
  59. };
  60. appealInfo = {
  61. exampleOperation: 2,
  62. casesEntryName: data.casesEntryName,
  63. casesEntryMsg: data.casesEntryMsg,
  64. remark: data.remark,
  65. behospitalCode: data.behospitalCode,
  66. modeId: data.modeId,
  67. qcResultAlgVO: {
  68. casesEntryId: casesEntryId,
  69. id: data.qcresultDetailId,
  70. casesScore: data.appealExamineRecordDTOList[0].casesScore,
  71. msg: data.appealExamineRecordDTOList[0].msg,
  72. score: data.qcresultDetaiValue,
  73. isReject: data.appealExamineRecordDTOList[0].isReject,
  74. explainInfo: data.appealExamineRecordDTOList[0].appealExplain,
  75. }
  76. };
  77. $('.info').html('');
  78. $('.content').html('');
  79. $('.history').html('');
  80. getInfo(data);
  81. getCon(data);
  82. getHistory(data.appealExamineRecordDTOList)
  83. // getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId);
  84. } else {
  85. const token = localStorage.getItem('accessToken');
  86. if (!token && window.location.href.indexOf('login') == -1) {
  87. //alert('无token判断,跳回登录')
  88. } else {
  89. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  90. }
  91. }
  92. }).catch((e) => {
  93. })
  94. }
  95. function getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId) {
  96. const param = {
  97. id: id,
  98. behospitalCode: behospitalCode,
  99. casesEntryId: casesEntryId,
  100. hospitalId: hospitalId,
  101. qcresultDetailId: qcresultDetailId,
  102. }
  103. return post(api.getAppealInfo, param).then(res => {
  104. if (res.data.code == '0') {
  105. data = res.data.data.appealExamineRecordDTOList
  106. getHistory(data)
  107. } else {
  108. const token = localStorage.getItem('accessToken');
  109. if (!token && window.location.href.indexOf('login') == -1) {
  110. //alert('无token判断,跳回登录')
  111. } else {
  112. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  113. }
  114. }
  115. }).catch((e) => {
  116. })
  117. }
  118. function getInfo(data) {
  119. let str = ''
  120. str += `<span class="info-title">病案号:${data.behospitalCode || '-'}</span>
  121. <span class="info-title">姓名:${data.name || '-'}</span>
  122. <span class="info-title">性别:${data.sex || '-'}</span>
  123. <span class="info-title">年龄:${data.age || '-'}</span>
  124. <span class="info-title">科室:${data.behDeptName || '-'}</span>
  125. <span class="info-title">主管医生:${data.doctorName || '-'}</span>
  126. <span class="info-title">入院时间:${data.behospitalDate || '-'}</span>
  127. <span class="info-title">出院时间:${data.leaveHospitalDate || '-'}</span>`;
  128. $('.info').append(str);
  129. }
  130. function getCon(data) {
  131. let str = ''
  132. str += `<p class="con-title">申诉模块:${data.modeName || '-'}</p>
  133. <p class="con-title">病历内容:${data.defectContent || '-'}</p>
  134. <p class="con-title">缺陷详情:${data.qcresultDetailMsg || '-'}</p>
  135. <p class="con-title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 评分:-${data.qcresultDetaiValue || '-'}</p>
  136. <p class="con-title">病案详情:<span class="goDetail">查看</span></p>`;
  137. $('.content').append(str);
  138. $('.goDetail').on('click', function (e) {
  139. scoreDetail(data.behospitalCode, data.age, 'YH-BLZK-ZKSSKS', data.name, data.modeName)
  140. })
  141. }
  142. function getHistory(data) {
  143. let str = ''
  144. for (let i = 0; i < data.length; i++) {
  145. const item = data[i]
  146. str += `<div class="box">
  147. <p class="con-title"><span>申诉时间:${item.appealCreateDate || '-'}</span><span>申诉人:${item.claimantName || '-'}</span><span>审核人:${item.checkName || '-'}</span></p>
  148. <p class="con-title">操作类型:${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}</p>
  149. ${item.appealOperationType == 1 ?
  150. `<p class="con-title">质控条目:${item.casesEntryName || '-'}</p>
  151. <p class="con-title">提示信息:${item.casesEntryMsg || '-'}</p>
  152. <p class="con-title">分值:${item.value || '-'}</p>
  153. <p class="con-title">备注:${item.appealRemark || '-'}</p>
  154. `:""}
  155. <p class="con-title">申诉说明:${item.appealExplain || '-'}</p>
  156. ${item.exampleStatus == 2 ?
  157. `<p class="con-title" style="border-top: 1px solid #333;margin-top: 10px;padding-top: 10px;"><span>审核时间:${item.appealExamineDate || '-'}</span><span>审核人:${item.checkName || '-'}</span></p>
  158. <p class="con-title">审核结果:审核通过</p>
  159. <p class="con-title">处理方式:${item.exampleOperation == 1 ? '修改' : item.exampleOperation == 2 ? '删除' : item.exampleOperation == 3 ? '新增已有' : item.exampleOperation == 4 ? '新增缺失' : '恢复条目'}</p>
  160. <p class="con-title">质控条目:${item.casesEntryName || '-'}</p>
  161. <p class="con-title">提示信息:${item.msg || '-'}</p>
  162. <p class="con-title">分值:${item.score || '-'}</p>
  163. <p class="con-title">备注:${item.exampleRemark || '-'}</p>`
  164. : item.exampleStatus == 1 ?
  165. `<p class="con-title" style="border-top: 1px solid #333;margin-top: 10px;padding-top: 10px;">审核时间:${item.appealExamineDate || '-'}</p>
  166. <p class="con-title">审核结果:驳回</p>
  167. <p class="con-title">驳回理由:${item.rejectReason || '-'}</p>`
  168. : ""}
  169. </div>`;
  170. }
  171. $('.history').append(str);
  172. }
  173. function scoreDetail(id, age, code, name, casesName) {
  174. const logoParam = getLogoParam();
  175. window.open(`./appealUserPage.html?id=${id}&age=${age}&code=${code}&hid=${getCookie('hospitalid')}&name=${name}&form=44&casesName=${casesName || '缺陷总览'}` + logoParam)
  176. }
  177. $(document).on("click", "input[type=radio][value=1]", (e) => {
  178. $(".endis").attr("disabled", false);
  179. });
  180. $(document).on("click", "input[type=radio][value=2]", (e) => {
  181. $(".endis").attr("disabled", true);
  182. });
  183. $(document).on("click", ".btn-sure", (e) => {
  184. $("#delModal .modal-body").html("");
  185. $("#delModal").show();
  186. if (appealOperationType == 0) {
  187. $("#appealDel").tmpl(appealExamineRecordDTOList).appendTo("#delModal .modal-body");
  188. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  189. approved(1)
  190. });
  191. } else if (appealOperationType == 1) {
  192. $("#appealAdd").tmpl(appealExamineRecordDTOList).appendTo("#delModal .modal-body");
  193. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  194. approved(2)
  195. });
  196. } else if (appealOperationType == 2) {
  197. $("#appealDef").tmpl(appealExamineRecordDTOList).appendTo("#delModal .modal-body");
  198. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  199. approved(3)
  200. });
  201. } else if (appealOperationType == 3) {
  202. $("#appealRec").tmpl(appealExamineRecordDTOList).appendTo("#delModal .modal-body");
  203. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  204. approved(4)
  205. });
  206. }
  207. });
  208. $(document).on("click", ".goback", (e) => {
  209. console.log(form);
  210. if (form == 1 || form == 2) {
  211. $(parent.document).find("#contentIframe").attr("src", './appealCheck.html');
  212. } else {
  213. console.log(123);
  214. $(parent.document).find("#contentIframe").attr("src", './appealHistory.html');
  215. }
  216. });
  217. $(document).on("click", ".btn-cancel", (e) => {
  218. $("#delModal .modal-body").html("");
  219. $("#delModal").show();
  220. $("#delModal .modal-header .title").html('驳回');
  221. $("#appealReject").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body");
  222. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  223. rejected()
  224. });
  225. });
  226. //审核
  227. function approved(type) {
  228. if (type == 1) {
  229. appealInfo.exampleOperation = $('input:radio:checked').val()
  230. if ($('input:radio:checked').val() == 2) {
  231. appealInfo.delStatus == 0
  232. } else {
  233. appealInfo.casesEntryMsg == $(".case").val()
  234. appealInfo.qcResultAlgVO.score = $('.score').val()
  235. appealInfo.qcResultAlgVO.explainInfo = $('.explainInfo').val()
  236. appealInfo.qcResultAlgVO.msg = $('.msg').val()
  237. }
  238. } else if (type == 2) {
  239. appealInfo.exampleOperation = 3
  240. appealInfo.qcResultAlgVO.score = $('.score').val()
  241. appealInfo.qcResultAlgVO.explainInfo = $('.explainInfo').val()
  242. appealInfo.qcResultAlgVO.msg = $('.msg').val()
  243. } else if (type == 3) {
  244. appealInfo.exampleOperation = 4
  245. appealInfo.processResult = $(".textarea").val()
  246. let val = $(".textarea").val()
  247. let num = 500
  248. if (!val) {
  249. $(".appealDef .warning .red").text("处理结果不能为空~");
  250. $(".appealDef .warning").show();
  251. return
  252. } else if (val.length > num) {
  253. $(".appealDef .warning .red").text("处理结果不能超过" + num + "个字~");
  254. $(".appealDef .warning").show();
  255. return
  256. }
  257. } else if (type == 4) {
  258. appealInfo.exampleOperation = 5
  259. appealInfo.qcResultAlgVO.score = $('.score').val()
  260. }
  261. const param = {
  262. 'id': id,
  263. ...appealInfo,
  264. };
  265. post(api.approved, param).then(function (res) {
  266. if (res.data.code === '0') {
  267. $("#delModal").hide();
  268. $(".bot").hide();
  269. getApprovedView()
  270. getAuditNumber()
  271. $.alerModal({ "message": "审核成功", type: "tip", time: '1000', win: true });
  272. } else {
  273. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  274. }
  275. }).catch(() => {
  276. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  277. });
  278. }
  279. //驳回
  280. function rejected() {
  281. let val = $(".textarea2").val()
  282. let num = 500
  283. if (!val) {
  284. $(".appealReject .warning .red").text("驳回理由不能为空~");
  285. $(".appealReject .warning").show();
  286. return
  287. } else if (val.length > num) {
  288. $(".appealReject .warning .red").text("驳回理由不能超过" + num + "个字~");
  289. $(".appealReject .warning").show();
  290. return
  291. }
  292. const param = {
  293. 'behospitalCode': behospitalCode,
  294. 'id': id,
  295. rejectedReason: $(".textarea2").val()
  296. };
  297. post(api.rejected, param).then(function (res) {
  298. if (res.data.code === '0') {
  299. $("#delModal").hide();
  300. $(".bot").hide();
  301. getApprovedView()
  302. getAuditNumber()
  303. $.alerModal({ "message": "驳回成功", type: "tip", time: '1000', win: true });
  304. } else {
  305. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  306. }
  307. }).catch(() => {
  308. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  309. });
  310. }
  311. //获取待审核数量
  312. function getAuditNumber() {
  313. return post(api.getAuditNumber, {}).then(res => {
  314. if (res.data.code == '0') {
  315. auditNumber = res.data.data > 99 ? '99+' : res.data.data
  316. if (auditNumber == 0) {
  317. $(".menu .page", parent.document).children('.reds').hide()
  318. $(".menu .dian", parent.document).hide()
  319. } else {
  320. $(".menu .page", parent.document).children('.reds').html(auditNumber)
  321. }
  322. } else {
  323. const token = localStorage.getItem('accessToken');
  324. if (!token && window.location.href.indexOf('login') == -1) {
  325. //alert('无token判断,跳回登录')
  326. } else {
  327. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  328. }
  329. }
  330. }).catch((e) => {
  331. })
  332. }