Browse Source

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

陈少旭 6 months ago
parent
commit
642338d179
2 changed files with 922 additions and 736 deletions
  1. 810 715
      package-lock.json
  2. 112 21
      src/xt_pages/stock/drugs/drugInventoryModePrint.vue

File diff suppressed because it is too large
+ 810 - 715
package-lock.json


+ 112 - 21
src/xt_pages/stock/drugs/drugInventoryModePrint.vue View File

@@ -96,19 +96,22 @@
96 96
                         </td>
97 97
                         <td align="center" style="width: 200px;">
98 98
 
99
-                           {{item.month_in_total_price }}
99
+                         <span v-if="item.is_total == 0">{{item.month_in_total_price }}</span>
100
+                         <span v-if="item.is_total == 1">{{(item.month_in_total_price).toFixed(2) }}</span>
100 101
                         </td>
101 102
                         <td align="center">{{ getOutCount(item.drug_id,item.min_number,item.min_unit,item.max_unit) }}</td> 
102 103
                         <td align="center" style="width: 200px;">{{ getRetailPrice(item.drug_id) }}</td>
103 104
                         <td align="center" style="width: 200px;">
104
-                            {{ item.month_out_total_price}}
105
+                          <span v-if="item.is_total == 0">  {{ item.month_out_total_price}}</span>
106
+                          <span v-if="item.is_total == 1">  {{ (item.month_out_total_price).toFixed(2)}}</span>
105 107
                         </td>
106 108
                         <td align="center">{{ getSumCount(item.sum_count,item.min_number,item.min_unit,item.max_unit) }}</td>
107 109
                         <td align="center" style="width: 200px;">
108 110
                             {{ getBuyPrice(item.drug_id) }}
109 111
                         </td>
110 112
                         <td align="center" style="width: 200px;">
111
-                            {{ item.month_over_total_price}}
113
+                           <span v-if="item.is_total == 0">{{ item.month_over_total_price}}</span> 
114
+                           <span v-if="item.is_total == 1">{{ (item.month_over_total_price).toFixed(2)}}</span> 
112 115
                         </td>
113 116
                         <td align="center">
114 117
                            <span v-if="item.is_total == 0">
@@ -313,7 +316,8 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
313 316
           warehouseInfoFlow:[],
314 317
           warehouseOutFlow:[],
315 318
           cancelFlow:[],
316
-
319
+          cancelOutInfo:[],
320
+          cancelInfoList:[],
317 321
        }
318 322
      },
319 323
      methods:{
@@ -376,6 +380,8 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
376 380
                  this.warehouseInfoFlow = response.data.data.warehouseInfoFlow
377 381
                  this.warehouseOutFlow = response.data.data.warehouseOutFlow
378 382
                  this.cancelFlow = response.data.data.cancelFlow
383
+
384
+                 this.cancelInfoList = response.data.data.cancelOutInfo
379 385
                 if(list!=null && list.length > 0){
380 386
                   let dataInfo = {}
381 387
                   list.forEach((item, index) => {
@@ -401,6 +407,9 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
401 407
                       month_over_total:0,//本月剩余库存
402 408
                       month_over_total_price:0,
403 409
                       is_total:0,
410
+                      month_in_total_price_one:0,
411
+                      month_out_total_price_one:0,
412
+                      month_over_total_price:0,
404 413
                     }
405 414
                   }
406 415
                 })
@@ -419,9 +428,13 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
419 428
                   arr[i].month_in_total = this.getInCount(arr[i].drug_id,arr[i].min_number,arr[i].min_unit,arr[i].max_unit)
420 429
                   arr[i].last_price = this.getBuyPrice(arr[i].drug_id)
421 430
                   arr[i].month_in_total_price = (this.getBuyPrice(arr[i].drug_id)*this.getInCountOne(arr[i].drug_id,arr[i].min_number,arr[i].min_unit,arr[i].max_unit)).toFixed(2)
431
+                  arr[i].month_in_total_price_one =this.getBuyPrice(arr[i].drug_id)*this.getInCountOne(arr[i].drug_id,arr[i].min_number,arr[i].min_unit,arr[i].max_unit)
422 432
                   arr[i].retail_price = this.getRetailPrice(arr[i].retail_price)
