Browse Source

11月7日 库存扣减更新

XMLWAN 3 years ago
parent
commit
61328dfbe7

+ 62 - 25
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -286,7 +286,7 @@
286 286
                                         </el-table-column>
287 287
                                         <el-table-column label="库存" width="60">
288 288
                                             <template slot-scope="scope">
289
-                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877">
289
+                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028">
290 290
                                                <span v-if="scope.row.count/scope.row.min_number>0">{{Math.floor(scope.row.count/scope.row.min_number)}}{{scope.row.max_unit}}</span> 
291 291
                                                <span v-if="scope.row.count%scope.row.min_number>0"> {{scope.row.count%scope.row.min_number}}{{scope.row.min_unit}}</span>
292 292
                                               </span>
@@ -383,7 +383,7 @@
383 383
                                         </el-table-column>
384 384
                                         <el-table-column label="库存" width="40">
385 385
                                             <template slot-scope="scope">
386
-                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877">
386
+                                              <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4 || org_id == 10138 || org_id == 3877 || org_id == 10028">
387 387
                                                    {{scope.row.stock_count}}
388 388
                                               </span>
389 389
                                               <span v-else> {{ scope.row.total }}</span>
@@ -2652,19 +2652,36 @@
2652 2652
       selectDrugs(selection, row) {
2653 2653
         console.log('selection', selection)
2654 2654
         console.log('row', row)
2655
-        if (row.total <= 0) {
2656
-          if (selection) {
2657
-            selection.forEach(row => {
2658
-              if (row.total <= 0) {
2659
-                this.$refs.multipleTable.toggleRowSelection(row)
2655
+        if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id == 3877 || this.org_id == 10028 ){
2656
+            if (row.count <= 0) {
2657
+              if (selection) {
2658
+                selection.forEach(row => {
2659
+                  if (row.count <= 0) {
2660
+                    this.$refs.multipleTable.toggleRowSelection(row)
2661
+                  }
2662
+                })
2663
+              } else {
2664
+                this.$refs.multipleTable.clearSelection()
2660 2665
               }
2661
-            })
2662
-          } else {
2663
-            this.$refs.multipleTable.clearSelection()
2664
-          }
2665
-          this.$message.error(row.drug_name + '库存不足')
2666
-          return
2666
+              this.$message.error(row.drug_name + '库存不足')
2667
+              return
2668
+            }
2669
+        }else{
2670
+           if (row.total <= 0) {
2671
+              if (selection) {
2672
+                selection.forEach(row => {
2673
+                  if (row.total <= 0) {
2674
+                    this.$refs.multipleTable.toggleRowSelection(row)
2675
+                  }
2676
+                })
2677
+              } else {
2678
+                this.$refs.multipleTable.clearSelection()
2679
+              }
2680
+              this.$message.error(row.drug_name + '库存不足')
2681
+              return
2682
+            }
2667 2683
         }
2684
+       
2668 2685
         this.curDrugs = selection
2669 2686
       },
2670 2687
 
@@ -2910,21 +2927,41 @@
2910 2927
       },
2911 2928
       selectChange(selection, row) {
2912 2929
         console.log('row', row)
2913
-        if (row.total <= 0) {
2914
-          if (row.type == 3) {
2915
-            if (selection) {
2916
-              selection.forEach(row => {
2917
-                if (row.total <= 0) {
2918
-                  this.$refs.tables.toggleRowSelection(row)
2919
-                }
2920
-              })
2921
-            } else {
2922
-              this.$refs.tables.clearSelection()
2930
+        if(this.org_id == 10138 || this.org_id == 9671 || this.org_id == 9675 || this.org_id == 4 || this.org_id ==3877 || this.org_id == 10028 ){
2931
+           if (row.stock_count <= 0) {
2932
+            if (row.type == 3) {
2933
+              if (selection) {
2934
+                selection.forEach(row => {
2935
+                  if (row.stock_count <= 0) {
2936
+                    this.$refs.tables.toggleRowSelection(row)
2937
+                  }
2938
+                })
2939
+              } else {
2940
+                this.$refs.tables.clearSelection()
2941
+              }
2942
+              this.$message.error(row.project_name + '库存不足')
2943
+              return
2923 2944
             }
2924
-            this.$message.error(row.project_name + '库存不足')
2925
-            return
2926 2945
           }
2946
+        }else{
2947
+           if (row.total <= 0) {
2948
+            if (row.type == 3) {
2949
+              if (selection) {
2950
+                selection.forEach(row => {
2951
+                  if (row.total <= 0) {
2952
+                    this.$refs.tables.toggleRowSelection(row)
2953
+                  }
2954
+                })
2955
+              } else {
2956
+                this.$refs.tables.clearSelection()
2957
+              }
2958
+              this.$message.error(row.project_name + '库存不足')
2959
+              return
2960
+            }
2961
+          }
2962
+
2927 2963
         }
2964
+       
2928 2965
         this.teamList.push(row)
2929 2966
       },
2930 2967
       getlist() {

+ 6 - 2
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue View File

@@ -562,6 +562,7 @@ export default {
562 562
           }
563 563
           for(let i=0;i<this.recordInfo.recordData.length;i++){
564 564
             this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
565
+            console.log("批次列表",this.numberList)
565 566
              for(let j=0;j<this.numberList.length;j++){
566 567
                 if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
567 568
                    this.recordInfo.recordData[i].batch_number = this.numberList[j].batch_number
@@ -574,7 +575,7 @@ export default {
574 575
             cancelStock: this.recordInfo.recordData
575 576
           };
576 577
           console.log("params2222",params,this.return_time)
577
-          
578
+        
578 579
           postDrugCancelStock(
579 580
             params,
580 581
             this.return_time,
@@ -698,7 +699,10 @@ export default {
698 699
            if(response.data.state == 1){
699 700
              var list = response.data.data.list
700 701
              console.log("list2222",list)
701
-             this.numberList = list
702
+             for(let i=0;i<list.length;i++){
703
+               this.numberList.push(list[i])
704
+             }
705
+             
702 706
            }
703 707
         })
704 708
       },

+ 3 - 1
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue View File

@@ -706,7 +706,9 @@
706 706
            if(response.data.state == 1){
707 707
              var list = response.data.data.list
708 708
              console.log("list2222",list)
709
-             this.numberList = list
709
+             for(let i=0;i<list.length;i++){
710
+               this.numberList.push(list[i])
711
+             }
710 712
            }
711 713
         })
712 714
       },

+ 1 - 1
src/xt_pages/stock/drugs/drugStockOutOrder.vue View File

@@ -1217,7 +1217,7 @@ export default {
1217 1217
               total += this.drugFlowList[i].count
1218 1218
           }
1219 1219
         }
1220
-        all_price = total * price
1220
+        all_price = total * min_price
1221 1221
       
1222 1222
         return  all_price
1223 1223
       },