|
@@ -525,7 +525,8 @@ export default {
|
525
|
525
|
outList:[],
|
526
|
526
|
userListOne:[],
|
527
|
527
|
exportList:[],
|
528
|
|
- batchNumberList:[]
|
|
528
|
+ batchNumberList:[],
|
|
529
|
+ drugFlowList:[],
|
529
|
530
|
};
|
530
|
531
|
},
|
531
|
532
|
methods: {
|
|
@@ -954,16 +955,13 @@ export default {
|
954
|
955
|
var list = response.data.data.list
|
955
|
956
|
console.log("list2323232",list)
|
956
|
957
|
var outList = response.data.data.outList
|
957
|
|
- // for(let i=0;i<outList.length;i++){
|
958
|
|
- // //如果都是最大单位,把最数量转为最小数量
|
959
|
|
- // if(outList[i].count_unit == outList[i].max_unit){
|
960
|
|
- // outList[i].count = outList[i].min_number * outList[i].count
|
961
|
|
- // }
|
962
|
|
- // }
|
963
|
958
|
this.outList = outList
|
964
|
959
|
console.log("outList222",outList)
|
965
|
960
|
this.manufacturerList = response.data.data.manufacturerList
|
966
|
961
|
this.dealerList = response.data.data.dealerList
|
|
962
|
+ var drugFlowList = response.data.data.drugFlowList
|
|
963
|
+ this.drugFlowList = drugFlowList
|
|
964
|
+ console.log("23232323232323",drugFlowList)
|
967
|
965
|
for(let i=0;i<list.length;i++){
|
968
|
966
|
if(list[i].batch_number == "0" || list[i].batch_number == 0){
|
969
|
967
|
list[i].batch_number = ""
|
|
@@ -1081,57 +1079,84 @@ export default {
|
1081
|
1079
|
return str + min_str
|
1082
|
1080
|
},
|
1083
|
1081
|
getTotalCountOne(id,min_number,max_unit,min_unit){
|
1084
|
|
-
|
1085
|
|
- for(let i=0;i<this.outList.length;i++){
|
1086
|
|
- if(this.outList[i].count_unit == this.outList[i].max_unit){
|
1087
|
|
- this.outList[i].total_count = this.outList[i].count * this.outList[i].min_number
|
1088
|
|
- }
|
1089
|
|
-
|
1090
|
|
- if(this.outList[i].count_unit == this.outList[i].min_unit){
|
1091
|
|
- this.outList[i].total_count = this.outList[i].count
|
|
1082
|
+ var arr = []
|
|
1083
|
+ for(let i=0;i<this.drugFlowList.length;i++){
|
|
1084
|
+ if(id == this.drugFlowList[i].drug_id){
|
|
1085
|
+ arr.push(this.drugFlowList[i])
|
1092
|
1086
|
}
|
1093
|
|
-
|
1094
|
1087
|
}
|
1095
|
|
- console.log("我的",this.outList)
|
1096
|
|
- let dataInfo = {};
|
1097
|
|
- this.outList.forEach((item, index) => {
|
1098
|
|
- let { drug_id } = item;
|
1099
|
|
- if (!dataInfo[drug_id]) {
|
1100
|
|
- dataInfo[drug_id] = {
|
1101
|
|
- drug_id,
|
1102
|
|
- child: [],
|
1103
|
|
- total:0,
|
1104
|
|
- };
|
1105
|
|
- }
|
1106
|
|
- });
|
1107
|
|
- let list = Object.values(dataInfo);
|
1108
|
|
- console.log("drug_id22222",list)
|
1109
|
|
- for(let i=0;i<list.length;i++){
|
1110
|
|
- for(let j=0;j<this.outList.length;j++){
|
1111
|
|
- if(list[i].drug_id == this.outList[j].drug_id){
|
1112
|
|
- list[i].child.push(this.outList[j])
|
1113
|
|
- }
|
|
1088
|
+ var total = 0
|
|
1089
|
+ for(let i=0;i<arr.length;i++){
|
|
1090
|
+ if(arr[i].max_unit == max_unit){
|
|
1091
|
+ arr[i].count = arr[i].count * arr[i].min_number
|
1114
|
1092
|
}
|
|
1093
|
+ if(arr[i].max_unit == min_unit){
|
|
1094
|
+ arr[i].count = arr[i].count
|
|
1095
|
+ }
|
|
1096
|
+ total += arr[i].count
|
1115
|
1097
|
}
|
1116
|
|
- var total = 0
|
1117
|
|
- for(let i=0;i<list.length;i++){
|
1118
|
|
- for(let j=0;j<list[i].child.length;j++){
|
1119
|
|
- if(id == list[i].child[j].drug_id){
|
1120
|
|
- total+= list[i].child[j].total_count
|
1121
|
|
- }
|
1122
|
|
- }
|
1123
|
|
- }
|
|
1098
|
+
|
|
1099
|
+ var str = ""
|
|
1100
|
+ var min_str = ""
|
|
1101
|
+
|
|
1102
|
+ str = parseInt(total/min_number)+ max_unit
|
|
1103
|
+ min_str = total%min_number + min_unit
|
|
1104
|
+
|
|
1105
|
+ return str + min_str
|
|
1106
|
+
|
|
1107
|
+ },
|
|
1108
|
+ // getTotalCountOne(id,min_number,max_unit,min_unit){
|
|
1109
|
+
|
|
1110
|
+ // for(let i=0;i<this.outList.length;i++){
|
|
1111
|
+ // if(this.outList[i].count_unit == this.outList[i].max_unit){
|
|
1112
|
+ // this.outList[i].total_count = this.outList[i].count * this.outList[i].min_number
|
|
1113
|
+ // }
|
|
1114
|
+
|
|
1115
|
+ // if(this.outList[i].count_unit == this.outList[i].min_unit){
|
|
1116
|
+ // this.outList[i].total_count = this.outList[i].count
|
|
1117
|
+ // }
|
|
1118
|
+
|
|
1119
|
+ // }
|
|
1120
|
+ // console.log("我的",this.outList)
|
|
1121
|
+ // let dataInfo = {};
|
|
1122
|
+ // this.outList.forEach((item, index) => {
|
|
1123
|
+ // let { drug_id } = item;
|
|
1124
|
+ // if (!dataInfo[drug_id]) {
|
|
1125
|
+ // dataInfo[drug_id] = {
|
|
1126
|
+ // drug_id,
|
|
1127
|
+ // child: [],
|
|
1128
|
+ // total:0,
|
|
1129
|
+ // };
|
|
1130
|
+ // }
|
|
1131
|
+ // });
|
|
1132
|
+ // let list = Object.values(dataInfo);
|
|
1133
|
+ // console.log("drug_id22222",list)
|
|
1134
|
+ // for(let i=0;i<list.length;i++){
|
|
1135
|
+ // for(let j=0;j<this.outList.length;j++){
|
|
1136
|
+ // if(list[i].drug_id == this.outList[j].drug_id){
|
|
1137
|
+ // list[i].child.push(this.outList[j])
|
|
1138
|
+ // }
|
|
1139
|
+ // }
|
|
1140
|
+ // }
|
|
1141
|
+ // var total = 0
|
|
1142
|
+ // for(let i=0;i<list.length;i++){
|
|
1143
|
+ // for(let j=0;j<list[i].child.length;j++){
|
|
1144
|
+ // if(id == list[i].child[j].drug_id){
|
|
1145
|
+ // total+= list[i].child[j].total_count
|
|
1146
|
+ // }
|
|
1147
|
+ // }
|
|
1148
|
+ // }
|
1124
|
1149
|
|
1125
|
|
- var str = ""
|
1126
|
|
- var min_str = ""
|
|
1150
|
+ // var str = ""
|
|
1151
|
+ // var min_str = ""
|
1127
|
1152
|
|
1128
|
|
- str = parseInt(total/min_number)+ max_unit
|
1129
|
|
- min_str = total%min_number + min_unit
|
|
1153
|
+ // str = parseInt(total/min_number)+ max_unit
|
|
1154
|
+ // min_str = total%min_number + min_unit
|
1130
|
1155
|
|
1131
|
|
- return str + min_str
|
|
1156
|
+ // return str + min_str
|
1132
|
1157
|
|
1133
|
1158
|
|
1134
|
|
- },
|
|
1159
|
+ // },
|
1135
|
1160
|
getAllPrice(drug_id,price,min_price){
|
1136
|
1161
|
var strprice = 0
|
1137
|
1162
|
var minstrprice = 0
|