瀏覽代碼

详情带上年龄参数

zhangxc 5 年之前
父節點
當前提交
2b3830111f
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 4 3
      src/js/qcList.js
  2. 2 1
      src/js/qcScore.js

+ 4 - 3
src/js/qcList.js

@@ -110,14 +110,15 @@ function renderTab(data){
     bindScoreDetail()
 }
 
-function scoreDetail(id){
-    window.open(`./qcScore.html?id=${id}`)
+function scoreDetail(id,age){
+    window.open(`./qcScore.html?id=${id}&age=${age}`)
 }
 function bindScoreDetail(){
     $('.patientNameSpan').on('click',function(e){
         const index = $(this).attr("data-index")
         const id = tabList[index].behospitalCode
-        scoreDetail(id)
+        const age = tabList[index].age
+        scoreDetail(id,age)
     })
 }
 

+ 2 - 1
src/js/qcScore.js

@@ -8,6 +8,7 @@ const {wordRound} = require("./qcScore_byll.js")
 //本页全局变量
 let global_flawData = {};    //缺陷数据
 const global_id=getUrlArgObject("id");
+const global_age = getUrlArgObject("age");
 let global_activeTab=$(".sub-menu .page.active").attr("code");  //当前激活菜单项
 
 $(function(){
@@ -73,7 +74,7 @@ function getRecordDetail(){
 function initPatientInfo(data){
   const date = data.birthday.substr(0,10);
   const age=new Date(date).getTime()/(365*24*60*60*1000);
-  const obj=Object.assign({},data,{age:Math.floor(-age)});
+  const obj=Object.assign({},data,{age:global_age});
   $("#infoTmpl").tmpl(obj).appendTo("#patientInfo");
 }
 //显示病例模块明细