appealExamine.js 13 KB

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