zhangxc 5 anni fa
parent
commit
383d168580

+ 114 - 0
src/css/index.less

@@ -720,6 +720,120 @@
     line-height: 50px;
     border-radius: 10px;
   }
+  .cloInfobox{
+    position: fixed;
+    width: 400px;
+    height: 496px;
+    top: 50%;
+    margin-top: -248px;
+    left: 50%;
+    margin-left: -200px;
+    /* z-index: 155; */
+    background: #fff;
+    border-radius:4px;
+    .cloInfoTitle{
+      height: 40px;
+      line-height: 40px;
+      border-bottom: 1px solid #E2E5EF;
+      position: relative;
+      
+    }
+    .cloInfo{
+      position: relative;
+      left: 50%;
+      margin-left: -150px;
+      margin-top: 30px;
+      width: 300px;
+      height: 330px;
+    }
+    .cloInfoTitleTxt{
+      display: inline-block;
+      height: 40px;
+      line-height: 40px;
+      margin-left: 20px;
+    }
+    .colTabInfoBox{
+      height: 302px;
+      overflow-y: auto;
+      border: 1px solid #E2E5EF;
+      box-sizing: border-box;
+    }
+    .colTabTitle{
+      background: #EFF0F9;
+      .colName{
+        text-align: center;
+      }
+    }
+    .colTabTitle,.colTabInfo{
+      height: 30px;
+      box-sizing: border-box;
+      line-height: 30px;
+      
+    }
+    .colOpera,.colName{
+      display: inline-block;
+      width: 94px;
+      position: relative;
+    }
+    .colName{
+      width: 182px;
+    }
+    .iconClose{
+      position: absolute;
+      right: 0;
+      cursor: pointer;
+    }
+    .colTabInfo:nth-child(2n){
+      background: #EFF1F6;
+    }
+    .toggleSelectCol,.toggleSelectColAll img{
+      position: relative;
+      margin:0 10px 0 24px;
+      top: 3px;
+      width: 14px;
+      cursor: pointer;
+    }
+    .toggleSelectColAll{
+      cursor: pointer;
+    }
+    .pageSetUp,.pageSetDown{
+      width: 10px;
+      cursor: pointer;
+    }
+    .pageOrder{
+      display: inline-block;
+      position: absolute;
+      right: 32px;
+    }
+    .pageSetUpBox,.pageSetDownBox{
+      position: relative;
+      display: inline-block;
+      width: 15px;
+    }
+    .btnBox{
+      position: absolute;
+      cursor: pointer;
+      bottom: 0px;
+      height: 64px;
+    }
+    .cancalColSet,.saveColSet{
+      display: inline-block;
+      width:80px;
+      height:34px;
+      text-align: center;
+      line-height: 32px;
+      border-radius:4px;
+      border: 1px solid #00A1FF;
+      color: #00A1FF;
+      position: relative;
+      left: 110px;
+    }
+    .saveColSet{
+      background: #00A1FF;
+      color: #fff;
+      margin-left: 20px;
+    }
+  }
   .mask {
     position: fixed;
     width: 100%;

+ 11 - 0
src/css/qcList.less

@@ -256,6 +256,17 @@ table{
         position: absolute;
     }
 }
+.setCol{
+    color: #777;
+    cursor: pointer;
+    margin: 0 0 0  50px;
+}
+.iconSetting{
+    width: 18px;
+    position: relative;
+    top: 3px;
+    margin: 0 3px 0 0;
+}
 .iconCalen{
     position: absolute;
     width: 15px;

+ 11 - 0
src/css/qcListDept.less

@@ -256,6 +256,17 @@ table{
         position: absolute;
     }
 }
+.setCol{
+    color: #777;
+    cursor: pointer;
+    margin: 0 0 0  50px;
+}
+.iconSetting{
+    width: 18px;
+    position: relative;
+    top: 3px;
+    margin: 0 3px 0 0;
+}
 .iconCalen{
     position: absolute;
     width: 15px;

+ 11 - 0
src/css/qcListPerson.less

@@ -260,6 +260,17 @@ table{
         position: absolute;
     }
 }