423 433
                   arr[i].month_out_total_price = (this.getOutCountOne(arr[i].drug_id,arr[i].min_number,arr[i].min_unit,arr[i].max_unit) * this.getRetailPrice(arr[i].drug_id)).toFixed(2)
434
+                  
435
+                  arr[i].month_out_total_price_one =this.getOutCountOne(arr[i].drug_id,arr[i].min_number,arr[i].min_unit,arr[i].max_unit) * this.getRetailPrice(arr[i].drug_id)
424 436
                   arr[i].month_over_total_price = (this.getSumCountOne(arr[i].sum_count,arr[i].min_number,arr[i].min_unit,arr[i].max_unit) * this.getBuyPrice(arr[i].drug_id)).toFixed(2)
437
+                  arr[i].month_over_total_price_one =this.getSumCountOne(arr[i].sum_count,arr[i].min_number,arr[i].min_unit,arr[i].max_unit) *  this.getBuyPrice(arr[i].drug_id)
425 438
                 }
426 439
 
427 440
                 this.tableList = arr
@@ -430,11 +443,13 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
430 443
 
431 444
               
432 445
                 for(let i=0;i<this.tableList.length;i++){
433
-                  obj.month_in_total_price += parseFloat(this.tableList[i].month_in_total_price) 
434
-                  obj.month_out_total_price +=parseFloat(this.tableList[i].month_out_total_price)
435
-                  obj.month_over_total_price +=parseFloat(this.tableList[i].month_over_total_price) 
446
+                  obj.month_in_total_price += parseFloat(this.tableList[i].month_in_total_price_one) 
447
+                  obj.month_out_total_price +=parseFloat(this.tableList[i].month_out_total_price_one)
448
+                  obj.month_over_total_price +=parseFloat(this.tableList[i].month_over_total_price_one) 
436 449
                 }
437
-                obj.mon
450
+                // obj.month_in_total_price = obj.month_in_total_price.toFixed(2)
451
+                // obj.month_out_total_price = obj.month_out_total_price.toFixed(2)
452
+                // obj.month_over_total_price = obj.month_out_total_price.toFixed(2)
438 453
                 console.log("obj=====================",obj)
439 454
                 this.tableList.push(obj)
440 455
                 // console.log("arr--------------",arr)
@@ -540,10 +555,10 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
540 555
                 }
541 556
              }
542 557
 
543
-             console.log("drug_id=================",drug_id)
544
-             console.log("total_in_count",total_in_count)
545
-             console.log("total_cancel_count",total_cancel_count)
546
-             console.log("total_out_count",total_out_count)
558
+            //  console.log("drug_id=================",drug_id)
559
+            //  console.log("total_in_count",total_in_count)
560
+            //  console.log("total_cancel_count",total_cancel_count)
561
+            //  console.log("total_out_count",total_out_count)
547 562
              total = total_in_count + total_cancel_count - total_out_count
548 563
 
549 564
 
@@ -800,11 +815,20 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
800 815
           var total =0
801 816
           var min_str  =""
802 817
           var max_str = ""
818
+          var cancelNewArr = []
819
+          var all_total = 0
820
+          var cancel_total = 0
803 821
           for(let i=0;i<this.outList.length;i++){
804 822
             if(drug_id == this.outList[i].drug_id){
805 823
                newArr.push(this.outList[i])
806 824
             }
807 825
           }
826
+
827
+          for(let i=0;i<this.cancelInfoList.length;i++){
828
+            if(drug_id == this.cancelInfoList[i].drug_id){
829
+                cancelNewArr.push(this.cancelInfoList[i])
830
+            }
831
+          }
808 832
         
809 833
          if(newArr!=null){
810 834
             for(let i=0;i<newArr.length;i++){
@@ -829,20 +853,45 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
829 853
             }
830 854
           }
831 855
 
