appealExamine.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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;
  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. appealInfo = {
  55. exampleOperation: 2,
  56. casesEntryName: data.casesEntryName,
  57. casesEntryMsg: data.casesEntryMsg,
  58. value: data.qcresultDetaiValue,
  59. remark: data.remark,
  60. behospitalCode: data.behospitalCode,
  61. qcResultAlgVO: {
  62. casesEntryId: casesEntryId,
  63. casesId: data.casesId,
  64. id: data.qcresultDetailId,
  65. exampleOperation: appealOperationType
  66. }
  67. }
  68. getInfo(data)
  69. getCon(data)
  70. getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId)
  71. } else {
  72. const token = localStorage.getItem('accessToken');
  73. if (!token && window.location.href.indexOf('login') == -1) {
  74. //alert('无token判断,跳回登录')
  75. } else {
  76. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  77. }
  78. }
  79. }).catch((e) => {
  80. })
  81. }
  82. function getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId) {
  83. const param = {
  84. id: id,
  85. behospitalCode: behospitalCode,
  86. casesEntryId: casesEntryId,
  87. hospitalId: hospitalId,
  88. qcresultDetailId: qcresultDetailId,
  89. }
  90. return post(api.getAppealInfo, param).then(res => {
  91. if (res.data.code == '0') {
  92. data = res.data.data.appealExamineRecordDTOList
  93. getHistory(data)
  94. } else {
  95. const token = localStorage.getItem('accessToken');
  96. if (!token && window.location.href.indexOf('login') == -1) {
  97. //alert('无token判断,跳回登录')
  98. } else {
  99. $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
  100. }
  101. }
  102. }).catch((e) => {
  103. })
  104. }
  105. function getInfo(data) {
  106. let str = ''
  107. str += `<span class="info-title">病案号:${data.behospitalCode || '-'}</span>
  108. <span class="info-title">姓名:${data.name || '-'}</span>
  109. <span class="info-title">性别:${data.sex || '-'}</span>
  110. <span class="info-title">年龄:${data.age || '-'}</span>
  111. <span class="info-title">科室:${data.behDeptName || '-'}</span>
  112. <span class="info-title">主管医生:${data.doctorName || '-'}</span>
  113. <span class="info-title">入院时间:${data.behospitalDate || '-'}</span>
  114. <span class="info-title">出院时间:${data.leaveHospitalDate || '-'}</span>`;
  115. $('.info').append(str);
  116. }
  117. function getCon(data) {
  118. let str = ''
  119. str += `<p class="con-title">申述模块:${data.casesName || '-'}</p>
  120. <p class="con-title">病历内容:${data.defectContent || '-'}</p>
  121. <p class="con-title">缺陷详情:${data.qcresultDetailMsg || '-'}</p>
  122. <p class="con-title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 评分:${data.qcresultDetaiValue || '-'}</p>
  123. <p class="con-title">病案详情:<span class="goDetail">查看</span></p>`;
  124. $('.content').append(str);
  125. }
  126. function getHistory(data) {
  127. let str = ''
  128. for (let i = 0; i < data.length; i++) {
  129. const item = data[i]
  130. str += `<div class="box">
  131. <p class="con-title"><span>申述时间:${item.appealCreateDate || '-'}</span><span>申述人:${item.claimantName || '-'}</span><span>审核人:${item.checkName || '-'}</span></p>
  132. <p class="con-title">操作类型:${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}</p>
  133. <p class="con-title">申述说明:${item.appealExplain || '-'}</p>
  134. </div>`;
  135. }
  136. $('.history').append(str);
  137. }
  138. $(document).on("click", ".goDetail", (e) => {
  139. $(parent.document).find("#contentIframe").attr("src", "checkTaskList.html")
  140. });
  141. $(document).on("click", ".btn-sure", (e) => {
  142. $("#delModal .modal-body").html("");
  143. $("#delModal").show();
  144. if (appealOperationType == 0) {
  145. $("#appealDel").tmpl(appealInfo).appendTo("#delModal .modal-body");
  146. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  147. approved(1)
  148. });
  149. } else if (appealOperationType == 1) {
  150. $("#appealAdd").tmpl(appealInfo).appendTo("#delModal .modal-body");
  151. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  152. approved(2)
  153. });
  154. } else if (appealOperationType == 2) {
  155. $("#appealDef").tmpl(appealInfo).appendTo("#delModal .modal-body");
  156. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  157. approved(3)
  158. });
  159. }
  160. console.log(appealOperationType);
  161. });
  162. $(document).on("click", ".btn-cancel", (e) => {
  163. $("#delModal .modal-body").html("");
  164. $('.bot ul').css({
  165. "display": 'none',
  166. });
  167. $("#delModal").show();
  168. $("#delModal .modal-header .title").html('驳回');
  169. $("#appealReject").tmpl(appealInfo).appendTo("#delModal .modal-body");
  170. $("#delModal .confirm").text("确定").unbind("click").click(function () {
  171. rejected()
  172. });
  173. });
  174. //审核
  175. function approved(type) {
  176. if (type == 1) {
  177. appealInfo.exampleOperation = $('input:radio:checked').val()
  178. if ($('input:radio:checked').val() == 2) {
  179. appealInfo.delStatus == 0
  180. }
  181. } else if (type == 2) {
  182. appealInfo.exampleOperation = 3
  183. } else if (type == 3) {
  184. appealInfo.exampleOperation = 4
  185. appealInfo.processResult = $(".textarea").val()
  186. let val = $(".textarea").val()
  187. let num = 500
  188. if (!val) {
  189. $(".appealDef .warning .red").text("处理结果不能为空~");
  190. $(".appealDef .warning").show();
  191. return
  192. } else if (val.length > num) {
  193. $(".appealDef .warning .red").text("处理结果不能超过" + num + "个字~");
  194. $(".appealDef .warning").show();
  195. return
  196. }
  197. }
  198. const param = {
  199. ...appealInfo,
  200. 'id': id,
  201. };
  202. post(api.approved, param).then(function (res) {
  203. if (res.data.code === '0') {
  204. $("#delModal").hide();
  205. $.alerModal({ "message": "审核成功", type: "tip", time: '1000', win: true });
  206. } else {
  207. $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  208. }
  209. }).catch(() => {
  210. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  211. });
  212. }
  213. //驳回
  214. function rejected() {
  215. let val = $(".textarea2").val()
  216. let num = 500
  217. if (!val) {
  218. $(".appealReject .warning .red").text("驳回理由不能为空~");
  219. $(".appealReject .warning").show();
  220. return
  221. } else if (val.length > num) {
  222. $(".appealReject .warning .red").text("驳回理由不能超过" + num + "个字~");
  223. $(".appealReject .warning").show();
  224. return
  225. }
  226. const param = {
  227. 'behospitalCode': behospitalCode,
  228. 'id': id,
  229. rejectedReason: $(".textarea2").val()
  230. };
  231. post(api.rejected, param).then(function (res) {
  232. console.log(res.data.data.code);
  233. if (res.data.data.code === '0') {
  234. $("#delModal").hide();
  235. $.alerModal({ "message": "驳回成功", type: "tip", time: '1000', win: true });
  236. } else {
  237. console.log(123);
  238. $.alerModal({ "message": res.data.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  239. }
  240. }).catch(() => {
  241. $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' });
  242. });
  243. }