luolei преди 5 години
родител
ревизия
7cb2c73c5a
променени са 5 файла, в които са добавени 41 реда и са изтрити 20 реда
  1. 5 1
      src/js/index.js
  2. 10 6
      src/js/qcList.js
  3. 11 6
      src/js/qcListDept.js
  4. 9 5
      src/js/qcListPerson.js
  5. 6 2
      src/js/qcScore.js

+ 5 - 1
src/js/index.js

@@ -83,18 +83,21 @@ function getMenu(){
   });
 };
 function getAllCode(data){
-  let lis = []
+  let lis = [],personCodeLis=[],deptCodeLis=[],trdObj={}
   for(let i = 0;i < data.length;i++){
     let tmpSon = data[i]
     lis.push(tmpSon.code)
     if(tmpSon.subMenuList.length > 0){//三层
       for(let j = 0;j<tmpSon.subMenuList.length;j++){//第二层循环
         let tmpGrandSon = tmpSon.subMenuList[j]
+        let sonLis=[]
         lis.push(tmpGrandSon.code)
         for(let m = 0;m < tmpGrandSon.sysUserPermissionDTOList.length;m++){
           let tmpData = tmpGrandSon.sysUserPermissionDTOList[m]
           lis.push(tmpData.code)
+          sonLis.push(tmpData.code)
         }
+        trdObj[tmpGrandSon.code] = sonLis
       }
     }else{//两层
       for(let n = 0;n < tmpSon.sysUserPermissionDTOList.length;n++){
@@ -104,6 +107,7 @@ function getAllCode(data){
     }
   }
   setCookie("codeLis",JSON.stringify(lis))
+  setCookie("trdObj",JSON.stringify(trdObj))
 }
 function sureChangeWord(){
   $(document).on('click','.sureChange',function(){

+ 10 - 6
src/js/qcList.js

@@ -34,13 +34,17 @@ $('.iconCalen').on("click", function(e){
 $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
 
 //判断有无某一权限
-function hasData(data){
-    let lis = JSON.parse(getCookie("codeLis"))
+  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 param = {
         current:activePage,
@@ -148,8 +152,8 @@ function renderTab(data,hisId){
     bindScoreDetail(hisId)
 }
 
-function scoreDetail(id,age,hid){
-    window.open(`./qcScore.html?id=${id}&age=${age}&hid=${hid}`)
+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){
@@ -161,7 +165,7 @@ function bindScoreDetail(hisId){
             $.alerModal({"message":'请先进行评分!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
             return
         } else{
-            scoreDetail(id,age,hisId)
+            scoreDetail(id,age,hisId,'YH-BLZK-ZKPF')
         }
        
     })

+ 11 - 6
src/js/qcListDept.js

@@ -31,14 +31,19 @@ $('.iconCalen').on("click", function(e){
     $(this).parent().find("input").focus()
 })
 $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
-//判断有无某一权限
+
+  //判断有无某一权限
 function hasData(data){
-    let lis = JSON.parse(getCookie("codeLis"))
+    let trdObj = JSON.parse(getCookie("trdObj"))
+    let lis = trdObj['YH-BLZK-ZKPFKS']
+    if(!lis){
+      return false
+    }
     if(lis.indexOf(data)>-1){//有权限
         return true
     }
     return false;
-  }
+}
 function getTabData(activePage){
     const param = {
         current:activePage,
@@ -161,8 +166,8 @@ function renderTab(data){
     bindScoreDetail()
 }
 
-function scoreDetail(id,age){
-    window.open(`./qcScore.html?id=${id}&age=${age}`)
+function scoreDetail(id,age,code){
+    window.open(`./qcScore.html?id=${id}&age=${age}&code=${code}`)
 }
 function bindScoreDetail(){
     $('.patientNameSpan').on('click',function(e){
@@ -174,7 +179,7 @@ function bindScoreDetail(){
             $.alerModal({"message":'请先进行评分!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
             return
         } else{
-            scoreDetail(id,age)
+            scoreDetail(id,age,'YH-BLZK-ZKPFKS')
         }
        
     })

+ 9 - 5
src/js/qcListPerson.js

@@ -37,12 +37,16 @@ $('.iconCalen').on("click", function(e){
 $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
 //判断有无某一权限
 function hasData(data){
-    let lis = JSON.parse(getCookie("codeLis"))
+    let trdObj = JSON.parse(getCookie("trdObj"))
+    let lis = trdObj['YH-BLZK-ZKPFGR']
+    if(!lis){
+      return false
+    }
     if(lis.indexOf(data)>-1){//有权限
         return true
     }
     return false;
-  }
+}
 function getTabData(activePage){
     const param = {
         current:activePage,
@@ -163,8 +167,8 @@ function renderTab(data){
     bindScoreDetail()
 }
 
-function scoreDetail(id,age){
-    window.open(`./qcScore.html?id=${id}&age=${age}`)
+function scoreDetail(id,age,code){
+    window.open(`./qcScore.html?id=${id}&age=${age}&code=${code}`)
 }
 function bindScoreDetail(){
     $('.patientNameSpan').on('click',function(e){
@@ -176,7 +180,7 @@ function bindScoreDetail(){
             $.alerModal({"message":'请先进行评分!',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
             return
         } else{
-            scoreDetail(id,age)
+            scoreDetail(id,age,'YH-BLZK-ZKPFGR')
         }
        
     })

+ 6 - 2
src/js/qcScore.js

@@ -9,6 +9,7 @@ const {wardRound,preoperation,summary,operationRecord,applicationForm,resultForm
 let global_flawData = {};    //缺陷数据
 const global_id=getUrlArgObject("id");
 const global_age = getUrlArgObject("age");
+const global_code = getUrlArgObject("code");
 let global_activeTab=$(".sub-menu .page.active").attr("code");  //当前激活菜单项
 let global_modules ={};   //模板数据缓存
 
@@ -53,7 +54,11 @@ function initMenu(data){
 }
 //判断有无某一权限
 function hasData(data){
-  let lis = JSON.parse(getCookie("codeLis"))
+  let trdObj = JSON.parse(getCookie("trdObj"))
+  let lis = trdObj[global_code]
+  if(!lis){
+    return false
+  }
   if(lis.indexOf(data)>-1){//有权限
       return true
   }
@@ -194,7 +199,6 @@ function initScoreItem(data){
   })
   $(".edit-flaw").css("opacity",hasAu?"1":"0.5")
   $(".del-flaw").css("opacity",hasAu2?"1":"0.5")
-
   $(".flaw-item .title a[href]").click(function(){
     const id = $(this).attr("href");
     $(".info-item .cont,.flaw-item .title").removeClass("active");