zhangxc 5 年之前
父节点
当前提交
03754941dd
共有 1 个文件被更改,包括 25 次插入1 次删除
  1. 25 1
      src/js/qcListCopy.js

+ 25 - 1
src/js/qcListCopy.js

@@ -32,6 +32,7 @@ let from = getUrlArgObjectNew("from",srcUrl)||""
 let defectName = getUrlArgObjectNew("defectName",srcUrl)||"";
 let casesId = getUrlArgObjectNew("casesEntryId",srcUrl)||"";
 let isSingleReject = getUrlArgObjectNew("isSingleReject",srcUrl)||""
+let deptListDept = JSON.parse(getCookie("deptList"))||[]
 
 $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
@@ -69,6 +70,11 @@ if(deptIdPram&&deptNamePram){
 if(from==2){
     $(".export").css('display','none')
     $(".partTitle .titlePic ").html(`<a class="consoleD" href="deptConsole.html">控制台(科室) / </a><a class="consoleP" href="singleVeto.html?from=1">条目缺陷占比 / </a>缺陷详情`)
+    deptId=deptListDept[0]&&deptListDept[0].deptId; 
+    deptName=deptListDept[0]&&deptListDept[0].deptName;
+    deptNameTemp=deptListDept[0]&&deptListDept[0].deptName;
+    deptIdTemp=deptListDept[0]&&deptListDept[0].deptId;
+    $('.selectDept').html(deptName)
 }else if(from==3){
   $(".partTitle .titlePic ").html(`<a href="keyItemFlawControl.html">关键条目缺陷占比 / </a>缺陷详情`)
 }else{
@@ -188,6 +194,12 @@ $(".abnormalClear").on("click", function(e){
     doctorNumTemp=""; 
     data_desc=["leaveHospitalDate"]
     data_asc=[];
+    if(from == 2){
+        deptId=deptListDept[0]&&deptListDept[0].deptId; 
+        deptName=deptListDept[0]&&deptListDept[0].deptName;
+        deptNameTemp=deptListDept[0]&&deptListDept[0].deptName;
+        deptIdTemp=deptListDept[0]&&deptListDept[0].deptId;
+    }
     $('.patientNumInp').val('')
     $('.patientNameInp').val('')
     $('.doctorInp').val('')
@@ -208,7 +220,12 @@ $(".abnormalClear").on("click", function(e){
         changeYear: true,
         dateFormat:"yy/mm/dd"
     }).datepicker( "setDate",new Date());
-    $('.selectDept ').html('全部')
+    if(from == 2){
+        console.log('deptListDept',deptListDept)
+        $('.selectDept ').html(deptListDept[0].deptName)
+    }else{
+        $('.selectDept ').html('全部')
+    }
     $(".deptList").css("display", "none")
     $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
     // $('.selectDept ').addClass('unSelect')
@@ -393,6 +410,10 @@ $('.selectDept').on("click", function(e){
 //获取科室列表
 getDeptList()
 function getDeptList(){
+    if(from == 2){
+        rendeDeptList(deptListDept) 
+        return
+    }
     post(api.getDeptList,{inputStr:""}).then(res =>{
         if(res.data.code == '0'){
            const  deptList = res.data.data
@@ -451,6 +472,9 @@ function bindSetCol(){
 
 function rendeDeptList(deptList){
     let str = `<li class="deptItem ellipsis" data-id=" " data-name="全部">全部</li>`;
+    if(from == 2){
+        str = ''
+    }
     for(let i = 0; i < deptList.length; i++){
         str += `<li class="deptItem ellipsis" title=${deptList[i].deptName} data-id=${deptList[i].deptId} data-name=${deptList[i].deptName}> ${deptList[i].deptName}</li>`
     }