Browse Source

11月14日 库存扣减更新

XMLWAN 3 years ago
parent
commit
4c20f3ef05

+ 3 - 2
src/xt_pages/outpatientCharges/statementTemplate/printThree.vue View File

@@ -147,8 +147,9 @@
147 147
 
148 148
         </div>
149 149
         <div v-else id='prescription-print' class="prescription-print" style="position: relative;">
150
-            <img style="width:100%;height:80px" v-if="$store.getters.xt_user.org_id != 10278" src="https://kuyi.shengws.com/bailin/bltotle.jpg" alt="">
151
-            <img style="width:100%;height:80px" v-else src="https://kuyi.shengws.com/beierlog.png" alt="">
150
+            <img style="width:100%;height:80px" v-if="$store.getters.xt_user.org_id == 10138" src="https://kuyi.shengws.com/bailin/bltotle.jpg" alt="">
151
+            <img style="width:100%;height:80px" v-if="$store.getters.xt_user.org_id == 10278" src="https://kuyi.shengws.com/beierlog.png" alt="">
152
+           
152 153
             <div class="printTitle" style="position: absolute;left: 40%;top: 50px;">门诊收费清单</div>
153 154
             <div style="display:flex;">
154 155
                 <div>单据号:<span style="display:inline-block;width:200px;">{{balanceAccounts.his.number ? balanceAccounts.his.number : ''}}</span>

+ 2 - 2
src/xt_pages/outpatientDoctorStation/template/printThree.vue View File

@@ -3,8 +3,8 @@
3 3
   <div id='prescriptionPrint1'>
4 4
     <div v-for="(item,index) in advicePrint" :key="index">
5 5
       <div id='prescription-print' v-if="item.project.length == 0" v-for='(i,pageIndex) in item.pageArr.length' :key="pageIndex" class="prescription-print" style="page-break-after: always;">
6
-          <span v-if="org_id = 10138"> <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt=""></span> 
7
-          <span v-if="org_id = 10278"> <img src="https://kuyi.shengws.com/beierlog.png" style="width:100%" alt=""></span> 
6
+          <span v-if="org_id == 10138"> <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt=""></span> 
7
+          <span v-if="org_id == 10278"> <img src="https://kuyi.shengws.com/beierlog.png" style="width:100%" alt=""></span> 
8 8
           <div class="printTitle">
9 9
             处方笺
10 10
             <span v-if="item.med_type == '1111'" style="margin-left: 50px;border: 1px solid #000;">精一</span>

+ 4 - 4
src/xt_pages/outpatientDoctorStation/treatTemplate/printTwo.vue View File

@@ -2,8 +2,8 @@
2 2
    <div id='prescriptionPrint2'>
3 3
     <div id='prescription-print' v-if="item.advices.length == 0" class="prescription-print" v-for="(item,index) in advicePrint" :key="index">
4 4
 
5
-        <span v-if="org_id = 10138"> <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt=""></span>
6
-         <span v-if="org_id = 10278"> <img src="https://kuyi.shengws.com/beierlog.png" style="width:100%" alt=""></span>
5
+        <span v-if="org_id == 10138"> <img src="https://kuyi.shengws.com/bailin/bltotle.jpg" style="width:100%" alt=""></span>
6
+         <span v-if="org_id == 10278"> <img src="https://kuyi.shengws.com/beierlog.png" style="width:100%" alt=""></span>
7 7
         <div class="printTitle">治疗单
8 8
           <span v-if="item.med_type == '1111'" style="margin-left: 50px;border: 1px solid #000;">精一</span>
9 9
           <span v-if="item.med_type == '1112'" style="margin-left: 50px;border: 1px solid #000;">精二</span>
@@ -92,8 +92,8 @@
92 92
           <div style="display:flex;">
93 93
             打印时间:<span style="border-bottom:1px solid #000;">{{getTime(new Date())?getTime(new Date()):""}}</span>
94 94
           </div>
95
-          <span v-if="org_id == 10138"></span> <img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt="">
96
-          <span v-if="org_id == 10278"></span> <img src="https://kuyi.shengws.com/bailinbeier.png" style="width:100%" alt="">
95
+          <span v-if="org_id == 10138"><img src="https://kuyi.shengws.com/bailin/blend.jpg" style="width:100%" alt=""></span> 
96
+          <span v-if="org_id == 10278"><img src="https://kuyi.shengws.com/bailinbeier.png" style="width:100%" alt=""></span> 
97 97
           <div style="page-break-after:always"></div>
