Browse Source

提交代码

陈少旭 10 months ago
parent
commit
c18a5461ee
1 changed files with 46 additions and 28 deletions
  1. 46 28
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue

+ 46 - 28
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -2600,9 +2600,18 @@ export default {
2600 2600
               //药品
2601 2601
               for(let i = 0; i < this.prescriptions.length; i++){
2602 2602
                   for(let b = 0; b < this.prescriptions[i].advices.length; b++){
2603
-                    if(this.prescriptions[i].advices[b].advice_id == 0) {
2604
-                      this.judgmentsDrugStock(this.prescriptions[i].advices[b].drug.bby01, this.prescriptions[i].advices[b].drug.bbx01,this.prescriptions[i].advices[b].drug_name,this.prescriptions[i].advices[b].prescribing_number,isLoading)
2605
-                    }
2603
+                    // if(this.prescriptions[i].advices[b].advice_id == 0) {
2604
+                      // this.judgmentsDrugStock(this.prescriptions[i].advices[b].drug.bby01, this.prescriptions[i].advices[b].drug.bbx01,this.prescriptions[i].advices[b].drug_name,this.prescriptions[i].advices[b].prescribing_number,isLoading)
2605
+                      for (let c = 0; c < this.zuobiao_drug.length; c++) {
2606
+                        if (this.zuobiao_drug[c].bby01 == this.prescriptions[i].advices[b].drug.bby01) {
2607
+                          if (this.zuobiao_drug[c].sysl < parseInt(this.prescriptions[i].advices[b].prescribing_number)){
2608
+                            isLoading = false
2609
+                            this.$message.error(this.prescriptions[i].advices[b].drug_name + "库存不足,无法保存")
2610
+                            return
2611
+                          }
2612
+                        }
2613
+                      }
2614
+                    // }
2606 2615
                   }
2607 2616
               }
2608 2617
               //耗材
@@ -2610,9 +2619,20 @@ export default {
2610 2619
 
2611 2620
                   for(let b = 0; b < this.prescriptions[i].project.length; b++){
2612 2621
                     if(this.prescriptions[i].project[b].type == 3){
2613
-                      if(this.prescriptions[i].project[b].id == 0) {
2614
-                        this.judgmentsGoodStock(this.prescriptions[i].project[b].good_info.bby01, this.prescriptions[i].project[b].good_info.bbx01,this.prescriptions[i].project[b].good_info.good_name,this.prescriptions[i].project[b].good_info.specification_name,this.prescriptions[i].project[b].total,isLoading)
2615
-                      }
2622
+                      // if(this.prescriptions[i].project[b].id == 0) {
2623
+                        // this.judgmentsGoodStock(this.prescriptions[i].project[b].good_info.bby01, this.prescriptions[i].project[b].good_info.bbx01,this.prescriptions[i].project[b].good_info.good_name,this.prescriptions[i].project[b].good_info.specification_name,this.prescriptions[i].project[b].total,isLoading)
2624
+                        for (let c = 0; c < this.zuobiao_project.length; c++) {
2625
+                          if (this.zuobiao_project[c].bbx01 == this.prescriptions[i].project[b].good_info.bbx01 && this.zuobiao_project[c].bby06 == this.prescriptions[i].project[b].good_info.specification_name) {
2626
+                            if (this.zuobiao_project[c].lsqty < parseInt(this.prescriptions[i].project[b].total)){
2627
+                              isLoading = false
2628
+                              this.$message.error(this.prescriptions[i].project[b].good_info.good_name + "库存不足,无法保存")
2629
+                              return
2630
+                            }
2631
+                          }
2632
+                        }
2633
+
2634
+                      //
2635
+                      // }
2616 2636
                     }
2617 2637
                   }
2618 2638
               }
@@ -3043,19 +3063,19 @@ export default {
3043 3063
 
3044 3064
                   }
3045 3065
              }
3046
-              // createHisPrescription(data, params).then(response => {
3047
-              //   if (response.data.state == 1) {
3048
-              //     this.$emit('change', this.patientInfo.id)
3049
-              //     this.$message.success('保存成功!')
3050
-              //     this.$emit('editKeepLoad', false)
3051
-              //     this.$parent.getInitData()
3052
-              //     this.getlist()
3053
-              //   } else {
3054
-              //     this.$message.error(response.data.msg)
3055
-              //     this.$emit('editKeepLoad', false)
3056
-              //
3057
-              //   }
3058
-              // })
3066
+              createHisPrescription(data, params).then(response => {
3067
+                if (response.data.state == 1) {
3068
+                  this.$emit('change', this.patientInfo.id)
3069
+                  this.$message.success('保存成功!')
3070
+                  this.$emit('editKeepLoad', false)
3071
+                  this.$parent.getInitData()
3072
+                  this.getlist()
3073
+                } else {
3074
+                  this.$message.error(response.data.msg)
3075
+                  this.$emit('editKeepLoad', false)
3076
+
3077
+                }
3078
+              })
3059 3079
             }
3060 3080
         }
3061 3081
 
@@ -3153,8 +3173,8 @@ export default {
3153 3173
       for (let i = 0; i < this.zuobiao_drug.length; i++) {
3154 3174
           if (this.zuobiao_drug[i].bby01 == bby01) {
3155 3175
             if (this.zuobiao_drug[i].sysl < parseInt(count)){
3156
-              this.$message.error(name + "库存不足,无法保存")
3157 3176
               isLoading = false
3177
+              this.$message.error(name + "库存不足,无法保存")
3158 3178
               return
3159 3179
             }
3160 3180
           }
@@ -3164,9 +3184,8 @@ export default {
3164 3184
       for (let i = 0; i < this.zuobiao_project.length; i++) {
3165 3185
         if (this.zuobiao_project[i].bbx01 == bbx01 && this.zuobiao_project[i].bby06 == specification_name) {
3166 3186
           if (this.zuobiao_project[i].lsqty < parseInt(count)){
3167
-            this.$message.error(name + "库存不足,无法保存")
3168 3187
             isLoading = false
3169
-
3188
+            this.$message.error(name + "库存不足,无法保存")
3170 3189
             return
3171 3190
           }
3172 3191
         }
@@ -4025,12 +4044,11 @@ export default {
4025 4044
                   this.$message.error(project[i].good_info.good_name + '库存不足')
4026 4045
                 }
4027 4046
 
4028
-                //TODO
4029
-                // if (project[i].good_info.zuobiao_stock_num <= 0 && this.org_id == 10206) {
4030
-                //   num++
4031
-                //   this.$refs.tabProjectTeam.toggleRowSelection(row)
4032
-                //   this.$message.error(project[i].good_info.good_name + '库存不足')
4033
-                // }
4047
+                if (project[i].good_info.zuobiao_stock_num <= 0 && this.org_id == 10206) {
4048
+                  num++
4049
+                  this.$refs.tabProjectTeam.toggleRowSelection(row)
4050
+                  this.$message.error(project[i].good_info.good_name + '库存不足')
4051
+                }
4034 4052
 
4035 4053
                 if (num > 0) {
4036 4054
                   this.$refs.tabProjectTeam.clearSelection()