const $ = require('jquery'); require("../css/appealExamine.less"); require('./modal.js'); require('jquery-templates'); const { api } = require('./api.js') const { post, getCookie, getLocal, getUrlArgObjectNew, emptyBox, downloadExportedData, expJson, getLogoParam, listenScroll, getPickerDate, exportTimeLimit } = require('./utils.js') require('./../resource/jquery-ui/jquery-ui.min.js'); require('./../resource/jquery-ui/jquery-ui.min.css'); const iconCheck = require("./../images/icon_check.png") const iconUnCheck = require("./../images/icon_unchecked.png") const iconCalenBlue = require("./../images/icon_calen_blue.png") const iconCalenGrey = require("./../images/icon_calen_grey.png") const iconDown = require("./../images/arrow_down.png") const iconUp = require("./../images/arrow_up.png") const loadingImg = require("./../images/loading.gif") const arrowLeft = require("./../images/arrow_left.png") const arrowRight = require("./../images/arrow_right.png") const goUpG = require("./../images/arrow_up_grey.png") const goUpB = require("./../images/arrow_up_blue.png") const goDownG = require("./../images/arrow_down_grey.png") const goDownB = require("./../images/arrow_down_blue.png") listenScroll() let srcUrl = $("#contentIframe", parent.document).attr("src") const id = getUrlArgObjectNew("id", srcUrl) || ""; const hospitalId = getUrlArgObjectNew("hospitalId", srcUrl) || ""; const behospitalCode = getUrlArgObjectNew("behospitalCode", srcUrl) || ""; const casesEntryId = getUrlArgObjectNew("casesEntryId", srcUrl) || ""; const qcresultDetailId = getUrlArgObjectNew("qcresultDetailId", srcUrl) || ""; const appealOperationType = getUrlArgObjectNew("appealOperationType", srcUrl) || ""; const form = getUrlArgObjectNew("form", srcUrl) || ""; let appealInfo, appealExamineRecordDTOList; (function () { getApprovedView() if (form == 2) { $(".bot").hide(); $('.appealExamine h2').html('申诉信息 > 申诉审核 > 查看'); } else if (form == 3) { $(".bot").hide(); $('.appealExamine h2').html('申诉信息 > 申诉记录 > 查看'); } })(); //获取审核详情 function getApprovedView() { const param = { id: id, behospitalCode: behospitalCode, casesEntryId: casesEntryId, hospitalId: hospitalId, qcresultDetailId: qcresultDetailId, } return post(api.getApprovedView, param).then(res => { if (res.data.code == '0') { data = res.data.data.data appealExamineRecordDTOList = data.appealExamineRecordDTOList, appealInfo = { exampleOperation: 2, casesEntryName: data.casesEntryName, casesEntryMsg: data.casesEntryMsg, remark: data.remark, behospitalCode: data.behospitalCode, qcResultAlgVO: { casesEntryId: casesEntryId, casesId: data.casesId, id: data.qcresultDetailId, casesScore: appealExamineRecordDTOList[0].casesScore, msg: appealExamineRecordDTOList[0].msg, score: appealExamineRecordDTOList[0].qcresultDetaiValue, isReject: appealExamineRecordDTOList[0].isReject, explainInfo:appealExamineRecordDTOList[0].explainInfo, } } getInfo(data) getCon(data) getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId) } else { const token = localStorage.getItem('accessToken'); if (!token && window.location.href.indexOf('login') == -1) { //alert('无token判断,跳回登录') } else { $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) }); } } }).catch((e) => { }) } function getAppealInfo(id, behospitalCode, casesEntryId, hospitalId, qcresultDetailId) { const param = { id: id, behospitalCode: behospitalCode, casesEntryId: casesEntryId, hospitalId: hospitalId, qcresultDetailId: qcresultDetailId, } return post(api.getAppealInfo, param).then(res => { if (res.data.code == '0') { data = res.data.data.appealExamineRecordDTOList getHistory(data) } else { const token = localStorage.getItem('accessToken'); if (!token && window.location.href.indexOf('login') == -1) { //alert('无token判断,跳回登录') } else { $.alerModal({ "message": res.data.msg, type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) }); } } }).catch((e) => { }) } function getInfo(data) { let str = '' str += `病案号:${data.behospitalCode || '-'} 姓名:${data.name || '-'} 性别:${data.sex || '-'} 年龄:${data.age || '-'} 科室:${data.behDeptName || '-'} 主管医生:${data.doctorName || '-'} 入院时间:${data.behospitalDate || '-'} 出院时间:${data.leaveHospitalDate || '-'}`; $('.info').append(str); } function getCon(data) { console.log(data); let str = '' str += `

申述模块:${data.casesName || '-'}

病历内容:${data.defectContent || '-'}

缺陷详情:${data.qcresultDetailMsg || '-'}

       评分:${data.qcresultDetaiValue || '-'}

病案详情:查看

