Parcourir la source

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

csx il y a 3 ans
Parent
révision
cd8dc1a8a6
1 fichiers modifiés avec 106 ajouts et 89 suppressions
  1. 106 89
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue

+ 106 - 89
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Voir le fichier

@@ -2676,7 +2676,7 @@
2676 2676
 
2677 2677
             }
2678 2678
           }
2679
-          
2679
+
2680 2680
           if(this.$store.getters.xt_user.org_id == 10138){
2681 2681
             let arr = this.teamList
2682 2682
             let newArr = []
@@ -2691,8 +2691,8 @@
2691 2691
             this.teamList = newArr
2692 2692
           }
2693 2693
         }
2694
-        
2695
-        
2694
+
2695
+
2696 2696
 
2697 2697
         if (this.curDrugs.length == 0) {
2698 2698
           if (this.$store.getters.xt_user.org_id == 10138) {
@@ -2872,7 +2872,12 @@
2872 2872
                   remark: '',
2873 2873
                   medical_code: temp2[b].medical_code,
2874 2874
                   unit: temp2[b].unit,
2875
-                  type: temp2[b].type
2875
+                  type: temp2[b].type,
2876
+                }
2877
+                if(temp2[b].team_id == undefined){
2878
+                  obj["team_id"] = 0
2879
+                }else{
2880
+                  obj["team_id"] = temp2[b].team_id
2876 2881
                 }
2877 2882
                 if (obj.total == 0 || obj.total == undefined) {
2878 2883
                   obj.total = 1
@@ -3006,99 +3011,111 @@
3006 3011
       },
3007 3012
       selectTeam(row) {
3008 3013
         console.log(row)
3009
-        var arr = []
3010
-        for (let i = 0; i < row.length; i++) {
3011
-          arr.push(row[i].item_id)
3012
-        }
3013
-        console.log(arr)
3014
-        var ids = arr.join(',')
3015
-        console.log(ids)
3016
-        var strArr = ids.split(',')
3017
-        console.log(strArr)
3018
-        var res = []//接收不重复的数据
3019
-
3020
-        for (var i = 0; i < strArr.length; i++) {
3021
-          var flag = true
3014
+        // var arr = []
3015
+        // for (let i = 0; i < row.length; i++) {
3016
+        //   arr.push(row[i].item_id)
3017
+        // }
3018
+        // console.log(arr)
3019
+        // var ids = arr.join(',')
3020
+        // console.log(ids)
3021
+        // var strArr = ids.split(',')
3022
+        // console.log(strArr)
3023
+        // var res = []//接收不重复的数据
3024
+        //
3025
+        // for (var i = 0; i < strArr.length; i++) {
3026
+        //   var flag = true
3027
+        //
3028
+        //   for (var j = 0; j < i; j++) {
3029
+        //     if (strArr[i] === strArr[j]) {
3030
+        //       flag = false
3031
+        //       break
3032
+        //     }
3033
+        //   }
3034
+        //   if (flag) {
3035
+        //     res.push(strArr[i])
3036
+        //   }
3037
+        // }
3038
+        // console.log(res)
3039
+        // var idstr = res.join(',')
3022 3040
 
3023
-          for (var j = 0; j < i; j++) {
3024
-            if (strArr[i] === strArr[j]) {
3025
-              flag = false
3026
-              break
3027
-            }
3041
+        let teamList = []
3042
+        for(let i = 0;i < row.length; i++){
3043
+          let team_id = row[i].id
3044
+          console.log(team_id)
3045
+          const params = {
3046
+            project_id:  row[i].item_id
3028 3047
           }
3029
-          if (flag) {
3030
-            res.push(strArr[i])
3031
-          }
3032
-        }
3033
-        console.log(res)
3034
-        var idstr = res.join(',')
3035
-        const params = {
3036
-          project_id: idstr
3037
-        }
3038
-        getPojectListById(params).then(response => {
3039
-          if (response.data.state == 1) {
3040
-            this.teamList = []
3041
-            var project = response.data.data.project
3042
-            let num = 0
3043
-            for (let i = 0; i < project.length; i++) {
3044
-              if (project[i].type == 2 && project[i].status == 1) {
3048
+          getPojectListById(params).then(response => {
3049
+            if (response.data.state == 1) {
3050
+              var project = response.data.data.project
3051
+              let num = 0
3052
+              for (let i = 0; i < project.length; i++) {
3053
+                if (project[i].type == 2 && project[i].status == 1) {
3054
+                  let obj = {
3055
+                    id: project[i].project_id,
3056
+                    project_name: project[i].project.project_name,
3057
+                    statistical_classification: project[i].project.statistical_classification,
3058
+                    single_dose: project[i].project.single_dose,
3059
+                    delivery_way: project[i].project.delivery_way,
3060
+                    execution_frequency: project[i].project.execution_frequency,
3061
+                    number_days: project[i].project.number_days,
3062
+                    cus_total: project[i].number,
3063
+                    price: project[i].project.price,
3064
+                    remark: '',
3065
+                    medical_code: project[i].project.medical_code,
3066
+                    unit: project[i].project.unit,
3067
+                    type: project[i].type,
3068
+                    is_special_diseases: project[i].project.disease_directory,
3069
+                    team_id:team_id
3070
+                  }
3071
+                  if (obj.cus_total == 0 || obj.cus_total == undefined) {
3072
+                    obj.cus_total = 1
3073
+                  }
3045 3074
 
3046
-                let obj = {
3047
-                  id: project[i].project_id,
3048
-                  project_name: project[i].project.project_name,
3049
-                  statistical_classification: project[i].project.statistical_classification,
3050
-                  single_dose: project[i].project.single_dose,
3051
-                  delivery_way: project[i].project.delivery_way,
3052
-                  execution_frequency: project[i].project.execution_frequency,
3053
-                  number_days: project[i].project.number_days,
3054
-                  cus_total: project[i].number,
3055
-                  price: project[i].project.price,
3056
-                  remark: '',
3057
-                  medical_code: project[i].project.medical_code,
3058
-                  unit: project[i].project.unit,
3059
-                  type: project[i].type,
3060
-                  is_special_diseases: project[i].project.disease_directory
3061
-                }
3062
-                if (obj.cus_total == 0 || obj.cus_total == undefined) {
3063
-                  obj.cus_total = 1
3064
-                }
3075
+                  teamList.push(obj)
3076
+                } else if (project[i].type == 3 && project[i].status == 1) {
3077
+                  if(project[i].good_info.total <= 0){
3078
+                    num++
3079
+                    this.$refs.tabProjectTeam.toggleRowSelection(row);
3080
+                    this.$message.error(project[i].good_info.good_name + '库存不足')
3081
+                  }
3082
+                  if(num > 0){
3083
+                    this.$refs.tabProjectTeam.clearSelection();
3084
+                  }
3085
+                  let obj = {
3086
+                    id: project[i].project_id,
3087
+                    project_name: project[i].good_info.good_name,
3088
+                    statistical_classification: '',
3089
+                    single_dose: '',
3090
+                    delivery_way: '',
3091
+                    execution_frequency: '',
3092
+                    number_days: '',
3093
+                    cus_total: project[i].number,
3094
+                    price: project[i].good_info.retail_price,
3095
+                    remark: '',
3096
+                    medical_code: project[i].good_info.medical_insurance_number,
3097
+                    unit: project[i].good_info.unit,
3098
+                    type: project[i].type,
3099
+                    is_special_diseases: project[i].good_info.is_special_diseases,
3100
+                    team_id:team_id
3065 3101
 
3066
-                this.teamList.push(obj)
3067
-              } else if (project[i].type == 3 && project[i].status == 1) {
3068
-                if(project[i].good_info.total <= 0){
3069
-                  num++
3070
-                  this.$refs.tabProjectTeam.toggleRowSelection(row);
3071
-                  this.$message.error(project[i].good_info.good_name + '库存不足')
3072
-                }
3073
-                if(num > 0){
3074
-                  this.$refs.tabProjectTeam.clearSelection();
3075
-                }
3076
-                let obj = {
3077
-                  id: project[i].project_id,
3078
-                  project_name: project[i].good_info.good_name,
3079
-                  statistical_classification: '',
3080
-                  single_dose: '',
3081
-                  delivery_way: '',
3082
-                  execution_frequency: '',
3083
-                  number_days: '',
3084
-                  cus_total: project[i].number,
3085
-                  price: project[i].good_info.retail_price,
3086
-                  remark: '',
3087
-                  medical_code: project[i].good_info.medical_insurance_number,
3088
-                  unit: project[i].good_info.unit,
3089
-                  type: project[i].type,
3090
-                  is_special_diseases: project[i].good_info.is_special_diseases
3091
-                }
3092
-                if (obj.cus_total == 0 || obj.cus_total == undefined) {
3093
-                  obj.cus_total = 1
3102
+                  }
3103
+                  if (obj.cus_total == 0 || obj.cus_total == undefined) {
3104
+                    obj.cus_total = 1
3105
+                  }
3106
+                  teamList.push(obj)
3094 3107
                 }
3095
-                this.teamList.push(obj)
3096
-
3097 3108
               }
3109
+
3110
+              this.teamList = this.teamList.concat(teamList)
3111
+              console.log(this.teamList)
3098 3112
             }
3113
+          })
3114
+        }
3115
+
3116
+
3117
+
3099 3118
 
3100
-          }
3101
-        })
3102 3119
 
3103 3120
       }, changeDoctor(val) {
3104 3121
         for (let i = 0; i < this.doctors.length; i++) {