appealExamine.js 16 KB

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