XMLWAN 3 jaren geleden
bovenliggende
commit
a7ee9c09c9

+ 167 - 151
src/xt_pages/data/components/addDrugs.vue Bestand weergeven

@@ -115,26 +115,42 @@
115 115
                     <el-form-item label="默认单次用量 : " prop="drug_dose">
116 116
                          <el-input v-model="form.drug_dose" style="width:70px;margin-right:5px;" placeholder=""
117 117
                                       maxlength="30"></el-input>
118
-                          <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="单次用量单位">
118
+                          <!-- <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="单次用量单位">
119 119
                                 <el-option
120 120
                                         v-for="(item,index) in unitList"
121 121
                                         :key="index"
122 122
                                         :label="item.name"
123 123
                                         :value="item.id">
124 124
                                 </el-option>
125
-                           </el-select>
125
+                           </el-select> -->
126
+                         <el-select v-model="form.drug_dose_unit" style="width:80px;" filterable placeholder="单次用量单位">
127
+                               <el-option
128
+                                v-for="(item,index) in getDataConfig('hemodialysis','units')"
129
+                                :key="index"
130
+                                :label="item.name"
131
+                                :value="item.id">
132
+                              </el-option>
133
+                        </el-select>
126 134
                      </el-form-item>
127 135
                     <el-form-item label="默认开药数量:" prop="prescribing_number">
128 136
                         <el-input v-model="form.prescribing_number" style="width:70px;margin-right:5px;" placeholder=""
129 137
                                   maxlength="30"></el-input>
130
-                        <el-select v-model="form.prescribing_number_unit" style="width:80px;" placeholder="开药数量单位">
138
+                        <!-- <el-select v-model="form.prescribing_number_unit" style="width:80px;" placeholder="开药数量单位">
131 139
                               <el-option
132 140
                                 v-for="(item,index) in packingUnit"
133 141
                                 :key="index"
134 142
                                 :label="item.name"
135 143
                                 :value="item.name">
136 144
                               </el-option>
137
-                          </el-select>
145
+                          </el-select> -->
146
+                         <el-select v-model="form.prescribing_number_unit" style="width:80px;" filterable placeholder="开药数量单位">
147
+                               <el-option
148
+                                v-for="(item,index) in getDataConfig('hemodialysis','units')"
149
+                                :key="index"
150
+                                :label="item.name"
151
+                                :value="item.name">
152
+                              </el-option>
153
+                        </el-select>
138 154
                     </el-form-item>
139 155
                      <!-- <el-form-item label="开药数量单位:" prop="prescribing_number">
140 156
                           <el-select v-model="form.prescribing_number_unit" style="width:160px;" placeholder="开药数量单位">
@@ -574,7 +590,7 @@
574 590
           packing_unit: [{ required: true, message: '请填写包装单位', trigger: 'change' }],
575 591
           drug_type: [{ required: true, message: '请填写药品类型', trigger: 'blur' }],
576 592
           drug_stock_limit: [{ required: true, message: '请填写库存警戒', trigger: 'blur' }],
577
-          drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
593
+          // drug_origin_place: [{ required: true, message: '请填写产地', trigger: 'blur' }],
578 594
           drug_dosage_form: [{ required: true, message: '请填写药品剂型', trigger: 'blur' }],
579 595
           medical_insurance_level: [{ required: true, message: '请选择医保等级', trigger: 'change' }],
580 596
 
@@ -925,156 +941,156 @@
925 941
            }
926 942
         })
927 943
       },
