소스 검색

查房记录修改

xiezhiming 8 달 전
부모
커밋
d0151a610b
1개의 변경된 파일46개의 추가작업 그리고 42개의 파일을 삭제
  1. 46 42
      src/js/qcScore.js

+ 46 - 42
src/js/qcScore.js

@@ -1246,6 +1246,7 @@ $(function () {
 
             getRecordDetailUpdate().then(res => {
               hideLoading()
+              $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
               $(this).text('编辑');
               isEditing[global_activeTab] = false
               editStatus = false
@@ -1262,21 +1263,23 @@ $(function () {
 
           break
         case "查房记录":
-          roomRecordUpdate(index).then(res => {
-            getRecordDetailUpdate().then(res => {
+          roomRecordUpdate(index, function (error, data) {
+            if (error) {
               hideLoading()
-              $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
-              isEditing[global_activeTab][index] = false
-              editStatus = false
-              $(this).text('编辑');
-            }).catch(err => {
-              console.log(err);
-              if (err !== "_Failed") {
-                hideLoading()
-                $.alerModal({ "message": "err", type: "tip", time: '1000', win: true });
+              if (error.message !== "_Failed") {
+                $.alerModal({ "message": error.message, type: "tip", time: '1000', win: 'default' });
               }
-
-            })
+            } else {
+              getRecordDetailUpdate().then(res => {
+                hideLoading()
+                $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
+                isEditing[global_activeTab] = false
+                editStatus = false
+                $(this).text('编辑');
+              }).catch(err => {
+                hideLoading()
+              })
+            }
           })
           break
         case "首次病程录":
@@ -1381,7 +1384,7 @@ $(function () {
     const name = $("#anchor1758 p").text();
 
     /**性别*/
-    const sex = $("#anchor1758 p").text();
+    const sex = $("#anchor1767 p").text();
 
     /**年龄*/
     const age = $("#anchor1793 p").text();
@@ -1393,16 +1396,16 @@ $(function () {
     const deptName = $("#anchor1797 p").text();
 
     /**病历日期*/
-    const recordDate = $("#anchor1796 p").text();
+    const recordDate = dateFormat("病历日期", $("#anchor1796 p").text());
 
     /**标题*/
     const recTitle = "";
 
     /**入院日期*/
-    const behospitalDate = $("#anchor1796 p").text();
+    const behospitalDate = dateFormat("入院日期", $("#anchor1796 p").text());
 
     /**出院日期*/
-    const leaveHospitalDate = $("#anchor1798 p").text();
+    const leaveHospitalDate = dateFormat("出院日期", $("#anchor1798 p").text());
 
     /**入院诊断*/
     const tentativeDiagnosis = $("#anchor1772 p").text();
@@ -1432,13 +1435,13 @@ $(function () {
     const recDoctor = $("#anchor1836 p").text();
 
     /**记录时间*/
-    const recDate = $("#anchor1837 p").text();
+    const recDate = dateFormat("记录时间", $("#anchor1837 p").text());
 
     /**审核医生*/
     const auditDoctor = $("#anchor1839 p").text();
 
     /**审核时间*/
-    const auditDate = $("#anchor1840 p").text();
+    const auditDate = dateFormat("审核时间", $("#anchor1840 p").text());
 
     /**主诊医生*/
     const chiefDoctor = $("#anchor1799 p").text();
@@ -1533,7 +1536,7 @@ $(function () {
     return new Promise((resolve, reject) => {
       if (validateEdit) {
         post1(api.editLeaveHospitalInfos, params).then(res => {
-          if (res.data.code === 0) {
+          if (res.data.code === "0") {
             resolve(true)
           } else {
             reject(res.data.msg)
@@ -1548,8 +1551,11 @@ $(function () {
     })
 
   }
-  /**查房记录数据更新*/
-  function roomRecordUpdate(index) {
+  /**
+   * @param {number} index 
+   * @param {function} callback 
+   * 查房记录数据更新*/
+  function roomRecordUpdate(index, callback) {
     validateEdit = true
     const this_item = $(".content-item[code='查房记录']").eq(index)
     /**病人住院ID*/
@@ -1569,9 +1575,9 @@ $(function () {
     /**性别*/
     const sex = "";
     /**病例日期*/
-    const recordDate = this_item.find('#anchor2118 p').text();
+    const recordDate = dateFormat("病例日期", this_item.find('#anchor2118 p').text());
     /**查房日期*/
-    const wardDate = this_item.find('#anchor2118 p').text();
+    const wardDate = dateFormat("查房日期", this_item.find('#anchor2118 p').text());
     /**查房医生*/
     const wardDoctor = this_item.find('#anchor2815 p').text();
     /**标题*/
@@ -1589,11 +1595,11 @@ $(function () {
     /**记录医生*/
     const recDoctor = this_item.find('#anchor2126 p').text();
     /**记录时间*/
-    const recDate = this_item.find('#anchor2127 p').text();
+    const recDate = dateFormat("记录时间", this_item.find('#anchor2127 p').text());
     /**审核医生*/
     const auditDoctor = this_item.find('#anchor2128 p').text();
     /**审核时间*/
-    const auditDate = this_item.find('#anchor2129 p').text();
+    const auditDate = dateFormat("审核时间", this_item.find('#anchor2129 p').text());
 
     const param = {
       "behospitalCode": behospitalCode,//病人住院ID
@@ -1618,22 +1624,20 @@ $(function () {
       "auditDoctor": auditDoctor,//审核医生
       "auditDate": auditDate//审核时间
     }
-    return new Promise((resolve, reject) => {
-      if (validateEdit) {
-        post1(api.editWardRecordInfos, param).then(res => {
-          if (res.data.code === 0) {
-            resolve(true)
-          } else {
-            reject(res.data.msg)
-          }
-        }).catch((err) => {
-          reject(err.msg)
-        })
-      } else {
-        reject("_Failed")
-      }
 
-    });
+    if (validateEdit) {
+      post1(api.editWardRecordInfos, param).then(res => {
+        if (res.data.code === '0') {
+          callback(null, "成功")
+        } else {
+          callback(new Error(res.data.msg))
+        }
+      }).catch((err) => {
+        callback(new Error(err.msg))
+      })
+    } else {
+      callback(new Error("_Failed"))
+    }
   }
 
   /**首次病程录更新*/
@@ -2061,7 +2065,7 @@ $(function () {
     }
     return new Promise((resolve, reject) => {
       post1(api.editAdmissionNoteInfos, params).then(res => {
-        if (res.data.code === 0) {
+        if (res.data.code === '0') {
           resolve(true)
         } else {
           resolve(res.data.msg)