Browse Source

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 4 months ago
parent
commit
b1cfd0eeb4

+ 1 - 1
src/xt_pages/user/components/PatientSidebar.vue View File

@@ -41,7 +41,7 @@
41 41
       >
42 42
       </el-tree>
43 43
     </div>
44
-    <div class="patient-app-container " :style="{width:(treeKey!='3-4'&& treeKey!='3-5')?'100vw':''}">
44
+    <div class="patient-app-container " :style="{width:(treeKey=='3-3')?'100vw':''}">
45 45
       <span class="patient-name"
46 46
         >姓名:{{ currentPatient.name }} &nbsp;&nbsp; 性别:{{
47 47
           tranSex(currentPatient.gender)

+ 31 - 21
src/xt_pages/user/inspection.vue View File

@@ -148,13 +148,13 @@
148 148
                         <span v-else> {{ scope.row.value }}</span>
149 149
                       </span>
150 150
                       <span v-if="scope.row.range_type == 1">
151
-                        <span v-if="scope.row.value < parseFloat(scope.row.range_min) ">
151
+                        <span v-if="parseFloat(scope.row.value) < parseFloat(getrange(scope.row.range_min)) ">
152 152
                           {{ scope.row.value }} <span style="color: blue;" v-if="scope.row.value>0">↓</span>
153 153
                         </span>
154
-                        <span v-if="parseFloat(scope.row.range_min)<= parseFloat( scope.row.value) && parseFloat(scope.row.value)<= parseFloat(scope.row.range_max) ">
154
+                        <span v-if="parseFloat(getrange(scope.row.range_min))<= parseFloat( scope.row.value) && parseFloat(scope.row.value)<= parseFloat(getrange(scope.row.range_max)) ">
155 155
                           {{ scope.row.value }}
156 156
                         </span>
157
-                        <span v-if="parseFloat(scope.row.value) >parseFloat(scope.row.range_max) ">
157
+                        <span v-if="parseFloat(scope.row.value) >parseFloat(getrange(scope.row.range_max)) ">
158 158
                           {{ scope.row.value }} <span style="color: red;" v-if="scope.row.value>0">↑</span>
159 159
                         </span>
160 160
                         <span v-if ="scope.row.range_max ==''||scope.row.range_min ==''">
@@ -311,7 +311,7 @@
311 311
     </el-dialog>
312 312
 
313 313
 
314
-
314
+<!-- 新增 -->
315 315
     <el-dialog
316 316
       :title="formTitle"
317 317
       :visible.sync="dialogFormVisible"
@@ -693,6 +693,7 @@ export default {
693 693
             date: this.itemDate,
694 694
             project_id: this.project.project_id
695 695
           }
696
+          console.log('params',params);
696 697
           DeletePatientInspection(params).then(response => {
697 698
             if (response.data.state == 0) {
698 699
               this.$message.error(response.data.msg)
@@ -843,7 +844,7 @@ export default {
843 844
           }
844 845
 
845 846
         }
846
-        console.log(this.form.formItem)
847
+        console.log('11111',this.form.formItem)
847 848
         this.dialogFormVisible = true
848 849
 
849 850
       }
@@ -897,6 +898,8 @@ export default {
897 898
 
898 899
     },
899 900
     openNew() {
901
+      console.log('this.project',this.project);
902
+
900 903
       if (this.project == null) {
901 904
         this.$message.error('请先选择项目')
902 905
         return false
@@ -916,10 +919,10 @@ export default {
916 919
       for (var index in this.project.inspection_reference) {
917 920
         var item_id =0
918 921
         if(this.project.inspection_reference[index].item_id == 0){
919
-            item_id =  parseInt(this.project.inspection_reference[index].id) 
922
+            item_id =  parseInt(this.project.inspection_reference[index].id)
920 923
         }
921 924
         if(this.project.inspection_reference[index].item_id > 0){
922
-          item_id = parseInt(this.project.inspection_reference[index].item_id) 
925
+          item_id = parseInt(this.project.inspection_reference[index].item_id)
923 926
         }
924 927
         this.form.formItem.push({
925 928
           id: 0,
@@ -1031,7 +1034,7 @@ export default {
1031 1034
 
1032 1035
           console.log("this.form",this.form)
1033 1036
 
1034
-         
1037
+
1035 1038
           CreatePatientInspection(
1036 1039
             this.patientID,
1037 1040
             this.form,
@@ -1327,7 +1330,7 @@ export default {
1327 1330
             }
1328 1331
 
1329 1332
             this.inspections = response.data.data.inspections
1330
-            console.log("this.inpections",this.inspections)
1333
+            console.log("this.inpections",response.data.data)
1331 1334
             if (inspections == null) {
1332 1335
               this.inspections = []
1333 1336
               return false
@@ -1354,38 +1357,37 @@ export default {
1354 1357
 
1355 1358
               console.log("item=-----------------12",inspectionsMap[items[index].id],inspectionsMap[parseInt(items[index].item_id)])
1356 1359
               if (item.item_id > 0) {
1357
-                console.log('执行0',inspectionsMap[items[index].id]);
1358 1360
 
1359 1361
                 if (typeof(inspectionsMap[parseInt(items[index].item_id)])  == "undefined") {
1360 1362
                   if(this.org_id == 10121 || this.org_id ==10138 || this.org_id ==10278){
1361 1363
                     item.value = inspectionsMap[items[index].id].inspect_value
1362 1364
                     item.item_name = inspectionsMap[items[index].id].item_name
1363 1365
                   }else{
1364
-                    console.log('执行3',inspectionsMap,item);
1366
+                    console.log('执行1');
1367
+                    
1365 1368
                     if(this.org_id == 10702 || this.org_id == 0){
1366
-                      if(item.project_name == '血常规'|| item.project_name == '透后肾功能' || 
1367
-                          item.project_name == '肝功能' || item.project_name == '电解质' || item.project_name == '透前肾功能'
1369
+                      if(item.project_name == '血常规'|| item.project_name == '透后肾功能' ||
1370
+                          item.project_name == '肝功能' || item.project_name == '电解质' || item.project_name == '透前肾功能' ||
1371
+                          item.project_name == '传染病检查'
1368 1372
                         ){
1369
-                        console.log('11111',inspectionsMap[items[index].id].inspect_value);
1373
+
1370 1374
                         item.value = inspectionsMap[items[index].id].inspect_value.replace(/&lt;/g, "<").replace(/&gt;/g, ">")
1371 1375
                         item.item_name = inspectionsMap[items[index].id].item_name
1372 1376
                       }else{
1373
-                        
1374 1377
                         item.value = ''
1375 1378
                         item.item_name = ''
1376 1379
                       }
1377 1380
                     } else{
1381
+                      console.log('执行2');
1378 1382
                       item.value = ''
1379 1383
                       item.item_name = ''
1380 1384
                     }
1381 1385
                   }
1382 1386
                 } else {
1383
-                  console.log('执行1',inspectionsMap);
1387
+                  console.log('执行3',inspectionsMap[items[index].item_id].inspect_value);
1384 1388
                   item.value = inspectionsMap[items[index].item_id].inspect_value.replace(/&lt;/g, "<").replace(/&gt;/g, ">")
1385 1389
                   item.item_name = inspectionsMap[items[index].item_id].item_name
1386 1390
                 }
1387
-               
1388
-
1389 1391
                 if(this.org_id ==10191){
1390 1392
                   if(item.project_name == "乙肝定性(五项)"){
1391 1393
                     console.log("金阿迪发到付阿打发")
@@ -1397,7 +1399,7 @@ export default {
1397 1399
                 if(typeof(inspectionsMap[parseInt(items[index].id)])  == "undefined"){
1398 1400
                   continue
1399 1401
                 }
1400
-                console.log('执行2',inspectionsMap);
1402
+                console.log('执行4',inspectionsMap);
1401 1403
                 item.value = inspectionsMap[items[index].id].inspect_value
1402 1404
                 item.item_name = inspectionsMap[items[index].id].item_name
1403 1405
               }
@@ -1405,6 +1407,7 @@ export default {
1405 1407
               // item["inspect_type"] = inspectionsMap[items[index].id].inspect_type
1406 1408
               item.value_direction = ''
1407 1409
               if (item.range_type == 1) {
1410
+                console.log('执行5',parseFloat(item.value));
1408 1411
                 var value = parseFloat(item.value)
1409 1412
                 var range_min = parseFloat(item.range_min)
1410 1413
                 var range_max = parseFloat(item.range_max)
@@ -1432,7 +1435,6 @@ export default {
1432 1435
                 this.isPic = false
1433 1436
               }
1434 1437
 
1435
-
1436 1438
               console.log("woowwoow",this.isPic)
1437 1439
               console.log("isPicwowowow",this.items)
1438 1440
             }
@@ -1443,7 +1445,15 @@ export default {
1443 1445
       setTimeout(() => {
1444 1446
         this.itemLoading = false
1445 1447
       }, 1000)
1446
-    }
1448
+    },
1449
+    getrange(val){
1450
+      if(val !=''){
1451
+        return (val.replace(/[^\d.]/g, ''))*1;
1452
+      }else{
1453
+        return ''
1454
+      }
1455
+
1456
+    },
1447 1457
   },
1448 1458
   created() {
1449 1459
     const id = this.$route.query && this.$route.query.id

+ 48 - 29
src/xt_pages/user/inspection_new.vue View File

@@ -657,10 +657,11 @@ export default {
657 657
             })
658 658
           }else{
659 659
             this.form.formItem.push({
660
-              id: this.list[index].id,
660
+              // id: this.list[index].item_id,
661
+              id: this.getid(this.list[index].item_id,row.inspect_date),
661 662
               project_id: this.list[index].project_id,
662 663
               project_name: this.list[index].project_name,
663
-              item_id: this.list[index].item_id,
664
+              item_id: (this.list[index].item_id)*1,
664 665
               item_name: this.list[index].item_name,
665 666
               range_type: this.list[index].range_type,
666 667
               value: this.getvalue(this.list[index].item_id,row.inspect_date) ,
@@ -738,7 +739,6 @@ export default {
738 739
           for (var index in this.form.formItem) {
739 740
             this.form.formItem[index].value = '' + this.form.formItem[index].value
740 741
           }
741
-
742 742
           EditPatientInspection(this.patientID, this.form, this.form.remind_cycle, this.form.inspect_date, this.form.project_id).then(response => {
743 743
             if (response.data.state == 1) {
744 744
               this.$notify({
@@ -747,8 +747,8 @@ export default {
747 747
                 type: 'success',
748 748
                 duration: 2000
749 749
               })
750
-              this.patient_info.remind_cycle =
751
-                response.data.data.remind_cycle
750
+              // this.patient_info.remind_cycle =
751
+              //   response.data.data.remind_cycle
752 752
               this.itemDate = this.form.inspect_date
753 753
               this.items = []
754 754
               var inspections = response.data.data.inspections
@@ -788,20 +788,23 @@ export default {
788 788
                   this.items.push(item)
789 789
                 }
790 790
               }
791
-
792
-              this.resetForm(formName)
793
-              this.dialogFormVisible = false
791
+              this.getchildlist(this.form.project_id)
792
+              // this.resetForm(formName)
793
+              
794 794
             } else {
795 795
               this.$message.error(response.data.msg)
796
+              // this.dialogFormVisible = false
796 797
               return false
797 798
             }
798 799
           })
799
-            .catch(v => {
800
-              this.$message.error(v)
801
-              return false
802
-            })
800
+            // .catch(v => {
801
+            //   this.$message.error(v)
802
+            //   return false
803
+            // })
803 804
           this.formLoading = false
804
-          return false
805
+          this.dialogFormVisible = false
806
+          
807
+          // return false
805 808
         } else {
806 809
           return false
807 810
         }
@@ -817,9 +820,6 @@ export default {
817 820
           }
818 821
           for (var index in this.form.formItem) {this.form.formItem[index].value ='' + this.form.formItem[index].value}
819 822
 
820
-          console.log("this.form",this.form)
821
-
822
-
823 823
           CreatePatientInspection(
824 824
             this.patientID,
825 825
             this.form,
@@ -833,9 +833,9 @@ export default {
833 833
                   duration: 2000
834 834
                 })
835 835
                 // this.form.remind_reycle = response.data.data.remind_reycc
836
-                this.patient_info.remind_cycle =
837
-                  response.data.data.remind_cycle
838
-                console.log(this.patient_info.remind_cycle)
836
+                // this.patient_info.remind_cycle =
837
+                //   response.data.data.remind_cycle
838
+                // console.log('this.patient_info.remind_cycle',this.patient_info.remind_cycle)
839 839
 
840 840
                 this.itemDate = this.form.inspect_date
841 841
                 this.items = []
@@ -883,25 +883,26 @@ export default {
883 883
                   }
884 884
                 }
885 885
 
886
-                this.resetForm(formName)
886
+                // this.resetForm(formName)
887 887
                 this.dialogFormVisible = false
888 888
 
889 889
                 this.queryParams.patient = this.patientID
890 890
                 this.queryParams.project_id = this.project.project_id
891 891
                 this.queryParams.page = 1
892 892
                 this.total = 0
893
-                this.fetchPatientInspections(this.queryParams)
893
+                this.getchildlist(this.project.project_id)
894 894
               } else {
895 895
                 this.$message.error(response.data.msg)
896 896
                 return false
897 897
               }
898 898
             })
899
-            .catch(v => {
900
-              this.$message.error(v)
901
-              return false
902
-            })
903
-          this.formLoading = false
904
-          return false
899
+            // .catch(v => {
900
+            //   this.$message.error(v)
901
+            //   return false
902
+            // })
903
+            // this.dialogFormVisible = false
904
+            this.formLoading = false
905
+          // return false
905 906
         } else {
906 907
           return false
907 908
         }
@@ -948,6 +949,8 @@ export default {
948 949
     //   this.$refs.singleTable.setCurrentRow(row)
949 950
     // },
950 951
     resetForm(formName) {
952
+      console.log('44444',formName);
953
+      
951 954
       this.$refs[formName].resetFields()
952 955
     },
953 956
     handleCurrentChange(row) {
@@ -1159,19 +1162,35 @@ export default {
1159 1162
 
1160 1163
     },
1161 1164
     getvalue(val,time){
1162
-      console.log();
1165
+      // console.log('val',this.items,val);
1163 1166
       const options = this.items
1164 1167
       for(let i in options){
1165 1168
         if( options[i].inspect_date == time){
1166 1169
           for(let j in options[i].Child){
1167 1170
             if(options[i].Child[j].item_id == val){
1168
-              console.log('options[i].inspect_value',options[i].inspect_value);
1171
+              // console.log('options[i].inspect_value',options[i].inspect_value);
1169 1172
               return options[i].Child[j].inspect_value
1170 1173
             }
1171 1174
 
1172 1175
           }
1173 1176
         }
1174 1177
 
1178
+      }
1179
+    },
1180
+    getid(val,time){
1181
+      // console.log('val',this.items,val);
1182
+      const options = this.items
1183
+      for(let i in options){
1184
+        if( options[i].inspect_date == time){
1185
+          for(let j in options[i].Child){
1186
+            if(options[i].Child[j].item_id == val){
1187
+              // console.log('options[i].inspect_value',options[i].inspect_value);
1188
+              return options[i].Child[j].id
1189
+            }
1190
+
1191
+          }
1192
+        }
1193
+
1175 1194
       }
1176 1195
     }
1177 1196
   },