Browse Source

首次病程录 时间格式问题

xiezhiming 9 months ago
parent
commit
481d95575b
2 changed files with 56 additions and 79 deletions
  1. 55 78
      src/js/qcScore.js
  2. 1 1
      src/js/utils.js

+ 55 - 78
src/js/qcScore.js

@@ -1169,9 +1169,8 @@ $(function () {
     "出院小结": false
   }
   $("body").on("click", ".save", function () {
-    // 切换状态
-    isEditing[global_activeTab] = !isEditing[global_activeTab]
-    if (isEditing[global_activeTab]) {
+    if (!isEditing[global_activeTab]) {
+      isEditing[global_activeTab] = true//改变为编辑状态
       console.log("编辑中");
       $(this).text('保存');
     } else {
@@ -1180,36 +1179,41 @@ $(function () {
           saveOrUpdate().then((res) => {
             getRecordDetailUpdate()
             $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
+            isEditing[global_activeTab] = false
             $(this).text('编辑');
           }).catch(err => {
-            $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', win: 'default' });
+            $.alerModal({ "message": err, type: "tip", time: '1000', win: 'default' });
           })
           break
         case "入院记录":
-          saveAdmissionRecordUpdate()
+          admissionRecordUpdate()
           $(this).text('编辑');
           break
         case "首次病程录":
           firstRecordUpdate().then(res => {
             getRecordDetailUpdate()
             $.alerModal({ "message": "保存成功", type: "tip", time: '1000', win: true });
+            isEditing[global_activeTab] = false
+            $(this).text('编辑');
           }).catch(err => {
-            $.alerModal({ "message": '保存失败,请重试~', type: "tip", time: '1000', win: 'default' });
+            $.alerModal({ "message": err, type: "tip", time: '1000', win: 'default' });
           })
           break
         default:
+          isEditing[global_activeTab] = false
           $(this).text('编辑');
       }
     }
-    $(`.content-item[code=${global_activeTab}]`).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', isEditing[global_activeTab]);
   });
 
+
   /**首次病程录更新*/
   function firstRecordUpdate() {
     /**病人住院ID*/
     const behospitalCode = global_id
     /**医院ID*/
-    const hospitalId = getUrlArgObject("hid")
+    const hospitalId = global_hid
     /**姓名*/
     const name = $('#anchor2019 p').text()
     /**性别*/
@@ -1221,69 +1225,50 @@ $(function () {
     /**床号*/
     const bedNo = $('#anchor2030 p').text()
     /**病历日期*/
-    const recordDate = $('#anchor2027 p').text()
+    const recordDate = $('#anchor2027 p').text().trim() + ":00"
     /** 标题 */
     const recTitle = '';
-
     /** 主诉 */
     const chief = '';
-
     /** 现病史 */
     const present = '';
-
     /** 既往史 */
     const pastHistory = '';
-
     /** 查体 */
     const vital = '';
-
     /** 辅检 */
     const assistantExam = '';
-
     /** 病例特点 */
     const caseCharacter = $('#anchor1959 p').text();
-
     /** 初步诊断 */
     const tentativeDiagnosis = $('#anchor1968 p').text();
-
     /** 诊断依据 */
     const supplyDiagnosis = $('#anchor1973 p').text();
-
     /** 鉴别诊断 */
     const revisedDiagnosis = $('#anchor1976 p').text();
-
     /** 诊疗计划(方案) */
     const treatPlan = $('#anchor1979 p').text();
-
     /** 记录医生 */
     const recDoctor = $('#anchor1986 p').text();
-
     /** 记录时间 */
-    const recDate = $('#anchor1988 p').text();
-
+    const recDate = $('#anchor1988 p').text().trim() + ":00";
     /** 审核医生 */
     const auditDoctor = $('#anchor1989 p').text();
-
     /** 审核时间 */
-    const auditDate = $('#anchor1992 p').text();
-
+    const auditDate = $('#anchor1992 p').text().trim() + ":00";
     /** 主诊医生 */
     const chiefDoctor = $('#anchor2025 p').text();
-
     /** 发热 */
     const fever = $('#anchor2038 p').text();
-
     /** 咳嗽等呼吸道症状 */
     const coughSymptom = $('#anchor2041 p').text();
-
     /** 入院时使用的治疗性药物 */
     const entryMedication = $('#anchor2816 p').text() || "无"
-
     /** 成瘾药物 */
     const addiMedication = $('#anchor2034 p').text();
-
     /** 入院时间 */
-    const behospitalDate = $('#anchor2027 p').text();
+    const behospitalDate = $('#anchor2027 p').text().trim() + ":00";
+
     const params = {
       "behospitalCode": behospitalCode,            // 入院编码
       "hospitalId": hospitalId,                    // 医院 ID
@@ -1292,7 +1277,7 @@ $(function () {
       "age": age,                                    // 年龄
       "deptName": deptName,                          // 科室名称
       "bedNo": bedNo,                                // 床号
-      "recordDate": recordDate,                      // 记录日期
+      "recordDate": recordDate,                      //病历日期   
       "recTitle": recTitle,                          // 标题
       "chief": chief,                                // 主诉
       "present": present,                            // 现病史
@@ -1317,29 +1302,27 @@ $(function () {
     };
 
     return new Promise((resolve, reject) => {
-      post1(api.editFirstRecordInfos, params).then(res => {
+      post(api.editFirstRecordInfos, params).then(res => {
         if (res.data.code === '0') {
           resolve(true)
         } else {
-          reject(false)
+          reject(res.data.msg)
         }
-
       }).catch(err => {
-        reject(false)
+        reject(err.msg)
       })
     })
 
   }
 
   /**保存入院记录数据更新*/
-  function saveAdmissionRecordUpdate() {
+  function admissionRecordUpdate() {
     /**入院记录编号*/
     const homePageId = $(`.content-item[code=${global_activeTab}] .title`).text().match(/\d+/)[0]
     /**医院ID*/
     const hospitalId = getUrlArgObject("hid")
     /**病人住院ID*/
     const behospitalCode = getUrlArgObject("id")
-
     /**病人年龄*/
     const age = $('#anchor22325 p').text().replace("岁", "")
     return true
@@ -1523,18 +1506,18 @@ $(function () {
     const tbiAfterMinute = '';
 
     let str_anchor2291 = $('#anchor2291 p').text()
-    let matchs_anchor2291_1 = str_anchor2291.match(/总费用(\d+\.?\d+)/)
-    let matchs_anchor2291_2 = str_anchor2291.match(/自付金额(\d+\.?\d+)/)
+    let matchs_anchor2291_1 = str_anchor2291.match(/总费用[\s:]*(\d+\.?\d+)/)
+    let matchs_anchor2291_2 = str_anchor2291.match(/自付金额[\s:]*(\d+\.?\d+)/)
     /** 总费用 */
     const totalFee = matchs_anchor2291_1 ? matchs_anchor2291_1[1] : '';
     /** 自付金额 */
     const ownFee = matchs_anchor2291_2 ? matchs_anchor2291_2[1] : '';
 
     let str_anchor2292 = $('#anchor2292 p').text()
-    let matchs_anchor2292_1 = str_anchor2292.match(/一般医疗服务费:(\d+\.?\d+)/)
-    let matchs_anchor2292_2 = str_anchor2292.match(/一般治疗服务费:(\d+\.?\d+)/)
-    let matchs_anchor2292_3 = str_anchor2292.match(/护理费:(\d+\.?\d+)/)
-    let matchs_anchor2292_4 = str_anchor2292.match(/其他费用:(\d+\.?\d+)/)
+    let matchs_anchor2292_1 = str_anchor2292.match(/一般医疗服务费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2292_2 = str_anchor2292.match(/一般治疗服务费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2292_3 = str_anchor2292.match(/护理费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2292_4 = str_anchor2292.match(/其他费用[\s]*(\d+\.?\d+)/)
     /** 一般医疗服务费 */
     const generalFee = matchs_anchor2292_1 ? matchs_anchor2292_1[1] : '';
     /** 一般治疗服务费 */
@@ -1545,10 +1528,10 @@ $(function () {
     const otherFee = matchs_anchor2292_4 ? matchs_anchor2292_3[1] : '';
 
     let str_anchor2293 = $('#anchor2293 p').text()
-    let matchs_anchor2293_1 = str_anchor2293.match(/病理诊断费:(\d+\.?\d+)/)
-    let matchs_anchor2293_2 = str_anchor2293.match(/实验室诊断费:(\d+\.?\d+)/)
-    let matchs_anchor2293_3 = str_anchor2293.match(/实验室诊断费:(\d+\.?\d+)/)
-    let matchs_anchor2293_4 = str_anchor2293.match(/影像学诊断费:(\d+\.?\d+)/)
+    let matchs_anchor2293_1 = str_anchor2293.match(/病理诊断费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2293_2 = str_anchor2293.match(/实验室诊断费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2293_3 = str_anchor2293.match(/实验室诊断费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2293_4 = str_anchor2293.match(/影像学诊断费[\s]*(\d+\.?\d+)/)
     /** 病理诊断费 */
     const pathologyFee = matchs_anchor2293_1 ? matchs_anchor2293_1[1] : '';
     /** 实验室诊断费 */
@@ -1559,11 +1542,11 @@ $(function () {
     const clinicDiagnoseFee = matchs_anchor2293_4 ? matchs_anchor2293_4[1] : '';
 
     let str_anchor2294 = $('#anchor2294 p').text()
-    let matchs_anchor2294_1 = str_anchor2294.match(/非手术治疗项目费:(\d+\.?\d+)/)
-    let matchs_anchor2294_2 = str_anchor2294.match(/临床物理治疗费:(\d+\.?\d+)/)
-    let matchs_anchor2294_3 = str_anchor2294.match(/手术治疗费:(\d+\.?\d+)/)
-    let matchs_anchor2294_4 = str_anchor2294.match(/麻醉费:(\d+\.?\d+)/)
-    let matchs_anchor2294_5 = str_anchor2294.match(/手术费:(\d+\.?\d+)/)
+    let matchs_anchor2294_1 = str_anchor2294.match(/非手术治疗项目费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2294_2 = str_anchor2294.match(/临床物理治疗费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2294_3 = str_anchor2294.match(/手术治疗费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2294_4 = str_anchor2294.match(/麻醉费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2294_5 = str_anchor2294.match(/手术费[\s]*(\d+\.?\d+)/)
     /** 非手术治疗项目费 */
     const notOperationFee = matchs_anchor2294_1 ? matchs_anchor2294_1[1] : '';
     /** 临床物理治疗费 */
@@ -1576,25 +1559,25 @@ $(function () {
     const operationFee = matchs_anchor2294_5 ? matchs_anchor2294_5[1] : '';
 
 
-    let matchs_anchor2295 = $('#anchor2295 p').text().match(/康复费:(\d+\.?\d+)/)
+    let matchs_anchor2295 = $('#anchor2295 p').text().match(/康复费[\s]*(\d+\.?\d+)/)
     /** 康复类 */
     const healthTypeFee = matchs_anchor2295 ? matchs_anchor2295[1] : '';
 
-    let matchs_anchor2296 = $('#anchor2296 p').text().match(/中医治疗费:(\d+\.?\d+)/)
+    let matchs_anchor2296 = $('#anchor2296 p').text().match(/中医治疗费[\s]*(\d+\.?\d+)/)
     /** 中医治疗费 */
     const chnTreatFee = matchs_anchor2296 ? matchs_anchor2296[1] : '';
 
     let str_anchor2297 = $('#anchor2297 p').text()
-    let matchs_anchor2297_1 = str_anchor2297.match(/西药费:(\d+\.?\d+)/)
-    let matchs_anchor2297_2 = str_anchor2297.match(/抗菌药物费用:(\d+\.?\d+)/)
+    let matchs_anchor2297_1 = str_anchor2297.match(/西药费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2297_2 = str_anchor2297.match(/抗菌药物费用[\s]*(\d+\.?\d+)/)
     /** 西药费 */
     const westernMedFee = matchs_anchor2297_1 ? matchs_anchor2297_1[1] : '';
     /** 抗菌药物费用 */
     const antibiosisFee = matchs_anchor2297_2 ? matchs_anchor2297_2[1] : '';
 
     let str_anchor2298 = $('#anchor2298 p').text()
-    let matchs_anchor2298_1 = str_anchor2298.match(/中成药费:(\d+\.?\d+)/)
-    let matchs_anchor2298_2 = str_anchor2298.match(/中草药费:(\d+\.?\d+)/)
+    let matchs_anchor2298_1 = str_anchor2298.match(/中成药费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2298_2 = str_anchor2298.match(/中草药费[\s]*(\d+\.?\d+)/)
     /** 中成药费 */
     const chnMedFee = matchs_anchor2298_1 ? matchs_anchor2298_1[1] : '';
     /** 中草药费 */
@@ -1602,11 +1585,11 @@ $(function () {
 
     // 血液和血液制品类
     let str_anchor2299 = $('#anchor2299 p').text()
-    let matchs_anchor2299_1 = str_anchor2299.match(/血费:(\d+\.?\d+)/)
-    let matchs_anchor2299_2 = str_anchor2299.match(/白蛋白类制品费:(\d+\.?\d+)/)
-    let matchs_anchor2299_3 = str_anchor2299.match(/球蛋白类制品费:(\d+\.?\d+)/)
-    let matchs_anchor2299_4 = str_anchor2299.match(/凝血因子类制品费:(\d+\.?\d+)/)
-    let matchs_anchor2299_5 = str_anchor2299.match(/细胞因子类制品费:(\d+\.?\d+)/)
+    let matchs_anchor2299_1 = str_anchor2299.match(/血费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2299_2 = str_anchor2299.match(/白蛋白类制品费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2299_3 = str_anchor2299.match(/球蛋白类制品费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2299_4 = str_anchor2299.match(/凝血因子类制品费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2299_5 = str_anchor2299.match(/细胞因子类制品费[\s]*(\d+\.?\d+)/)
     /** 血费 */
     const bloodFee = matchs_anchor2299_1 ? matchs_anchor2299_1[1] : '';
     /** 白蛋白类制品费 */
@@ -1620,9 +1603,9 @@ $(function () {
 
     //耗材类 
     let str_anchor2300 = $('#anchor2300 p').text()
-    let matchs_anchor2300_1 = str_anchor2300.match(/检查用一次性医用耗材费:(\d+\.?\d+)/)
-    let matchs_anchor2300_2 = str_anchor2300.match(/治疗用一次性医用耗材费:(\d+\.?\d+)/)
-    let matchs_anchor2300_3 = str_anchor2300.match(/手术用一次性医用耗材费:(\d+\.?\d+)/)
+    let matchs_anchor2300_1 = str_anchor2300.match(/检查用一次性医用耗材费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2300_2 = str_anchor2300.match(/治疗用一次性医用耗材费[\s]*(\d+\.?\d+)/)
+    let matchs_anchor2300_3 = str_anchor2300.match(/手术用一次性医用耗材费[\s]*(\d+\.?\d+)/)
     /** 检查用一次性医用材料费 */
     const checkMaterialFee = matchs_anchor2300_1 ? matchs_anchor2300_1[1] : "";
     /** 治疗用一次性医用材料费 */
@@ -1630,7 +1613,7 @@ $(function () {
     /** 手术用一次性医用材料费 */
     const operationMaterialFee = matchs_anchor2300_3 ? matchs_anchor2300_3[1] : '';
 
-    let matchs_anchor2301 = $('#anchor2301 p').text().match(/其他费:(\d+\.?\d+)/)
+    let matchs_anchor2301 = $('#anchor2301 p').text().match(/其他费[\s]*(\d+\.?\d+)/)
     /** 其他类其他费 */
     const otherTypeFee = matchs_anchor2301 ? matchs_anchor2301[1] : '';
     /** 单病种管理 */
@@ -1856,18 +1839,12 @@ $(function () {
     return new Promise((resolve, reject) => {
       post1(api.sendHomePageIng, param).then(res => {
         if (res.data.code == '0') {
-          // window.parent.location.reload()
-          // console.log("sendHomePageIngRes", res.data)
-          // console.log("成功");
           resolve(true)
         } else {
-          reject(false)
-          // console.log("失败");
+          reject(res.data.msg)
         }
-
-      }).catch((e) => {
-        reject(false)
-        // console.log("失败1");
+      }).catch((err) => {
+        reject(err.msg)
       })
     });
   }

+ 1 - 1
src/js/utils.js

@@ -284,7 +284,7 @@ const post1 = function (url, data, opts) {
       cache: false,
       processData: false,
       data: JSON.stringify(data),
-
+      timeout: 60000,
       contentType: 'application/json; charset=UTF-8',
       beforeSend: function (xmlHttp) {
         xmlHttp.setRequestHeader('isPlacefile', isPlacefile);