Browse Source

缺陷已发送持久化

xtf 8 months ago
parent
commit
5a3ac27d41
2 changed files with 45 additions and 25 deletions
  1. 44 24
      src/js/qcScore.js
  2. 1 1
      webpack.config.js

+ 44 - 24
src/js/qcScore.js

@@ -93,7 +93,7 @@ $(function () {
       $(".menu-mini").hide();
       $(".sub-menu,.copy-right").show().animate({
         "width": "220px"
-      }, function () {});
+      }, function () { });
       $(".tab-container").animate({
         "margin-left": "220px"
       });
@@ -200,7 +200,7 @@ $(function () {
     return false;
   }
   //发送入院记录
-  function sendRuleWarn(msg,i) {
+  function sendRuleWarn(msg, i) {
     $(".send-flaw:eq(" + i + ")").css({
       "display": "none"
     });
@@ -208,20 +208,6 @@ $(function () {
       "display": "inline"
     });
     $(".ysend-flaw:eq(" + i + ")").off('click');
-    // post(api.sendRuleWarn, {
-    //   'behospitalCode': global_id,
-    //   'msg': msg
-    // }).then(function (res) {
-    //   if (res.data.code === '0') {
-    //     $(".send-flaw:eq(" + i + ")").css({
-    //       "display": "none"
-    //     });
-    //     $(".ysend-flaw:eq(" + i + ")").css({
-    //       "display": "inline"
-    //     });
-    //     $(".ysend-flaw:eq(" + i + ")").off('click');
-    //   }
-    // });
     post(api.sendRuleWarn, {
       'behospitalCode': global_id,
       'msg': msg
@@ -245,6 +231,40 @@ $(function () {
       });
     });
   }
+  //已发送持久化
+  function saveStatus() {
+    post(api.getRecordDetail, {
+      'behospitalCode': global_id
+    }).then(function (res) {
+      const data = res.data.data;
+      const { msg } = data;
+      console.log("11111", msg);
+      for (const key in msg) {
+        if (msg.hasOwnProperty(key)) {
+          const records = msg[key];
+  
+          records.forEach(function (record, i) {
+            const isSend = record.isSend; 
+            console.log(`isSend: ${isSend}, index: ${i}`);
+  
+            if (isSend === 2) {
+              $(".send-flaw:eq(" + i + ")").css("display", "none");
+              $(".ysend-flaw:eq(" + i + ")").css("display", "inline");
+              $(".ysend-flaw:eq(" + i + ")").off('click');
+            } else {
+              console.error('状态为发送:', res.data.code);
+            }
+          });
+        }
+      }
+    }).catch(function (error) {
+      console.error('状态为发送:', error);
+    });
+  }
+  window.onload = function() {
+    saveStatus(); // 页面加载完成后调用
+};
+ 
   //获取病例明细
   function getRecordDetail() {
     post(api.getRecordDetail, {
@@ -502,7 +522,7 @@ $(function () {
       console.log("global_activeTab:", global_activeTab);
       console.log("code:", code);
       console.log("i:", i);
-      
+
       if (isEdit && hasAu) {
         showModal('0', code, i); //编辑
       } else if (!isEdit && hasAu2) {
@@ -511,8 +531,8 @@ $(function () {
         } else if (isSend) {
           const msg = $(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text();
           console.log($(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text());
-          sendRuleWarn(msg.replace(/\s/g,""),i)
-        } 
+          sendRuleWarn(msg.replace(/\s/g, ""), i)
+        }
         else {
           showModal('1', code, i); //删除
         }
@@ -697,9 +717,9 @@ $(function () {
     $("#delModal .confirm").off("click");
     const flawsList = formatFlawKeys(global_flawData);
     console.log(flawsList);
-    
+
     const info = flawsList[global_activeTab] && flawsList[global_activeTab][i];
-console.log(info,flag);
+    console.log(info, flag);
 
 
     if (flag === '0') { //修改
@@ -843,7 +863,7 @@ console.log(info,flag);
       $("#delModal .cancel").show().text("恢复").unbind("click").click(function () {
         delScore(code, info, true);
       });
-    } else if(flag === '1'){
+    } else if (flag === '1') {
       $("#delModal .title").text("删除提示");
       $("#delModal .modal-body").html('<p>确定要删除该评分记录吗?</p>');
       $("#delModal .confirm").text("取消").unbind("click").click(function () {
@@ -1156,5 +1176,5 @@ console.log(info,flag);
       }
     });
   }
-
-});
+  
+});

+ 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://172.16.8.12:5859"; //正式
 // const proxyHost = "http://www.diagbot.net:5858/"; //测试
 // const proxyHost = "http://192.168.4.222:5858";
 // const proxyHost = "http://192.168.3.117:5858";//铁钢