+.setCol{
+    color: #777;
+    cursor: pointer;
+    margin: 0 0 0  50px;
+}
+.iconSetting{
+    width: 18px;
+    position: relative;
+    top: 3px;
+    margin: 0 3px 0 0;
+}
 .iconCalen{
     position: absolute;
     width: 15px;

+ 23 - 21
src/html/qcList.html

@@ -67,32 +67,34 @@
             <div class="overAuto">
                 <table>
                     <thead>
-                    <tr>
-                        <td colspan="18" style="background: #fff">
+                    <tr class="tabOpera">
+                        <!-- <td colspan="18" style="background: #fff">
                             <div class="tabFoot">
                                 <span class="scoreOpera" data-selectAll=false><img class="iconCheck" src="../images/icon_unchecked.png" alt="checkbox">全选</span>
                                 <span class="recordScoreBtn">评分</span>
                             </div>
-                        </td>
+                        </td> -->
+                    </tr>
+                    <tr class="tabTitle">
+                        <!-- <th class="textCenter" ></th>
+                        <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
+                        <th class="beHospitalId textCenter" code="behospital_code">病人住院序号</th>
+                        <th class="patientNo textCenter" code="file_code">病案号</th>
+                        <th class="patientName textCenter" code="name" style="width: 100px;">病人姓名</th>
+                        <th class="patientSex textCenter" code="sex">性别</th>
+                        <th class="patientage textCenter" code="age">年龄</th>
+                        <th class="bedNum textCenter" code="bed_code">床号</th>
+                        <th class="inHospitalDate textCenter" code="behospital_date">入院日期</th>
+                        <th class="outHospitalDate textCenter desc" code="leave_hospital_date">出院日期</th>
+                        <th class="diagnose textCenter" code="diagnose">主诊断</th>
+                        <th class="doctorName textCenter" code="beh_doctor_name">住院医生</th>
+                        <th class="doctorName textCenter" code="doctor_name">主管医生</th>
+                        <th class="doctorName textCenter" code="director_doctor_name">主任医生</th>
+                        <th class="deptName textCenter" code="beh_dept_name">科室</th>
+                        <th class="recordLevel textCenter" code="level">病历等级</th>
+                        <th class="recordScore textCenter" code="score_res">病历得分</th>
+                        <th class="scoreTime textCenter" code="grade_time">评分时间</th> -->
                     </tr>
-                    <th class="textCenter" ></th>
-                    <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
-                    <th class="beHospitalId textCenter" code="behospital_code">病人住院序号</th>
-                    <th class="patientNo textCenter" code="file_code">病案号</th>
-                    <th class="patientName textCenter" code="name" style="width: 100px;">病人姓名</th>
-                    <th class="patientSex textCenter" code="sex">性别</th>
-                    <th class="patientage textCenter" code="age">年龄</th>
-                    <th class="bedNum textCenter" code="bed_code">床号</th>
-                    <th class="inHospitalDate textCenter" code="behospital_date">入院日期</th>
-                    <th class="outHospitalDate textCenter desc" code="leave_hospital_date">出院日期</th>
-                    <th class="diagnose textCenter" code="diagnose">主诊断</th>
-                    <th class="doctorName textCenter" code="beh_doctor_name">住院医生</th>
-                    <th class="doctorName textCenter" code="doctor_name">主管医生</th>
-                    <th class="doctorName textCenter" code="director_doctor_name">主任医生</th>
-                    <th class="deptName textCenter" code="beh_dept_name">科室</th>
-                    <th class="recordLevel textCenter" code="level">病历等级</th>
-                    <th class="recordScore textCenter" code="score_res">病历得分</th>
-                    <th class="scoreTime textCenter" code="grade_time">评分时间</th>
                     </thead>
                     <tbody>
 

+ 23 - 21
src/html/qcListDept.html

@@ -67,32 +67,34 @@
             <div class="overAuto">
                 <table>
                     <thead>
-                        <tr>
-                            <td colspan="18" style="background: #fff">
+                        <tr class="tabOpera">
+                            <!-- <td colspan="18" style="background: #fff">
                                 <div class="tabFoot">
                                     <span class="scoreOpera" data-selectAll=false><img class="iconCheck" src="../images/icon_unchecked.png" alt="checkbox">全选</span>
                                     <span class="recordScoreBtn">评分</span>
                                 </div>
-                            </td>
+                            </td> -->
+                        </tr>
+                        <tr class="tabTitle">
+                            <!-- <th class="textCenter" ></th>
+                            <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
+                            <th class="beHospitalId textCenter" code="behospital_code">病人住院序号</th>
+                            <th class="patientNo textCenter" code="file_code">病案号</th>
+                            <th class="patientName textCenter" code="name" style="width: 100px;">病人姓名</th>
+                            <th class="patientSex textCenter" code="sex">性别</th>
+                            <th class="patientage textCenter" code="age">年龄</th>
+                            <th class="bedNum textCenter" code="bed_code">床号</th>
+                            <th class="inHospitalDate textCenter" code="behospital_date">入院日期</th>
+                            <th class="outHospitalDate textCenter desc" code="leave_hospital_date">出院日期</th>
+                            <th class="diagnose textCenter" code="diagnose">主诊断</th>
+                            <th class="doctorName textCenter" code="beh_doctor_name">住院医生</th>
+                            <th class="doctorName textCenter" code="doctor_name">主管医生</th>
+                            <th class="doctorName textCenter" code="director_doctor_name">主任医生</th>
+                            <th class="deptName textCenter" code="beh_dept_name">科室</th>
+                            <th class="recordLevel textCenter" code="level">病历等级</th>
+                            <th class="recordScore textCenter" code="score_res">病历得分</th>
+                            <th class="scoreTime textCenter" code="grade_time">评分时间</th> -->
                         </tr>
-                        <th class="textCenter" ></th>
-                        <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
-                        <th class="beHospitalId textCenter" code="behospital_code">病人住院序号</th>
-                        <th class="patientNo textCenter" code="file_code">病案号</th>
-                        <th class="patientName textCenter" code="name" style="width: 100px;">病人姓名</th>
-                        <th class="patientSex textCenter" code="sex">性别</th>
-                        <th class="patientage textCenter" code="age">年龄</th>
-                        <th class="bedNum textCenter" code="bed_code">床号</th>
-                        <th class="inHospitalDate textCenter" code="behospital_date">入院日期</th>
-                        <th class="outHospitalDate textCenter desc" code="leave_hospital_date">出院日期</th>
-                        <th class="diagnose textCenter" code="diagnose">主诊断</th>
-                        <th class="doctorName textCenter" code="beh_doctor_name">住院医生</th>
-                        <th class="doctorName textCenter" code="doctor_name">主管医生</th>
-                        <th class="doctorName textCenter" code="director_doctor_name">主任医生</th>
-                        <th class="deptName textCenter" code="beh_dept_name">科室</th>
-                        <th class="recordLevel textCenter" code="level">病历等级</th>
-                        <th class="recordScore textCenter" code="score_res">病历得分</th>
-                        <th class="scoreTime textCenter" code="grade_time">评分时间</th>
                     </thead>
                     <tbody>
 

+ 23 - 21
src/html/qcListPerson.html

@@ -66,32 +66,34 @@
             <div class="overAuto">
                 <table>
                     <thead>
-                        <tr>
-                            <td colspan="18" style="background: #fff">
+                        <tr class="tabOpera">
+                            <!-- <td colspan="18" style="background: #fff">
                                 <div class="tabFoot">
                                     <span class="scoreOpera" data-selectAll=false><img class="iconCheck" src="../images/icon_unchecked.png" alt="checkbox">全选</span>
                                     <span class="recordScoreBtn">评分</span>
                                 </div>
-                            </td>
+                            </td> -->
                         </tr>
-                        <th class="textCenter" ></th>
-                        <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
-                        <th class="beHospitalId textCenter" code="behospital_code">病人住院序号</th>
-                        <th class="patientNo textCenter" code="file_code">病案号</th>
-                        <th class="patientName textCenter" code="name" style="width: 100px;">病人姓名</th>
-                        <th class="patientSex textCenter" code="sex">性别</th>
-                        <th class="patientage textCenter" code="age">年龄</th>
-                        <th class="bedNum textCenter" code="bed_code">床号</th>
-                        <th class="inHospitalDate textCenter" code="behospital_date">入院日期</th>
-                        <th class="outHospitalDate textCenter desc" code="leave_hospital_date">出院日期</th>
-                        <th class="diagnose textCenter" code="diagnose">主诊断</th>
-                        <th class="doctorName textCenter" code="beh_doctor_name">住院医生</th>
-                        <th class="doctorName textCenter" code="doctor_name">主管医生</th>
-                        <th class="doctorName textCenter" code="director_doctor_name">主任医生</th>
-                        <th class="deptName textCenter" code="beh_dept_name">科室</th>
-                        <th class="recordLevel textCenter" code="level">病历等级</th>
-                        <th class="recordScore textCenter" code="score_res">病历得分</th>
-                        <th class="scoreTime textCenter" code="grade_time">评分时间</th>    
+                        <tr class="tabTitle">
+                            <th class="textCenter" ></th>
+                            <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
+                            <th class="beHospitalId textCenter" code="behospital_code">病人住院序号</th>
+                            <th class="patientNo textCenter" code="file_code">病案号</th>
+                            <th class="patientName textCenter" code="name" style="width: 100px;">病人姓名</th>
+                            <th class="patientSex textCenter" code="sex">性别</th>
+                            <th class="patientage textCenter" code="age">年龄</th>
+                            <th class="bedNum textCenter" code="bed_code">床号</th>
+                            <th class="inHospitalDate textCenter" code="behospital_date">入院日期</th>
+                            <th class="outHospitalDate textCenter desc" code="leave_hospital_date">出院日期</th>
+                            <th class="diagnose textCenter" code="diagnose">主诊断</th>
+                            <th class="doctorName textCenter" code="beh_doctor_name">住院医生</th>
+                            <th class="doctorName textCenter" code="doctor_name">主管医生</th>
+                            <th class="doctorName textCenter" code="director_doctor_name">主任医生</th>
+                            <th class="deptName textCenter" code="beh_dept_name">科室</th>
+                            <th class="recordLevel textCenter" code="level">病历等级</th>
+                            <th class="recordScore textCenter" code="score_res">病历得分</th>
+                            <th class="scoreTime textCenter" code="grade_time">评分时间</th>   
+                        </tr> 
                     </thead>
                     <tbody>
 

BIN
src/images/arrow_down_blue.png


BIN
src/images/arrow_down_grey.png


BIN
src/images/arrow_up_blue.png


BIN
src/images/arrow_up_grey.png


BIN
src/images/setting.png


+ 2 - 0
src/js/api.js

@@ -81,6 +81,8 @@ const api = {
     exportQcListDept:'/qc/behospitalInfo/exportQcresultByDept',//质控评分(科室)导出
     entryRejectPercent:'/console/entryRejectPercent',//单项否决占比
     qcResultLevelPercent:'/console/qcResultLevelPercent',//各科室甲乙丙级占比
+    getQcListPageSet:'/sys/user/pageset/getPageSet',
+    saveQcListPageSet:'/sys/user/pageset/savePageSet',
 }
 module.exports = {
     api

+ 280 - 59
src/js/qcList.js

@@ -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();   //初始查询
+    })
+   
 });
 
 //分页渲染

