|
@@ -25,7 +25,7 @@
|
25
|
25
|
:value="item.id">
|
26
|
26
|
</el-option>
|
27
|
27
|
</el-select>
|
28
|
|
- <el-input v-model="keyword" style="width:200px" placeholder="请输入耗材名称或生产厂商" ></el-input>
|
|
28
|
+ <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称或生产厂商" ></el-input>
|
29
|
29
|
<el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
|
30
|
30
|
</div>
|
31
|
31
|
</div>
|
|
@@ -42,93 +42,118 @@
|
42
|
42
|
>
|
43
|
43
|
<el-table-column label="药品类型" align="center">
|
44
|
44
|
<template slot-scope="scope">
|
45
|
|
-
|
|
45
|
+ {{getDrugTypeName(scope.row.drug_type)}}
|
46
|
46
|
</template>
|
47
|
47
|
</el-table-column>
|
48
|
48
|
<el-table-column label="药品名称" align="center">
|
49
|
49
|
<template slot-scope="scope">
|
50
|
|
-
|
|
50
|
+ {{scope.row.drug_name}}
|
51
|
51
|
</template>
|
52
|
52
|
</el-table-column>
|
53
|
53
|
<el-table-column label="规格&单位" align="center">
|
54
|
54
|
<template slot-scope="scope">
|
55
|
|
-
|
|
55
|
+ {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
|
56
|
56
|
</template>
|
57
|
57
|
</el-table-column>
|
58
|
58
|
<el-table-column label="生产厂商" align="center">
|
59
|
59
|
<template slot-scope="scope">
|
60
|
|
-
|
|
60
|
+ {{getManufacturName(scope.row.manufacturer)}}
|
61
|
61
|
</template>
|
62
|
62
|
</el-table-column>
|
63
|
63
|
<el-table-column label="国家编码" align="center">
|
64
|
64
|
<template slot-scope="scope">
|
65
|
|
-
|
|
65
|
+ {{scope.row.social_security_directory_code}}
|
66
|
66
|
</template>
|
67
|
67
|
</el-table-column>
|
68
|
68
|
<el-table-column label="仓库名称" align="center">
|
69
|
69
|
<template slot-scope="scope">
|
70
|
|
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
|
71
|
|
- <td style="border-right: none; border-inline-end: none;text-align: center" >
|
72
|
|
-
|
73
|
|
- </td>
|
74
|
|
- </tr>
|
|
70
|
+ <tr style="background: none" v-for="(item, index) in scope.row.drug_warehouse" :key="index">
|
|
71
|
+ <td style="border-right: none;border-inline-end: none;text-align: center;">
|
|
72
|
+ {{ getHouseName(item.storehouse_id) }}
|
|
73
|
+ </td>
|
|
74
|
+ </tr>
|
75
|
75
|
</template>
|
76
|
76
|
</el-table-column>
|
77
|
77
|
|
78
|
78
|
<el-table-column label="入库量" align="center">
|
79
|
79
|
<template slot-scope="scope">
|
80
|
|
- <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
|
81
|
|
- <td style="border-right: none; border-inline-end: none;text-align: center">
|
82
|
|
-
|
83
|
|
- </td>
|
84
|
|
- </tr>
|
|
80
|
+ <tr style="background: none" v-for="(item, index) in scope.row.drug_warehouse" :key="index">
|
|
81
|
+ <td style="border-right: none;border-inline-end: none;text-align: center; ">
|
|
82
|
+ {{getWarehoseInfoSeven(scope.row.drug_warehouse_info, scope.row.max_unit, scope.row.min_unit,scope.row.min_number,item.storehouse_id)}}
|
|
83
|
+ </td>
|
|
84
|
+ </tr>
|
85
|
85
|
</template>
|
86
|
86
|
</el-table-column>
|
87
|
87
|
|
88
|
88
|
<el-table-column label="出库量" align="center">
|
89
|
89
|
<template slot-scope="scope">
|
90
|
|
-
|
|
90
|
+ <tr style="background: none" v-for="(item, index) in scope.row.drug_warehouse" :key="index">
|
|
91
|
+ <td style="border-right: none;border-inline-end: none;text-align: center;">
|
|
92
|
+ <span style="color:#0099FF" @click="toDialogClick(scope.row.id,scope.row.drug_name,scope.row.dose,scope.row.dose_unit,scope.row.min_number,scope.row.min_unit,scope.row.max_unit)"> {{getOutFlushNight(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info,item.storehouse_id)}} </span>
|
|
93
|
+ </td>
|
|
94
|
+ </tr>
|
91
|
95
|
</template>
|
92
|
96
|
</el-table-column>
|
93
|
97
|
|
94
|
98
|
<el-table-column label="退库数量" align="center">
|
95
|
99
|
<template slot-scope="scope">
|
96
|
|
-
|
97
|
|
-
|
|
100
|
+ <tr style="background: none" v-for="(item, index) in scope.row.drug_warehouse" :key="index">
|
|
101
|
+ <td style="border-right: none;border-inline-end: none;text-align: center;">
|
|
102
|
+ {{getOutFlushTen(scope.row.drug_cancel_stock_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,item.storehouse_id)}}
|
|
103
|
+ </td>
|
|
104
|
+ </tr>
|
98
|
105
|
</template>
|
99
|
106
|
</el-table-column>
|
100
|
107
|
|
101
|
108
|
<el-table-column label="实际出库" align="center">
|
102
|
109
|
<template slot-scope="scope">
|
103
|
|
-
|
|
110
|
+ <tr style="background: none" v-for="(item, index) in scope.row.drug_warehouse" :key="index">
|
|
111
|
+ <td style="border-right: none;border-inline-end: none;text-align: center;">
|
|
112
|
+ {{getDrugOut(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,item.storehouse_id)}}
|
|
113
|
+ </td>
|
|
114
|
+ </tr>
|
104
|
115
|
</template>
|
105
|
116
|
</el-table-column>
|
106
|
117
|
|
107
|
118
|
<el-table-column label="剩余库存" align="center">
|
108
|
|
-
|
|
119
|
+ <template slot-scope="scope">
|
|
120
|
+ <tr style="background: none" v-for="(item, index) in scope.row.drug_warehouse" :key="index">
|
|
121
|
+ <td style="border-right: none;border-inline-end: none;text-align: center;">
|
|
122
|
+ {{getOverFlushInfoEight(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,item.storehouse_id,scope.row.storehouse_id)}}
|
|
123
|
+ </td>
|
|
124
|
+ </tr>
|
|
125
|
+ </template>
|
109
|
126
|
</el-table-column>
|
110
|
127
|
|
111
|
128
|
<el-table-column label="总库存量" align="center">
|
112
|
|
-
|
|
129
|
+ <template slot-scope="scope">
|
|
130
|
+ <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info) > 0">
|
|
131
|
+ {{getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)? getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number): 0}}
|
|
132
|
+ </div>
|
|
133
|
+ </template>
|
113
|
134
|
</el-table-column>
|
114
|
135
|
|
115
|
|
- <el-table-column label="操作" align="center" width="200px">
|
116
|
|
-
|
117
|
|
- <template slot-scope="scope">
|
118
|
|
- <el-button
|
119
|
|
- size="small"
|
120
|
|
- type="primary"
|
121
|
|
- @click="toClick(scope.row)"
|
122
|
|
- >库存流水
|
123
|
|
- </el-button>
|
124
|
|
- <el-button
|
125
|
|
- size="small"
|
126
|
|
- type="primary"
|
127
|
|
- @click="toClickOne(scope.row)"
|
128
|
|
- >批次
|
129
|
|
- </el-button>
|
130
|
|
- </template>
|
131
|
|
- </el-table-column>
|
|
136
|
+ <el-table-column
|
|
137
|
+ prop="drug_name"
|
|
138
|
+ label="操作"
|
|
139
|
+ align="center"
|
|
140
|
+ width="200px"
|
|
141
|
+ >
|
|
142
|
+ <template slot-scope="scope">
|
|
143
|
+ <el-button
|
|
144
|
+ size="small"
|
|
145
|
+ type="primary"
|
|
146
|
+ @click="handleDetail(scope.row)"
|
|
147
|
+ >库存流水
|
|
148
|
+ </el-button>
|
|
149
|
+ <el-button
|
|
150
|
+ size="small"
|
|
151
|
+ type="primary"
|
|
152
|
+ @click="handleBatch(scope.row)"
|
|
153
|
+ >批次
|
|
154
|
+ </el-button>
|
|
155
|
+ </template>
|
|
156
|
+ </el-table-column>
|
132
|
157
|
</el-table>
|
133
|
158
|
<el-pagination
|
134
|
159
|
@size-change="handleSizeChange"
|
|
@@ -151,7 +176,7 @@
|
151
|
176
|
:visible.sync="dialogVisible"
|
152
|
177
|
width="70%">
|
153
|
178
|
<span>
|
154
|
|
- 耗材名称:{{good_name}}
|
|
179
|
+ 药品名称:{{drug_name}}
|
155
|
180
|
规格&单位:{{specification_name}}
|
156
|
181
|
查询日期:
|
157
|
182
|
<el-date-picker
|
|
@@ -213,6 +238,7 @@
|
213
|
238
|
|
214
|
239
|
</template>
|
215
|
240
|
</el-table-column>
|
|
241
|
+
|
216
|
242
|
<el-table-column label="使用人" align="center">
|
217
|
243
|
<template slot-scope="scope">
|
218
|
244
|
{{getName(scope.row.patient_id)}}
|
|
@@ -245,11 +271,9 @@
|
245
|
271
|
</div>
|
246
|
272
|
</template>
|
247
|
273
|
<script>
|
248
|
|
-import { getStorehouseList,getDrugNewQuery,getGoodWarehouseOutInfoById } from "@/api/drug/drug"
|
249
|
|
-import {
|
250
|
|
- getStockDrugCount
|
251
|
|
-} from "@/api/stock";
|
|
274
|
+import { getStorehouseList,getDrugNewQuery,getDrugWarehouseOutInfoById } from "@/api/drug/drug"
|
252
|
275
|
import { uParseTime } from '@/utils/tools'
|
|
276
|
+import { max } from 'moment'
|
253
|
277
|
export default {
|
254
|
278
|
|
255
|
279
|
data(){
|
|
@@ -284,10 +308,11 @@ export default {
|
284
|
308
|
start_first_time:"",
|
285
|
309
|
end_first_time:"",
|
286
|
310
|
tableData:[],
|
287
|
|
- good_id:0,
|
|
311
|
+ drug_id:0,
|
288
|
312
|
patientList:[],
|
289
|
|
- good_name:"",
|
290
|
|
- specification_name:""
|
|
313
|
+ drug_name:"",
|
|
314
|
+ specification_name:"",
|
|
315
|
+ drugTypeList:[],
|
291
|
316
|
}
|
292
|
317
|
|
293
|
318
|
},
|
|
@@ -356,19 +381,33 @@ export default {
|
356
|
381
|
getDrugNewQuery(params).then(response=>{
|
357
|
382
|
if(response.data.state == 1){
|
358
|
383
|
var list = response.data.data.list
|
359
|
|
- console.log("list2332233232323232w",list)
|
360
|
|
-
|
361
|
|
- if(list.length > 0){
|
362
|
|
- var arr = []
|
363
|
|
- for(let i=0;i<list.length;i++){
|
364
|
|
- if(list[i].xt_warehouse_info.length > 0){
|
365
|
|
- arr.push(list[i])
|
|
384
|
+ for (let i = 0; i < list.length; i++) {
|
|
385
|
+ for (let j = 0; j < list[i].drug_warehouse_info.length; j++) {
|
|
386
|
+ if (list[i].max_unit == list[i].drug_warehouse_info[j].max_unit) {
|
|
387
|
+ list[i].drug_warehouse_info[j].stock_max_number =list[i].min_number *list[i].drug_warehouse_info[j].stock_max_number
|
|
388
|
+ list[i].drug_warehouse_info[j].warehousing_count =list[i].min_number *list[i].drug_warehouse_info[j].warehousing_count
|
|
389
|
+ }
|
366
|
390
|
}
|
|
391
|
+ for (let y = 0; y < list[i].drug_warehouse_out.length; y++) {
|
|
392
|
+ if (list[i].drug_warehouse_out[y].count_unit == list[i].max_unit) {
|
|
393
|
+ list[i].drug_warehouse_out[y].count =list[i].drug_warehouse_out[y].count * list[i].min_number
|
|
394
|
+ }
|
|
395
|
+ }
|
|
396
|
+ for (let z = 0; z < list[i].drug_cancel_stock_info.length; z++) {
|
|
397
|
+ if (list[i].drug_cancel_stock_info[z].max_unit == list[i].max_unit) {
|
|
398
|
+ list[i].drug_cancel_stock_info[z].count =list[i].drug_cancel_stock_info[z].count * list[i].min_number
|
|
399
|
+ }
|
|
400
|
+ }
|
|
401
|
+ }
|
|
402
|
+ var arr = [];
|
|
403
|
+ for (let i = 0; i < list.length; i++) {
|
|
404
|
+ if (list[i].drug_warehouse_info.length > 0) {
|
|
405
|
+ arr.push(list[i]);
|
367
|
406
|
}
|
368
|
|
- this.tableList = arr
|
369
|
407
|
}
|
|
408
|
+ this.tableList = arr;
|
370
|
409
|
this.total = response.data.data.total
|
371
|
|
-
|
|
410
|
+ this.drugTypeList = response.data.data.drugTypeList
|
372
|
411
|
}
|
373
|
412
|
})
|
374
|
413
|
},
|
|
@@ -391,11 +430,11 @@ export default {
|
391
|
430
|
},
|
392
|
431
|
handleSizeChangeOne(val) {
|
393
|
432
|
this.limitone = val;
|
394
|
|
- this.toDialogClick(this.good_id,this.good_name,this.specification_name)
|
|
433
|
+ this.toDialogClick(this.drug_id,this.drug_name,this.specification_name)
|
395
|
434
|
},
|
396
|
435
|
handleCurrentChangeOne(val) {
|
397
|
436
|
this.pageone = val;
|
398
|
|
- this.toDialogClick(this.good_id,this.good_name,this.specification_name)
|
|
437
|
+ this.toDialogClick(this.drug_id,this.drug_name,this.specification_name)
|
399
|
438
|
},
|
400
|
439
|
seach(){
|
401
|
440
|
this.getlist()
|
|
@@ -433,178 +472,37 @@ export default {
|
433
|
472
|
return ""
|
434
|
473
|
}
|
435
|
474
|
},
|
436
|
|
- getStockDrugCount(){
|
437
|
|
- var params ={
|
438
|
|
- keywords: this.keywords,
|
439
|
|
- start_time:this.start_time,
|
440
|
|
- end_time:this.end_time,
|
|
475
|
+ getOverFlushInfo(arr, max_unit, min_unit, min_number) {
|
|
476
|
+ var max_str = "";
|
|
477
|
+ var min_str = "";
|
|
478
|
+ var total = 0;
|
|
479
|
+ var newarr = arr;
|
|
480
|
+ if (newarr.length > 0) {
|
|
481
|
+ for (let i = 0; i < newarr.length; i++) {
|
|
482
|
+ total += newarr[i].stock_max_number + newarr[i].stock_min_number;
|
441
|
483
|
}
|
442
|
|
- getStockDrugCount(params).then(response=>{
|
443
|
|
- if(response.data.state == 1){
|
444
|
|
- var outlist = response.data.data.outList
|
445
|
|
- this.outCountList = outlist
|
446
|
|
- var autoCount = response.data.data.autoCount
|
447
|
|
- this.autoCountList = autoCount
|
448
|
|
- var totalCount = response.data.data.totalCount
|
449
|
|
- this.cancelCountList = totalCount
|
450
|
|
- }
|
451
|
|
- })
|
452
|
|
- },
|
453
|
|
- getWareInfoCountOne(val,storehouse_id){
|
454
|
|
- var count = 0
|
455
|
|
- if(val.length > 0){
|
456
|
|
- for(let i=0;i<val.length;i++){
|
457
|
|
- if(val[i].storehouse_id == storehouse_id){
|
458
|
|
- count +=val[i].stock_count
|
459
|
|
- }
|
460
|
|
- }
|
461
|
|
- }
|
462
|
|
- if(count > 0){
|
463
|
|
- return count
|
464
|
|
- }else{
|
465
|
|
- return ""
|
466
|
|
- }
|
467
|
|
- },
|
468
|
|
- getOutCount(id){
|
469
|
|
- var count = 0
|
470
|
|
- for(let i=0;i<this.outCountList.length;i++){
|
471
|
|
- if(id == this.outCountList[i].good_id){
|
472
|
|
- count = this.outCountList[i].count
|
473
|
|
- }
|
474
|
484
|
}
|
475
|
|
- return count
|
476
|
|
- },
|
477
|
|
- getAutoCount(id){
|
478
|
|
- var count= 0
|
479
|
|
- for(let i=0;i<this.autoCountList.length;i++){
|
480
|
|
- if(id == this.autoCountList[i].good_id){
|
481
|
|
- count = this.autoCountList[i].count
|
482
|
|
- }
|
483
|
|
- }
|
484
|
|
- return count
|
485
|
|
- },
|
486
|
|
- getCancelCount(id){
|
487
|
|
- var count = 0
|
488
|
|
- for(let i=0;i<this.cancelCountList.length;i++){
|
489
|
|
- if(id == this.cancelCountList[i].good_id){
|
490
|
|
- count = this.cancelCountList[i].count
|
491
|
|
- }
|
492
|
|
- }
|
493
|
|
- return count
|
494
|
|
- },
|
495
|
|
- getCancelCountInfo(cancel_stock_info,storehouse_id){
|
496
|
|
- var count = 0
|
497
|
|
- if(cancel_stock_info.length >0){
|
498
|
|
- for(let i=0;i<cancel_stock_info.length;i++){
|
499
|
|
- if(storehouse_id == cancel_stock_info[i].storehouse_id){
|
500
|
|
- count += cancel_stock_info[i].count
|
501
|
|
- }
|
502
|
|
- }
|
503
|
|
- }
|
504
|
|
- return count
|
505
|
|
- },
|
506
|
|
- getWareOutInfoCount(warehouse_out_info,storehouse_id){
|
507
|
|
- var count = 0
|
508
|
|
- if(warehouse_out_info.length > 0){
|
509
|
|
- for(let i=0;i<warehouse_out_info.length;i++){
|
510
|
|
- if(storehouse_id == warehouse_out_info[i].storehouse_id){
|
511
|
|
- count +=warehouse_out_info[i].count
|
512
|
|
- }
|
513
|
|
- }
|
514
|
|
- }
|
515
|
|
- return count
|
516
|
|
- },
|
517
|
|
- getInCount(id){
|
518
|
|
- var count= 0
|
519
|
|
- for(let i=0;i<this.countList.length;i++){
|
520
|
|
- if(id == this.countList[i].good_id){
|
521
|
|
- count = this.countList[i].count
|
|
485
|
+ if (total < min_number) {
|
|
486
|
+ min_str = total + min_unit;
|
522
|
487
|
}
|
523
|
|
- }
|
524
|
|
- return count
|
525
|
|
- },
|
526
|
|
- getOutCount(id){
|
527
|
|
- var count = 0
|
528
|
|
- for(let i=0;i<this.outCountList.length;i++){
|
529
|
|
- if(id == this.outCountList[i].good_id){
|
530
|
|
- count = this.outCountList[i].count
|
531
|
|
- }
|
|
488
|
+ if (total == 0) {
|
|
489
|
+ min_str = "";
|
|
490
|
+ max_str = "";
|
532
|
491
|
}
|
533
|
|
- return count
|
534
|
|
- },
|
535
|
|
- getAutoCount(id){
|
536
|
|
- var count= 0
|
537
|
|
- for(let i=0;i<this.autoCountList.length;i++){
|
538
|
|
- if(id == this.autoCountList[i].good_id){
|
539
|
|
- count = this.autoCountList[i].count
|
540
|
|
- }
|
541
|
|
- }
|
542
|
|
- return count
|
543
|
|
- },
|
544
|
|
- getCancelCount(id){
|
545
|
|
- var count = 0
|
546
|
|
- for(let i=0;i<this.cancelCountList.length;i++){
|
547
|
|
- if(id == this.cancelCountList[i].good_id){
|
548
|
|
- count = this.cancelCountList[i].count
|
549
|
|
- }
|
550
|
|
- }
|
551
|
|
- return count
|
552
|
|
- },
|
553
|
|
- getStockCount(id){
|
554
|
|
- var stock_count = 0
|
555
|
|
- for(let i=0;i<this.countList.length;i++){
|
556
|
|
- if(id == this.countList[i].good_id){
|
557
|
|
- stock_count = this.countList[i].stock_count
|
558
|
|
- }
|
559
|
|
- }
|
560
|
|
- return stock_count
|
561
|
|
- },
|
562
|
|
- getWareInfo(arr){
|
563
|
|
- var total = 0
|
564
|
|
- if(arr.length > 0){
|
565
|
|
- for(let i=0;i<arr.length;i++){
|
566
|
|
- total += parseInt(arr[i].warehousing_count)
|
567
|
|
- }
|
568
|
|
- }else{
|
569
|
|
- total = ""
|
570
|
|
- }
|
571
|
|
- return total
|
572
|
|
- },
|
573
|
|
- getOverplus(arr){
|
574
|
|
- var total = 0
|
575
|
|
- if(arr.length > 0){
|
576
|
|
- for(let i=0;i<arr.length;i++){
|
577
|
|
- total += arr[i].stock_count
|
578
|
|
- }
|
579
|
|
- }else{
|
580
|
|
- total = ""
|
581
|
|
- }
|
582
|
|
- return total
|
583
|
|
- },
|
584
|
|
- getCancelInfo(arr){
|
585
|
|
- var total = 0
|
586
|
|
- if(arr.length > 0){
|
587
|
|
- for(let i=0;i<arr.length;i++){
|
588
|
|
- total += arr[i].count
|
589
|
|
- }
|
590
|
|
- }else{
|
591
|
|
- total = ""
|
592
|
|
- }
|
593
|
|
- return total
|
594
|
|
- },
|
595
|
|
- getOverFlushInfo(arr){
|
596
|
|
- var total = 0
|
597
|
|
- if(arr.length >0){
|
598
|
|
- for(let i=0;i<arr.length;i++){
|
599
|
|
- total += arr[i].stock_count
|
|
492
|
+ if (total >= min_number) {
|
|
493
|
+ if (parseInt(total / min_number) != 0) {
|
|
494
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
495
|
+ }
|
|
496
|
+ if (total % min_number != 0) {
|
|
497
|
+ min_str = (total % min_number) + min_unit;
|
|
498
|
+ }
|
600
|
499
|
}
|
601
|
|
- }
|
602
|
|
- return total
|
603
|
|
- },
|
604
|
|
- toDialogClick(id,good_name,specification_name){
|
605
|
|
- this.good_id = id
|
606
|
|
- this.good_name = good_name
|
607
|
|
- this.specification_name = specification_name
|
|
500
|
+ return max_str + min_str;
|
|
501
|
+ },
|
|
502
|
+ toDialogClick(id,drug_name,dose,dose_unit,min_number,min_unit,max_unit){
|
|
503
|
+ this.drug_id = id
|
|
504
|
+ this.drug_name = drug_name
|
|
505
|
+ this.specification_name = dose + dose_unit + "*"+min_number+min_unit +"/"+ max_unit
|
608
|
506
|
var params = {
|
609
|
507
|
good_id:id,
|
610
|
508
|
limit:this.limitone,
|
|
@@ -612,7 +510,7 @@ export default {
|
612
|
510
|
start_first_time:this.start_first_time,
|
613
|
511
|
end_first_time:this.end_first_time,
|
614
|
512
|
}
|
615
|
|
- getGoodWarehouseOutInfoById(params).then(response=>{
|
|
513
|
+ getDrugWarehouseOutInfoById(params).then(response=>{
|
616
|
514
|
if(response.data.state == 1){
|
617
|
515
|
var list = response.data.data.list
|
618
|
516
|
console.log("list23233233232w",list)
|
|
@@ -647,12 +545,243 @@ export default {
|
647
|
545
|
}
|
648
|
546
|
}
|
649
|
547
|
return name
|
650
|
|
- }
|
|
548
|
+ },
|
|
549
|
+ getDrugTypeName(id){
|
|
550
|
+ var type_name = ""
|
|
551
|
+ for(let i=0;i<this.drugTypeList.length;i++){
|
|
552
|
+ if(id == this.drugTypeList[i].value){
|
|
553
|
+ type_name = this.drugTypeList[i].name
|
|
554
|
+ }
|
|
555
|
+ }
|
|
556
|
+ return type_name
|
|
557
|
+ },
|
|
558
|
+ getWarehoseInfoSeven(arr, max_unit, min_unit, min_number, storehouse_id) {
|
|
559
|
+ var total = 0;
|
|
560
|
+ var max_str = "";
|
|
561
|
+ var min_str = "";
|
|
562
|
+ if (arr.length > 0) {
|
|
563
|
+ for (let i = 0; i < arr.length; i++) {
|
|
564
|
+ if (arr[i].storehouse_id == storehouse_id) {
|
|
565
|
+ total += parseInt(arr[i].warehousing_count);
|
|
566
|
+ }
|
|
567
|
+ }
|
|
568
|
+ }
|
|
569
|
+ if (total < min_number) {
|
|
570
|
+ min_str = total + min_unit;
|
|
571
|
+ }
|
|
572
|
+ if (total == 0) {
|
|
573
|
+ min_str = "";
|
|
574
|
+ max_str = "";
|
|
575
|
+ }
|
|
576
|
+ if (total >= min_number) {
|
|
577
|
+ if (parseInt(total / min_number) != 0) {
|
|
578
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
579
|
+ }
|
|
580
|
+ if (total % min_number != 0) {
|
|
581
|
+ min_str = (total % min_number) + min_unit;
|
|
582
|
+ }
|
|
583
|
+ }
|
|
584
|
+ return max_str + min_str;
|
|
585
|
+ },
|
|
586
|
+ getOutFlushNight(info, max_unit, min_unit,min_number, cancel_info,storehouse_id){
|
|
587
|
+ var str = "";
|
|
588
|
+ var str_min = "";
|
|
589
|
+ //总库存
|
|
590
|
+ var total = 0;
|
|
591
|
+ var out_count = 0;
|
|
592
|
+ var over_count = 0;
|
|
593
|
+ var cancel_count = 0;
|
|
594
|
+ for (let i = 0; i < info.length; i++) {
|
|
595
|
+ if (info[i].storehouse_id == storehouse_id) {
|
|
596
|
+ total += info[i].warehousing_count;
|
|
597
|
+ }
|
|
598
|
+ }
|
|
599
|
+
|
|
600
|
+ for (let j = 0; j < info.length; j++) {
|
|
601
|
+ if (info[j].storehouse_id == storehouse_id) {
|
|
602
|
+ out_count += info[j].stock_max_number + info[j].stock_min_number;
|
|
603
|
+ }
|
|
604
|
+ }
|
|
605
|
+ over_count = total - out_count;
|
|
606
|
+ if (parseInt(over_count / min_number) != 0) {
|
|
607
|
+ str = parseInt(over_count / min_number) + max_unit;
|
|
608
|
+ }
|
|
609
|
+ if (over_count % min_number != 0) {
|
|
610
|
+ str_min = (over_count % min_number) + min_unit;
|
|
611
|
+ }
|
|
612
|
+ return str + str_min;
|
|
613
|
+ },
|
|
614
|
+ getOverFlushInfoEight(arr, max_unit, min_unit, min_number, storehouse_id) {
|
|
615
|
+ var max_str = "";
|
|
616
|
+ var min_str = "";
|
|
617
|
+ var total = 0;
|
|
618
|
+ var newarr = arr;
|
|
619
|
+
|
|
620
|
+ if (newarr.length > 0) {
|
|
621
|
+ for (let i = 0; i < newarr.length; i++) {
|
|
622
|
+ if (newarr[i].storehouse_id == storehouse_id) {
|
|
623
|
+ total += newarr[i].stock_max_number + newarr[i].stock_min_number;
|
|
624
|
+ }
|
|
625
|
+ }
|
|
626
|
+ }
|
|
627
|
+ if (total < min_number) {
|
|
628
|
+ min_str = total + min_unit;
|
|
629
|
+ }
|
|
630
|
+ if (total == 0) {
|
|
631
|
+ min_str = "";
|
|
632
|
+ max_str = "";
|
|
633
|
+ }
|
|
634
|
+ if (total >= min_number) {
|
|
635
|
+ if (parseInt(total / min_number) != 0) {
|
|
636
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
637
|
+ }
|
|
638
|
+ if (total % min_number != 0) {
|
|
639
|
+ min_str = (total % min_number) + min_unit;
|
|
640
|
+ }
|
|
641
|
+ }
|
|
642
|
+
|
|
643
|
+ return max_str + min_str;
|
|
644
|
+ },
|
|
645
|
+
|
|
646
|
+ getWarehoseInfo(arr) {
|
|
647
|
+ var total = 0;
|
|
648
|
+ if (arr.length > 0) {
|
|
649
|
+ for (let i = 0; i < arr.length; i++) {
|
|
650
|
+ total += parseInt(arr[i].warehousing_count);
|
|
651
|
+ }
|
|
652
|
+ }
|
|
653
|
+ if (total == 0) {
|
|
654
|
+ total = "";
|
|
655
|
+ }
|
|
656
|
+
|
|
657
|
+ return total;
|
|
658
|
+ },
|
|
659
|
+ getOutFlushTen(info, max_unit, min_unit,min_number,storehouse_id){
|
|
660
|
+ var str = "";
|
|
661
|
+ var str_min = "";
|
|
662
|
+ //总库存
|
|
663
|
+ var total = 0;
|
|
664
|
+ for (let i = 0; i < info.length; i++) {
|
|
665
|
+ if (info[i].storehouse_id == storehouse_id) {
|
|
666
|
+ total += info[i].count;
|
|
667
|
+ }
|
|
668
|
+ }
|
|
669
|
+ if (parseInt(total / min_number) != 0) {
|
|
670
|
+ str = parseInt(total / min_number) + max_unit;
|
|
671
|
+ }
|
|
672
|
+ if (total % min_number != 0) {
|
|
673
|
+ str_min = (total % min_number) + min_unit;
|
|
674
|
+ }
|
|
675
|
+ return str + str_min;
|
|
676
|
+ },
|
|
677
|
+ getDrugOut(info, max_unit, min_unit,min_number,storehouse_id){
|
|
678
|
+
|
|
679
|
+ var str = "";
|
|
680
|
+ var str_min = "";
|
|
681
|
+ //总库存
|
|
682
|
+ var total = 0;
|
|
683
|
+ for (let i = 0; i < info.length; i++) {
|
|
684
|
+ if (info[i].storehouse_id == storehouse_id) {
|
|
685
|
+ total += info[i].count;
|
|
686
|
+ }
|
|
687
|
+ }
|
|
688
|
+ if (parseInt(total / min_number) != 0) {
|
|
689
|
+ str = parseInt(total / min_number) + max_unit;
|
|
690
|
+ }
|
|
691
|
+ if (total % min_number != 0) {
|
|
692
|
+ str_min = (total % min_number) + min_unit;
|
|
693
|
+ }
|
|
694
|
+ return str + str_min;
|
|
695
|
+ },
|
|
696
|
+ handleDetail(val) {
|
|
697
|
+ var manufacturer_name = "";
|
|
698
|
+ for (let i = 0; i < this.manufacturerList.length; i++) {
|
|
699
|
+ if (val.manufacturer == this.manufacturerList[i].id) {
|
|
700
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name;
|
|
701
|
+ }
|
|
702
|
+ }
|
|
703
|
+ var unit =
|
|
704
|
+ val.dose +
|
|
705
|
+ val.dose_unit +
|
|
706
|
+ "*" +
|
|
707
|
+ val.min_number +
|
|
708
|
+ val.min_unit +
|
|
709
|
+ "/" +
|
|
710
|
+ val.max_unit;
|
|
711
|
+ var over_plus = this.getOverFlushInfo(
|
|
712
|
+ val.drug_warehouse_info,
|
|
713
|
+ val.max_unit,
|
|
714
|
+ val.min_unit,
|
|
715
|
+ val.min_number
|
|
716
|
+ );
|
|
717
|
+ this.$router.push({
|
|
718
|
+ path:
|
|
719
|
+ "/drugstock/in/drugstockflow?drug_id=" +
|
|
720
|
+ val.id +
|
|
721
|
+ "&manufacturer=" +
|
|
722
|
+ manufacturer_name +
|
|
723
|
+ "&unit=" +
|
|
724
|
+ unit +
|
|
725
|
+ "&min_number=" +
|
|
726
|
+ val.min_number +
|
|
727
|
+ "&max_unit=" +
|
|
728
|
+ val.max_unit +
|
|
729
|
+ "&min_unit=" +
|
|
730
|
+ val.min_unit +
|
|
731
|
+ "&over_plus=" +
|
|
732
|
+ over_plus,
|
|
733
|
+ });
|
|
734
|
+ window.sessionStorage.setItem("start_time", this.start_time);
|
|
735
|
+ window.sessionStorage.setItem("end_time", this.end_time);
|
|
736
|
+ },
|
|
737
|
+ handleBatch(val) {
|
|
738
|
+ console.log("val322332323232", val);
|
|
739
|
+ var manufacturer_name = "";
|
|
740
|
+ for (let i = 0; i < this.manufacturerList.length; i++) {
|
|
741
|
+ if (val.manufacturer == this.manufacturerList[i].id) {
|
|
742
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name;
|
|
743
|
+ }
|
|
744
|
+ }
|
|
745
|
+ var unit =
|
|
746
|
+ val.dose +
|
|
747
|
+ val.dose_unit +
|
|
748
|
+ "*" +
|
|
749
|
+ val.min_number +
|
|
750
|
+ val.min_unit +
|
|
751
|
+ "/" +
|
|
752
|
+ val.max_unit;
|
|
753
|
+ var over_plus = this.getOverFlushInfo(
|
|
754
|
+ val.drug_warehouse_info,
|
|
755
|
+ val.max_unit,
|
|
756
|
+ val.min_unit,
|
|
757
|
+ val.min_number
|
|
758
|
+ );
|
|
759
|
+
|
|
760
|
+ window.sessionStorage.setItem("start_time", this.start_time);
|
|
761
|
+ window.sessionStorage.setItem("end_time", this.end_time);
|
|
762
|
+ this.$router.push({
|
|
763
|
+ path:
|
|
764
|
+ "/drugstock/in/drugbatchnumber?drug_id=" +
|
|
765
|
+ val.id +
|
|
766
|
+ "&manufacturer=" +
|
|
767
|
+ manufacturer_name +
|
|
768
|
+ "&unit=" +
|
|
769
|
+ unit +
|
|
770
|
+ "&min_number=" +
|
|
771
|
+ val.min_number +
|
|
772
|
+ "&max_unit=" +
|
|
773
|
+ val.max_unit +
|
|
774
|
+ "&min_unit=" +
|
|
775
|
+ val.min_unit +
|
|
776
|
+ "&over_plus=" +
|
|
777
|
+ over_plus,
|
|
778
|
+ });
|
|
779
|
+ },
|
651
|
780
|
},
|
652
|
781
|
created(){
|
653
|
782
|
this.getStorehouseList()
|
654
|
783
|
this.getlist()
|
655
|
|
- this.getStockDrugCount()
|
|
784
|
+
|
656
|
785
|
}
|
657
|
786
|
}
|
658
|
787
|
</script>
|