Explorar el Código

解决首次打开 质控缺陷和评分卡顿的问题

yangdr hace 5 meses
padre
commit
9af86c0bb5
Se han modificado 2 ficheros con 15 adiciones y 20 borrados
  1. 14 19
      src/js/qcScore.js
  2. 1 1
      webpack.config.js

+ 14 - 19
src/js/qcScore.js

@@ -306,7 +306,11 @@ $(function () {
       checkStateHome: global_check_home
     });
 
-    $("#infoTmpl").tmpl(obj).appendTo("#patientInfo");
+    $("#infoTmpl").tmpl(obj).appendTo("#patientInfo").promise().done(function () {
+      getQcFirstAnalyze()
+      console.log("getQcFirstAnalyze执行了")
+      // showQcFirstAnalyze()
+    });
     /*$(".check").on("click", function(){
       checkQc()
     })*/
@@ -1148,7 +1152,7 @@ $(function () {
   }
   // 获取首次质控缺陷和评分的数据
   function getQcFirstAnalyze() {
-    if ($(".patient-info .first .detail").css('display') == 'none') return;
+    // if ($(".patient-info .first .detail").css('display') == 'none') return;
     post(api.getQcFirstAnalyze, {
       "behospitalCode": global_id,
     }).then(res => {
@@ -1156,38 +1160,29 @@ $(function () {
       const { code, msg, data } = res.data
       if (code == '0') {
         qcFirstAnalyzeData = data
+        console.log("getQcFirstAnalyze数据", data)
+        $(".patient-info .first .detail").empty()
+        let str = `<p> 病历等级:${data.level} </p><p>病历得分:${data.scoreRes}</p><p>缺陷条目:</p>`
+        data.msg.forEach((el, index) => {
+          str += `<p>${index + 1}.${el}</p>`
+        })
+        $(".patient-info .first .detail").html(str)
       }
     }).catch(err => {
       console.log("getQcFirstAnalyze接口错误", err)
     })
   }
 
-  function showQcFirstAnalyze() {
-    $(".patient-info .first .detail").empty()
-    let data = qcFirstAnalyzeData
-    let str = `<p> 病历等级:${data.level} </p><p>病历得分:${data.scoreRes}</p><p>缺陷条目:</p>`
-    data.msg.forEach((el, index) => {
-      str += `<p>${index + 1}.${el}</p>`
-    })
-    $(".patient-info .first .detail").html(str)
-  }
-
-  getQcFirstAnalyze()
-
   $(document).on("click", "body", function () {
     $(".patient-info .first .detail").slideUp()
   })
   $(document).on("click", ".patient-info .first .detail", function (event) {
     event.stopPropagation()
   })
-  let qcListFirstAnalyze = false
+
   $(document).on("click", ".patient-info .first .text", function (event) {
     // console.log("event", event)
     event.stopPropagation()
     $(".patient-info .first .detail").slideToggle()
-    if (!qcListFirstAnalyze) {
-      showQcFirstAnalyze()
-      qcListFirstAnalyze = true
-    }
   })
 });

+ 1 - 1
webpack.config.js

@@ -9,7 +9,7 @@ const webpack = require('webpack');
 const glob = require('glob');
 // const proxyHost = "http://192.168.2.236:5858";
 // const proxyHost = "http://192.168.3.184:5859";
-// const proxyHost = "http://172.16.8.64:5858"; //正式
+// const proxyHost = "http://192.16.1.104:5858"; //正式
 // const proxyHost = "http://172.16.8.12:5859";
 const proxyHost = "http://172.16.8.60:5858";
 // const proxyHost = "http://www.diagbot.net:5858/"; //测试