appealExamine.js 16 KB

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