928
-      changeDoseUnit(val){
929
-        if(val == this.form.min_unit){
930
-          // this.form.dose = 1
931
-          this.form.min_number = 1
932
-          this.dosageShow = true
933
-        }
934
-        if(val !=this.form.min_unit){
935
-          this.dosageShow = false
936
-        }
937
-        var arr =  getDataConfig('hemodialysis','units')
938
-        this.unitList = []
939
-        for(let i=0;i<arr.length;i++){
940
-
941
-          if(this.form.min_unit == arr[i].name){
942
-            this.unitList.push(arr[i])
943
-          }
944
-          if(val == arr[i].name){
945
-            this.unitList.push(arr[i])
946
-          }
947
-          let idArr = []
948
-          this.unitList.map(item => {
949
-            idArr.push(item.id)
950
-          })
951
-          if(idArr.indexOf(this.form.drug_dose_unit) == -1){
952
-            if(this.form.drug_dose_unit == arr[i].id){
953
-              this.unitList.push(arr[i])
954
-            }
955
-          }
956
-
957
-        }
958
-        let ojb = {};
959
-        this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
960
-            //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
961
-            ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
962
-            return prevArr
963
-        }, [])
964
-
965
-      },
966
-      changeMinUnit(val){
967
-        if(val == this.form.dose_unit){
968
-          // this.form.dose = 1
969
-          this.form.min_number = 1
970
-          this.dosageShow = true
971
-        }else{
972
-          this.dosageShow = false
973
-        }
974
-        // if(val != this.form.max_unit){
975
-        //   this.dosageShow = false
976
-        // }
977
-        if(val == this.form.max_unit){
978
-          this.form.min_number = 1
979
-          this.minNumberShow = true
980
-        }else{
981
-          this.minNumberShow = false
982
-        }
983
-
984
-        // if(this.form.dosage == "" || this.form.max_unit == ""){
985
-        //    this.form.min_number = 1
986
-        // }
987
-        var arr = getDataConfig('hemodialysis','units')
988
-        this.unitList = []
989
-        this.packingUnit = []
990
-        for(let i=0;i<arr.length;i++){
991
-            if(val == arr[i].name){
992
-              this.unitList.push(arr[i])
993
-              this.packingUnit.push(arr[i])
994
-            }
995
-            if(this.form.max_unit == arr[i].name){
996
-              this.unitList.push(arr[i])
997
-              this.packingUnit.push(arr[i])
998
-            }
999
-            if(this.form.drug_dose_unit == arr[i].id){
1000
-              this.unitList.push(arr[i])
1001
-            }
1002
-            if(this.form.prescribing_number_unit == arr[i].id){
1003
-              this.packingUnit.push(arr[i])
1004
-            }
944
+      // changeDoseUnit(val){
945
+      //   if(val == this.form.min_unit){
946
+      //     // this.form.dose = 1
947
+      //     this.form.min_number = 1
948
+      //     this.dosageShow = true
949
+      //   }
950
+      //   if(val !=this.form.min_unit){
951
+      //     this.dosageShow = false
952
+      //   }
953
+      //   var arr =  getDataConfig('hemodialysis','units')
954
+      //   this.unitList = []
955
+      //   for(let i=0;i<arr.length;i++){
956
+
957
+      //     if(this.form.min_unit == arr[i].name){
958
+      //       this.unitList.push(arr[i])
959
+      //     }
960
+      //     if(val == arr[i].name){
961
+      //       this.unitList.push(arr[i])
962
+      //     }
963
+      //     let idArr = []
964
+      //     this.unitList.map(item => {
965
+      //       idArr.push(item.id)
966
+      //     })
967
+      //     if(idArr.indexOf(this.form.drug_dose_unit) == -1){
968
+      //       if(this.form.drug_dose_unit == arr[i].id){
969
+      //         this.unitList.push(arr[i])
970
+      //       }
971
+      //     }
972
+
973
+      //   }
974
+      //   let ojb = {};
975
+      //   this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
976
+      //       //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
977
+      //       ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
978
+      //       return prevArr
979
+      //   }, [])
980
+
981
+      // },
982
+      // changeMinUnit(val){
983
+      //   if(val == this.form.dose_unit){
984
+      //     // this.form.dose = 1
985
+      //     this.form.min_number = 1
986
+      //     this.dosageShow = true
987
+      //   }else{
988
+      //     this.dosageShow = false
989
+      //   }
990
+      //   // if(val != this.form.max_unit){
991
+      //   //   this.dosageShow = false
992
+      //   // }
993
+      //   if(val == this.form.max_unit){
994
+      //     this.form.min_number = 1
995
+      //     this.minNumberShow = true
996
+      //   }else{
997
+      //     this.minNumberShow = false
998
+      //   }
999
+
1000
+      //   // if(this.form.dosage == "" || this.form.max_unit == ""){
1001
+      //   //    this.form.min_number = 1
1002
+      //   // }
1003
+      //   var arr = getDataConfig('hemodialysis','units')
1004
+      //   this.unitList = []
1005
+      //   this.packingUnit = []
1006
+      //   for(let i=0;i<arr.length;i++){
1007
+      //       if(val == arr[i].name){
1008
+      //         this.unitList.push(arr[i])
1009
+      //         this.packingUnit.push(arr[i])
1010
+      //       }
1011
+      //       if(this.form.max_unit == arr[i].name){
1012
+      //         this.unitList.push(arr[i])
1013
+      //         this.packingUnit.push(arr[i])
1014
+      //       }
1015
+      //       if(this.form.drug_dose_unit == arr[i].id){
1016
+      //         this.unitList.push(arr[i])
1017
+      //       }
1018
+      //       if(this.form.prescribing_number_unit == arr[i].id){
1019
+      //         this.packingUnit.push(arr[i])
1020
+      //       }
1005 1021
             
1006 1022
 
1007 1023
 
1008 1024
 
1009
-            let idArr = []
1010
-            this.unitList.map(item => {
1011
-              idArr.push(item.id)
1012
-            })
1013
-            if(idArr.indexOf(this.form.drug_dose_unit) == -1){
1014
-              if(this.form.drug_dose_unit == arr[i].id){
1015
-                this.unitList.push(arr[i])
1016
-              }
1017
-            }
1018
-            let packingIdArr = []
1019
-            this.packingUnit.map(item => {
1020
-              packingIdArr.push(item.id)
1021
-            })
1022
-            if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1023
-              if(this.form.prescribing_number_unit == arr[i].id){
1024
-                this.packingUnit.push(arr[i])
1025
-              }
1026
-            }
1027
-        }
1028
-        let ojb = {};
1029
-        this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
1030
-          //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1031
-          ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
1032
-          return prevArr
1033
-        }, [])
1034
-
1035
-        let newojb = {};
1036
-        this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1037
-          //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1038
-          newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1039
-          return prevArr
1040
-        }, [])
1041
-
1042
-      },
1043
-      changeMaxUnit(val){
1044
-        if(val == this.form.min_unit){
1045
-          this.form.min_number = 1
1046
-          this.minNumberShow = true
1047
-        }else{
1048
-          this.minNumberShow = false
1049
-        }
1050
-        var arr = getDataConfig('hemodialysis','units')
1051
-        this.packingUnit = []
1052
-        for(let i=0;i<arr.length;i++){
1053
-            if(val == arr[i].name){
1054
-              this.packingUnit.push(arr[i])
1055
-            }
1056
-            if(this.form.min_unit == arr[i].name){
1057
-              this.packingUnit.push(arr[i])
1058
-            }
1059
-            let packingIdArr = []
1060
-            this.packingUnit.map(item => {
1061
-              packingIdArr.push(item.id)
1062
-            })
1063
-            if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1064
-              if(this.form.prescribing_number_unit == arr[i].id){
1065
-                this.packingUnit.push(arr[i])
1066
-              }
1067
-            }
1068
-        }
1069
-
1070
-
1071
-        let newojb = {};
1072
-        this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1073
-          //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1074
-          newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1075
-          return prevArr
1076
-        }, [])
1077
-      }
1025
+      //       let idArr = []
1026
+      //       this.unitList.map(item => {
1027
+      //         idArr.push(item.id)
1028
+      //       })
1029
+      //       if(idArr.indexOf(this.form.drug_dose_unit) == -1){
1030
+      //         if(this.form.drug_dose_unit == arr[i].id){
1031
+      //           this.unitList.push(arr[i])
1032
+      //         }
1033
+      //       }
1034
+      //       let packingIdArr = []
1035
+      //       this.packingUnit.map(item => {
1036
+      //         packingIdArr.push(item.id)
1037
+      //       })
1038
+      //       if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1039
+      //         if(this.form.prescribing_number_unit == arr[i].id){
1040
+      //           this.packingUnit.push(arr[i])
1041
+      //         }
1042
+      //       }
1043
+      //   }
1044
+      //   let ojb = {};
1045
+      //   this.unitList = this.unitList.reduce(function(prevArr, currentItem) {
1046
+      //     //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1047
+      //     ojb[currentItem.name] ? '' : ojb[currentItem.name] = true && prevArr.push(currentItem);
1048
+      //     return prevArr
1049
+      //   }, [])
1050
+
1051
+      //   let newojb = {};
1052
+      //   this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1053
+      //     //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1054
+      //     newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1055
+      //     return prevArr
1056
+      //   }, [])
1057
+
1058
+      // },
1059
+      // changeMaxUnit(val){
1060
+      //   if(val == this.form.min_unit){
1061
+      //     this.form.min_number = 1
1062
+      //     this.minNumberShow = true
1063
+      //   }else{
1064
+      //     this.minNumberShow = false
1065
+      //   }
1066
+      //   var arr = getDataConfig('hemodialysis','units')
1067
+      //   this.packingUnit = []
1068
+      //   for(let i=0;i<arr.length;i++){
1069
+      //       if(val == arr[i].name){
1070
+      //         this.packingUnit.push(arr[i])
1071
+      //       }
1072
+      //       if(this.form.min_unit == arr[i].name){
1073
+      //         this.packingUnit.push(arr[i])
1074
+      //       }
1075
+      //       let packingIdArr = []
1076
+      //       this.packingUnit.map(item => {
1077
+      //         packingIdArr.push(item.id)
1078
+      //       })
1079
+      //       if(packingIdArr.indexOf(this.form.prescribing_number_unit) == -1){
1080
+      //         if(this.form.prescribing_number_unit == arr[i].id){
1081
+      //           this.packingUnit.push(arr[i])
1082
+      //         }
1083
+      //       }
1084
+      //   }
1085
+
1086
+
1087
+      //   let newojb = {};
1088
+      //   this.packingUnit = this.packingUnit.reduce(function(prevArr, currentItem) {
1089
+      //     //利用对象的键名无法重复的特点,mch_id是唯一区别的属性值
1090
+      //     newojb[currentItem.name] ? '' : newojb[currentItem.name] = true && prevArr.push(currentItem);
1091
+      //     return prevArr
1092
+      //   }, [])
1093
+      // }
1078 1094
     }, watch: {
1079 1095
       visible(val) {
1080 1096
         // this.form = this.formValue

+ 21 - 83
src/xt_pages/stock/drugs/drugStockOutOrder.vue Bestand weergeven

@@ -307,10 +307,7 @@
307 307
               <span>序号</span>
308 308
             </template>
309 309
             <template slot-scope="scope">
310
-              <!-- <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
311
-              <span v-if="scope.row.is_total == 1">{{'合计'}}</span> -->
312 310
               {{scope.$index+1}}
313
-            
314 311
             </template>
315 312
           </el-table-column>
316 313
 
@@ -951,16 +948,19 @@ export default {
951 948
           this.tableShow = true
952 949
           this.tableList = []
953 950
           var list =  response.data.data.list
954
-          var outList = response.data.data.outList
955
-          for(let i=0;i<outList.length;i++){
956
-          if(outList[i].count_unit == outList[i].max_unit){
957
-              outList[i].count =outList[i].count * outList[i].min_number
958
-            }
959
-          }
960
-          this.outList = outList
961 951
          this.manufacturerList = response.data.data.manufacturerList
962 952
          this.dealerList = response.data.data.dealerList
963 953
          var drugFlowList = response.data.data.drugFlowList
954
+         for(let i=0;i<drugFlowList.length;i++){
955
+           if(drugFlowList[i].count_unit == drugFlowList[i].XtBaseDrug.max_unit){
956
+               drugFlowList[i].count = drugFlowList[i].count * drugFlowList[i].XtBaseDrug.min_number
957
+           }
958
+           if(drugFlowList[i].count_unit == drugFlowList[i].XtBaseDrug.min_unit){
959
+              drugFlowList[i].count = drugFlowList[i].count 
960
+           }
961
+         }
962
+         console.log("库存柳树",drugFlowList)
963
+ 
964 964
          this.drugFlowList = drugFlowList
965 965
          for(let i=0;i<list.length;i++){
966 966
            if(list[i].batch_number == "0" || list[i].batch_number == 0){
@@ -983,11 +983,12 @@ export default {
983 983
        drug_id:val.drug_id,
984 984
        record_time:val.sys_record_time,
985 985
      }
986
+     console.log("使用明细",params)
986 987
      getAutoDrugDetail(params).then(response=>{
987 988
        if(response.data.state == 1){
988 989
         
989 990
         this.userList = response.data.data.list
990
-        
991
+        console.log("自动出库数据",this.userList)
991 992
         if(val.is_sys == 1){
992 993
         
993 994
           this.drugDialogVisible = true
@@ -1097,84 +1098,21 @@ export default {
1097 1098
              arr.push(this.drugFlowList[i])
1098 1099
           }
1099 1100
         }
1100
-        var total = 0
1101
-        for(let i=0;i<arr.length;i++){
1102
-          if(arr[i].count_unit == max_unit){
1103
-             arr[i].count = arr[i].count * min_number
1104
-          }
1105
-          if(arr[i].count_unit == min_unit){
1106
-            arr[i].count = arr[i].count
1107
-          }
1108
-          total += arr[i].count
1109
-        }
1110 1101
         var str = ""
1111 1102
         var min_str = ""
1112
-        if(total >= min_number){
1113
-          if(parseInt(total/min_number)!=0){
1114
-            str = parseInt(total/min_number)+ max_unit
1115
-          }
1116
-          if(total%min_number !=0){
1117
-            min_str =  total%min_number + min_unit
1103
+        if(arr.length > 0){
1104
+          for(let i=0;i<arr.length;i++){
1105
+            if(parseInt(arr[i].count/min_number)!=0){
1106
+              str = parseInt(arr[i].count/min_number)+ max_unit
1107
+            }
1108
+            if(arr[i].count%min_number !=0){
1109
+              min_str =  arr[i].count%min_number + min_unit
1110
+            }
1118 1111
           }
1119 1112
         }
1120
-        if (total < min_number){
1121
-          str = ""
1122
-          min_str = total + min_unit
1123
-        }
1124 1113
         return str + min_str 
1125 1114
       },
1126
-    //   getTotalCountOne(id,min_number,max_unit,min_unit){
1127
-       
1128
-    //     for(let i=0;i<this.outList.length;i++){
1129
-    //       if(this.outList[i].count_unit == this.outList[i].max_unit){
1130
-    //         this.outList[i].total_count = this.outList[i].count * this.outList[i].min_number
1131
-    //       }
1132 1115
 
1133
-    //      if(this.outList[i].count_unit == this.outList[i].min_unit){
1134
-    //         this.outList[i].total_count = this.outList[i].count
1135
-    //       }
1136
-       
1137
-    //     }
1138
-    //     console.log("我的",this.outList)
1139
-    //       let dataInfo = {};
1140
-    //       this.outList.forEach((item, index) => {
1141
-    //         let { drug_id } = item;
1142
-    //         if (!dataInfo[drug_id]) {
1143
-    //           dataInfo[drug_id] = {
1144
-    //             drug_id,
1145
-    //             child: [],
1146
-    //             total:0,
1147
-    //           };
1148
-    //         }
1149
-    //       });
1150
-    //     let list = Object.values(dataInfo);
1151
-    //     console.log("drug_id22222",list)
1152
-    //     for(let i=0;i<list.length;i++){
1153
-    //       for(let j=0;j<this.outList.length;j++){
1154
-    //         if(list[i].drug_id == this.outList[j].drug_id){
1155
-    //           list[i].child.push(this.outList[j])
1156
-    //         }
1157
-    //       }
1158
-    //     }
1159
-    //    var total = 0
1160
-    //    for(let i=0;i<list.length;i++){
1161
-    //     for(let j=0;j<list[i].child.length;j++){
1162
-    //        if(id == list[i].child[j].drug_id){
1163
-    //          total+= list[i].child[j].total_count
1164
-    //        }
1165
-    //     }
1166
-    //    }
1167
-      
1168
-    //   var str = ""
1169
-    //   var min_str = ""
1170
-      
1171
-    //   str = parseInt(total/min_number)+ max_unit
1172
-    //   min_str =  total%min_number + min_unit
1173
-
1174
-    //  return str + min_str
1175
-      
1176
-       
1177
-    //  },
1178 1116
       getAllPrice(drug_id,price,min_price){
1179 1117
          var strprice = 0
1180 1118
          var minstrprice = 0
@@ -1198,7 +1136,7 @@ export default {
1198 1136
          return  total_price
1199 1137
       },
1200 1138
       getDrugBatchNumber(drugid,count){
1201
-        console.log("drug_id2323",drug_id)
1139
+        console.log("drug_id2323",drugid)
1202 1140
         console.log("count",count)
1203 1141
         console.log("hhhhhhhhhhh",this.batchNumberList)
1204 1142
         var arr = []

+ 62 - 5
src/xt_pages/stock/drugs/query.vue Bestand weergeven

@@ -112,15 +112,20 @@
112 112
         </el-table-column>
113 113
         <el-table-column prop="drug_name" label="出库数量" align="center">
114 114
            <template slot-scope="scope">
115
-              <span>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
116
-              <!-- <span v-else>{{getWarehouseOutInfo(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>  -->
115
+             <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
116
+                <span v-if="scope.row.drug_warehouse_out.length > 0"></span> {{getDrugOutList(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
117
+             </span>
118
+             <span v-else>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
117 119
            </template>
118 120
         </el-table-column>
119 121
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
120 122
            <template slot-scope="scope">
121 123
             <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)!=0">
122
-               <span>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
123
-               <!-- <span v-else>{{getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>  -->
124
+               <span v-if="org_id == 9671 || org_id == 9675 || org_id == 4">
125
+                 {{getDrugChaCount(scope.row.drug_warehouse_info,scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info)}}
126
+               </span>
127
+               
128
+               <span v-else>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>
124 129
             </div>
125 130
            </template>
126 131
         </el-table-column>
@@ -237,7 +242,6 @@ import { min } from 'moment'
237 242
     methods: {
238 243
      //获取库存
239 244
       getlist(){
240
-      
241 245
         const params = {
242 246
           page: this.page,
243 247
           limit: this.limit,
@@ -260,6 +264,11 @@ import { min } from 'moment'
260 264
                     list[i].drug_warehouse_out[y].count = list[i].drug_warehouse_out[y].count * list[i].min_number
261 265
                   }
262 266
                }
267
+               for(let z=0;z<list[i].drug_cancel_stock_info.length;z++){
268
+                 if(list[i].drug_cancel_stock_info[z].max_unit == list[i].max_unit){
269
+                   list[i].drug_cancel_stock_info[z].count = list[i].drug_cancel_stock_info[z].count * list[i].min_number
270
+                 } 
271
+               }
263 272
              }
264 273
              console.log("列表list232323323232323223",list)
265 274
              this.tableList = list
@@ -715,6 +724,54 @@ import { min } from 'moment'
715 724
          }
716 725
         return max_str + min_str
717 726
 
727
+      },
728
+
729
+      getDrugOutList(arr,max_unit,min_unit,min_number){
730
+        var str = ""
731
+        var str_min = ""
732
+        if(arr.length > 0){
733
+          for(let i=0;i<arr.length;i++){
734
+           if(parseInt(arr[i].count/min_number)!=0){
735
+              str = parseInt(arr[i].count/min_number)+ max_unit
736
+            }
737
+            if(arr[i].count%min_number !=0){
738
+              str_min =  arr[i].count%min_number + min_unit
739
+            }
740
+          }
741
+        }
742
+        return str + str_min
743
+      },
744
+
745
+      getDrugChaCount(info,out_info,max_unit,min_unit,min_number,cancel_info){
746
+        var total_info = 0
747
+        var total_out = 0
748
+        var cha_count = 0
749
+        var cancel_count = 0
750
+        if(info.length > 0 ){
751
+          for(let i=0;i<info.length;i++){
752
+            total_info += info[i].warehousing_count * min_number
753
+          }
754
+        }
755
+        if(out_info.length>0){
756
+          for(let j=0;j<out_info.length;j++){
757
+            total_out += out_info[j].count
758
+          }
759
+        }
760
+        if(cancel_info.length >0){
761
+         for(let z=0;z<cancel_info.length;z++){
762
+            cancel_count +=cancel_info[z].count
763
+         }
764
+        }
765
+        cha_count = total_info - total_out + cancel_count
766
+        var str = ""
767
+        var str_min = ""
768
+        if(parseInt(cha_count/min_number)!=0){
769
+            str = parseInt(cha_count/min_number)+ max_unit
770
+         }
771
+         if(cha_count%min_number !=0){
772
+           str_min =  cha_count%min_number + min_unit
773
+         }
774
+         return str + str_min
718 775
       }
719 776
     }
720 777
   }

+ 5 - 3
src/xt_pages/stock/stockPrint.vue Bestand weergeven

@@ -42,11 +42,13 @@
42 42
                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info)}}{{item.packing_unit}}</span>
43 43
                                    </td>
44 44
                                    <td>
45
-                                       <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info) - getOverplus(item.xt_warehouse_info) - getCancelInfo(item.cancel_stock_info)}}{{item.packing_unit}}</span>
45
+                                        {{getAutoCount(item.id) + getOutCount(item.id)}}
46
+                                       <!-- <span v-if="getWareInfo(item.xt_warehouse_info)>0">{{getWareInfo(item.xt_warehouse_info) - getOverplus(item.xt_warehouse_info) - getCancelInfo(item.cancel_stock_info)}}{{item.packing_unit}}</span> -->
46 47
                                    </td>
47 48
                                   
48 49
                                    <td>
49
-                                     <span v-if="getOverplus(item.xt_warehouse_info)>0">{{getOverplus(item.xt_warehouse_info)}}{{item.packing_unit}}</span>  
50
+                                     <span v-if="getWareInfo(item.xt_warehouse_info) > 0">{{getWareInfo(item.xt_warehouse_info) - getAutoCount(item.id) - getOutCount(item.id) + getCancelCount(item.id) }}</span> 
51
+                                     <!-- <span v-if="getOverplus(item.xt_warehouse_info)>0">{{getOverplus(item.xt_warehouse_info)}}{{item.packing_unit}}</span>   -->
50 52
                                    </td>
51 53
                                 </tr>
52 54
                             </tbody>
@@ -303,7 +305,7 @@ export default {
303 305
       this.limit = this.$route.query.limit
304 306
       this.getlist()
305 307
       this.GetAllGoodType()
306
-      // this.getStockDrugCount()
308
+      this.getStockDrugCount()
307 309
     }
308 310
 }
309 311
 </script>

+ 0 - 2
src/xt_pages/stock/stockQuery.vue Bestand weergeven

@@ -110,14 +110,12 @@
110 110
        <el-table-column label="出库数量" align="center">
111 111
          <template slot-scope="scope">
112 112
             {{getAutoCount(scope.row.id) + getOutCount(scope.row.id)}}
113
-            <!-- <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info) - getOverplus(scope.row.xt_warehouse_info) - getCancelInfo(scope.row.cancel_stock_info)}}{{scope.row.packing_unit}}</span> -->
114 113
          </template>
115 114
        </el-table-column>
116 115
 
117 116
        <el-table-column label="剩余库存量" align="center">
118 117
          <template slot-scope="scope">
119 118
           <span v-if="getWareInfo(scope.row.xt_warehouse_info) > 0">{{getWareInfo(scope.row.xt_warehouse_info) - getAutoCount(scope.row.id) - getOutCount(scope.row.id) + getCancelCount(scope.row.id) }}</span> 
120
-           <!-- <span v-if="getOverplus(scope.row.xt_warehouse_info)>0">{{getOverplus(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span> -->
121 119
          </template>
122 120
        </el-table-column>
123 121
        <el-table-column label="操作" align="center" width="260px">