|
@@ -14,7 +14,12 @@ 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")
|
|
|
|
|
|
+let pageSet = [],pageSetCopy = [], showNum = 0, scrollTop=0;
|
|
|
let srcUrl = $("#contentIframe",parent.document).attr("src")
|
|
|
let statisticsType = getUrlArgObjectNew("dateType",srcUrl)||getUrlArgObjectNew("shijian",srcUrl) || ""
|
|
|
let chengdu = getUrlArgObjectNew("chengdu",srcUrl)||""
|
|
@@ -95,7 +100,7 @@ function getTabData(activePage){
|
|
|
size: 15,
|
|
|
statisticsType:statisticsType
|
|
|
}
|
|
|
- post(api.qcList,param).then(res =>{
|
|
|
+ return post(api.qcList,param).then(res =>{
|
|
|
if(res.data.code == '0'){
|
|
|
const data = res.data.data;
|
|
|
tabList = data.records;
|
|
@@ -201,7 +206,7 @@ function renderTab(data,hisId){
|
|
|
let str = ``
|
|
|
let hasSelectAll = true;
|
|
|
if(data.length===0){
|
|
|
- $('tbody').html(emptyBox())
|
|
|
+ $('tbody').html(emptyBox(null,showNum+2))
|
|
|
return;
|
|
|
}
|
|
|
for(let i = 0; i < data.length; i++){
|
|
@@ -212,25 +217,30 @@ function renderTab(data,hisId){
|
|
|
str += `
|
|
|
<tr data-index=${i}>
|
|
|
<td class="scoreOperaItem textCenter">${item.hasSelect ? `<img class="iconCheck" src=${iconCheck} />`:`<img class="iconCheck" src=${iconUnCheck} />`}</td>
|
|
|
- <td class="recordScoreOperaBtn textCenter" style="opacity:${hasData('FUNC000017')?'1':'0.5'}">评分</td>
|
|
|
- <td >${item.behospitalCode || "-"}</td>
|
|
|
- <td>${item.fileCode || "-"}</td>
|
|
|
- <td class="textCenter"><span data-index=${i} class="patientNameSpan">${item.name || "-"}<span></td>
|
|
|
- <td class="textCenter">${item.sex || "-"}</td>
|
|
|
- <td class="textCenter">${item.age || "-"}</td>
|
|
|
- <td class="textCenter">${item.bedCode || "-"}</td>
|
|
|
- <td class="textCenter">${item.behospitalDate&&item.behospitalDate.slice(0,10) || "-"}</td>
|
|
|
- <td class="textCenter">${item.leaveHospitalDate&&item.leaveHospitalDate.slice(0,10)|| "-"}</td>
|
|
|
- <td class="textCenter">${item.diagnose|| "-"}</td>
|
|
|
- <td class="textCenter">${item.behDoctorName || "-"}</td>
|
|
|
- <td class="textCenter">${item.doctorName || "-"}</td>
|
|
|
- <td class="textCenter">${item.directorDoctorName || "-"}</td>
|
|
|
- <td class="textCenter">${item.behDeptName || "-"}</td>
|
|
|
- <td class="textCenter">${item.level || "-"}</td>
|
|
|
- <td class="textCenter">${item.scoreRes || "-"}</td>
|
|
|
- <td class="textCenter">${item.gradeTime&&item.gradeTime.slice(0,10) || "-"}</td>
|
|
|
- </tr>
|
|
|
- `
|
|
|
+ <td class="recordScoreOperaBtn textCenter" style="opacity:${hasData('FUNC000017')?'1':'0.5'}">评分</td>`
|
|
|
+ for(let j = 0; j < pageSet.length; j++){
|
|
|
+ if(pageSet[j].status == 1){
|
|
|
+ str += `<td><span data-index=${i} class="${pageSet[j].val=='name'?'patientNameSpan':''}">${item[pageSet[j].val] || "-"}<span></td>`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // <td >${item.behospitalCode || "-"}</td>
|
|
|
+ // <td>${item.fileCode || "-"}</td>
|
|
|
+ // <td class="textCenter"><span data-index=${i} class="patientNameSpan">${item.name || "-"}<span></td>
|
|
|
+ // <td class="textCenter">${item.sex || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.age || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.bedCode || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.behospitalDate&&item.behospitalDate.slice(0,10) || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.leaveHospitalDate&&item.leaveHospitalDate.slice(0,10)|| "-"}</td>
|
|
|
+ // <td class="textCenter">${item.diagnose|| "-"}</td>
|
|
|
+ // <td class="textCenter">${item.behDoctorName || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.doctorName || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.directorDoctorName || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.behDeptName || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.level || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.scoreRes || "-"}</td>
|
|
|
+ // <td class="textCenter">${item.gradeTime&&item.gradeTime.slice(0,10) || "-"}</td>
|
|
|
+
|
|
|
+ str += "</tr>"
|
|
|
}
|
|
|
if(data.length === 0){
|
|
|
hasSelectAll = false
|
|
@@ -296,10 +306,10 @@ function bindLeveldSelect(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-//全选绑定
|
|
|
-bindOperaAll()
|
|
|
+
|
|
|
+
|
|
|
function bindScoreOperaItem(){
|
|
|
- $(".scoreOperaItem").on("click", function(e){
|
|
|
+ $(".scoreOperaItem").off("click").on("click", function(e){
|
|
|
const index = $(this).parent().attr("data-index")
|
|
|
tabList[index].hasSelect = tabList[index].hasSelect ? false:true
|
|
|
renderTab(tabList)
|
|
@@ -360,6 +370,55 @@ function getDeptList(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//获取页面配置
|
|
|
+
|
|
|
+function getPageSet(){
|
|
|
+ return post(api.getQcListPageSet,{pageType:1}).then(res =>{
|
|
|
+ if(res.data.code == '0'){
|
|
|
+ pageSet = res.data.data
|
|
|
+ pageSetCopy = JSON.parse(JSON.stringify(pageSet))
|
|
|
+ showNum = 0
|
|
|
+ renderTabTitle(pageSet)
|
|
|
+
|
|
|
+ }else{}
|
|
|
+ }).catch((e) =>{
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function renderTabTitle(data){
|
|
|
+ let str = ` <th class="textCenter" ></th>
|
|
|
+ <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>`
|
|
|
+ for(let i = 0; i < data.length; i++){
|
|
|
+ const item = data[i]
|
|
|
+ if(item.status == 1){
|
|
|
+ showNum++
|
|
|
+ str += `<th class="textCenter" code="${item.val.replace(/([A-Z])/g,function(match) {
|
|
|
+ return '_' + match.toLowerCase()
|
|
|
+ })}">${item.name}</th>`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let operStr=`<td colspan="${showNum+2}" style="background: #fff">
|
|
|
+ <div class="tabFoot">
|
|
|
+ <span class="scoreOpera" data-selectAll=false><img class="iconCheck" src="${iconUnCheck}" alt="checkbox">全选</span>
|
|
|
+ <span class="recordScoreBtn">评分</span>
|
|
|
+ <span class="setCol"><img class="iconSetting" src=${require('./../images/setting.png')} alt="关闭" />列设置</span>
|
|
|
+ </div>
|
|
|
+ </td>`
|
|
|
+ $(".tabOpera").html(operStr)
|
|
|
+ $(".tabTitle").html(str)
|
|
|
+ //全选绑定
|
|
|
+ bindOperaAll()
|
|
|
+ bindRecordScoreBtn()
|
|
|
+ bindSetCol()
|
|
|
+ bindOrder()
|
|
|
+}
|
|
|
+
|
|
|
+function bindSetCol(){
|
|
|
+ $(".setCol").off("click").on("click", function(){
|
|
|
+ renderColSet(pageSetCopy)
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
function rendeDeptList(deptList){
|
|
|
let str = `<li class="deptItem ellipsis" data-id=" " data-name="全部">全部</li>`;
|
|
@@ -398,42 +457,50 @@ function loading(){
|
|
|
function hideLoading(){
|
|
|
$("#mainBox .loadingBox", parent.document).remove()
|
|
|
}
|
|
|
-$('.recordScoreBtn').on("click",function(e){
|
|
|
- if(!hasData('FUNC000017')){
|
|
|
- return
|
|
|
- }
|
|
|
- let scoreList = []
|
|
|
- for(let i = 0; i <tabList.length; i++){
|
|
|
- if(tabList[i].hasSelect){
|
|
|
- scoreList.push(tabList[i].behospitalCode)
|
|
|
+
|
|
|
+function bindRecordScoreBtn(){
|
|
|
+ $('.recordScoreBtn').off("click").on("click",function(e){
|
|
|
+ if(!hasData('FUNC000017')){
|
|
|
+ return
|
|
|
}
|
|
|
- }
|
|
|
- if(scoreList.length === 0){
|
|
|
- $.alerModal({"message":'请选择要评分的项!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
- return
|
|
|
- } else{
|
|
|
- loading()
|
|
|
- for(let j = 0; j < scoreList.length; j++){
|
|
|
- recordScore(scoreList[j],scoreList.length,true)
|
|
|
+ let scoreList = []
|
|
|
+ for(let i = 0; i <tabList.length; i++){
|
|
|
+ if(tabList[i].hasSelect){
|
|
|
+ scoreList.push(tabList[i].behospitalCode)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-})
|
|
|
-$("th[code]").on("click",function(e){
|
|
|
- const code=$(this).attr("code");
|
|
|
- if(data_asc[0]===code){
|
|
|
- data_desc=[code];
|
|
|
- data_asc=[];
|
|
|
- $("th[code]").removeClass("asc desc");
|
|
|
- $(this).addClass("desc");
|
|
|
- }else{
|
|
|
- data_desc=[];
|
|
|
- data_asc=[code];
|
|
|
- $("th[code]").removeClass("asc desc");
|
|
|
- $(this).addClass("asc");
|
|
|
- }
|
|
|
- getTabData(1);
|
|
|
- // console.log(code)
|
|
|
-});
|
|
|
+ if(scoreList.length === 0){
|
|
|
+ $.alerModal({"message":'请选择要评分的项!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+ return
|
|
|
+ } else{
|
|
|
+ loading()
|
|
|
+ for(let j = 0; j < scoreList.length; j++){
|
|
|
+ recordScore(scoreList[j],scoreList.length,true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function bindOrder(){
|
|
|
+ $("th[code]").off("click").on("click",function(e){
|
|
|
+ const code=$(this).attr("code");
|
|
|
+ if(data_asc[0]===code){
|
|
|
+ data_desc=[code];
|
|
|
+ data_asc=[];
|
|
|
+ $("th[code]").removeClass("asc desc");
|
|
|
+ $(this).addClass("desc");
|
|
|
+ }else{
|
|
|
+ data_desc=[];
|
|
|
+ data_asc=[code];
|
|
|
+ $("th[code]").removeClass("asc desc");
|
|
|
+ $(this).addClass("asc");
|
|
|
+ }
|
|
|
+ getTabData(1);
|
|
|
+ // console.log(code)
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
function recordScore(behospitalCode,totalNum,hasToast){
|
|
|
const param = {
|
|
|
behospitalCode: behospitalCode
|
|
@@ -465,6 +532,157 @@ function recordScore(behospitalCode,totalNum,hasToast){
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+function renderColSet(pageSetList){
|
|
|
+ let allSelect = true
|
|
|
+ for(let i = 0; i < pageSetList.length; i++){
|
|
|
+ if(pageSetList[i].status != 1){
|
|
|
+ allSelect = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let str = `<div class='colSetBox'>
|
|
|
+ <div class='mask'></div>
|
|
|
+ <div class='cloInfobox'>
|
|
|
+ <div class='cloInfoTitle'><span class='cloInfoTitleTxt'>列显示设置</span> <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></div>
|
|
|
+ <div class='cloInfo'></div>
|
|
|
+ <div class='btnBox'> <span class='cancalColSet'>取消</span> <span class='saveColSet'>保存设置</span></div>
|
|
|
+ </div>
|
|
|
+ </div>`
|
|
|
+ let infoStr = `<div class='colTabTitle' ><span class='colOpera toggleSelectColAll' data-select=${allSelect}>${allSelect ? `<img src=${iconCheck} />`:`<img src=${iconUnCheck} />`}全选</span><span class='colName'>列名</span></div><div class='colTabInfoBox' >`
|
|
|
+ for(let i = 0; i < pageSetList.length; i++){
|
|
|
+ infoStr += `<div class='colTabInfo' data-index=${i}>
|
|
|
+ <span class='colOpera' data-index=${i}>${pageSetList[i].status == 1 ? `<img class="toggleSelectCol" src=${iconCheck} />`:`<img class="toggleSelectCol" src=${iconUnCheck} />`}</span>
|
|
|
+ <span class='colName'>
|
|
|
+ <span>${pageSetList[i].name}</span>
|
|
|
+ <span class="pageOrder">
|
|
|
+ <span class="pageSetUpBox">${ i === 0 ?'':`<img class="pageSetUp" src=${goUpG} />`}</span>
|
|
|
+ <span class="pageSetDownBox">${ i === pageSetList.length -1 ?'':`<img class="pageSetDown" src=${goDownG} />`}</span>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </span>
|
|
|
+
|
|
|
+ </div>`
|
|
|
+ }
|
|
|
+ infoStr += "</div>"
|
|
|
+ // $(".main-body").append(str)
|
|
|
+ if(!$("#mainBox .colSetBox", parent.document).length){
|
|
|
+ $("#mainBox", parent.document).append(str)
|
|
|
+ }
|
|
|
+ $("#mainBox .colSetBox .cloInfo", parent.document).html(infoStr)
|
|
|
+
|
|
|
+ bindSelectCol()
|
|
|
+ bindColOrder()
|
|
|
+ bindSaveColSet()
|
|
|
+ bindCloseColSet()
|
|
|
+ bindImgEnter()
|
|
|
+}
|
|
|
+
|
|
|
+function bindImgEnter(){
|
|
|
+ $(".pageSetUpBox img",parent.document).off("mouseenter").on("mouseenter",function(){
|
|
|
+ $(this).attr('src', goUpB)
|
|
|
+ })
|
|
|
+ $(".pageSetDownBox img",parent.document).off("mouseenter").on("mouseenter",function(){
|
|
|
+ $(this).attr('src', goDownB)
|
|
|
+ })
|
|
|
+ $(".pageSetUpBox img",parent.document).off("mouseout").on("mouseout",function(){
|
|
|
+ $(this).attr('src', goUpG)
|
|
|
+ })
|
|
|
+ $(".pageSetDownBox img",parent.document).off("mouseout").on("mouseout",function(){
|
|
|
+ $(this).attr('src', goDownG)
|
|
|
+ })
|
|
|
+}
|
|
|
+function bindSelectCol(){
|
|
|
+ $(".toggleSelectCol", parent.document ).off("click").on("click", function(){
|
|
|
+ const index = $(this).parent().attr("data-index")
|
|
|
+ pageSetCopy[index].status = pageSetCopy[index].status == 1 ? 0 : 1
|
|
|
+ renderColSet(pageSetCopy)
|
|
|
+
|
|
|
+ })
|
|
|
+ $(".toggleSelectColAll", parent.document ).off("click").on("click", function(){
|
|
|
+ const hasSelectAll = $(this).attr("data-select")
|
|
|
+ for(let i = 0; i < pageSetCopy.length; i++){
|
|
|
+ if(hasSelectAll == "true"){
|
|
|
+ pageSetCopy[i].status = 0
|
|
|
+
|
|
|
+ }else{
|
|
|
+ pageSetCopy[i].status = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ renderColSet(pageSetCopy)
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function closeColSet(){
|
|
|
+ pageSetCopy = pageSet
|
|
|
+ $("#mainBox .colSetBox", parent.document).remove()
|
|
|
+}
|
|
|
+function bindCloseColSet(){
|
|
|
+ $(".colSetBox .iconClose", parent.document ).off("click").on("click",function(){
|
|
|
+ closeColSet()
|
|
|
+ })
|
|
|
+ $(".colSetBox .cancalColSet", parent.document ).off("click").on("click",function(){
|
|
|
+ closeColSet()
|
|
|
+ })
|
|
|
+}
|
|
|
+function bindSaveColSet(){
|
|
|
+ $(".saveColSet", parent.document ).off("click").on("click", function(){
|
|
|
+ let sysUserPagesetVOList = []
|
|
|
+ for(let i = 0; i < pageSetCopy.length; i++){
|
|
|
+ const item = pageSetCopy[i]
|
|
|
+ sysUserPagesetVOList.push({
|
|
|
+ name: item.name,
|
|
|
+ orderNo: i,
|
|
|
+ status: item.status,
|
|
|
+ val: item.val
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return post(api.saveQcListPageSet,{pageType:1,sysUserPagesetVOList:sysUserPagesetVOList}).then(res =>{
|
|
|
+ if(res.data.code == '0'){
|
|
|
+ closeColSet()
|
|
|
+ getPageSet().then(res =>{
|
|
|
+ $(".filter").click(); //初始查询
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ $("#mainBox .colSetBox", parent.document).remove()
|
|
|
+ $.alerModal({"message":'保存失败',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+ }
|
|
|
+ }).catch((e) =>{
|
|
|
+ $("#mainBox .colSetBox", parent.document).remove()
|
|
|
+ $.alerModal({"message":'保存失败',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function bindColOrder(){
|
|
|
+ $(".pageSetUp", parent.document ).off("click").on("click", function(){
|
|
|
+ const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
|
|
|
+ if(index != 0){
|
|
|
+ const upItem = pageSetCopy[index]
|
|
|
+ const upItemPre = pageSetCopy[index-1]
|
|
|
+ pageSetCopy.splice(index-1,2,upItem,upItemPre)
|
|
|
+ renderColSet(pageSetCopy)
|
|
|
+
|
|
|
+ }else{
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ $(".pageSetDown", parent.document ).off("click").on("click", function(){
|
|
|
+ const index = parseInt($(this).parent().parent().parent().parent().attr("data-index"))
|
|
|
+ if(index == pageSetCopy.length - 1){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ const downItem = pageSetCopy[index]
|
|
|
+ const downItemBack = pageSetCopy[index + 1]
|
|
|
+ console.log('downItem',downItem,'downItemBack',downItemBack)
|
|
|
+ pageSetCopy.splice(index,2,downItemBack,downItem)
|
|
|
+ renderColSet(pageSetCopy)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
$(".patientNumInp").on("input", function(e){
|
|
|
const val = $(this).val().trim()
|
|
|
behospitalCodeTemp = val
|
|
@@ -534,7 +752,10 @@ $(function() {
|
|
|
changeYear: true,
|
|
|
dateFormat:"yy/mm/dd"
|
|
|
}).datepicker( "setDate",endDate);
|
|
|
- $(".filter").click(); //初始查询
|
|
|
+ getPageSet().then(res =>{
|
|
|
+ $(".filter").click(); //初始查询
|
|
|
+ })
|
|
|
+
|
|
|
});
|
|
|
|
|
|
//分页渲染
|