const $ = require('jquery'); require("../css/deptScoreDetail.less"); require('./modal.js'); const {api} = require('./api.js') const {post,getCookie,getUrlArgObjectNew,focusMenuItem,emptyBox,setDatePicker,getPickerDate,initScroll} = 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 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") $(".selectLevel").append(`下拉`) $(".selectDept").append(`下拉`) let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",behosDateEnd="", scoreSum = 0,statisticsType="",deptList=[], nameTemp = "", behospitalCodeTemp="",levelTemp="",curDeptId="", deptId="",deptIdTemp="", doctorName="", doctorNum="",doctorNameTemp="",doctorNumTemp="", data_desc=[],data_asc=[]; $(function(){ deptList = JSON.parse(getCookie("deptList"))||[] let srcUrl = $("#contentIframe",parent.document).attr("src") deptId = deptIdTemp = getUrlArgObjectNew("deptName",srcUrl)||"" statisticsType = getUrlArgObjectNew("dateType",srcUrl)||"" from = getUrlArgObjectNew("from",srcUrl)||"1" curDeptId = getUrlArgObjectNew("curDeptId",srcUrl)||"" let startDateParam = getUrlArgObjectNew("startDateParam",srcUrl)||"" let endDateParam = getUrlArgObjectNew("endDateParam",srcUrl)||"" if(statisticsType == 1){ $(".monthYear .mon").css({ backgroundColor:'#00A1FF', color:'#fff' }).siblings().css({ color:'#00A1FF', backgroundColor:'#fff' }) setDatePicker($("#datepicker"),$("#datepicker2"),1) }else if(statisticsType == 2){ $(".monthYear .year").css({ backgroundColor:'#00A1FF', color:'#fff' }).siblings().css({ color:'#00A1FF', backgroundColor:'#fff' }) setDatePicker($("#datepicker"),$("#datepicker2"),2) }else if(statisticsType == 3){ setDatePicker($("#datepicker"),$("#datepicker2"),3,new Date(startDateParam),new Date(endDateParam)) }else{ setDatePicker($("#datepicker"),$("#datepicker2"),"default") } if(!statisticsType){ setDatePicker($("#datepicker"),$("#datepicker2"),"default") } if(deptId){ $(".selectDept").html(deptId).attr({ "data-id":deptId, "dept-id":curDeptId, "title":deptId }).append(`下拉`) getDeptList() }else{ getDeptList(1) } getTabData(1) }) $(".abnormalClear").click(function(){ deptId = deptIdTemp = deptList[0]&&deptList[0].deptName curDeptId = deptIdTemp = deptList[0]&&deptList[0].deptId behospitalCode=behospitalCodeTemp = "" setDatePicker($("#datepicker"),$("#datepicker2"),"default") $(".patientNumInp").val("") $(".selectDept").html(deptId).attr({ "data-id":deptId, "dept-id":curDeptId, "title":deptId }).append(`下拉`) getTabData(1) }) $(".partTitle a").click(function(){ //初始菜单选中 if(from == 2){ focusMenuItem('YH-KZTKS') }else{ focusMenuItem('YH-KZT') } $(".container",parent.document).addClass("console-cont"); }) $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5') //科室处理 // getDeptList() function getDeptList(flg){ let str = `` if(deptList.length<=0)return if(flg){ $(".deptScoreDetail .selectDept ").attr({"data-id":deptList[0].deptName,'dept-id':deptList[0].deptId}).find("i").html(deptList[0].deptName) deptId = deptIdTemp = deptList[0].deptName curDeptId = deptList[0].deptId } for(let i = 0;i < deptList.length;i++){ let tmp = deptList[i] str += `
  • ${tmp.deptName}
  • ` } $(".deptScoreDetail .filterDropList").html(str) } dateChange() //所有数据切换日期筛选 function dateChange(){ $(".monthYear .mon").click(function(){ $(this).css({ backgroundColor:'#00A1FF', color:'#fff' }).siblings().css({ color:'#00A1FF', backgroundColor:'#fff' }) $(".dayDetail .deptListWrap").css("display","block") $(".dayDetail .dayFilter").css("display","none") statisticsType = 1 setDatePicker($("#datepicker"),$("#datepicker2"),1) getTabData(1) }) $(".monthYear .year").click(function(){ $(this).css({ backgroundColor:'#00A1FF', color:'#fff' }).siblings().css({ color:'#00A1FF', backgroundColor:'#fff' }) $(".dayDetail .deptListWrap").css("display","none") $(".dayDetail .dayFilter").css("display","block") statisticsType = 2 setDatePicker($("#datepicker"),$("#datepicker2"),2) getTabData(1) }) } //判断有无某一权限 function hasData(data){ let trdObj = JSON.parse(getCookie("trdObj")) let lis = trdObj['YH-BLZK-ZKPF'] if(!lis){ return false } if(lis.indexOf(data)>-1){//有权限 return true } return false; } function getTabData(activePage){ const dateStatrt = getPickerDate($("#datepicker"),1) const dateEnd = getPickerDate($("#datepicker2"),2) const start = new Date(dateStatrt).getTime() const end = new Date(dateEnd).getTime() if(start > end){ $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)}); return } const param = { "asc": "", "deptName": deptId||"", "desc": "", "level": "", "name": behospitalCode||"", "type": 0, //1-本月,2-本年,0-自定义时间(现在 都是自定义时间,都会传具体时间进去) "startDate":dateStatrt, "endDate":dateEnd } startDateParam = dateStatrt endDateParam = dateEnd post(api.levelStatisticsByDept,param).then(res =>{ if(res.data.code == '0'){ const data = res.data.data; tabList = data.records; const totalPage = data.pages; const totalNum = data.total; renderTab(data,data.hospitalId,activePage); renderPagination(totalPage,Number(activePage),totalNum) if(totalPage > 1){ renderPagination(totalPage,Number(activePage),totalNum) } else{ $('.pagination').html("") } }else{ $.alerModal({"message":res.data.msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)}); } }).catch((e) =>{ }) } $(".filter").on("click", function(e){ name = nameTemp behospitalCode = behospitalCodeTemp level = levelTemp deptId = deptIdTemp getTabData(1) }) function renderTab(data,hisId,activePage){ let str = `` for(let i = 0; i < data.length; i++){ const item = data[i] str += ` ${(activePage-1)*15 + i+1} ${item.doctorName || "-"} ${item.entryNum+'' || "-"} ${item.averageValue || "-"} ${item.mrNum+'' || "-"} ${item.firstLevelNum+'' || "-"} ${item.secondLevelNum+'' || "-"} ${item.thirdLevelNum+'' || "-"} ${item.firstLevelPercentStr || "-"} ${item.secondLevelPercentStr || "-"} ${item.thirdLevelPercentStr || "-"} ` } $('.tbody').html(str?str:emptyBox()) bindScoreDetail(hisId) $(".goHomeDetail").click(function(){ let docName = $(this).attr("data-doc") $(parent.document).find("#contentIframe").attr("src","quexianDetail.html?from=2&deptName="+deptIdTemp+"&docName="+docName+"&shijian=3"+"&startDateParam="+startDateParam+"&endDateParam="+endDateParam) }) $(".goHomeDetailB").click(function(){ let docName = $(this).attr("data-dept") let deptC = $(this).attr("data-c") focusMenuItem("YH-BLZK-ZKPFKS"); $(parent.document).find("#contentIframe").attr("src","qcListDept.html?from=2&deptName="+deptIdTemp+"&docName="+docName+"&shijian=3"+"&chengdu="+deptC+"&deptId="+curDeptId+"&startDateParam="+startDateParam+"&endDateParam="+endDateParam) }) initScroll("deptScoreDetail","YX",1) } function scoreDetail(id,age,hid,code){ window.open(`./qcScore.html?id=${id}&age=${age}&hid=${hid}&code=${code}`) } function bindScoreDetail(hisId){ $('.patientNameSpan').on('click',function(e){ const index = $(this).attr("data-index") const type = $(this).attr("data-type") const item = tabList[index] midifyMsgBox(item,type) }) } function midifyMsgBox(item,type){ const itemCopy = JSON.parse(JSON.stringify(item)) let msgBox = '' if(type == 1){ msgBox = `

    修改 关闭

    状态: ${itemCopy.status == 0?"未处理":"已处理"}
    • 未处理
    • 已处理
    备注:
    支持≥0的数字输入,最多保留小数点后1位~
    保存
    ` }else{ msgBox = `

    修改 关闭

    确认要删除该条异常记录?

    删除 取消
    ` } $("#mainBox", parent.document).append(msgBox) $(".midifyEditDel", parent.document).on("click",function(){ delModifyOne(itemCopy) }) $(".midifyEditQuit", parent.document).on("click",function(){ $("#mainBox .midifyMsgBox", parent.document).remove() }) $(".abnormalAll", parent.document).on("click",function(){ $(".abnormalStatusLis", parent.document).slideToggle() }) $(".abnormalStatusLis li", parent.document).on("click",function(){ let status = $(this).attr("data-status") let str = $(this).html() $(".abnormalAll", parent.document).attr("data-status",status).html(str) $(".abnormalStatusLis", parent.document).slideToggle() }) $("#mainBox .midifyMsgBox .iconClose", parent.document).on("click", function(e){ $("#mainBox .midifyMsgBox", parent.document).remove() }) $("#mainBox .midifyMsgBox .itemScore", parent.document).on("keypress", function(event){ return (/[\d\.]/.test(String.fromCharCode(event.keyCode))) }) $("#mainBox .midifyMsgBox .itemScore", parent.document).on("input", function(e){ const val = $(this).val() itemCopy.score = val }) $("#mainBox .midifyMsgBox .midifyEdit", parent.document).on("click", function(e){ saveModifyOne(itemCopy) }) } //保存修改 function delModifyOne(itemCopy){ let param = { "id": itemCopy.id } post(api.delQcAnnormal,param).then(res =>{ if(res.data.code == '0'){ const data = res.data.data; getTabData(1) $("#mainBox .midifyMsgBox", parent.document).remove() $.alerModal({"message":'删除成功',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)}); }else{ } }).catch((e) =>{ }) } //保存修改 function saveModifyOne(itemCopy){ let txt = $(".abnormalTxt", parent.document).val() let status = $(".abnormalAll", parent.document).attr("data-status") let param = { "id": itemCopy.id, "remark": txt, "status": status } post(api.saveQcAnnormal,param).then(res =>{ if(res.data.code == '0'){ const data = res.data.data; getTabData(1) $("#mainBox .midifyMsgBox", parent.document).remove() $.alerModal({"message":'修改成功',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)}); }else{ } }).catch((e) =>{ }) } //选择病历等级 $('.selectLevel').on("click", function(e){ e.stopPropagation() $(".deptList ").css("display", "none") $(".selectDept .arrow").attr("src",iconDown) const showList = $(".levelList ").css("display") if(showList == "none" ||!showList){ $(".levelList ").css("display","block") $(".selectLevel .arrow").attr("src",iconUp) }else{ $(".levelList ").css("display", "none") $(".selectLevel .arrow").attr("src",iconDown) } }) bindLeveldSelect() //是否启用选择 function bindLeveldSelect(){ $('.levelItem').on("click",function(){ const levelItemName = $(this).attr("data-name") const levelItemItemId = $(this).attr("data-id") levelTemp =levelItemItemId $('.selectLevel').html(levelItemName) $(".levelList").css("display", "none") $(".selectLevel").append(`下拉`) }) } //全选绑定 $('.selectDept').on("click", function(e){ e.stopPropagation() $(".levelList ").css("display","none") $(".selectLevel .arrow").attr("src",iconDown) const showList = $(".deptList ").css("display") if(showList == "none" ||!showList){ $(".deptList ").css("display","block") $(".selectDept .arrow").attr("src",iconUp) }else{ $(".deptList ").css("display", "none") $(".selectDept .arrow").attr("src",iconDown) } }) function rendeDeptList(deptList){ let str = `
  • 全部
  • ` for(let i = 0; i < deptList.length; i++){ str += `
  • ${deptList[i].deptName}
  • ` } $('.deptList').html(str) } bindDeptSelect() //科室选择 function bindDeptSelect(){ $("body").on("click",'.deptItem',function(){ const deptItemName = $(this).attr("data-name") const deptItemId = $(this).attr("data-id") const did = $(this).attr("dept-id") deptIdTemp =deptItemId curDeptId = did if(deptItemName.length > 10){ $('.selectDept').html(deptItemName.substring(0,8)+'...').attr({"dept-id":curDeptId,"title":deptItemName}) }else{ $('.selectDept').html(deptItemName).attr({"dept-id":curDeptId,"title":deptItemName}) } $('.selectDept ').attr({'title':deptItemName,'data-id':deptItemName,'dept-id':curDeptId}) $(".selectDept").append(`下拉`) $(".deptList").css("display", "none") }) } function loading(){ const str = `
    loading
    ` $("#mainBox", parent.document).append(str) } function hideLoading(){ $("#mainBox .loadingBox", parent.document).remove() } $('.recordScoreBtn').on("click",function(e){ if(!hasData('FUNC000017')){ return } let scoreList = [] for(let i = 0; i { if(res.data.code == '0'){ scoreSum++ if(scoreSum === totalNum){ hideLoading() scoreSum = 0 const activePage = $(".activePage").attr('data-page') || 1 getTabData(activePage) } }else{} }).catch((e) =>{ }) } $(".patientNumInp").on("input", function(e){ const val = $(this).val().trim() behospitalCodeTemp = val }) $(".patientNameInp").on("input", function(e){ const val = $(this).val().trim() nameTemp = val }) $(".doctorInp").on("input", function(e){ const val = $(this).val().trim() doctorNameTemp = val }) $(".doctorNumInp").on("input", function(e){ const val = $(this).val().trim(); doctorNumTemp = val }) $(function() { $.datepicker.regional['zh-CN'] = { clearText: '清除', clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期', closeText: '关闭', closeStatus: '不改变当前选择', prevText: '<上月', prevStatus: '显示上月', prevBigText: '<<', prevBigStatus: '显示上一年', nextText: '下月>', nextStatus: '显示下月', nextBigText: '>>', nextBigStatus: '显示下一年', currentText: '今天', currentStatus: '显示本月', monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], yearNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthStatus: '选择月份', yearStatus: '选择年份', weekHeader: '周', weekStatus: '年内周次', dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], dayNamesMin: ['日','一','二','三','四','五','六'], dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: '请选择日期', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['zh-CN']); $( "#datepicker" ).datepicker({ changeMonth: true, changeYear: true, dateFormat:"yy/mm/dd" }); $( "#datepicker2" ).datepicker({ changeMonth: true, changeYear: true, dateFormat:"yy/mm/dd" }); }); //分页渲染 function renderPagination(totalPage,activePage,totalNum){ let str = `共${totalPage}页/${totalNum}条数据` if(totalPage <= 6){ for(let i = 1; i <= totalPage; i++){ str += `${i}` } }else{ if(activePage <= 3){ //选中页数小于4 for(let i = 1; i <= 4; i++){ str += `${i}` } str += `...` str += `${totalPage}` } else if(activePage > totalPage -3){ str += `1` str += `...` str += `${totalPage -3}` str += `${totalPage -2}` str += `${totalPage -1}` str += `${totalPage}` } else { str += `1` str += `...` str += `${activePage -1}` str += `${activePage}` str += `${activePage +1}` str += `...` str += `${totalPage}` } } str += `` $('.pagination').html(str) $('.page' + activePage).addClass('activePage') $(".pageNum").on("click", function(e){ const activePageNow = Number($(this).attr('data-page')) getTabData(activePageNow) // renderPagination(totalPage,activePageNow,totalNum) }) $(".prePage").on("click", function(e){ let activePageNow = Number($(".activePage").attr('data-page')) if(activePageNow > 1){ activePageNow-- getTabData(activePageNow) // renderPagination(totalPage,activePageNow,totalNum) } }) $(".nextPage").on("click", function(e){ let activePageNow = Number($(".activePage").attr('data-page')) if(activePageNow < totalPage){ activePageNow++ getTabData(activePageNow) // renderPagination(totalPage,activePageNow,totalNum) } }) } $(document).on("click", function(){ $(".levelList ").css("display", "none") $(".deptList").css("display", "none") $(".selectDept .arrow").attr("src",iconDown) }) $(function() { const iconCalenBlue= require("./../images/darkDate.png") const iconCalenGrey= require("./../images/icon_calen_grey.png") $('.datapickerBox').append(``) $('.iconCalen').on("mouseenter", function(e){ $(this).attr("src", iconCalenBlue) }) $('.iconCalen').on("mouseleave", function(e){ $(this).attr("src", iconCalenGrey) }) $('.iconCalen').on("click", function(e){ $(this).parent().find("input").focus() }) });