`; $('.content').append(str); $('.goDetail').on('click', function (e) { scoreDetail(data.behospitalCode, data.age, 'YH-BLZK-ZKSSKS', data.name) }) } function getHistory(data) { let str = '' for (let i = 0; i < data.length; i++) { const item = data[i] str += `

申述时间:${item.appealCreateDate || '-'}申述人:${item.claimantName || '-'}审核人:${item.checkName || '-'}

操作类型:${item.appealOperationType == 0 ? '删改条目' : item.appealOperationType == 1 ? '新增已有条目' : item.appealOperationType == 2 ? '新增缺失条目' : '恢复条目'}

申述说明:${item.appealExplain || '-'}

${item.exampleStatus == 2 ? `

审核时间:${item.appealExamineDate || '-'}

申述结果:审核通过

处理方式:${item.exampleOperation == 1 ? '修改' : item.exampleOperation == 2 ? '删除' : item.exampleOperation == 3 ? '新增已有' : item.exampleOperation == 4 ? '新增缺失' : '恢复条目'}

质控条目:${item.casesEntryName || '-'}

提示信息:${item.msg || '-'}

分值:${item.score || '-'}

备注:${item.exampleRemark || '-'}

` : item.exampleStatus == 1 ? `

审核时间:${item.appealExamineDate || '-'}

申述结果:审核通过

驳回理由:${item.rejectReason || '-'}

` : ""}
`; } $('.history').append(str); } function scoreDetail(id, age, code, name) { const logoParam = getLogoParam(); window.open(`./appealUserPage.html?id=${id}&age=${age}&code=${code}&hid=${getCookie('hospitalid')}&name=${name}&form=44` + logoParam) } $(document).on("click", "input[type=radio][value=1]", (e) => { $(".endis").attr("disabled", false); }); $(document).on("click", "input[type=radio][value=2]", (e) => { $(".endis").attr("disabled", true); }); $(document).on("click", ".btn-sure", (e) => { $("#delModal .modal-body").html(""); $("#delModal").show(); if (appealOperationType == 0) { $("#appealDel").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { approved(1) }); } else if (appealOperationType == 1) { console.log(appealInfo); $("#appealAdd").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { approved(2) }); } else if (appealOperationType == 2) { $("#appealDef").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { approved(3) }); } }); $(document).on("click", ".btn-cancel", (e) => { $("#delModal .modal-body").html(""); $('.bot ul').css({ "display": 'none', }); $("#delModal").show(); $("#delModal .modal-header .title").html('驳回'); $("#appealReject").tmpl(appealExamineRecordDTOList[0]).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { rejected() }); }); //审核 function approved(type) { if (type == 1) { appealInfo.exampleOperation = $('input:radio:checked').val() if ($('input:radio:checked').val() == 2) { appealInfo.delStatus == 0 } else { appealInfo.casesEntryMsg == $(".case").val() appealInfo.qcResultAlgVO.score = $('.score').val() appealInfo.qcResultAlgVO.explainInfo = $('.explainInfo').val() } } else if (type == 2) { appealInfo.exampleOperation = 3 appealInfo.qcResultAlgVO.score = $('.score').val() appealInfo.qcResultAlgVO.explainInfo = $('.explainInfo').val() } else if (type == 3) { appealInfo.exampleOperation = 4 appealInfo.processResult = $(".textarea").val() let val = $(".textarea").val() let num = 500 if (!val) { $(".appealDef .warning .red").text("处理结果不能为空~"); $(".appealDef .warning").show(); return } else if (val.length > num) { $(".appealDef .warning .red").text("处理结果不能超过" + num + "个字~"); $(".appealDef .warning").show(); return } } console.log(appealInfo); const param = { ...appealInfo, 'id': id, }; post(api.approved, param).then(function (res) { if (res.data.code === '0') { $("#delModal").hide(); $.alerModal({ "message": "审核成功", type: "tip", time: '1000', win: true }); } else { $.alerModal({ "message": res.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' }); } }).catch(() => { $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' }); }); } //驳回 function rejected() { let val = $(".textarea2").val() let num = 500 if (!val) { $(".appealReject .warning .red").text("驳回理由不能为空~"); $(".appealReject .warning").show(); return } else if (val.length > num) { $(".appealReject .warning .red").text("驳回理由不能超过" + num + "个字~"); $(".appealReject .warning").show(); return } const param = { 'behospitalCode': behospitalCode, 'id': id, rejectedReason: $(".textarea2").val() }; post(api.rejected, param).then(function (res) { console.log(res.data.data.code); if (res.data.data.code === '0') { $("#delModal").hide(); $.alerModal({ "message": "驳回成功", type: "tip", time: '1000', win: true }); } else { console.log(123); $.alerModal({ "message": res.data.data.msg || '失败,请重试~', type: "tip", time: '1000', win: 'default' }); } }).catch(() => { $.alerModal({ "message": '失败,请重试~', type: "tip", time: '1000', win: 'default' }); }); }