|
@@ -20,7 +20,6 @@
|
20
|
20
|
<tr>
|
21
|
21
|
<td align="center">药品名称</td>
|
22
|
22
|
<td align="center">规格</td>
|
23
|
|
-
|
24
|
23
|
<td align="center">本月入库数量</td>
|
25
|
24
|
<td align="center">本月出库数量</td>
|
26
|
25
|
<td align="center">本月剩余库存</td>
|
|
@@ -33,11 +32,11 @@
|
33
|
32
|
</tr>
|
34
|
33
|
|
35
|
34
|
<tr v-for="(item,index) in tableList" :key="index">
|
36
|
|
- <td align="center">{{ item.good_name }}</td>
|
|
35
|
+ <td align="center">{{ item.drug_name }}</td>
|
37
|
36
|
<td align="center">{{ item.specification_name }}</td>
|
38
|
|
- <td align="center">{{ getInCount(item.good_id) }}</td>
|
39
|
|
- <td align="center">{{ getOutCount(item.good_id) }}</td>
|
40
|
|
- <td align="center">{{ getSumCount(item.good_id) }}</td>
|
|
37
|
+ <td align="center">{{ getInCount(item.drug_id,item.min_number,item.min_unit,item.max_unit) }}</td>
|
|
38
|
+ <td align="center">{{ getOutCount(item.drug_id,item.min_number,item.min_unit,item.max_unit) }}</td>
|
|
39
|
+ <td align="center">{{ getSumCount(item.sum_count,item.min_number,item.min_unit,item.max_unit) }}</td>
|
41
|
40
|
<td align="center">
|
42
|
41
|
<table
|
43
|
42
|
class="ware_table"
|
|
@@ -70,14 +69,14 @@
|
70
|
69
|
},
|
71
|
70
|
]"
|
72
|
71
|
>
|
73
|
|
- {{ it.number }}
|
|
72
|
+ {{ it.batch_number }}
|
74
|
73
|
</td>
|
75
|
74
|
</tr>
|
76
|
75
|
</table>
|
77
|
76
|
</td>
|
78
|
77
|
|
79
|
78
|
<td align="center">
|
80
|
|
- <table
|
|
79
|
+ <table
|
81
|
80
|
class="ware_table"
|
82
|
81
|
style="width: 100%; border-collapse: collapse"
|
83
|
82
|
>
|
|
@@ -114,7 +113,7 @@
|
114
|
113
|
</table>
|
115
|
114
|
</td>
|
116
|
115
|
<td align="center">
|
117
|
|
- <table
|
|
116
|
+ <table
|
118
|
117
|
class="ware_table"
|
119
|
118
|
style="width: 100%; border-collapse: collapse"
|
120
|
119
|
>
|
|
@@ -148,7 +147,7 @@
|
148
|
147
|
{{ getTime(it.expiry_date) }}
|
149
|
148
|
</td>
|
150
|
149
|
</tr>
|
151
|
|
- </table>
|
|
150
|
+ </table>
|
152
|
151
|
</td>
|
153
|
152
|
<td align="center">
|
154
|
153
|
|
|
@@ -217,8 +216,8 @@ import { getDrugInventroyModePrintList } from "@/api/stock"
|
217
|
216
|
return{
|
218
|
217
|
crumbs: [
|
219
|
218
|
{ path: false, name: '库存管理' },
|
220
|
|
- { path: false, name: '耗材管理' },
|
221
|
|
- { path: false, name: '耗材模版打印' },
|
|
219
|
+ { path: false, name: '药品管理' },
|
|
220
|
+ { path: false, name: '药品模版打印' },
|
222
|
221
|
],
|
223
|
222
|
tableList:[],
|
224
|
223
|
org_name: this.$store.getters.xt_user.org.org_name,
|
|
@@ -226,10 +225,8 @@ import { getDrugInventroyModePrintList } from "@/api/stock"
|
226
|
225
|
end_time:"",
|
227
|
226
|
manufacturerList:[],
|
228
|
227
|
infoList:[],
|
229
|
|
- outinfo:[],
|
230
|
|
- flowProList:[],
|
231
|
|
- flowNoProList:[],
|
232
|
|
- goodInfo:[]
|
|
228
|
+ drugList:[],
|
|
229
|
+ outList:[]
|
233
|
230
|
}
|
234
|
231
|
},
|
235
|
232
|
methods:{
|
|
@@ -264,19 +261,23 @@ import { getDrugInventroyModePrintList } from "@/api/stock"
|
264
|
261
|
if(response.data.state == 1){
|
265
|
262
|
var list = response.data.data.list
|
266
|
263
|
|
267
|
|
- console.log("list===============",list)
|
|
264
|
+ console.log("list===============998",list)
|
268
|
265
|
|
269
|
266
|
if(list!=null && list.length > 0){
|
270
|
267
|
let dataInfo = {}
|
271
|
268
|
list.forEach((item, index) => {
|
272
|
|
- let { good_id } = item
|
273
|
|
- if (!dataInfo[good_id]) {
|
274
|
|
- dataInfo[good_id] = {
|
275
|
|
- good_id:item.good_id,
|
|
269
|
+ let { drug_id } = item
|
|
270
|
+ if (!dataInfo[drug_id]) {
|
|
271
|
+ dataInfo[drug_id] = {
|
|
272
|
+ drug_id:item.drug_id,
|
276
|
273
|
child: [],
|
277
|
274
|
count:0,
|
278
|
|
- specification_name:item.specification_name,
|
279
|
|
- good_name:item.good_name,
|
|
275
|
+ specification_name:item.dose +item.dose_unit+"*"+item.min_number+item.min_unit+"/"+item.max_unit,
|
|
276
|
+ drug_name:item.drug_name,
|
|
277
|
+ min_number:item.min_number,
|
|
278
|
+ min_unit:item.min_unit,
|
|
279
|
+ max_unit:item.max_unit,
|
|
280
|
+ sum_count:item.sum_count,
|
280
|
281
|
}
|
281
|
282
|
}
|
282
|
283
|
})
|
|
@@ -284,7 +285,7 @@ import { getDrugInventroyModePrintList } from "@/api/stock"
|
284
|
285
|
|
285
|
286
|
for(let i=0;i<arr.length;i++){
|
286
|
287
|
for(let j=0;j<list.length;j++){
|
287
|
|
- if(arr[i].good_id == list[j].good_id){
|
|
288
|
+ if(arr[i].drug_id == list[j].drug_id){
|
288
|
289
|
arr[i].child.push(list[j])
|
289
|
290
|
}
|
290
|
291
|
}
|
|
@@ -298,13 +299,10 @@ import { getDrugInventroyModePrintList } from "@/api/stock"
|
298
|
299
|
|
299
|
300
|
this.infoList = response.data.data.infoList
|
300
|
301
|
|
301
|
|
- this.outinfo = response.data.data.outinfo
|
|
302
|
+ this.outList = response.data.data.outList
|
302
|
303
|
|
303
|
|
- this.flowNoProList = response.data.data.flowNoProList
|
304
|
|
-
|
305
|
|
- this.flowProList = response.data.data.flowProList
|
306
|
|
-
|
307
|
|
- this.goodInfo = response.data.data.goodInfo
|
|
304
|
+
|
|
305
|
+ this.drugList = response.data.data.drugList
|
308
|
306
|
}
|
309
|
307
|
})
|
310
|
308
|
},
|
|
@@ -318,78 +316,149 @@ import { getDrugInventroyModePrintList } from "@/api/stock"
|
318
|
316
|
return manufacturer_name
|
319
|
317
|
},
|
320
|
318
|
|
321
|
|
- getInCount(good_id){
|
|
319
|
+ getInCount(drug_id,min_number,min_unit,max_unit){
|
322
|
320
|
|
323
|
321
|
var newArr =[]
|
324
|
|
- var total_count =0
|
325
|
|
- var newArrOne = []
|
326
|
|
- var total_count_one = 0
|
327
|
322
|
var total =0
|
|
323
|
+ var min_str =""
|
|
324
|
+ var max_str = ""
|
328
|
325
|
for(let i=0;i<this.infoList.length;i++){
|
329
|
|
- if(good_id == this.infoList[i].good_id){
|
|
326
|
+ if(drug_id == this.infoList[i].drug_id){
|
330
|
327
|
newArr.push(this.infoList[i])
|
331
|
328
|
}
|
332
|
329
|
}
|
|
330
|
+
|
|
331
|
+ if(newArr!=null){
|
|
332
|
+ for(let i=0;i<newArr.length;i++){
|
|
333
|
+ if(newArr[i].max_unit == max_unit && max_unit!=min_unit){
|
|
334
|
+ newArr[i].last_stock_max_number = newArr[i].count * min_number
|
|
335
|
+ }
|
|
336
|
+ if(newArr[i].max_unit == min_unit && max_unit!=min_unit){
|
|
337
|
+ newArr[i].last_stock_max_number = newArr[i].count
|
|
338
|
+ }
|
|
339
|
+ if(newArr[i].max_unit == max_unit && max_unit==min_unit){
|
|
340
|
+ newArr[i].last_stock_max_number = newArr[i].count
|
|
341
|
+ }
|
|
342
|
+ }
|
|
343
|
+ }
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+ console.log("newARR========",newArr)
|
333
|
348
|
if(newArr!=null){
|
334
|
349
|
for(let i=0;i<newArr.length;i++){
|
335
|
|
- total_count += parseInt(newArr[i].warehousing_count)
|
|
350
|
+ total += parseInt(newArr[i].last_stock_max_number)
|
336
|
351
|
}
|
337
|
352
|
}
|
338
|
353
|
|
339
|
|
- for(let i=0;i<this.flowProList.length;i++){
|
340
|
|
- if(good_id == this.flowProList[i].good_id){
|
341
|
|
- newArrOne.push(this.flowProList[i])
|
|
354
|
+
|
|
355
|
+ if (total < min_number) {
|
|
356
|
+ min_str = total + min_unit;
|
|
357
|
+ }
|
|
358
|
+ if (total == 0) {
|
|
359
|
+ min_str = "";
|
|
360
|
+ max_str = "";
|
342
|
361
|
}
|
343
|
|
- }
|
344
|
|
- if(newArrOne!=null){
|
345
|
|
- for(let i=0;i<newArrOne.length;i++){
|
346
|
|
- total_count_one += newArrOne[i].count
|
|
362
|
+ if (total >= min_number) {
|
|
363
|
+ if (parseInt(total / min_number) != 0) {
|
|
364
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
365
|
+ }
|
|
366
|
+ if (total % min_number != 0) {
|
|
367
|
+ min_str = (total % min_number) + min_unit;
|
|
368
|
+ }
|
|
369
|
+ }
|
|
370
|
+ console.log("max_str",max_str)
|
|
371
|
+ console.log("min_str",min_str)
|
|
372
|
+ if(max_str == "" && min_str == ""){
|
|
373
|
+ return "0"
|
|
374
|
+ }else{
|
|
375
|
+ return max_str + min_str
|
347
|
376
|
}
|
348
|
|
- }
|
349
|
|
- total = total_count + total_count_one
|
350
|
|
- return total
|
351
|
377
|
},
|
352
|
|
- getOutCount(good_id){
|
353
|
|
-
|
|
378
|
+ getOutCount(drug_id,min_number,min_unit,max_unit){
|
|
379
|
+
|
354
|
380
|
var newArr =[]
|
355
|
|
- var newArrOne = []
|
356
|
|
- var total_count =0
|
357
|
|
- var total_count_one = 0
|
358
|
|
- var total = 0
|
359
|
|
- for(let i=0;i<this.outinfo.length;i++){
|
360
|
|
- if(good_id == this.outinfo[i].good_id){
|
361
|
|
- newArr.push(this.outinfo[i])
|
|
381
|
+ var total =0
|
|
382
|
+ var min_str =""
|
|
383
|
+ var max_str = ""
|
|
384
|
+ for(let i=0;i<this.outList.length;i++){
|
|
385
|
+ if(drug_id == this.outList[i].drug_id){
|
|
386
|
+ newArr.push(this.outList[i])
|
362
|
387
|
}
|
363
|
388
|
}
|
|
389
|
+
|
|
390
|
+ if(newArr!=null){
|
|
391
|
+ for(let i=0;i<newArr.length;i++){
|
|
392
|
+ if(newArr[i].max_unit == max_unit && max_unit!=min_unit){
|
|
393
|
+ newArr[i].last_stock_max_number = newArr[i].count * min_number
|
|
394
|
+ }
|
|
395
|
+ if(newArr[i].max_unit == min_unit && max_unit!=min_unit){
|
|
396
|
+ newArr[i].last_stock_max_number = newArr[i].count
|
|
397
|
+ }
|
|
398
|
+ if(newArr[i].max_unit == max_unit && max_unit==min_unit){
|
|
399
|
+ newArr[i].last_stock_max_number = newArr[i].count
|
|
400
|
+ }
|
|
401
|
+ }
|
|
402
|
+ }
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+ console.log("newARR========",newArr)
|
364
|
407
|
if(newArr!=null){
|
365
|
408
|
for(let i=0;i<newArr.length;i++){
|
366
|
|
- total_count += parseInt(newArr[i].count)
|
|
409
|
+ total += parseInt(newArr[i].last_stock_max_number)
|
367
|
410
|
}
|
368
|
411
|
}
|
369
|
412
|
|
370
|
|
- for(let i=0;i<this.flowNoProList.length;i++){
|
371
|
|
- if(good_id == this.flowNoProList[i].good_id){
|
372
|
|
- newArrOne.push(this.flowNoProList[i])
|
|
413
|
+
|
|
414
|
+ if (total < min_number) {
|
|
415
|
+ min_str = total + min_unit;
|
|
416
|
+ }
|
|
417
|
+ if (total == 0) {
|
|
418
|
+ min_str = "";
|
|
419
|
+ max_str = "";
|
373
|
420
|
}
|
374
|
|
- }
|
375
|
|
- if(newArrOne!=null){
|
376
|
|
- for(let i=0;i<newArrOne.length;i++){
|
377
|
|
- total_count_one += newArrOne[i].count
|
|
421
|
+ if (total >= min_number) {
|
|
422
|
+ if (parseInt(total / min_number) != 0) {
|
|
423
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
424
|
+ }
|
|
425
|
+ if (total % min_number != 0) {
|
|
426
|
+ min_str = (total % min_number) + min_unit;
|
|
427
|
+ }
|
|
428
|
+ }
|
|
429
|
+ console.log("max_str",max_str)
|
|
430
|
+ console.log("min_str",min_str)
|
|
431
|
+ if(max_str == "" && min_str == ""){
|
|
432
|
+ return "0"
|
|
433
|
+ }else{
|
|
434
|
+ return max_str + min_str
|
378
|
435
|
}
|
379
|
|
- }
|
380
|
|
-
|
381
|
|
-
|
382
|
|
- total = total_count + total_count_one
|
383
|
|
- return total
|
384
|
436
|
},
|
385
|
|
- getSumCount(good_id){
|
386
|
|
- var sum_count = 0
|
387
|
|
- for(let i=0;i<this.goodInfo.length;i++){
|
388
|
|
- if(good_id == this.goodInfo[i].id){
|
389
|
|
- sum_count = this.goodInfo[i].sum_count
|
390
|
|
- }
|
391
|
|
- }
|
392
|
|
- return sum_count
|
|
437
|
+ getSumCount(total,min_number,min_unit,max_unit){
|
|
438
|
+ var min_str =""
|
|
439
|
+ var max_str = ""
|
|
440
|
+ if (total < min_number) {
|
|
441
|
+ min_str = total + min_unit;
|
|
442
|
+ }
|
|
443
|
+ if (total == 0) {
|
|
444
|
+ min_str = "";
|
|
445
|
+ max_str = "";
|
|
446
|
+ }
|
|
447
|
+ if (total >= min_number) {
|
|
448
|
+ if (parseInt(total / min_number) != 0) {
|
|
449
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
450
|
+ }
|
|
451
|
+ if (total % min_number != 0) {
|
|
452
|
+ min_str = (total % min_number) + min_unit;
|
|
453
|
+ }
|
|
454
|
+ }
|
|
455
|
+ console.log("max_str",max_str)
|
|
456
|
+ console.log("min_str",min_str)
|
|
457
|
+ if(max_str == "" && min_str == ""){
|
|
458
|
+ return "0"
|
|
459
|
+ }else{
|
|
460
|
+ return max_str + min_str
|
|
461
|
+ }
|
393
|
462
|
}
|
394
|
463
|
|
395
|
464
|
|