XMLWAN 2 anni fa
parent
commit
07537412c1

+ 7 - 5
src/xt_pages/stock/drugs/drugStockOutOrder.vue Vedi File

@@ -235,7 +235,11 @@
235 235
             {{getHouseName(scope.row.storehouse_id)}}
236 236
           </template>
237 237
         </el-table-column>
238
-
238
+         <!-- <el-table-column label="剩余库存" align="center" v-if="is_sys == 0">
239
+            <template slot-scope="scope">
240
+              {{scope.row.stock_count}}
241
+            </template>
242
+          </el-table-column> -->
239 243
           <el-table-column label="出库数量" align="center">
240 244
             <template slot-scope="scope">
241 245
               <span> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
@@ -252,9 +256,9 @@
252 256
               <span v-if="scope.row.price == 0"> {{scope.row.retail_price}}</span>
253 257
             </template>
254 258
           </el-table-column>
255
-          <!-- <el-table-column label="拆零零售价" align="center">
259
+          <!-- <el-table-column label="进货价" align="center" v-if="is_sys == 0">
256 260
             <template slot-scope="scope">
257
-              {{scope.row.retail_price}}
261
+              {{scope.row.last_price}}
258 262
             </template>
259 263
           </el-table-column> -->
260 264
           <el-table-column label="总价" align="center">
@@ -1010,7 +1014,6 @@ export default {
1010 1014
          }
1011 1015
          if(is_sys == 0 || is_sys == 12){
1012 1016
             var flowlist = response.data.data.flowlist
1013
-            console.log("flowlist233232232323233223",flowlist)
1014 1017
             this.drugFlowList = []
1015 1018
             for(let i=0;i<flowlist.length;i++){
1016 1019
               if(flowlist[i].count_unit == flowlist[i].max_unit){
@@ -1022,7 +1025,6 @@ export default {
1022 1025
               }
1023 1026
             }
1024 1027
             this.drugFlowList = flowlist
1025
-            console.log("this.drugFlowList32323232322323323232322323我的",flowlist)
1026 1028
 
1027 1029
          }
1028 1030
 

+ 169 - 6
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Vedi File

@@ -117,6 +117,28 @@
117 117
               </el-form-item>
118 118
             </template>
119 119
           </el-table-column>
120
+
121
+
122
+          <!-- <el-table-column width="150" align="center">
123
+            <template slot="header" slot-scope="scope">
124
+              <span>剩余库存</span>
125
+            </template>
126
+            <template slot-scope="scope">
127
+              <el-form-item
128
+                :rules="tableRules.stock_count"
129
+                style="padding-top: 20px"
130
+              >
131
+                <div>
132
+                  <el-input
133
+                    :disabled="true"
134
+                    style="width:120px"
135
+                    placeholder="剩余库存"
136
+                    v-model="scope.row.stock_count"
137
+                  ></el-input>
138
+                </div>
139
+              </el-form-item>
140
+            </template>
141
+          </el-table-column> -->
120 142
           
121 143
           <el-table-column width="200" align="center">
122 144
             <template slot="header" slot-scope="scope">
@@ -130,13 +152,14 @@
130 152
               >
131 153
                 <div style="display:flex;">
132 154
                   <el-input
155
+                    @input="getSupplyCount(scope.row.count,scope.row.max_unit,scope.row.min_number,scope.$index,scope.row.total_count,scope.row.max_unit_fisrt,scope.row.min_unit_fisrt)"
133 156
                     oninput="value=value.replace(/\D|^0/g,'')"
134 157
                     style="width:80px"
135 158
                     placeholder="请输入出库数量"
136 159
                     type="number"
137 160
                     v-model="scope.row.count"
138 161
                   ></el-input>
139
-                  <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px" @change="changeUnit(scope.row)">
162
+                  <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px" @change="changeUnit(scope.row,scope.$index)">
140 163
                     <el-option
141 164
                       v-for="(option, index) in unitList"
142 165
                       :key="index"
@@ -164,6 +187,26 @@
164 187
             </template>
165 188
           </el-table-column>
166 189
 
190
+           <!-- <el-table-column width="120" align="center">
191
+            <template slot="header" slot-scope="scope">
192
+              <span>进货价</span>
193
+            </template>
194
+            <template slot-scope="scope">
195
+            
196
+              <el-form-item
197
+                :rules="tableRules.last_price"
198
+                style="padding-top: 20px"
199
+              >
200
+                <el-input
201
+                 :disabled="true"
202
+                  placeholder="进货价"
203
+                  type="number"
204
+                  v-model="scope.row.last_price"
205
+                ></el-input>
206
+              </el-form-item>
207
+            </template>
208
+          </el-table-column> -->
209
+
167 210
           <el-table-column width="120" align="center">
168 211
             <template slot="header" slot-scope="scope">
169 212
               <span>出货价<span style="color: red">*</span></span>
@@ -454,6 +497,11 @@ export default {
454 497
       tempObj["dealer"] = ""
455 498
       tempObj['manufacturer'] = ''
456 499
       tempObj["admin_user_id"] =  this.$store.getters.xt_user.user.user_name
500
+      tempObj["last_price"] = ""
501
+      tempObj["stock_count"] = ""
502
+      tempObj["total_count"] = 0
503
+      tempObj["max_unit_fisrt"] = 0
504
+      tempObj["min_unit_fisrt"] = 0
457 505
       this.recordInfo.recordData.push(tempObj);
458 506
     },
459 507
     handleDelete: function(index, row) {
@@ -590,13 +638,14 @@ export default {
590 638
 
591 639
             }
592 640
 
641
+            this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].last_price.toString()
642
+            this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
643
+
593 644
           }