98 98
      </div>
99 99
 

+ 119 - 3
src/xt_pages/supply/components/addGoodReturn.vue View File

@@ -202,6 +202,7 @@
202 202
                 :rules="tableRules.supply_count"
203 203
               >
204 204
                 <el-input
205
+                  @input="getSupplyCount(scope.row.supply_count,scope.row.sum_count,scope.row.supply_unit,scope.row.type,scope.row.min_number,scope.row.max_unit,scope.row.min_unit,scope.$index)"
205 206
                   v-model="scope.row.supply_count"
206 207
                   style="width: 80px"
207 208
                   :disabled="disabled"
@@ -554,6 +555,12 @@ export default {
554 555
               drugList[i].unitList[0].name = drugList[i].max_unit;
555 556
               drugList[i].unitList[1].name = drugList[i].min_unit;
556 557
             }
558
+            drugList[i].sum_count =  this.getWarehoseInfoTwo(
559
+              drugList[i].drug_warehouse_info,
560
+              drugList[i].max_unit,
561
+              drugList[i].min_unit,
562
+              drugList[i].min_number
563
+            );
557 564
             this.tabList.push(drugList[i]);
558 565
           }
559 566
           this.drugList = drugList;
@@ -601,6 +608,10 @@ export default {
601 608
             for (let j = 0; j < goodList[i].unitList.length; j++) {
602 609
               goodList[i].unitList[0].name = goodList[i].packing_unit;
603 610
             }
611
+        
612
+            goodList[i].sum_count = this.getTotalStockCountTwo(
613
+              goodList[i].good_warehouse_info
614
+            );
604 615
             this.tabList.push(goodList[i]);
605 616
           }
606 617
           this.goodList = goodList;
@@ -611,6 +622,7 @@ export default {
611 622
       this.currentIndex = val;
612 623
     },
613 624
     changeName(val) {
625
+      console.log("val332322323233",val)
614 626
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
615 627
         if (this.currentIndex == i) {
616 628
           this.recordInfo.tableList[i].project_id = val.id;
@@ -643,6 +655,16 @@ export default {
643 655
           this.recordInfo.tableList[i].supply_unit = val.supply_unit;
644 656
           this.recordInfo.tableList[i].unitList = val.unitList;
645 657
           this.recordInfo.tableList[i].count = val.count
658
+          this.recordInfo.tableList[i].sum_count = val.sum_count
659
+          if(val.type == 1){
660
+            this.recordInfo.tableList[i].min_number = val.min_number
661
+            this.recordInfo.tableList[i].max_unit = val.max_unit
662
+            this.recordInfo.tableList[i].min_unit = val.min_unit
663
+          }else{
664
+             this.recordInfo.tableList[i].max_unit = ""
665
+             this.recordInfo.tableList[i].min_unit = ""
666
+             this.recordInfo.tableList[i].min_number = ""
667
+          }
646 668
         }
647 669
       }
648 670
     },
@@ -674,6 +696,10 @@ export default {
674 696
       tempObj["good_number"] = ""
675 697
       tempObj["min_price"] = "";
676 698
       tempObj["deposit_rate"] = ""
699
+      tempObj["sum_count"] = 0
700
+      tempObj["min_number"] = 0
701
+      tempObj["max_unit"] = ""
702
+      tempObj["min_unit"] = ""
677 703
       this.recordInfo.tableList.push(tempObj);
678 704
     },