+ 270 - 56
src/js/qcListDept.js

@@ -14,8 +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;
 $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 
@@ -99,7 +103,7 @@ function getTabData(activePage){
         size: 15,
         statisticsType:statisticsType
     }
-    post(api.qcListByDept,param).then(res =>{
+    return post(api.qcListByDept,param).then(res =>{
         if(res.data.code == '0'){
             tabList = res.data.data.records
             const totalPage = res.data.data.pages
@@ -199,22 +203,24 @@ $(".abnormalClear").on("click", function(e){
     }
     getTabData(1)
 })
-$("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)
-});
+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 renderTab(data){
     let str = ``
     let hasSelectAll = true;
@@ -230,25 +236,30 @@ function renderTab(data){
         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
@@ -378,6 +389,56 @@ 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>`
@@ -416,26 +477,28 @@ 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)
+            }
         }
-    }
-})
+        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 recordScore(behospitalCode,totalNum,hasToast){
     const param = {
         behospitalCode: behospitalCode
@@ -466,6 +529,155 @@ 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
@@ -536,7 +748,9 @@ $(function() {
         changeYear: true,
         dateFormat:"yy/mm/dd"
     }).datepicker( "setDate",endDate);
-    $(".filter").click();   //初始查询
+    getPageSet().then(res =>{
+        $(".filter").click();   //初始查询
+    })
 });
 
 //分页渲染

+ 273 - 57
src/js/qcListPerson.js

@@ -14,6 +14,14 @@ 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 doctorName_global = getUrlArgObject("doctorName")
 
 // console.log('doctorName_global',doctorName_global)
@@ -100,7 +108,7 @@ function getTabData(activePage){
         size: 15,
         statisticsType:statisticsType
     }
-    post(api.qcListByPerson,param).then(res =>{
+    return post(api.qcListByPerson,param).then(res =>{
         if(res.data.code == '0'){
             tabList = res.data.data.records
             const totalPage = res.data.data.pages
@@ -198,22 +206,24 @@ $(".abnormalClear").on("click", function(e){
     }
     getTabData(1)
 })
-$("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)
-});
+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 renderTab(data){
     let str = ``
     let hasSelectAll = true;
@@ -229,25 +239,30 @@ function renderTab(data){
         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
@@ -314,9 +329,8 @@ 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)
@@ -376,6 +390,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){
@@ -415,26 +478,28 @@ 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)
+            }
         }
-    }
-})
+        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 recordScore(behospitalCode,totalNum,hasToast){
     const param = {
         behospitalCode: behospitalCode
@@ -465,6 +530,155 @@ 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
@@ -531,7 +745,9 @@ $(function() {
         changeYear: true,
         dateFormat:"yy/mm/dd"
     }).datepicker( "setDate",endDate);
-    $(".filter").click();   //初始查询
+    getPageSet().then(res =>{
+        $(".filter").click();   //初始查询
+    })
 });
 
 //分页渲染

+ 4 - 3
src/js/utils.js

@@ -2,7 +2,7 @@ const qs = require('qs');
 const $ = require("jquery");
 const axios = require("axios")
 var Utils = require('./rePromise');
-const baseUrl = "http://192.168.2.121:5858"
+const baseUrl = "http://192.168.2.236:5858"
 //页面映射
 const pageMap={
   'YH-KZT':'console.html',
@@ -275,8 +275,9 @@ function focusMenuItem(code){
   //console.log($(parent.document).find(".menu .page[code='YH-ZKK-GMKQXZB_XQ']"))
   ele.click();
 }
-function emptyBox(name){
-  let str = `<tr><td colspan="18" style="text-align: center;color: #aaa">
+function emptyBox(name,showNum){
+  let showNumer = showNum || 18
+  let str = `<tr><td colspan="${showNumer}" style="text-align: center;color: #aaa">
   <img style="margin-top:50px;width:100px;" src="${require('../images/empty1.png')}" />
   <p style="margin-top:20px;margin-bottom:30px;color:#ccc;position:relative;left:5px;">${name||'暂无数据~'}</p>
   </td></tr>`