594 645
           const params = {
595 646
             stockOut: this.recordInfo.recordData
596 647
           };
597 648
        
598
-          console.log("parasm2233223233232233232",params)
599
-        
600 649
           const loading = this.$loading({
601 650
             lock: true,
602 651
             text: 'Loading',
@@ -696,7 +745,9 @@ export default {
696 745
         this.currentIndex = val
697 746
       },
698 747
       handleSelect(val){
748
+       
699 749
         var arr = []
750
+
700 751
          for(let i=0;i<this.recordInfo.recordData.length;i++){
701 752
             arr.push(this.recordInfo.recordData[i].drug_id)
702 753
          }
@@ -707,6 +758,18 @@ export default {
707 758
             return
708 759
          }
709 760
          this.getDrugBatchNumber(val.id)
761
+        
762
+        var str_count = ""
763
+        var total_count = 0
764
+        for(let i=0;i<val.drug_warehouse_info.length;i++){
765
+           if(val.max_unit == val.drug_warehouse_info[i].max_unit){
766
+             val.drug_warehouse_info[i].stock_max_number = val.drug_warehouse_info[i].stock_max_number * val.min_number
767
+           }
768
+        }
769
+       
770
+       str_count =  this.getWarehoseInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
771
+       total_count = this.getWarehoseInfoTwo(val.drug_warehouse_info)
772
+     
710 773
         for(let i=0;i<this.recordInfo.recordData.length;i++){
711 774
           if(this.currentIndex == i){
712 775
             this.recordInfo.recordData[i].drug_id = val.id
@@ -721,6 +784,11 @@ export default {
721 784
             this.recordInfo.recordData[i].number = val.number
722 785
             this.recordInfo.recordData[i].unit = val.max_unit
723 786
             this.recordInfo.recordData[i].retail_price = val.retail_price
787
+            this.recordInfo.recordData[i].last_price = val.last_price
788
+            this.recordInfo.recordData[i].stock_count = str_count
789
+            this.recordInfo.recordData[i].total_count = total_count
790
+            this.recordInfo.recordData[i].max_unit_fisrt = val.max_unit
791
+            this.recordInfo.recordData[i].min_unit_fisrt = val.min_unit
724 792
             if(val.retail_price == 0){
725 793
               this.recordInfo.recordData[i].price = ""
726 794
             }else{
@@ -754,8 +822,9 @@ export default {
754 822
            }
755 823
         })
756 824
       },
757
-      changeUnit(val){
758
-       
825
+      changeUnit(val,index){
826
+        console.log("vla33232233232323232",val)
827
+
759 828
         this.getDrugBatchNumber(val.drug_id)
760 829
         for(let i=0;i<this.recordInfo.recordData.length;i++){
761 830
           if(this.recordInfo.recordData[i].drug_id == val.drug_id){
@@ -773,7 +842,32 @@ export default {
773 842
             }
774 843
           }
775 844
         }
776
-        console.log('23323223333233232',this.recordInfo.recordData)
845
+
846
+        var count_total = 0
847
+        if(val.max_unit == val.max_unit_fisrt){
848
+          count_total = val.count * val.min_number
849
+        }
850
+
851
+        if(val.max_unit == val.min_unit_fisrt){
852
+          count_total = val.count 
853
+        }
854
+        if(count_total > val.total_count){
855
+          this.$message.error("出库数量不能大于剩余库存")
856
+          for(let i=0;i<this.recordInfo.recordData.length;i++){
857
+            if(index == i){
858
+                this.recordInfo.recordData[i].count = ""
859
+            }
860
+          }
861
+        }else{
862
+          for(let i=0;i<this.recordInfo.recordData.length;i++){
863
+            if(index == i){
864
+                this.recordInfo.recordData[i].count = val.count
865
+            }
866
+          } 
867
+        }
868
+     
869
+
870
+       
777 871
       },
778 872
       changeBatchNumber(val){
779 873
        
@@ -788,7 +882,71 @@ export default {
788 882
               }
789 883
             }
790 884
         }
885
+      },
886
+
887
+     getWarehoseInfo(arr, max_unit, min_unit, min_number) {
888
+      var total = 0;
889
+      var max_str = "";
890
+      var min_str = "";
891
+      if (arr.length > 0) {
892
+        for (let i = 0; i < arr.length; i++) {
893
+
894
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
895
+        }
896
+      }
897
+      if (total < min_number) {
898
+        min_str = total + min_unit;
899
+      }
900
+      if (total == 0) {
901
+        min_str = "";
902
+        max_str = "";
903
+      }
904
+      if (total >= min_number) {
905
+        if (parseInt(total / min_number) != 0) {
906
+          max_str = parseInt(total / min_number) + max_unit;
907
+        }
908
+        if (total % min_number != 0) {
909
+          min_str = (total % min_number) + min_unit;
910
+        }
911
+      }
912
+      return max_str + min_str;
913
+    },
914
+    getWarehoseInfoTwo(arr){
915
+      var total = 0;
916
+      if (arr.length > 0) {
917
+        for (let i = 0; i < arr.length; i++) {
918
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
919
+        }
920
+      }
921
+      return total
922
+    },
923
+    getSupplyCount(count,max_unit,min_number,index,total_count,max_unit_fisrt,min_unit_fisrt){
924
+     
925
+      var count_total = 0
926
+      if(max_unit == max_unit_fisrt){
927
+        count_total = count * min_number
928
+      }
929
+
930
+      if(max_unit == min_unit_fisrt){
931
+        count_total = count 
932
+      }
933
+
934
+      if(count_total > total_count){
935
+        this.$message.error("出库数量不能大于剩余库存")
936
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
937
+           if(index == i){
938
+              this.recordInfo.recordData[i].count = ""
939
+           }
940
+        }
941
+      }else{
942
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
943
+           if(index == i){
944
+              this.recordInfo.recordData[i].count = count
945
+           }
946
+        } 
791 947
       }
948
+     console.log("count_toal23233232",count_total)
949
+    }
792 950
   },
