|
@@ -37,7 +37,7 @@
|
37
|
37
|
<td>{{item.warehousing_unit}}</td>
|
38
|
38
|
<td>{{getNumber(item.id)}}</td>
|
39
|
39
|
<td>{{item.manufacturer}}</td>
|
40
|
|
- <td>{{item.storehouse_id}}</td>
|
|
40
|
+ <td>{{getHouseName(item.storehouse_id)}}</td>
|
41
|
41
|
<td>
|
42
|
42
|
<span v-if="item.stock_max_number>0">{{item.stock_max_number}}{{item.warehousing_unit}} </span>
|
43
|
43
|
<span v-if="item.stock_min_number>0">{{item.stock_min_number}}{{item.min_unit}}</span>
|
|
@@ -52,7 +52,9 @@
|
52
|
52
|
<span v-if="item.inventory_type == 11">盘亏</span>
|
53
|
53
|
</td>
|
54
|
54
|
<td>{{getPrice(item.id)}}</td>
|
55
|
|
- <td>{{getTotalPrice(item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id,item.stock_max_number,item.stock_min_number)}}</td>
|
|
55
|
+ <td v-if="item.inventory_type == 11">{{getTotalPrice(item.stock_max_number,item.stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit) - getReduceTotalPrice(item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit)}}</td>
|
|
56
|
+ <td v-if="item.inventory_type == 10">{{getTotalPrice(item.last_stock_max_number,item.last_stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit) - getReduceTotalPrice(item.stock_max_number,item.stock_min_number,item.min_number,item.id,item.warehousing_unit,item.min_unit)}}</td>
|
|
57
|
+ <td v-if="item.inventory_type != 10 && item.inventory_type!=11">0</td>
|
56
|
58
|
</tr>
|
57
|
59
|
</tbody>
|
58
|
60
|
</table>
|
|
@@ -144,16 +146,64 @@ export default {
|
144
|
146
|
}
|
145
|
147
|
return number
|
146
|
148
|
},
|
147
|
|
- getTotalPrice(last_stock_max_number,last_stock_min_number,min_number,id,stock_max_number,stock_min_number){
|
|
149
|
+ getTotalPrice(last_stock_max_number,last_stock_min_number,min_number,id,last_max_unit,last_min_unit){
|
148
|
150
|
var retail_price = 0
|
149
|
151
|
var totail_price =0
|
|
152
|
+ var max_unit = ""
|
|
153
|
+ var min_unit = ""
|
|
154
|
+ var max_number = 0
|
150
|
155
|
for(let i=0;i<this.inventoryList.length;i++){
|
151
|
156
|
if(id == this.inventoryList[i].id){
|
152
|
157
|
retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
|
|
158
|
+ max_unit = this.inventoryList[i].drug.max_unit
|
|
159
|
+ min_unit = this.inventoryList[i].drug.min_unit
|
153
|
160
|
}
|
154
|
161
|
}
|
155
|
|
- var totail_price = (stock_max_number*min_number +stock_min_number - last_stock_max_number * min_number + last_stock_min_number) * retail_price
|
156
|
|
- // var totail_price = last_stock_max_number * min_number * retail_price + last_stock_min_number * retail_price
|
|
162
|
+ console.log("max_unit",max_unit)
|
|
163
|
+ console.log("min_unit",min_unit)
|
|
164
|
+ if(last_max_unit == max_unit){
|
|
165
|
+ if(last_stock_max_number%min_number == 0){
|
|
166
|
+ totail_price = (last_stock_max_number/min_number) * retail_price + last_stock_min_number * retail_price
|
|
167
|
+ }
|
|
168
|
+ if(last_stock_max_number%min_number != 0){
|
|
169
|
+ totail_price = (last_stock_max_number/min_number)* retail_price + (last_stock_min_number%min_number) * retail_price + last_stock_min_number * retail_price
|
|
170
|
+ }
|
|
171
|
+ }
|
|
172
|
+ if(last_min_unit == min_unit){
|
|
173
|
+ totail_price = last_stock_max_number * retail_price + last_stock_min_number * retail_price
|
|
174
|
+ }
|
|
175
|
+ if(totail_price > 0){
|
|
176
|
+ return totail_price.toFixed(4)
|
|
177
|
+ }else{
|
|
178
|
+ return ""
|
|
179
|
+ }
|
|
180
|
+ },
|
|
181
|
+ getReduceTotalPrice(last_stock_max_number,last_stock_min_number,min_number,id,last_max_unit,last_min_unit){
|
|
182
|
+ var retail_price = 0
|
|
183
|
+ var totail_price =0
|
|
184
|
+ var max_unit = ""
|
|
185
|
+ var min_unit = ""
|
|
186
|
+ var max_number = 0
|
|
187
|
+ for(let i=0;i<this.inventoryList.length;i++){
|
|
188
|
+ if(id == this.inventoryList[i].id){
|
|
189
|
+ retail_price = this.inventoryList[i].drug_warehouse_info.retail_price
|
|
190
|
+ max_unit = this.inventoryList[i].drug.max_unit
|
|
191
|
+ min_unit = this.inventoryList[i].drug.min_unit
|
|
192
|
+ }
|
|
193
|
+ }
|
|
194
|
+ console.log("max_unit",max_unit)
|
|
195
|
+ console.log("min_unit",min_unit)
|
|
196
|
+ if(last_max_unit == max_unit){
|
|
197
|
+ if(last_stock_max_number%min_number == 0){
|
|
198
|
+ totail_price = (last_stock_max_number/min_number) * retail_price + last_stock_min_number * retail_price
|
|
199
|
+ }
|
|
200
|
+ if(last_stock_max_number%min_number != 0){
|
|
201
|
+ totail_price = (last_stock_max_number/min_number)* retail_price + (last_stock_min_number%min_number) * retail_price + last_stock_min_number * retail_price
|
|
202
|
+ }
|
|
203
|
+ }
|
|
204
|
+ if(last_min_unit == min_unit){
|
|
205
|
+ totail_price = last_stock_max_number * retail_price + last_stock_min_number * retail_price
|
|
206
|
+ }
|
157
|
207
|
if(totail_price > 0){
|
158
|
208
|
return totail_price.toFixed(4)
|
159
|
209
|
}else{
|
|
@@ -171,7 +221,20 @@ export default {
|
171
|
221
|
return retail_price
|
172
|
222
|
}
|
173
|
223
|
|
|
224
|
+ },
|
|
225
|
+ getHouseName(id){
|
|
226
|
+ var storehouse_name = ""
|
|
227
|
+ for(let i=0;i<this.houseList.length;i++){
|
|
228
|
+ if(id == this.houseList[i].id){
|
|
229
|
+ storehouse_name = this.houseList[i].storehouse_name
|
|
230
|
+ }
|
|
231
|
+ }
|
|
232
|
+ if(storehouse_name == "全部"){
|
|
233
|
+ return ""
|
|
234
|
+ }else{
|
|
235
|
+ return storehouse_name
|
174
|
236
|
}
|
|
237
|
+ }
|
175
|
238
|
},
|
176
|
239
|
created(){
|
177
|
240
|
|