679 705
     handleDelete: function (index, row) {
@@ -712,6 +738,15 @@ export default {
712 738
       console.log("hh2332232332",max_str + min_str)
713 739
       return max_str + min_str;
714 740
     },
741
+    getWarehoseInfoTwo(arr, max_unit, min_unit, min_number){
742
+      var total = 0;
743
+      if (arr.length > 0) {
744
+        for (let i = 0; i < arr.length; i++) {
745
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
746
+        }
747
+      }
748
+      return total
749
+    },
715 750
     getTotalStockCount(arr) {
716 751
       var total_count = 0;
717 752
       for (let i = 0; i < arr.length; i++) {
@@ -723,6 +758,14 @@ export default {
723 758
         return ""
724 759
       }
725 760
       
761
+    },
762
+    getTotalStockCountTwo(arr) {
763
+      var total_count = 0;
764
+      for (let i = 0; i < arr.length; i++) {
765
+        total_count += arr[i].stock_count;
766
+      }
767
+      return total_count
768
+    
726 769
     },
727 770
     calculate: function (val) {
728 771
       if (isNaN(val)) {
@@ -833,7 +876,7 @@ export default {
833 876
             }
834 877
             orderInfo[i].id = orderInfo[i].id;
835 878
             orderInfo[i].supply_count = orderInfo[i].supply_count;
836
-            orderInfo[i].count = orderInfo[i].count
879
+            
837 880
             orderInfo[i].supply_price = orderInfo[i].price;
838 881
             orderInfo[i].supply_remake = orderInfo[i].remark;
839 882
             orderInfo[i].type = orderInfo[i].is_source;
@@ -864,8 +907,20 @@ export default {
864 907
                     orderInfo[i].unitList = [{ id: 1, name: "" }];
865 908
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
866 909
                   }
910
+                   //用来统计数量比大小
911
+                 if(orderInfo[i].supply_unit == drugList[j].max_unit){
912
+                    orderInfo[i].sum_count = orderInfo[i].count*drugList[j].min_number
913
+                  }
914
+                  if(orderInfo[i].supply_unit == drugList[j].min_unit){
915
+                     orderInfo[i].sum_count = orderInfo[i].count
916
+                  }
917
+                  orderInfo[i].min_number =  drugList[j].min_number
918
+                  orderInfo[i].max_unit =drugList[j].max_unit
919
+                  orderInfo[i].min_unit =drugList[j].min_unit
867 920
                 }
921
+               
868 922
               }
923
+              orderInfo[i].count = orderInfo[i].count + orderInfo[i].supply_unit
869 924
             }
870 925
             if (orderInfo[i].is_source == 2) {
871 926
               for (let j = 0; j < goodList.length; j++) {
@@ -874,10 +929,16 @@ export default {
874 929
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
875 930
                 }
876 931
               }
932
+              orderInfo[i].sum_count = orderInfo[i].count
933
+              orderInfo[i].min_number = 0
934
+              orderInfo[i].count = orderInfo[i].count;
935
+              orderInfo[i].max_unit =""
936
+              orderInfo[i].min_unit =""
877 937
             }
878 938
           }
879 939
 
880 940
           this.recordInfo.tableList = [];
941
+          console.log("相亲233232322332323223322323",orderInfo)
881 942
           this.recordInfo.tableList = orderInfo;
882 943
           this.tableDataList = []
883 944
           this.tableDataList = orderInfo
@@ -894,6 +955,11 @@ export default {
894 955
         if(valid){
895 956
           this.loading = true
896 957
           for(let i=0;i<this.recordInfo.tableList.length;i++){
958
+            if(this.recordInfo.tableList[i].count == ""){
959
+              this.$message.error(this.recordInfo.tableList[i].name+"无可退库数量,保存失败!")
960
+              this.loading = false
961
+              return false
962
+            }
897 963
             this.recordInfo.tableList[i].supply_count = parseInt(this.recordInfo.tableList[i].supply_count);
898 964
             this.recordInfo.tableList[i].supply_price =this.recordInfo.tableList[i].supply_price.toString();
899 965
             this.recordInfo.tableList[i].supply_total =this.recordInfo.tableList[i].supply_total.toString();
@@ -916,7 +982,7 @@ export default {
916 982
             }
917 983
           } 
918 984
            //判断是否在采购单数据中做了删除,如果长度相等则代表没有删除,如果不等则代表做了删除或者新增
919
-           if(this.recordInfo.tableList.length != this.tableDataList.length){
985
+           if(this.recordInfo.tableList.length < this.tableDataList.length){
920 986
              warehouse_out_id = 0
921 987
              for(let i=0;i<this.recordInfo.tableList.length;i++){
922 988
                 this.recordInfo.tableList[i].id = 0
@@ -1102,7 +1168,53 @@ export default {
1102 1168
         }
1103 1169
       });
1104 1170
     },
1105
-   
1171
+    getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
1172
+     console.log("val23322323",supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit)
1173
+      var total_count = 0
1174
+      
1175
+      if(type == 1){
1176
+       if(supply_unit == max_unit){
1177
+          total_count = supply_count * min_number
1178
+       }
1179
+       if(supply_unit == min_unit){
1180
+         total_count = supply_count
1181
+       }
1182
+       console.log("sum_counts",sum_count)
1183
+       console.log("count232232332",total_count)
1184
+       if(total_count > sum_count){
1185
+         this.$message.error("数量不能大于可退数量!")
1186
+         for(let i=0;i<this.recordInfo.tableList.length;i++){
1187
+           if(index == i){
1188
+             this.recordInfo.tableList[i].supply_count = ""
1189
+           }
1190
+         }
1191
+       }else{
1192
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
1193
+            if(index == i){
1194
+              this.recordInfo.tableList[i].supply_count = supply_count
1195
+            }
1196
+          }
1197
+         }
1198
+      }
1199
+       
1200
+      if(type == 2){
1201
+         if(supply_count > sum_count){
1202
+          this.$message.error("数量不能大于可退数量!")
1203
+          for(let i=0;i<this.recordInfo.tableList.length;i++){
1204
+            if(index == i){
1205
+              this.recordInfo.tableList[i].supply_count = ""
1206
+            }
1207
+          }
1208
+         }else{
1209
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
1210
+            if(index == i){
1211
+              this.recordInfo.tableList[i].supply_count = supply_count
1212
+            }
1213
+          }
1214
+         }
1215
+      }
1216
+    
1217
+    },
1106 1218
   },
