瀏覽代碼

提交代码

陈少旭 10 月之前
父節點
當前提交
9053e68476
共有 1 個文件被更改,包括 73 次插入19 次删除
  1. 73 19
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue

+ 73 - 19
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue 查看文件

@@ -2592,7 +2592,34 @@ export default {
2592 2592
           //   }
2593 2593
           // }
2594 2594
           if (index == 1) {
2595
-            console.log(this.prescriptions)
2595
+            // console.log(this.prescriptions)
2596
+
2597
+            if (this.org_id == 10206 || this.org_id == 0){
2598
+              console.log(this.prescriptions)
2599
+
2600
+              //药品
2601
+              for(let i = 0; i < this.prescriptions.length; i++){
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)
2605
+                    }
2606
+                  }
2607
+              }
2608
+              //耗材
2609
+              for(let i = 0; i < this.prescriptions.length; i++){
2610
+
2611
+                  for(let b = 0; b < this.prescriptions[i].project.length; b++){
2612
+                    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)
2615
+                      }
2616
+                    }
2617
+                  }
2618
+              }
2619
+            }
2620
+
2621
+            return
2622
+
2596 2623
 
2597 2624
             if (this.org_id != 10206 && this.org_id != 0) {
2598 2625
               for (let i = 0; i < this.prescriptions.length; i++) {
@@ -2624,6 +2651,10 @@ export default {
2624 2651
               }
2625 2652
             }
2626 2653
 
2654
+            //库存限制
2655
+
2656
+
2657
+
2627 2658
 
2628 2659
             this.$emit('editKeepLoad', true)
2629 2660
             var str = ""
@@ -3013,19 +3044,19 @@ export default {
3013 3044
 
3014 3045
                   }
3015 3046
              }
3016
-              createHisPrescription(data, params).then(response => {
3017
-                if (response.data.state == 1) {
3018
-                  this.$emit('change', this.patientInfo.id)
3019
-                  this.$message.success('保存成功!')
3020
-                  this.$emit('editKeepLoad', false)
3021
-                  this.$parent.getInitData()
3022
-                  this.getlist()
3023
-                } else {
3024
-                  this.$message.error(response.data.msg)
3025
-                  this.$emit('editKeepLoad', false)
3026
-
3027
-                }
3028
-              })
3047
+              // createHisPrescription(data, params).then(response => {
3048
+              //   if (response.data.state == 1) {
3049
+              //     this.$emit('change', this.patientInfo.id)
3050
+              //     this.$message.success('保存成功!')
3051
+              //     this.$emit('editKeepLoad', false)
3052
+              //     this.$parent.getInitData()
3053
+              //     this.getlist()
3054
+              //   } else {
3055
+              //     this.$message.error(response.data.msg)
3056
+              //     this.$emit('editKeepLoad', false)
3057
+              //
3058
+              //   }
3059
+              // })
3029 3060
             }
3030 3061
         }
3031 3062
 
@@ -3119,6 +3150,26 @@ export default {
3119 3150
           }
3120 3151
         }
3121 3152
       }
3153
+    },judgmentsDrugStock(bby01, bbx01,name,count){
3154
+      console.log(count)
3155
+      for (let i = 0; i < this.zuobiao_drug.length; i++) {
3156
+          if (this.zuobiao_drug[i].bby01 == bby01) {
3157
+            if (this.zuobiao_drug[i].sysl < count){
3158
+              this.$message.error(name + "库存不足,无法保存")
3159
+              return
3160
+            }
3161
+          }
3162
+      }
3163
+
3164
+    },judgmentsGoodStock(bby01, bbx01,name,specification_name,count){
3165
+      for (let i = 0; i < this.zuobiao_project.length; i++) {
3166
+        if (this.zuobiao_project[i].bbx01 == bbx01 && this.zuobiao_project[i].bby06 == specification_name) {
3167
+          if (this.zuobiao_project[i].lsqty < count){
3168
+            this.$message.error(name + "库存不足,无法保存")
3169
+            return
3170
+          }
3171
+        }
3172
+      }
3122 3173
     },
3123 3174
     addTab(targetName) {
3124 3175
 
@@ -3651,6 +3702,8 @@ export default {
3651 3702
                 groupno: index + temp_index,
3652 3703
                 hosp_appr_flag: '1',
3653 3704
                 execution_state:2,
3705
+
3706
+
3654 3707
               }
3655 3708
               if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
3656 3709
                 obj.prescribing_number = 1
@@ -3970,11 +4023,12 @@ export default {
3970 4023
                   this.$message.error(project[i].good_info.good_name + '库存不足')
3971 4024
                 }
3972 4025
 
3973
-                if (project[i].good_info.zuobiao_stock_num <= 0 && this.org_id == 10206) {
3974
-                  num++
3975
-                  this.$refs.tabProjectTeam.toggleRowSelection(row)
3976
-                  this.$message.error(project[i].good_info.good_name + '库存不足')
3977
-                }
4026
+                //TODO
4027
+                // if (project[i].good_info.zuobiao_stock_num <= 0 && this.org_id == 10206) {
4028
+                //   num++
4029
+                //   this.$refs.tabProjectTeam.toggleRowSelection(row)
4030
+                //   this.$message.error(project[i].good_info.good_name + '库存不足')
4031
+                // }
3978 4032
 
3979 4033
                 if (num > 0) {
3980 4034
                   this.$refs.tabProjectTeam.clearSelection()