793 951
   created() {
794 952
     this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
@@ -821,6 +979,11 @@ export default {
821 979
     tempObj["count"] = ""
822 980
     tempObj["admin_user_id"] =  this.$store.getters.xt_user.user.user_name
823 981
     tempObj["retail_price"] = 0;
982
+    tempObj["last_price"] = ""
983
+    tempObj["stock_count"] = ""
984
+    tempObj["total_count"] = 0
985
+    tempObj["max_unit_fisrt"] = 0
986
+    tempObj["min_unit_fisrt"] = 0
824 987
     this.recordInfo.recordData.push(tempObj);
825 988
     this.GetConfigInfo();
826 989
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 138 - 2
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Vedi File

@@ -126,6 +126,27 @@
126 126
                   </el-form-item>
127 127
               </template>
128 128
           </el-table-column> -->
129
+<!--          
130
+         <el-table-column width="150" align="center">
131
+            <template slot="header" slot-scope="scope">
132
+              <span>剩余库存</span>
133
+            </template>
134
+            <template slot-scope="scope">
135
+              <el-form-item
136
+                :rules="tableRules.stock_count"
137
+                style="padding-top: 20px"
138
+              >
139
+                <div>
140
+                  <el-input
141
+                    :disabled="true"
142
+                    style="width:120px"
143
+                    placeholder="剩余库存"
144
+                    v-model="scope.row.stock_count"
145
+                  ></el-input>
146
+                </div>
147
+              </el-form-item>
148
+            </template>
149
+          </el-table-column> -->
129 150
            <el-table-column width="200" align="center">
130 151
             <template slot="header" slot-scope="scope">
131 152
               <span>出库数量<span style="color: red">*</span></span>
@@ -138,12 +159,14 @@
138 159
               >
139 160
                 <div style="display:flex;">
140 161
                   <el-input
162
+                   @input="getSupplyCount(scope.row.count,scope.row.max_unit,scope.row.min_number,scope.$index,scope.row.total_count,scope.row.max_unit_fisrt,scope.row.min_unit_fisrt)"
141 163
                    oninput="value=value.replace(/\D|^0/g,'')"
142 164
                    style="width:100px"
143 165
                    :disabled="drug_show"
144 166
                     placeholder="请输入出库数量"
145 167
                     type="number"
146 168
                     v-model="scope.row.count"
169
+
147 170
                   ></el-input>
148 171
                   <el-select v-model="scope.row.count_unit" filterable placeholder="请选择单位" style="width:80px" :disabled="unitShow">
149 172
                     <el-option
@@ -170,6 +193,26 @@
170 193
                </el-select>
171 194
             </template>
172 195
           </el-table-column>
196
+        
197
+          <!-- <el-table-column width="120" align="center">
198
+            <template slot="header" slot-scope="scope">
199
+              <span>进货价</span>
200
+            </template>
201
+            <template slot-scope="scope">
202
+            
203
+              <el-form-item
204
+                :rules="tableRules.last_price"
205
+                style="padding-top: 20px"
206
+              >
207
+                <el-input
208
+                 :disabled="true"
209
+                  placeholder="进货价"
210
+                  type="number"
211
+                  v-model="scope.row.last_price"
212
+                ></el-input>
213
+              </el-form-item>
214
+            </template>
215
+          </el-table-column> -->
173 216
          <el-table-column width="120" align="center">
174 217
             <template slot="header" slot-scope="scope">
175 218
               <span>出货价<span style="color: red">*</span></span>
@@ -486,15 +529,22 @@
486 529
         tempObj['drug_id'] = 0
487 530
         tempObj['retail_price'] = ''
488 531
         tempObj['count'] = ''
532
+        tempObj['max_unit'] = ''
533
+        tempObj['min_unit'] = ''
489 534
         tempObj['price'] = ''
490 535
         tempObj['remark'] = ''
491 536
         tempObj['batch_number'] = ''
492 537
         tempObj['number'] = ''
493
-        tempObj['count_unit'] = ""
538
+        tempObj['count_unit'] = ''
494 539
         tempObj['dealer'] = ""
495 540
         tempObj['manufacturer'] = ""
496 541
         tempObj['warehouse_info_id'] = 0
497 542
         tempObj["admin_user_id"] =  this.$store.getters.xt_user.user.user_name
543
+        tempObj["last_price"] = ""
544
+        tempObj["stock_count"] = ""
545
+        tempObj["total_count"] = 0
546
+        tempObj["max_unit_fisrt"] = 0
547
+        tempObj["min_unit_fisrt"] = 0
498 548
         this.recordInfo.recordData.push(tempObj)
499 549
       }, handleDelete: function(index, row) {
500 550
         if(parseInt(this.$route.query.is_sys) == 12){
@@ -645,6 +695,8 @@
645 695
                   }
646 696
 
647 697
                }
698
+               this.recordInfo.recordData[i].last_price = this.recordInfo.recordData[i].last_price.toString()
699
+               this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
648 700
             }