856
+          if(cancelNewArr!=null){
857
+            for(let i=0;i<cancelNewArr.length;i++){
858
+               if(cancelNewArr[i].max_unit == max_unit && max_unit!=min_unit){
859
+                cancelNewArr[i].last_stock_max_number = cancelNewArr[i].count * min_number
860
+               } 
861
+               if(cancelNewArr[i].max_unit == min_unit && max_unit!=min_unit){
862
+                cancelNewArr[i].last_stock_max_number = cancelNewArr[i].count 
863
+               } 
864
+               if(cancelNewArr[i].max_unit == max_unit && max_unit==min_unit){
865
+                cancelNewArr[i].last_stock_max_number = cancelNewArr[i].count 
866
+               } 
867
+            }
868
+         }
869
+
870
+
871
+
872
+        console.log("newARR========",newArr)
873
+          if(cancelNewArr!=null){
874
+            for(let i=0;i<cancelNewArr.length;i++){
875
+              cancel_total += parseInt(cancelNewArr[i].last_stock_max_number)
876
+            }
877
+          }
878
+
879
+          var all_total = total - cancel_total
880
+
832 881
         
833
-          if (total < min_number) {
834
-               min_str = total + min_unit;
882
+          if (all_total < min_number) {
883
+               min_str = all_total + min_unit;
835 884
            }
836 885
             if (total == 0) {
837 886
                 min_str = "";
838 887
                 max_str = "";
839 888
             }
840
-            if (total >= min_number) {
841
-                if (parseInt(total / min_number) != 0) {
842
-                max_str = parseInt(total / min_number) + max_unit;
889
+            if (all_total >= min_number) {
890
+                if (parseInt(all_total / min_number) != 0) {
891
+                max_str = parseInt(all_total / min_number) + max_unit;
843 892
                 }
844
-                if (total % min_number != 0) {
845
-                min_str = (total % min_number) + min_unit;
893
+                if (all_total % min_number != 0) {
894
+                min_str = (all_total % min_number) + min_unit;
846 895
                 }
847 896
             }
848 897
             console.log("max_str",max_str)
@@ -857,12 +906,20 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
857 906
           
858 907
           var newArr =[]
859 908
           var total =0
860
-
909
+          var cancelNewArr = []
910
+          var all_total = 0
911
+          var cancel_total = 0
861 912
           for(let i=0;i<this.outList.length;i++){
862 913
             if(drug_id == this.outList[i].drug_id){
863 914
                newArr.push(this.outList[i])
864 915
             }
865 916
           }
917
+
918
+          for(let i=0;i<this.cancelInfoList.length;i++){
919
+            if(drug_id == this.cancelInfoList[i].drug_id){
920
+                cancelNewArr.push(this.cancelInfoList[i])
921
+            }
922
+          }
866 923
         
867 924
          if(newArr!=null){
868 925
             for(let i=0;i<newArr.length;i++){
@@ -883,7 +940,41 @@ import { getDrugInventroyModePrintList } from  "@/api/stock"
883 940
             }
884 941
           }
885 942
 
886
-         return total
943
+       
944
+
945
+
946
+          if(cancelNewArr!=null){
947
+            for(let i=0;i<cancelNewArr.length;i++){
948
+               if(cancelNewArr[i].max_unit == max_unit && max_unit!=min_unit){
949
+                cancelNewArr[i].last_stock_max_number = cancelNewArr[i].count * min_number
950
+               } 
951
+               if(cancelNewArr[i].max_unit == min_unit && max_unit!=min_unit){
952
+                cancelNewArr[i].last_stock_max_number = cancelNewArr[i].count 
953
+               } 
954
+               if(cancelNewArr[i].max_unit == max_unit && max_unit==min_unit){
955
+                cancelNewArr[i].last_stock_max_number = cancelNewArr[i].count 
956
+               } 
957
+            }
958
+         }
959
+
960
+
961
+
962
+       
963
+          if(cancelNewArr!=null){
964
+            for(let i=0;i<cancelNewArr.length;i++){
965
+              cancel_total += parseInt(cancelNewArr[i].last_stock_max_number)
966
+            }
967
+          }
968
+
969
+          var all_total = total - cancel_total
970
+          if(drug_id == 25194){
971
+            console.log("drug_id =====",drug_id)
972
+            console.log("total =====",total)
973
+            console.log("cancel_total =====",cancel_total)
974
+            console.log("all_total555555555",all_total)
975
+          }
976
+         
977
+         return all_total
887 978
         },
888 979
         getSumCount(total,min_number,min_unit,max_unit){
889 980
            var min_str  =""