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; (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 appealInfo = { exampleOperation: 2, casesEntryName: data.casesEntryName, casesEntryMsg: data.casesEntryMsg, value: data.qcresultDetaiValue, remark: data.remark, behospitalCode: data.behospitalCode, qcResultAlgVO: { casesEntryId: casesEntryId, casesId: data.casesId, id: data.qcresultDetailId, exampleOperation: appealOperationType } } 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) { let str = '' str += `

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

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

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

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

病案详情:查看

`; $('.content').append(str); } 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 || '-'}

`; } $('.history').append(str); } $(document).on("click", ".goDetail", (e) => { $(parent.document).find("#contentIframe").attr("src", "checkTaskList.html") }); $(document).on("click", ".btn-sure", (e) => { $("#delModal .modal-body").html(""); $("#delModal").show(); if (appealOperationType == 0) { $("#appealDel").tmpl(appealInfo).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { approved(1) }); } else if (appealOperationType == 1) { $("#appealAdd").tmpl(appealInfo).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { approved(2) }); } else if (appealOperationType == 2) { $("#appealDef").tmpl(appealInfo).appendTo("#delModal .modal-body"); $("#delModal .confirm").text("确定").unbind("click").click(function () { approved(3) }); } console.log(appealOperationType); }); $(document).on("click", ".btn-cancel", (e) => { $("#delModal .modal-body").html(""); $('.bot ul').css({ "display": 'none', }); $("#delModal").show(); $("#delModal .modal-header .title").html('驳回'); $("#appealReject").tmpl(appealInfo).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 if (type == 2) { appealInfo.exampleOperation = 3 } 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 } } 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' }); }); }