649 701
             const loading = this.$loading({
650 702
               lock: true,
@@ -720,6 +772,8 @@
720 772
               response.data.data.list[i].price = response.data.data.list[i].price.toString()
721 773
               response.data.data.list[i].retail_price = response.data.data.list[i].price.toString()
722 774
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
775
+
776
+            
723 777
               if(response.data.data.list[i].dealer == "0" || response.data.data.list[i].dealer == 0){
724 778
                   response.data.data.list[i].dealer = ""
725 779
               }else{
@@ -728,6 +782,9 @@
728 782
 
729 783
               response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,"{y}-{h}-{d}")
730 784
               response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,"{y}-{h}-{d}")
785
+
786
+              response.data.data.list[i].stock_count = response.data.data.list[i].stock_count
787
+              response.data.data.list[i].last_price = response.data.data.list[i].last_price
731 788
               this.recordInfo.recordData.push(response.data.data.list[i])
732 789
             }
733 790
              for(let j=0;j<this.recordInfo.recordData.length;j++){
@@ -819,6 +876,16 @@
819 876
             return
820 877
          }
821 878
          this.getDrugBatchNumber(val.id)
879
+          var str_count = ""
880
+          var total_count = 0
881
+          for(let i=0;i<val.drug_warehouse_info.length;i++){
882
+            if(val.max_unit == val.drug_warehouse_info[i].max_unit){
883
+              val.drug_warehouse_info[i].stock_max_number = val.drug_warehouse_info[i].stock_max_number * val.min_number
884
+            }
885
+          }
886
+        
887
+        str_count =  this.getWarehoseInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
888
+        total_count = this.getWarehoseInfoTwo(val.drug_warehouse_info)
822 889
          for(let i=0;i<this.recordInfo.recordData.length;i++){
823 890
            if(i == this.currentIndex){
824 891
              this.recordInfo.recordData[i].drug_id  = val.id
@@ -830,6 +897,12 @@
830 897
              this.recordInfo.recordData[i].number = val.number
831 898
              this.recordInfo.recordData[i].max_unit = val.max_unit
832 899
              this.recordInfo.recordData[i].min_unit = val.min_unit
900
+             this.recordInfo.recordData[i].last_price = val.last_price
901
+             this.recordInfo.recordData[i].stock_count = str_count
902
+             this.recordInfo.recordData[i].total_count = total_count
903
+             this.recordInfo.recordData[i].max_unit_fisrt = val.max_unit
904
+             this.recordInfo.recordData[i].min_unit_fisrt = val.min_unit
905
+             this.recordInfo.recordData[i].count_unit = val.max_unit
833 906
              if(val.dealer == 0){
834 907
                this.recordInfo.recordData[i].dealer = ""
835 908
              }else{
@@ -849,14 +922,77 @@
849 922
           var params = {
850 923
             id:id
851 924
           }
852
-        getDrugBatchNumber(params).then(response=>{
925
+     getDrugBatchNumber(params).then(response=>{
853 926
            if(response.data.state == 1){
854 927
              var list = response.data.data.list
855 928
 
856 929
              this.numberList = list
857 930
            }
858 931
         })
932
+      },
933
+    getWarehoseInfo(arr, max_unit, min_unit, min_number) {
934
+      var total = 0;
935
+      var max_str = "";
936
+      var min_str = "";
937
+      if (arr.length > 0) {
938
+        for (let i = 0; i < arr.length; i++) {
939
+
940
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
941
+        }
859 942
       }
943
+      if (total < min_number) {
944
+        min_str = total + min_unit;
945
+      }
946
+      if (total == 0) {
947
+        min_str = "";
948
+        max_str = "";
949
+      }
950
+      if (total >= min_number) {
951
+        if (parseInt(total / min_number) != 0) {
952
+          max_str = parseInt(total / min_number) + max_unit;
953
+        }
954
+        if (total % min_number != 0) {
955
+          min_str = (total % min_number) + min_unit;
956
+        }
957
+      }
958
+      return max_str + min_str;
959
+    },
960
+    getWarehoseInfoTwo(arr){
961
+      var total = 0;
962
+      if (arr.length > 0) {
963
+        for (let i = 0; i < arr.length; i++) {
964
+          total += parseInt(arr[i].stock_max_number+ arr[i].stock_min_number);
965
+        }
966
+      }
967
+      return total
968
+    },
969
+    getSupplyCount(count,max_unit,min_number,index,total_count,max_unit_fisrt,min_unit_fisrt){
970
+     
971
+      var count_total = 0
972
+      if(max_unit == max_unit_fisrt){
973
+        count_total = count * min_number
974
+      }
975
+
976
+      if(max_unit == min_unit_fisrt){
977
+        count_total = count 
978
+      }
979
+
980
+      if(count_total > total_count){
981
+        this.$message.error("出库数量不能大于剩余库存")
982
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
983
+           if(index == i){
984
+              this.recordInfo.recordData[i].count = ""
985
+           }
986
+        }
987
+      }else{
988
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
989
+           if(index == i){
990
+              this.recordInfo.recordData[i].count = count
991
+           }
992
+        } 
993
+      }
994
+     console.log("count_toal23233232",count_total)
995
+    }
860 996
     },
861 997
     created() {
862 998
       this.drugTypeList = getDictionaryDataConfig('system','drug_type')

+ 0 - 3
src/xt_pages/stock/stockModifyPrice.vue Vedi File

@@ -666,12 +666,9 @@ export default {
666 666
          var params= {
667 667
            tableData:this.tableData,
668 668
          }
669
-      
670
-      console.log("parasm222",params)
671 669
       saveAdjustPrice(params).then(response=>{
672 670
         if(response.data.state == 1){
673 671
           var msg =  response.data.data.msg
674
-          console.log("msg",msg)
675 672
           this.$message.success("保存成功!")
676 673
           this.dialogVisible = false
677 674
           this.tableData = []

+ 27 - 21
src/xt_pages/stock/stockOutOrder.vue Vedi File

@@ -229,6 +229,11 @@
229 229
               {{getHouseName(scope.row.storehouse_id)}}
230 230
             </template>
231 231
           </el-table-column>
232
+          <!-- <el-table-column label="剩余库存" align="center" v-if="is_sys== 0">
233
+            <template slot-scope="scope">
234
+              <span>{{scope.row.stock_count}}</span>
235
+            </template>
236
+          </el-table-column> -->
232 237
          
233 238
           <el-table-column label="出库数量" align="center">
234 239
             <template slot-scope="scope">
@@ -241,6 +246,11 @@
241 246
              {{getXuserName(scope.row.admin_user_id)}}
242 247
             </template>
243 248
           </el-table-column>
249
+          <!-- <el-table-column label="进货价" align="center" v-if="is_sys== 0">
250
+            <template slot-scope="scope">
251
+              <span>{{scope.row.buy_price}}</span>
252
+            </template>
253
+          </el-table-column> -->
244 254
           <el-table-column label="出货价" align="center">
245 255
             <template slot-scope="scope">
246 256
               <span v-if="scope.row.price >0">{{ scope.row.price}}</span> 
@@ -926,7 +936,7 @@ export default {
926 936
     },
927 937
     fetchAllAdminUsers() {
928 938
       fetchAllAdminUsers().then(response => {
929
-        console.log(response);
939
+       
930 940
         if (response.data.state == 1) {
931 941
           this.adminUserOptions = response.data.data.users;
932 942
           var alen = this.adminUserOptions.length;
@@ -1073,7 +1083,7 @@ export default {
1073 1083
       for(let i=0;i<selection.length;i++){
1074 1084
         ids.push(selection[i].id)
1075 1085
       }
1076
-      console.log("ids",ids)
1086
+
1077 1087
       this.exportList = []
1078 1088
       this.order_id = ids.join(",")
1079 1089
       this.warehouse_out_time = selection[0].warehouse_out_time
@@ -1082,7 +1092,7 @@ export default {
1082 1092
 
1083 1093
     },
1084 1094
     batchDelete() {
1085
-      console.log("this.selectedTableData",this.selectedTableData)
1095
+     
1086 1096
       
1087 1097
       if (this.selectedTableData.length <= 0) {
1088 1098
         this.$message.error("请选择要删除的记录");
@@ -1160,7 +1170,7 @@ export default {
1160 1170
             if(response.data.state == 1){
1161 1171
               this.tableShow = true
1162 1172
               var list = response.data.data.list          
1163
-              console.log("info2232323",list)
1173
+             
1164 1174
               this.tableList = []
1165 1175
               for(let i=0;i<list.length;i++){
1166 1176
                 // if(list[i].dealer == 0){
@@ -1245,9 +1255,7 @@ export default {
1245 1255
               is_total: 1,
1246 1256
               total: total,
1247 1257
             })
1248
-            // this.type_name = this.userList[0].type.type_name
1249
-            // this.specification_name = this.userList[0].info.specification_name
1250
-            console.log("详情数据区",this.userList)
1258
+        
1251 1259
             this.editdialogVisibleThree = true
1252 1260
           }
1253 1261
         })
@@ -1294,9 +1302,9 @@ export default {
1294 1302
         GetOutStockTotalCount(params).then(response=>{
1295 1303
            if(response.data.state == 1){
1296 1304
               var stockCount = response.data.data.stockCount
1297
-              console.log("出库数量2323",stockCount)
1305
+             
1298 1306
               this.stockCount = stockCount
1299
-              // this.dialogVisible = true
1307
+            
1300 1308
            }
1301 1309
         })
1302 1310
       },
@@ -1328,7 +1336,7 @@ export default {
1328 1336
         const params = {
1329 1337
           'id': order_id
1330 1338
         }
1331
-        console.log("触发了222222",order_id)
1339
+
1332 1340
         getWarehouseOutInfo(params).then(response => {
1333 1341
          if (response.data.state == 0) {
1334 1342
             this.$message.error(response.data.msg)
@@ -1535,7 +1543,7 @@ export default {
1535 1543
         this.$refs['tableForm'].validate((valid) => {
1536 1544
           if (valid) {
1537 1545
             const array = this.recordInfo.recordData
1538
-            console.log("$arr3333333333",array)
1546
+
1539 1547
             for (let i = 0; i < array.length; i++) {
1540 1548
               if (array[i].good_type_id == 0) {
1541 1549
                 this.$message.error('商品类型不能为空')
@@ -1583,9 +1591,9 @@ export default {
1583 1591
               var arrList =  this.unique(list)
1584 1592
               var info = response.data.data.info
1585 1593
               this.infoList = info
1586
-              console.log("info列表22222222",info)
1594
+             
1587 1595
               var stockflowlist = response.data.data.stockFlowList
1588
-              console.log("stockflowlist",stockflowlist)
1596
+ 
1589 1597
               this.stockFlowList = stockflowlist
1590 1598
              
1591 1599
 
@@ -1599,8 +1607,6 @@ export default {
1599 1607
                 is_total: 1,
1600 1608
                 total: total,
1601 1609
               })
1602
-
1603
-              console.log("详情数据区",this.userList)
1604 1610
               if(val.is_sys == 1){
1605 1611
                 this.editdialogVisibleThree = true
1606 1612
               }
@@ -1619,7 +1625,7 @@ export default {
1619 1625
             arr.push(...this.userList[i].warehouseOutInfo)
1620 1626
           }
1621 1627
         }
1622
-        console.log("arr",arr)
1628
+      
1623 1629
         if(arr.length > 0){
1624 1630
           for(let i=0;i<arr.length;i++){
1625 1631
               ids.push(arr[i].number)
@@ -1641,12 +1647,12 @@ export default {
1641 1647
            "start_time":this.start_time,
1642 1648
            "end_time":this.end_time,
1643 1649
          }
1644
-        console.log('parasm22',params)
1650
+       
1645 1651
        getOutExportList(params).then(response=>{
1646 1652
           if(response.data.state == 1){
1647 1653
             var list = response.data.data.list
1648 1654
             var outCount = response.data.data.outCount
1649
-            console.log("outCount",outCount)
1655
+        
1650 1656
             for(let i=0;i<list.length;i++){
1651 1657
                list[i].unit = list[i].specification_name +"/" + list[i].packing_unit
1652 1658
                list[i].total_price = (list[i].total_count * list[i].price).toFixed(2)
@@ -1668,7 +1674,7 @@ export default {
1668 1674
                  }
1669 1675
               } 
1670 1676
             }
1671
-            console.log("导出list222222",list)
1677
+           
1672 1678
             this.exportList = list
1673 1679
           }
1674 1680
         })
@@ -1679,7 +1685,7 @@ export default {
1679 1685
          return
1680 1686
         }
1681 1687
         import('@/vendor/Export2Excel').then(excel => {
1682
-          console.log("23232323",this.exportList)
1688
+         
1683 1689
         for(let i=0;i<this.exportList.length;i++){
1684 1690
           this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
1685 1691
           for(let j=0;j<this.goodType.length;j++){
@@ -1700,7 +1706,7 @@ export default {
1700 1706
        
1701 1707
         const tHeader = ['耗材名称', '耗材类型', '规格&单位','出库数量','出货价','总价','生产厂商','经销商','生产日期','有效期','备注']
1702 1708
         const filterVal = ['good_name', 'good_type_id', 'unit','count','price','total_price','manufacturer','dealer','product_date','expiry_date','remark']
1703
-        console.log("table",this.exportList)
1709
+    
1704 1710
        
1705 1711
         const data = this.formatJson(filterVal, this.exportList)
1706 1712
         excel.export_json_to_excel({

+ 82 - 5
src/xt_pages/stock/stockOutOrderAdd.vue Vedi File

@@ -122,12 +122,30 @@
122 122
             </template>
123 123
             <template slot-scope="scope">
124 124
               <el-form-item style="padding-top: 20px">
125
-                <el-input v-model="scope.row.name"></el-input>
125
+                <el-input v-model="scope.row.name" placeholder="规格&单位"></el-input>
126 126
               </el-form-item>
127 127
             </template>
128 128
           </el-table-column>
129 129
           
130
-      
130
+          <!-- <el-table-column  width="150" align="center">
131
+            <template slot="header" slot-scope="scope">
132
+              <span>剩余库存</span>
133
+            </template>
134
+            <template slot-scope="scope">
135
+              <el-form-item
136
+                :rules="tableRules.count"
137
+                style="padding-top: 17px"
138
+              >
139
+                <el-input
140
+                  :disabled="true"
141
+                  placeholder="剩余库存"
142
+                  type="number"
143
+                  v-model="scope.row.stock_count"
144
+                ></el-input>
145
+              </el-form-item>
146
+            </template>
147
+          </el-table-column>
148
+       -->
131 149
 
132 150
          <el-table-column  width="150" align="center">
133 151
             <template slot="header" slot-scope="scope">
@@ -140,6 +158,7 @@
140 158
                 style="padding-top: 17px"
141 159
               >
142 160
                 <el-input
161
+                  @input="getSupplyCount(scope.row.count,scope.row.stock_count,scope.$index)"
143 162
                  oninput="value=value.replace(/\D|^0/g,'')"
144 163
                   placeholder="请输入出库数量"
145 164
                   type="number"
@@ -161,6 +180,26 @@
161 180
                </el-select>
162 181
             </template>   
163 182
           </el-table-column>
183
+<!-- 
184
+          <el-table-column  width="150" align="center">
185
+            <template slot="header" slot-scope="scope">
186
+              <span>进货价</span>
187
+            </template>
188
+            <template slot-scope="scope">
189
+              <el-form-item
190
+                :prop="'recordData.' + scope.$index + '.buy_price'"
191
+                :rules="tableRules.buy_price"
192
+                style="padding-top: 20px"
193
+              >
194
+                <el-input
195
+                  :disabled="true"
196
+                  placeholder="进货价"
197
+                  type="number"
198
+                  v-model="scope.row.buy_price"
199
+                ></el-input>
200
+              </el-form-item>
201
+            </template>
202
+          </el-table-column> -->
164 203
 
165 204
           <el-table-column  width="150" align="center">
166 205
             <template slot="header" slot-scope="scope">
@@ -474,6 +513,8 @@ export default {
474 513
       tempObj["license_number"] = ""
475 514
       tempObj["warehouse_info_id"] = 0
476 515
       tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
516
+      tempObj["buy_price"]= ""
517
+      tempObj["stock_count"] = ""
477 518
       this.recordInfo.recordData.push(tempObj);
478 519
     },
479 520
     handleDelete: function(index, row) {
@@ -600,6 +641,10 @@ export default {
600 641
             }
601 642
            
602 643
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
644
+
645
+             this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
646
+
647
+             this.recordInfo.recordData[i].buy_price = this.recordInfo.recordData[i].buy_price.toString()
603 648
           }
604 649
        
605 650
           for(let i=0;i<this.recordInfo.recordData.length;i++){
@@ -631,7 +676,8 @@ export default {
631 676
           const params = {
632 677
             stockOut: this.recordInfo.recordData
633 678
           };
634
-        
679
+         
680
+         
635 681
           const loading = this.$loading({
636 682
             lock: true,
637 683
             text: 'Loading',
@@ -721,8 +767,10 @@ export default {
721 767
       this.currentIndex = val
722 768
     },
723 769
     handleSelect(val){
724
-       console.log("val232323",val)
770
+       
725 771
         var arr = []
772
+       
773
+       
726 774
         for(let i=0;i<this.recordInfo.recordData.length;i++){
727 775
            arr.push(this.recordInfo.recordData[i].good_id)
728 776
         }
@@ -735,15 +783,22 @@ export default {
735 783
         }
736 784
         //获取当前耗材的批号
737 785
         this.getStockBatchNumber(val.id)
786
+        var total_count = 0
787
+        for(let i=0;i<val.xt_warehouse_info.length;i++){
788
+           total_count += val.xt_warehouse_info[i].stock_count
789
+        }
790
+
738 791
         for(let i=0;i<this.recordInfo.recordData.length;i++){
739 792
           if(this.currentIndex == i){
793
+           
740 794
             this.recordInfo.recordData[i].good_type_id = val.id
741 795
             this.recordInfo.recordData[i].good_name = val.good_name
742 796
             this.recordInfo.recordData[i].good_type_id = val.good_type_id
743 797
             this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
744 798
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
745 799
             this.recordInfo.recordData[i].remark = val.remark
746
-          
800
+            this.recordInfo.recordData[i].buy_price = val.buy_price
801
+            this.recordInfo.recordData[i].stock_count = total_count
747 802
             if(val.packing_price == 0){
748 803
               this.recordInfo.recordData[i].price =""
749 804
             }else{
@@ -786,6 +841,26 @@ export default {
786 841
        }  
787 842
     
788 843
     },
844
+    getSupplyCount(count,sum_count,index){
845
+    
846
+      if(sum_count < count){
847
+        this.$message.error("出库数量不能大于剩余库存")
848
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
849
+          if(index == i){
850
+            this.recordInfo.recordData[i].count = ""
851
+          }
852
+          return
853
+        }
854
+      }else{
855
+       for(let i=0;i<this.recordInfo.recordData.length;i++){
856
+          if(index == i){
857
+            this.recordInfo.recordData[i].count = count
858
+          }
859
+          return
860
+        }
861
+      }
862
+ 
863
+    }
789 864
     
790 865
   },
791 866
   created() {
@@ -813,6 +888,8 @@ export default {
813 888
     tempObj["license_number"] = ""
814 889
     tempObj["warehouse_info_id"] = 0
815 890
     tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
891
+    tempObj["buy_price"]= ""
892
+    tempObj["stock_count"] = ""
816 893
     this.recordInfo.recordData.push(tempObj);
817 894
     this.GetConfigInfo();
818 895
   

+ 72 - 2
src/xt_pages/stock/stockOutOrderEdit.vue Vedi File

@@ -126,6 +126,26 @@
126 126
             </template>
127 127
           </el-table-column> -->
128 128
 
129
+          <!-- <el-table-column  width="150" align="center">
130
+            <template slot="header" slot-scope="scope">
131
+              <span>进货价</span>
132
+            </template>
133
+            <template slot-scope="scope">
134
+              <el-form-item
135
+                :prop="'recordData.' + scope.$index + '.buy_price'"
136
+                :rules="tableRules.buy_price"
137
+                style="padding-top: 20px"
138
+              >
139
+                <el-input
140
+                  :disabled="true"
141
+                  placeholder="进货价"
142
+                  type="number"
143
+                  v-model="scope.row.buy_price"
144
+                ></el-input>
145
+              </el-form-item>
146
+            </template>
147
+          </el-table-column> -->
148
+
129 149
           <el-table-column width="150" align="center">
130 150
             <template slot="header" slot-scope="scope">
131 151
               <span>单价<span style="color: red">*</span></span>
@@ -141,6 +161,25 @@
141 161
             </template>
142 162
           </el-table-column>
143 163
 
164
+          <!-- <el-table-column  width="150" align="center">
165
+            <template slot="header" slot-scope="scope">
166
+              <span>剩余库存</span>
167
+            </template>
168
+            <template slot-scope="scope">
169
+              <el-form-item
170
+                :rules="tableRules.count"
171
+                style="padding-top: 17px"
172
+              >
173
+                <el-input
174
+                  :disabled="true"
175
+                  placeholder="剩余库存"
176
+                  type="number"
177
+                  v-model="scope.row.stock_count"
178
+                ></el-input>
179
+              </el-form-item>
180
+            </template>
181
+          </el-table-column> -->
182
+
144 183
           <el-table-column width="150" align="center">
145 184
             <template slot="header" slot-scope="scope">
146 185
               <span>出库数量<span style="color: red">*</span></span>
@@ -148,7 +187,7 @@
148 187
             <template slot-scope="scope">
149 188
               <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
150 189
                             style="padding-top: 17px">
151
-                <el-input type="number" v-model="scope.row.count"  :disabled="stockShow"   oninput="value=value.replace(/\D|^0/g,'')"></el-input>
190
+                <el-input type="number" v-model="scope.row.count"  :disabled="stockShow"   oninput="value=value.replace(/\D|^0/g,'')"  @input="getSupplyCount(scope.row.count,scope.row.stock_count,scope.$index)"></el-input>
152 191
               </el-form-item>
153 192
             </template>
154 193
           </el-table-column>
@@ -451,6 +490,8 @@
451 490
         tempObj['dealer'] = ""
452 491
         tempObj['manufacturer'] = ""
453 492
         tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
493
+        tempObj["buy_price"]= ""
494
+        tempObj["stock_count"] = ""
454 495
         this.recordInfo.recordData.push(tempObj)
455 496
       },
456 497
       handleDelete: function(index, row) {
@@ -591,6 +632,9 @@
591 632
                 this.recordInfo.recordData[i].product_date = ""
592 633
               }
593 634
                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
635
+              
636
+              this.recordInfo.recordData[i].buy_price = this.recordInfo.recordData[i].buy_price.toString()
637
+              this.recordInfo.recordData[i].stock_count = this.recordInfo.recordData[i].stock_count.toString()
594 638
 
595 639
               for(let j=0;j<this.manufacturerList.length;j++){
596 640
                 if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
@@ -726,6 +770,10 @@
726 770
           return
727 771
         }
728 772
         this.getStockBatchNumber(val.id)
773
+        var total_count = 0
774
+        for(let i=0;i<val.xt_warehouse_info.length;i++){
775
+           total_count += val.xt_warehouse_info[i].stock_count
776
+        }
729 777
         for(let i=0;i<this.recordInfo.recordData.length;i++){
730 778
           if(this.currentIndex == i){
731 779
             this.recordInfo.recordData[i].good_type_id = val.id
@@ -736,6 +784,8 @@
736 784
             this.recordInfo.recordData[i].remark = val.remark
737 785
             this.recordInfo.recordData[i].license_number = ""
738 786
             this.recordInfo.recordData[i].warehouse_info_id = 0
787
+            this.recordInfo.recordData[i].buy_price = val.buy_price
788
+            this.recordInfo.recordData[i].stock_count = total_count
739 789
             if(val.packing_price == 0){
740 790
                this.recordInfo.recordData[i].price = ""
741 791
             }else{
@@ -774,6 +824,7 @@
774 824
           this.manufacturerList = manufacturerList
775 825
           this.goodType = response.data.data.goodType
776 826
           this.doctorList = response.data.data.doctorlist
827
+         
777 828
           for (let i = 0; i < response.data.data.list.length; i++) {
778 829
 
779 830
             response.data.data.list[i].price = response.data.data.list[i].price.toString()
@@ -784,7 +835,8 @@
784 835
             response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,"{y}-{m}-{d}")
785 836
             response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,"{y}-{m}-{d}")
786 837
             response.data.data.list[i].remark = response.data.data.list[i].remark
787
-
838
+            response.data.data.list[i].buy_price = response.data.data.list[i].buy_price.toString()
839
+            response.data.data.list[i].stock_count = response.data.data.list[i].stock_count.toString()
788 840
             if(response.data.data.list[i].dealer == 0){
789 841
                response.data.data.list[i].dealer = ""
790 842
             }
@@ -822,6 +874,24 @@
822 874
          }
823 875
        }
824 876
 
877
+     },
878
+     getSupplyCount(count,sum_count,index){
879
+      if(sum_count < count){
880
+        this.$message.error("出库数量不能大于剩余库存")
881
+        for(let i=0;i<this.recordInfo.recordData.length;i++){
882
+          if(index == i){
883
+            this.recordInfo.recordData[i].count = ""
884
+          }
885
+          return
886
+        }
887
+      }else{
888
+       for(let i=0;i<this.recordInfo.recordData.length;i++){
889
+          if(index == i){
890
+            this.recordInfo.recordData[i].count = count
891
+          }
892
+          return
893
+        }
894
+      }
825 895
      }
826 896
     },
827 897
     created() {

+ 2 - 2
src/xt_pages/user/patients.vue Vedi File

@@ -1341,14 +1341,14 @@
1341 1341
         this.getList()
1342 1342
       },
1343 1343
       getList() {
1344
-        console.log("parasm2222",this.listQuery)
1344
+       
1345 1345
         fetchList(this.listQuery).then(response => {
1346 1346
           if (response.data.state === 0) {
1347 1347
             this.$message.error(response.data.msg)
1348 1348
             return false
1349 1349
           } else {
1350 1350
             this.tableData = response.data.data.patients
1351
-            console.log('病人是', this.tableData)
1351
+           
1352 1352
             this.pageTotal = this.tableData.length
1353 1353
             this.total = response.data.data.total
1354 1354