Sfoglia il codice sorgente

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

XMLWAN 3 anni fa
parent
commit
38d5c88c65

+ 28 - 16
src/xt_pages/hospitalStation/components/deskPrescription.vue Vedi File

667
         }
667
         }
668
       },
668
       },
669
       setMonthPrescription(month_prescriptions) {
669
       setMonthPrescription(month_prescriptions) {
670
+        console.log("~~~~~~~~")
670
         this.month_prescriptions = []
671
         this.month_prescriptions = []
671
 
672
 
672
         let drug_month_prescriptions = {
673
         let drug_month_prescriptions = {
673
           advices: []
674
           advices: []
674
         }
675
         }
675
         let drug_ids = []
676
         let drug_ids = []
677
+        let drug_ids2 = []
678
+
676
         let project_month_prescriptions = {
679
         let project_month_prescriptions = {
677
           project: []
680
           project: []
678
 
681
 
693
                 price: month_prescriptions[i].advices[a].price
696
                 price: month_prescriptions[i].advices[a].price
694
 
697
 
695
               }
698
               }
699
+              if(month_prescriptions[i].advices[a].drug_id == 1280){
700
+                drug_ids2.push(obj)
701
+              }
696
               drug_ids.push(obj)
702
               drug_ids.push(obj)
697
               drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
703
               drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
698
             }
704
             }
726
         const obj1 = {}
732
         const obj1 = {}
727
         const obj2 = {}
733
         const obj2 = {}
728
 
734
 
729
-        drug_ids = drug_ids.reduce((cur, next) => {
730
-          obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
731
-          return cur
732
-        }, []) // 设置cur默认类型为数组,并且初始值为空的数组
733
-        project_ids = project_ids.reduce((cur, next) => {
734
-          obj1[next.price] ? '' : obj1[next.price] = true && cur.push(next)
735
-          return cur
736
-        }, []) // 设置cur默认类型为数组,并且初始值为空的数组
737
-        additions_ids = additions_ids.reduce((cur, next) => {
738
-          obj2[next.price] ? '' : obj2[next.price] = true && cur.push(next)
739
-          return cur
740
-        }, []) // 设置cur默认类型为数组,并且初始值为空的数组
735
+        drug_ids = this.unique(drug_ids)
736
+        project_ids = this.unique(project_ids)
737
+        additions_ids = this.unique(additions_ids)
738
+
741
 
739
 
742
         let drugs = []
740
         let drugs = []
743
         let projects = []
741
         let projects = []
747
           let obj = {}
745
           let obj = {}
748
           let count = 0
746
           let count = 0
749
           for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
747
           for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
