Jelajahi Sumber

分离查房记录的编辑

xiezhiming 8 bulan lalu
induk
melakukan
3ed4a2164e
2 mengubah file dengan 48 tambahan dan 9 penghapusan
  1. 46 8
      src/js/qcScore.js
  2. 2 1
      webpack.config.js

+ 46 - 8
src/js/qcScore.js

@@ -264,7 +264,8 @@ $(function () {
 
           global_diagList = diagList;
           global_operaList = operaList;
-
+          console.log("global_diagList:", global_diagList)
+          console.log("global_operaList:", global_operaList);
           initContent(result.pageData);
 
           initList(msg);
@@ -1168,18 +1169,43 @@ $(function () {
     });
   }
   /**编辑状态*/
+
   var isEditing = {
     "病案首页": false,
     "入院记录": false,
     "首次病程录": false,
-    "查房记录": false,
+    "查房记录": [],
     "会诊申请单": false,
     "会诊结果单": false,
     "出院小结": false
   }
+
   $("body").on("click", ".save", function () {
-    if (!isEditing[global_activeTab]) {
-      isEditing[global_activeTab] = true//改变为编辑状态
+    let editStatus = false
+    let index = -1
+
+    if (global_activeTab === "查房记录") {
+      index = $(".content-item[code='查房记录']").index($(this).parents('.content-item'))
+      if (isEditing[global_activeTab].length === 0) {
+        const inspectionRecordsCount = $(".content-item[code='查房记录']").size()
+        isEditing[global_activeTab] = new Array(inspectionRecordsCount).fill(false)
+        editStatus = false
+      } else {
+        editStatus = isEditing[global_activeTab][index]
+      }
+
+    } else {
+      editStatus = isEditing[global_activeTab]
+    }
+    if (!editStatus) {
+
+      if (global_activeTab === "查房记录") {
+        isEditing[global_activeTab][index] = true
+        editStatus = true
+      } else {
+        isEditing[global_activeTab] = true
+        editStatus = true
+      }
       console.log("编辑中");
       $(this).text('保存');
     } else {
@@ -1193,6 +1219,7 @@ $(function () {
               hideLoading()
               $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
               isEditing[global_activeTab] = false
+              editStatus = false
               $(this).text('编辑');
             }).catch(err => {
               hideLoading()
@@ -1206,8 +1233,17 @@ $(function () {
           admissionRecordUpdate().then(res => {
             hideLoading()
             $(this).text('编辑');
+            isEditing[global_activeTab] = false
+            editStatus = false
           })
 
+          break
+        case "查房记录":
+          console.log("index:", index);
+          hideLoading()
+          isEditing[global_activeTab][index] = false
+          editStatus = false
+          $(this).text('编辑');
           break
         case "首次病程录":
           firstRecordUpdate().then(res => {
@@ -1215,6 +1251,7 @@ $(function () {
               hideLoading()
               $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
               isEditing[global_activeTab] = false
+              editStatus = false
               $(this).text('编辑');
             }).catch(err => {
               hideLoading()
@@ -1227,10 +1264,11 @@ $(function () {
         default:
           hideLoading()
           isEditing[global_activeTab] = false
+          editStatus = false
           $(this).text('编辑');
       }
     }
-    $(this).parents(".content-item").find('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td,.inner-table td').attr('contenteditable', isEditing[global_activeTab]);
+    $(this).parents(".content-item").find('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td,.inner-table td').attr('contenteditable', editStatus);
   });
 
   /**验证首次病程录更新*/
@@ -1430,11 +1468,11 @@ $(function () {
     /**国籍*/
     const nationality = $('#anchor22324 p').text()
 
-    let split_anchor2243 = $('#anchor2243 p').text().split(/[天月]/)
+    let matches_anchor2243 = $('#anchor2243 p').text().match(/\d+\.?d+/)
     /**新生儿出生月数*/
-    const newbornMonth = split_anchor2243 ? split_anchor2243[0].trim() : ""
+    const newbornMonth = matches_anchor2243 ? matches_anchor2243[0].trim() : ""
     /**新生儿出生天数*/
-    const newbornDay = split_anchor2243 ? split_anchor2243[1].trim() : ""
+    const newbornDay = matches_anchor2243 ? matches_anchor2243[1].trim() : ""
     /**新生儿出生体重*/
     const newbornWeight = $('#anchor2244 p').text().replace("克", "") || "-"
     /**新生儿入院体重*/

+ 2 - 1
webpack.config.js

@@ -8,7 +8,8 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
 const webpack = require('webpack');
 const glob = require('glob');
 // const proxyHost = "http://173.18.12.195:5858";
-const proxyHost = "http://172.16.8.60:5858";
+// const proxyHost = "http://172.16.8.60:5858";
+const proxyHost = "http://172.16.8.64:5858";
 // const proxyHost = "http://173.18.12.195:5656";
 // const proxyHost = "http://192.168.2.241:5858";
 // const proxyHost = "http://192.168.4.222:5858";