zhouna 4 年之前
父節點
當前提交
d8437fb6d4
共有 3 個文件被更改,包括 35 次插入2 次删除
  1. 8 0
      src/css/allotCheckTask.less
  2. 2 2
      src/html/allotCheckTask.html
  3. 25 0
      src/js/allotCheckTask.js

+ 8 - 0
src/css/allotCheckTask.less

@@ -77,6 +77,14 @@ h2{
     }
     .tabTitle   {
         background: #EFF0F9 !important;
+        .allCheck{
+            img{
+                width: 15px;
+                height: 15px;
+                cursor: pointer;
+                vertical-align: middle;
+            }
+        }
       }
     
 }

+ 2 - 2
src/html/allotCheckTask.html

@@ -119,7 +119,7 @@
                             <table class="qctable patientTable">
                                 <thead>
                                 <tr class="tabTitle">
-                                    <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>
+                                    <th class="allCheck textCenter" style="width: 65px;"><img code="" src="../images/icon_dis.png" alt=""></th>
                                     <th class="patientName textCenter" style="width: 100px;" valCode="name">病人姓名</th>
                                     <th class="beHospitalId textCenter" valCode="behospitalCode">病人住院序号</th>
                                     <th class="deptName textCenter" valCode="behospitalDept">科室</th>
@@ -160,7 +160,7 @@
                                 <th class="beHospitalId textCenter" valCode="behospitalCode">病人住院序号</th>
                                 <th class="deptName textCenter" valCode="behospitalDept">科室</th>
                                 <th class="doctorName textCenter" valCode="attendingDoctor">主管医生</th>
-                                <th class="outHospitalDate textCenter" valCode="leaveHospitalDate desc" code="leaveHospitalDate">出院日期</th>
+                                <th class="outHospitalDate textCenter desc" valCode="leaveHospitalDate" code="leaveHospitalDate">出院日期</th>
                                 <th class="recordScore textCenter" valCode="value" code="value">筛选分值</th>
                                 <th class="recordScore textCenter" valCode="jobDistributorName" code="jobDistributorName">分配人</th>
                                 <th class="recordScoreOpera textCenter" style="width: 65px;">操作</th>

+ 25 - 0
src/js/allotCheckTask.js

@@ -503,6 +503,7 @@ function selectTaskTb(){
         const depts=global_TaskDept.join(",")+",";
         if(it.is(".active")){
             $(this).find("img").attr('src',iconUnCheck);
+            $(".allCheck img").attr('src',iconUnCheck).removeClass("active");console.log(codes)
             global_TaskCodes = codes.replace(id+",","").replace(/^,|,$/,'').split(",");
             global_TaskDept = depts.replace(did+",","").replace(/^,|,$/,'').split(",");
         }else{
@@ -513,6 +514,29 @@ function selectTaskTb(){
         it.toggleClass('active');
 
     });
+
+    //全选
+    $(".allCheck img").unbind("click").click(function(){
+        const checks = $(".taskCheck img");
+        if($(this).is(".active")){
+            $(this).attr("src",iconUnCheck).removeClass("active");
+            checks.attr("src",iconUnCheck).removeClass("active");
+            global_TaskCodes=[];
+            global_TaskDept=[];
+        }else{
+            $(this).attr("src",iconCheck).addClass("active");
+            checks.attr("src",iconCheck).addClass("active");
+            let codes = [],depts=[];
+            checks.map((i)=>{
+                codes.push($(checks[i]).parent().attr("code"));
+                depts.push($(checks[i]).parent().attr("deptid"))
+            });
+            global_TaskCodes=codes;
+            global_TaskDept=codes;
+        }
+        console.log(global_TaskCodes)
+
+    });
 }
 //待分配任务列表渲染
 function renderTab(data){
@@ -539,6 +563,7 @@ function renderTab(data){
     }
 
     $('.patientTable .tbody').html(str)
+    $(".allCheck  img").attr("src",iconUnCheck);    //全选改为可用状态
     selectTaskTb();
     bindOrder()
 }