750
-            if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
748
+            if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id ==  drug_month_prescriptions.advices[a].drug_id) {
751
               obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
749
               obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
752
               obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
750
               obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
753
               obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
751
               obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
775
           let obj = {}
773
           let obj = {}
776
           let count = 0
774
           let count = 0
777
           for (let a = 0; a < project_month_prescriptions.project.length; a++) {
775
           for (let a = 0; a < project_month_prescriptions.project.length; a++) {
778
-            if (project_ids[i].price == project_month_prescriptions.project[a].price) {
776
+            if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
779
 
777
 
780
               if (project_month_prescriptions.project[a].type == 2) {
778
               if (project_month_prescriptions.project[a].type == 2) {
781
                 obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
779
                 obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
3194
         if (this.dayorMonth == 'day') {
3192
         if (this.dayorMonth == 'day') {
3195
           this.$emit('day')
3193
           this.$emit('day')
3196
         } else if (this.dayorMonth == 'month') {
3194
         } else if (this.dayorMonth == 'month') {
3197
-          console.log('~~~~~~')
3198
           let form = {
3195
           let form = {
3199
             id: this.patientInfo.id,
3196
             id: this.patientInfo.id,
3200
             his_patient_id: this.hisPatientInfo.id
3197
             his_patient_id: this.hisPatientInfo.id
3213
       },
3210
       },
3214
       clearSelection() {
3211
       clearSelection() {
3215
         this.$refs.tabProjectTeam.clearSelection()
3212
         this.$refs.tabProjectTeam.clearSelection()
3216
-      }
3213
+      },unique(array) {
3214
+        // res用来存储结果
3215
+        var res = []
3216
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
3217
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
3218
+            if (array[i].id === res[j].id && array[i].price === res[j].price) {
3219
+              break
3220
+            }
3221
+          }
3222
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
3223
+          if (j === resLen) {
3224
+            res.push(array[i])
3225
+          }
3226
+        }
3227
+        return res
3228
+      },
3217
     },
3229
     },
3218
     mounted() {
3230
     mounted() {
3219
 
3231
 

+ 26 - 14
src/xt_pages/hospitalStation/doctorDesk.vue Vedi File

318
     },
318
     },
319
     data() {
319
     data() {
320
       return {
320
       return {
321
+        current_data:null,
321
         drugs: [],
322
         drugs: [],
322
         allDrugs: [],
323
         allDrugs: [],
323
         advices_template: [],
324
         advices_template: [],
598
             this.admin_info = response.data.data.info
599
             this.admin_info = response.data.data.info
599
 
600
 
600
             if (this.patientTableData.length > 0) {
601
             if (this.patientTableData.length > 0) {
602
+              this.current_data = this.patientTableData[0]
601
               this.$refs.tab.setCurrentRow(this.patientTableData[0])
603
               this.$refs.tab.setCurrentRow(this.patientTableData[0])
602
               this.oldCurrentRow = this.patientTableData[0]
604
               this.oldCurrentRow = this.patientTableData[0]
603
               this.getPatientInfo(this.patientTableData[0])
605
               this.getPatientInfo(this.patientTableData[0])
703
         const obj1 = {}
705
         const obj1 = {}
704
         const obj2 = {}
706
         const obj2 = {}
705
 
707
 
706
-        drug_ids = drug_ids.reduce((cur, next) => {
707
-          obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
708
-          return cur
709
-        }, []) // 设置cur默认类型为数组,并且初始值为空的数组
710
-        project_ids = project_ids.reduce((cur, next) => {
711
-          obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
712
-          return cur
713
-        }, []) // 设置cur默认类型为数组,并且初始值为空的数组
714
-        additions_ids = additions_ids.reduce((cur, next) => {
715
-          obj[next.price] ? '' : obj[next.price] = true && cur.push(next)
716
-          return cur
717
-        }, []) // 设置cur默认类型为数组,并且初始值为空的数组
708
+        drug_ids = this.unique(drug_ids)
709
+        project_ids = this.unique(project_ids)
710
+        additions_ids = this.unique(additions_ids)
711
+
718
 
712
 
719
         let drugs = []
713
         let drugs = []
720
         let projects = []
714
         let projects = []
724
           let obj = {}
718
           let obj = {}
725
           let count = 0
719
           let count = 0
726
           for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
720
           for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
727
-            if (drug_ids[i].price == drug_month_prescriptions.advices[a].price) {
721
+            if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id ==  drug_month_prescriptions.advices[a].drug_id) {
728
               obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
722
               obj['drug_name'] = drug_month_prescriptions.advices[a].advice_name
729
               obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
723
               obj['single_dose'] = drug_month_prescriptions.advices[a].single_dose
730
               obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
724
               obj['delivery_way'] = drug_month_prescriptions.advices[a].delivery_way
751
           let obj = {}
745
           let obj = {}
752
           let count = 0
746
           let count = 0
753
           for (let a = 0; a < project_month_prescriptions.project.length; a++) {
747
           for (let a = 0; a < project_month_prescriptions.project.length; a++) {
754
-            if (project_ids[i].price == project_month_prescriptions.project[a].price) {
748
+            if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
755
               if (project_month_prescriptions.project[a].type == 2) {
749
               if (project_month_prescriptions.project[a].type == 2) {
756
                 obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
750
                 obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
757
                 obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
751
                 obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
1038
             this.admin_info = response.data.data.info
1032
             this.admin_info = response.data.data.info
1039
 
1033
 
1040
             if (this.patientTableData.length > 0) {
1034
             if (this.patientTableData.length > 0) {
1035
+              this.current_data = this.patientTableData[0]
1041
               this.$refs.tab.setCurrentRow(this.patientTableData[0])
1036
               this.$refs.tab.setCurrentRow(this.patientTableData[0])
1042
               this.oldCurrentRow = this.patientTableData[0]
1037
               this.oldCurrentRow = this.patientTableData[0]
1043
               this.getPatientInfo(this.patientTableData[0])
1038
               this.getPatientInfo(this.patientTableData[0])
1419
           }
1414
           }
1420
         })
1415
         })
1421
 
1416
 
1417
+      },unique(array) {
1418
+        // res用来存储结果
1419
+        var res = []
1420
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
1421
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
1422
+            if (array[i].id === res[j].id && array[i].price === res[j].price) {
1423
+              break
1424
+            }
1425
+          }
1426
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
1427
+          if (j === resLen) {
1428
+            res.push(array[i])
1429
+          }
1430
+        }
1431
+        return res
1422
       },
1432
       },
1423
 
1433
 
1424
       choosePatient(val) {
1434
       choosePatient(val) {
1435
+        this.current_data = val
1425
         if (this.titleType == '电子病历') {
1436
         if (this.titleType == '电子病历') {
1426
 
1437
 
1427
           if (this.$refs.child.watchSign > 2) {
1438
           if (this.$refs.child.watchSign > 2) {
4010
         }
4021
         }
4011
       }, changeDay() {
4022
       }, changeDay() {
4012
         this.current_tab = 'day'
4023
         this.current_tab = 'day'
4024
+        this.getPatientInfo(this.current_data)
4013
 
4025
 
4014
       }, changeMonth(val) {
4026
       }, changeMonth(val) {
4015
         this.current_tab = 'month'
4027
         this.current_tab = 'month'