1107 1219
   created() {
1108 1220
     const tempObj = {};
@@ -1132,6 +1244,10 @@ export default {
1132 1244
     tempObj["good_number"] = ""
1133 1245
     tempObj["min_price"] = "";
1134 1246
     tempObj["deposit_rate"] = ""
1247
+    tempObj["sum_count"] = 0
1248
+    tempObj["min_number"] = 0
1249
+    tempObj["max_unit"] = ""
1250
+    tempObj["min_unit"] = ""
1135 1251
     this.recordInfo.tableList.push(tempObj);
1136 1252
    
1137 1253
     this.getInitOrder();

+ 131 - 16
src/xt_pages/supply/components/editGoodReturn.vue View File

@@ -174,12 +174,12 @@
174 174
                   placeholder="请选择"
175 175
                   :disabled="disabled"
176 176
                 >
177
-                  <!-- <el-option
178
-                            v-for="(item,index) in scope.row.unitList"
179
-                            :key="index"
180
-                            :label="item.name"
181
-                            :value="item.name">
182
-                        </el-option> -->
177
+                  <el-option
178
+                    v-for="(item,index) in scope.row.unitList"
179
+                    :key="index"
180
+                    :label="item.name"
181
+                    :value="item.name">
182
+                  </el-option>
183 183
                 </el-select>
184 184
               </el-form-item>
185 185
             </template>
@@ -214,6 +214,7 @@
214 214
                 :rules="tableRules.supply_count"
215 215
               >
216 216
                 <el-input
217
+                 @input="getSupplyCount(scope.row.supply_count,scope.row.sum_count,scope.row.supply_unit,scope.row.type,scope.row.min_number,scope.row.max_unit,scope.row.min_unit,scope.$index)"
217 218
                   v-model="scope.row.supply_count"
218 219
                   style="width: 80px"
219 220
                   :disabled="disabled"
@@ -554,6 +555,7 @@ export default {
554 555
               drugList[i].min_unit,
555 556
               drugList[i].min_number
556 557
             );
558
+            
557 559
             drugList[i].supply_count = "";
558 560
             drugList[i].supply_total_price = "";
559 561
             drugList[i].supply_manufacturer = drugList[i].manufacturer;
@@ -562,7 +564,6 @@ export default {
562 564
             drugList[i].type = 1;
563 565
             drugList[i].supply_price = drugList[i].last_price;
564 566
             drugList[i].name = drugList[i].drug_name;
565
-            drugList[i].count = ""
566 567
             drugList[i].unitList = [
567 568
               { id: 1, name: "" },
568 569
               { id: 2, name: "" },
@@ -572,6 +573,12 @@ export default {
572 573
               drugList[i].unitList[0].name = drugList[i].max_unit;
573 574
               drugList[i].unitList[1].name = drugList[i].min_unit;
574 575
             }
576
+            drugList[i].sum_count =  this.getWarehoseInfoTwo(
577
+              drugList[i].drug_warehouse_info,
578
+              drugList[i].max_unit,
579
+              drugList[i].min_unit,
580
+              drugList[i].min_number
581
+            );
575 582
             this.tabList.push(drugList[i]);
576 583
           }
577 584
           this.drugList = drugList;
@@ -617,10 +624,13 @@ export default {
617 624
             ];
618 625
 
619 626
             goodList[i].supply_unit = goodList[i].packing_unit;
620
-            goodList[i].count = ""
627
+
621 628
             for (let j = 0; j < goodList[i].unitList.length; j++) {
622 629
               goodList[i].unitList[0].name = goodList[i].packing_unit;
623 630
             }
631
+            goodList[i].sum_count = this.getTotalStockCountTwo(
632
+              goodList[i].good_warehouse_info
633
+            );
624 634
             this.tabList.push(goodList[i]);
625 635
           }
626 636
           this.goodList = goodList;
@@ -631,6 +641,7 @@ export default {
631 641
       this.currentIndex = val;
632 642
     },
633 643
     changeName(val) {
644
+    
634 645
       for (let i = 0; i < this.recordInfo.tableList.length; i++) {
635 646
         if (this.currentIndex == i) {
636 647
           this.recordInfo.tableList[i].project_id = val.id;
@@ -638,8 +649,7 @@ export default {
638 649
           this.recordInfo.tableList[i].name = val.name;
639 650
           this.recordInfo.tableList[i].supply_name = val.supply_name;
640 651
           this.recordInfo.tableList[i].supply_type = val.supply_type;
641
-          this.recordInfo.tableList[i].supply_specification_name =
642
-            val.supply_specification_name;
652
+          this.recordInfo.tableList[i].supply_specification_name = val.supply_specification_name;
643 653
           this.recordInfo.tableList[i].supply_total = val.supply_total;
644 654
           if (val.supply_count == NaN) {
645 655
             this.recordInfo.tableList[i].supply_count = "";
@@ -663,6 +673,19 @@ export default {
663 673
           this.recordInfo.tableList[i].supply_unit = val.supply_unit;
664 674
           this.recordInfo.tableList[i].unitList = val.unitList;
665 675
           this.recordInfo.tableList[i].count = val.count
676
+          this.recordInfo.tableList[i].sum_count = val.sum_count
677
+          
678
+          if(val.type == 1){
679
+            this.recordInfo.tableList[i].min_number = val.min_number
680
+            this.recordInfo.tableList[i].max_unit = val.max_unit
681
+            this.recordInfo.tableList[i].min_unit = val.min_unit
682
+          }else{
683
+             this.recordInfo.tableList[i].max_unit = ""
684
+             this.recordInfo.tableList[i].min_unit = ""
685
+             this.recordInfo.tableList[i].min_number = ""
686
+          }
687
+          
688
+         
666 689
         }
667 690
       }
668 691
     },
@@ -698,6 +721,10 @@ export default {
698 721
       tempObj["good_number"] = ""
699 722
       tempObj["deposit_rate"] = ""
700 723
       tempObj["order_number"] = ""
724
+      tempObj["sum_count"] =0
725
+      tempObj["min_number"] = 0
726
+      tempObj["max_unit"] = ""
727
+      tempObj["min_unit"] = ""
701 728
       this.recordInfo.tableList.push(tempObj);
702 729
     },
703 730
     handleDelete: function (index, row) {
@@ -744,6 +771,7 @@ export default {
744 771
       var min_str = "";
745 772
       if (arr.length > 0) {
746 773
         for (let i = 0; i < arr.length; i++) {
774
+
747 775
           total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
748 776
         }
749 777
       }
@@ -764,6 +792,15 @@ export default {
764 792
       }
765 793
       return max_str + min_str;
766 794
     },
795
+    getWarehoseInfoTwo(arr, max_unit, min_unit, min_number){
796
+      var total = 0;
797
+      if (arr.length > 0) {
798
+        for (let i = 0; i < arr.length; i++) {
799
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
800
+        }
801
+      }
802
+      return total
803
+    },
767 804
     getTotalStockCount(arr) {
768 805
       var total_count = 0;
769 806
       for (let i = 0; i < arr.length; i++) {
@@ -775,6 +812,14 @@ export default {
775 812
         return ""
776 813
       }
777 814
     
815
+    },
816
+    getTotalStockCountTwo(arr) {
817
+      var total_count = 0;
818
+      for (let i = 0; i < arr.length; i++) {
819
+        total_count += arr[i].stock_count;
820
+      }
821
+      return total_count
822
+    
778 823
     },
779 824
     calculate: function (val) {
780 825
       if (isNaN(val)) {
@@ -893,6 +938,53 @@ export default {
893 938
     count_arrearage() {
894 939
       this.payment = this.total_price - this.arrearage;
895 940
     },
941
+    getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
942
+     console.log("val23322323",supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit)
943
+      var total_count = 0
944
+      
945
+      if(type == 1){
946
+       if(supply_unit == max_unit){
947
+          total_count = supply_count * min_number
948
+       }
949
+       if(supply_unit == min_unit){
950
+         total_count = supply_count
951
+       }
952
+       console.log("sum_counts",sum_count)
953
+       console.log("count232232332",total_count)
954
+       if(total_count > sum_count){
955
+         this.$message.error("数量不能大于可退数量!")
956
+         for(let i=0;i<this.recordInfo.tableList.length;i++){
957
+           if(index == i){
958
+             this.recordInfo.tableList[i].supply_count = ""
959
+           }
960
+         }
961
+       }else{
962
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
963
+            if(index == i){
964
+              this.recordInfo.tableList[i].supply_count = supply_count
965
+            }
966
+          }
967
+         }
968
+      }
969
+       
970
+      if(type == 2){
971
+         if(supply_count > sum_count){
972
+          this.$message.error("数量不能大于可退数量!")
973
+          for(let i=0;i<this.recordInfo.tableList.length;i++){
974
+            if(index == i){
975
+              this.recordInfo.tableList[i].supply_count = ""
976
+            }
977
+          }
978
+         }else{
979
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
980
+            if(index == i){
981
+              this.recordInfo.tableList[i].supply_count = supply_count
982
+            }
983
+          }
984
+         }
985
+      }
986
+    
987
+    },
896 988
     getGoodReturnDetail() {
897 989
       var id = this.$route.query.id;
898 990
       getGoodReturnDetail(id).then((response) => {
@@ -921,7 +1013,6 @@ export default {
921 1013
           for (let i = 0; i < orderInfo.length; i++) {
922 1014
             orderInfo[i].id = orderInfo[i].id;
923 1015
             orderInfo[i].supply_count = orderInfo[i].supply_count;
924
-            orderInfo[i].count = orderInfo[i].count;
925 1016
             orderInfo[i].supply_price = orderInfo[i].price;
926 1017
             orderInfo[i].supply_remake = orderInfo[i].remark;
927 1018
             orderInfo[i].type = orderInfo[i].is_source;
@@ -937,11 +1028,9 @@ export default {
937 1028
             if (orderInfo[i].is_source == 1) {
938 1029
               for (let j = 0; j < drugList.length; j++) {
939 1030
                 if (orderInfo[i].project_id == drugList[j].id) {
1031
+                  
940 1032
                   if (drugList[j].max_unit != drugList[j].min_unit) {
941
-                    orderInfo[i].unitList = [
942
-                      { id: 1, name: "" },
943
-                      { id: 2, name: "" },
944
-                    ];
1033
+                    orderInfo[i].unitList = [{ id: 1, name: "" },{ id: 2, name: "" }];
945 1034
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
946 1035
                     orderInfo[i].unitList[1].name = drugList[j].min_unit;
947 1036
                   }
@@ -949,8 +1038,19 @@ export default {
949 1038
                     orderInfo[i].unitList = [{ id: 1, name: "" }];
950 1039
                     orderInfo[i].unitList[0].name = drugList[j].max_unit;
951 1040
                   }
1041
+                  //用来统计数量比大小
1042
+                  if(orderInfo[i].supply_unit == drugList[j].max_unit){
1043
+                    orderInfo[i].sum_count = orderInfo[i].count*drugList[j].min_number
1044
+                  }
1045
+                  if(orderInfo[i].supply_unit == drugList[j].min_unit){
1046
+                     orderInfo[i].sum_count = orderInfo[i].count
1047
+                  }
1048
+                  orderInfo[i].min_number =  drugList[j].min_number
1049
+                  orderInfo[i].max_unit =drugList[j].max_unit
1050
+                  orderInfo[i].min_unit =drugList[j].min_unit
952 1051
                 }
953 1052
               }
1053
+              orderInfo[i].count = orderInfo[i].count + orderInfo[i].supply_unit
954 1054
             }
955 1055
             if (orderInfo[i].is_source == 2) {
956 1056
               for (let j = 0; j < goodList.length; j++) {
@@ -959,10 +1059,16 @@ export default {
959 1059
                   orderInfo[i].unitList[0].name = goodList[j].packing_unit;
960 1060
                 }
961 1061
               }
1062
+              orderInfo[i].sum_count = orderInfo[i].count
1063
+              orderInfo[i].min_number = 0
1064
+              orderInfo[i].count = orderInfo[i].count;
1065
+              orderInfo[i].max_unit =""
1066
+              orderInfo[i].min_unit =""
962 1067
             }
963 1068
           }
964 1069
 
965 1070
           this.recordInfo.tableList = [];
1071
+          console.log("or233232332233223233223",orderInfo)
966 1072
           this.recordInfo.tableList = orderInfo;
967 1073
         }
968 1074
       });
@@ -977,6 +1083,11 @@ export default {
977 1083
         if (valid) {
978 1084
           this.loading = true;
979 1085
           for (let i = 0; i < this.recordInfo.tableList.length; i++) {
1086
+            if(this.recordInfo.tableList[i].count == ""){
1087
+              this.$message.error(this.recordInfo.tableList[i].name+"无可退库数量,保存失败!")
1088
+              this.loading = false
1089
+              return false
1090
+            }
980 1091
             this.recordInfo.tableList[i].supply_count = parseInt(
981 1092
               this.recordInfo.tableList[i].supply_count
982 1093
             );
@@ -1008,7 +1119,7 @@ export default {
1008 1119
             return_marke: this.return_remark,
1009 1120
           };
1010 1121
           console.log("parms32322332",params)
1011
-         
1122
+          
1012 1123
           updateGoodReturn(
1013 1124
             params,
1014 1125
             warehouse_out_id,
@@ -1114,6 +1225,10 @@ export default {
1114 1225
     tempObj["good_number"] = ""
1115 1226
     tempObj["deposit_rate"] = ""
1116 1227
     tempObj["order_number"] = ""
1228
+    tempObj["sum_count"] = 0
1229
+    tempObj["min_number"] = 0
1230
+    tempObj["max_unit"] = ""
1231
+    tempObj["min_unit"] = ""
1117 1232
     this.recordInfo.tableList.push(tempObj);
1118 1233
     this.getInitOrder();
1119 1234
 

+ 10 - 3
src/xt_pages/supply/purchaseOrderQuery.vue View File

@@ -128,10 +128,17 @@
128 128
             <!-- <span v-if="scope.row.is_warehouse == 1">全部入库</span>
129 129
             <span v-if="scope.row.is_warehouse == 2">未入库</span>
130 130
             <span v-if="scope.row.is_warehouse == 3">部分入库</span> -->
131
-            <span v-if="scope.row.orderOut!= undefined && scope.row.orderOut.length == 0">未入库</span> 
131
+          
132 132
             <span v-if="scope.row.orderOut!= undefined && scope.row.orderOut.length > 0">
133
-            <span v-if="getStatus(scope.row.orderOut) >= getAllCount(scope.row.orderInfo) ">全部入库</span> 
134
-            <span v-if="getStatus(scope.row.orderOut) < getAllCount(scope.row.orderInfo) ">部分入库</span> 
133
+              <span >
134
+                <span v-if="getStatus(scope.row.orderOut) == 0">未入库</span>
135
+                <span v-if="getStatus(scope.row.orderOut) > 0">
136
+                  <span v-if="getStatus(scope.row.orderOut) >= getAllCount(scope.row.orderInfo) ">全部入库</span> 
137
+                  <span v-if="getStatus(scope.row.orderOut) < getAllCount(scope.row.orderInfo) ">部分入库</span>
138
+                </span>
139
+              </span> 
140
+              
141
+              
135 142
             </span> 
136 143
           </template>
137 144
         </el-table-column>