|
@@ -15,16 +15,18 @@
|
15
|
15
|
</el-option>
|
16
|
16
|
</el-select>
|
17
|
17
|
<span>库存预警:</span>
|
18
|
|
- <el-select v-model="good_id" style="width:250px;margin-right:10px;" placeholder="请选择"
|
|
18
|
+ <el-select v-model="good_type" style="width:250px;margin-right:10px;" placeholder="请选择"
|
19
|
19
|
filterable
|
20
|
20
|
@change="changeGoodName">
|
21
|
21
|
<el-option
|
22
|
22
|
v-for="item in goodList"
|
23
|
23
|
:key="item.id"
|
24
|
|
- :label="item.good_name"
|
|
24
|
+ :label="item.name"
|
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>
|
|
29
|
+ <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
|
28
|
30
|
</div>
|
29
|
31
|
</div>
|
30
|
32
|
|
|
@@ -40,73 +42,123 @@
|
40
|
42
|
>
|
41
|
43
|
<el-table-column label="耗材类型" align="center">
|
42
|
44
|
<template slot-scope="scope">
|
43
|
|
-
|
44
|
|
- </template>
|
|
45
|
+ {{getGoodTypeName(scope.row.good_type_id)}}
|
|
46
|
+ </template>
|
45
|
47
|
</el-table-column>
|
46
|
48
|
<el-table-column label="耗材名称" align="center">
|
47
|
49
|
<template slot-scope="scope">
|
48
|
|
-
|
|
50
|
+ {{scope.row.good_name}}
|
49
|
51
|
</template>
|
50
|
52
|
</el-table-column>
|
51
|
53
|
<el-table-column label="规格&单位" align="center">
|
52
|
54
|
<template slot-scope="scope">
|
53
|
|
-
|
|
55
|
+ {{scope.row.specification_name}}
|
54
|
56
|
</template>
|
55
|
57
|
</el-table-column>
|
56
|
58
|
<el-table-column label="生产厂商" align="center">
|
57
|
|
- <template slot-scope="scope">
|
58
|
|
-
|
59
|
|
- </template>
|
|
59
|
+ <template slot-scope="scope">
|
|
60
|
+ {{getManufacturName(scope.row.manufacturer)}}
|
|
61
|
+ </template>
|
60
|
62
|
</el-table-column>
|
61
|
63
|
<el-table-column label="国家编码" align="center">
|
62
|
64
|
<template slot-scope="scope">
|
63
|
|
-
|
|
65
|
+ {{scope.row.social_security_directory_code}}
|
64
|
66
|
</template>
|
65
|
67
|
</el-table-column>
|
66
|
68
|
<el-table-column label="仓库名称" align="center">
|
67
|
69
|
<template slot-scope="scope">
|
68
|
|
-
|
|
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
|
+ {{getHouseName(item.storehouse_id)}}
|
|
73
|
+ </td>
|
|
74
|
+ </tr>
|
69
|
75
|
</template>
|
70
|
76
|
</el-table-column>
|
71
|
77
|
|
72
|
|
-
|
73
|
78
|
<el-table-column label="入库量" align="center">
|
74
|
79
|
<template slot-scope="scope">
|
75
|
|
-
|
76
|
|
- </template>
|
|
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
|
+ {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id)}}
|
|
83
|
+ </td>
|
|
84
|
+ </tr>
|
|
85
|
+ </template>
|
77
|
86
|
</el-table-column>
|
78
|
|
-
|
|
87
|
+
|
79
|
88
|
<el-table-column label="出库量" align="center">
|
80
|
89
|
<template slot-scope="scope">
|
81
|
|
-
|
82
|
|
- </template>
|
|
90
|
+ <span v-if="org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
|
|
91
|
+ <span v-if="org_id!=3907 && org_id!=9583">
|
|
92
|
+ <tr style="background: none" v-for="(item,index) in scope.row.warehouse_out_info" :key="index">
|
|
93
|
+ <td style="border-right: none; border-inline-end: none;text-align: center">
|
|
94
|
+ <span style="color:blue" @click="d"> {{getWareOutInfoCount(scope.row.warehouse_out_info,item.storehouse_id)}}</span>
|
|
95
|
+ </td>
|
|
96
|
+ </tr>
|
|
97
|
+ </span>
|
|
98
|
+ </template>
|
83
|
99
|
</el-table-column>
|
84
|
100
|
|
85
|
101
|
<el-table-column label="退库数量" align="center">
|
86
|
102
|
<template slot-scope="scope">
|
87
|
|
-
|
|
103
|
+ <tr style="background: none" v-for="(item,index) in scope.row.cancel_stock_info" :key="index">
|
|
104
|
+ <td style="border-right: none; border-inline-end: none;text-align: center">
|
|
105
|
+ {{getCancelCountInfo(scope.row.cancel_stock_info,item.storehouse_id)}}
|
|
106
|
+ </td>
|
|
107
|
+ </tr>
|
|
108
|
+
|
88
|
109
|
</template>
|
89
|
110
|
</el-table-column>
|
90
|
111
|
|
91
|
112
|
<el-table-column label="实际出库" align="center">
|
92
|
113
|
<template slot-scope="scope">
|
93
|
|
-
|
94
|
|
- </template>
|
|
114
|
+ <span v-if="org_id == 3907 || org_id == 9583">{{ getAutoCount(scope.row.id) + getOutCount(scope.row.id) }}</span>
|
|
115
|
+ <span v-if="org_id!=3907 && org_id!=9583">
|
|
116
|
+ <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
|
|
117
|
+ <td style="border-right: none; border-inline-end: none;text-align: center">
|
|
118
|
+ {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id) - getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
|
|
119
|
+ </td>
|
|
120
|
+ </tr>
|
|
121
|
+ </span>
|
|
122
|
+ </template>
|
95
|
123
|
</el-table-column>
|
96
|
124
|
|
97
|
125
|
<el-table-column label="剩余库存" align="center">
|
98
|
126
|
<template slot-scope="scope">
|
99
|
|
-
|
|
127
|
+ <span v-if="org_id == 3907 || org_id == 9583">
|
|
128
|
+ {{
|
|
129
|
+ getWareInfo(scope.row.xt_warehouse_info) -
|
|
130
|
+ getAutoCount(scope.row.id) -
|
|
131
|
+ getOutCount(scope.row.id) +
|
|
132
|
+ getCancelCount(scope.row.id)
|
|
133
|
+ }}
|
|
134
|
+ </span>
|
|
135
|
+ <span v-if="org_id!=3907 && org_id!=9583">
|
|
136
|
+ <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
|
|
137
|
+ <td style="border-right: none; border-inline-end: none;text-align: center">
|
|
138
|
+ {{getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
|
|
139
|
+ </td>
|
|
140
|
+ </tr>
|
|
141
|
+ </span>
|
100
|
142
|
</template>
|
101
|
143
|
</el-table-column>
|
102
|
144
|
|
103
|
145
|
<el-table-column label="总库存量" align="center">
|
104
|
146
|
<template slot-scope="scope">
|
105
|
|
-
|
106
|
|
- </template>
|
|
147
|
+ <span v-if="org_id == 3907 || org_id == 9583">
|
|
148
|
+ {{
|
|
149
|
+ getWareInfo(scope.row.xt_warehouse_info) -
|
|
150
|
+ getAutoCount(scope.row.id) -
|
|
151
|
+ getOutCount(scope.row.id) +
|
|
152
|
+ getCancelCount(scope.row.id)
|
|
153
|
+ }}
|
|
154
|
+ </span>
|
|
155
|
+ <span v-if="org_id != 3907 && org_id != 9583">
|
|
156
|
+ {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
|
|
157
|
+ </span>
|
|
158
|
+ </template>
|
107
|
159
|
</el-table-column>
|
108
|
160
|
|
109
|
|
- <el-table-column label="操作" align="center">
|
|
161
|
+ <el-table-column label="操作" align="center" width="200px">
|
110
|
162
|
|
111
|
163
|
<template slot-scope="scope">
|
112
|
164
|
<el-button
|
|
@@ -123,25 +175,55 @@
|
123
|
175
|
</el-button>
|
124
|
176
|
</template>
|
125
|
177
|
</el-table-column>
|
126
|
|
-
|
127
|
178
|
</el-table>
|
|
179
|
+ <el-pagination
|
|
180
|
+ @size-change="handleSizeChange"
|
|
181
|
+ @current-change="handleCurrentChange"
|
|
182
|
+ :page-sizes="[10, 50, 100,200,500,1000]"
|
|
183
|
+ :page-size="10"
|
|
184
|
+ background
|
|
185
|
+ align="right"
|
|
186
|
+ style="margin-top:20px;"
|
|
187
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
188
|
+ :total="total"
|
|
189
|
+ >
|
|
190
|
+ </el-pagination>
|
128
|
191
|
</div>
|
129
|
192
|
|
130
|
193
|
</div>
|
131
|
194
|
</template>
|
132
|
195
|
<script>
|
|
196
|
+import { getStorehouseList,getGoodNewQuery } from "@/api/drug/drug"
|
|
197
|
+import {
|
|
198
|
+ getStockDrugCount
|
|
199
|
+} from "@/api/stock";
|
133
|
200
|
export default {
|
134
|
201
|
|
135
|
202
|
data(){
|
136
|
203
|
return{
|
137
|
204
|
tableList:[],
|
138
|
|
- goodList:[],
|
|
205
|
+ goodList:[
|
|
206
|
+ {id:1,name:"全部耗材"},
|
|
207
|
+ {id:2,name:"库存预警"},
|
|
208
|
+ ],
|
139
|
209
|
houseList:[],
|
140
|
210
|
storehouse_id:0,
|
141
|
|
- good_id:0,
|
|
211
|
+ good_type:1,
|
142
|
212
|
multipleSelection: [],
|
143
|
213
|
signAndWeighBoxPatients: "sign-and-weigh-box-patients",
|
144
|
214
|
manufacturerList:[],
|
|
215
|
+ limit:10,
|
|
216
|
+ page:1,
|
|
217
|
+ total:0,
|
|
218
|
+ keyword:"",
|
|
219
|
+ goodTypeList:[],
|
|
220
|
+ start_time:"",
|
|
221
|
+ end_time:"",
|
|
222
|
+ countList:[],
|
|
223
|
+ outCountList:[],
|
|
224
|
+ autoCountList:[],
|
|
225
|
+ cancelCountList:[],
|
|
226
|
+ org_id:this.$store.getters.xt_user.org_id,
|
145
|
227
|
}
|
146
|
228
|
|
147
|
229
|
},
|
|
@@ -179,6 +261,278 @@ export default {
|
179
|
261
|
// window.sessionStorage.setItem('end_time',this.end_time)
|
180
|
262
|
this.$router.push({path:"/stock/in/stockbatchnumber?id="+val.id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.packing_unit+"&overCount="+overCount})
|
181
|
263
|
},
|
|
264
|
+
|
|
265
|
+ getStorehouseList(){
|
|
266
|
+ getStorehouseList().then(response=>{
|
|
267
|
+ if(response.data.state == 1){
|
|
268
|
+ var houseList = response.data.data.list
|
|
269
|
+ var obj = {id:0,storehouse_name:"全部"}
|
|
270
|
+ this.houseList.push(obj)
|
|
271
|
+ for(let i=0;i<houseList.length;i++){
|
|
272
|
+ this.houseList.push(houseList[i])
|
|
273
|
+ }
|
|
274
|
+ this.manufacturerList = response.data.data.manufacturerList
|
|
275
|
+ this.goodTypeList = response.data.data.goodTypeList
|
|
276
|
+ }
|
|
277
|
+ })
|
|
278
|
+ },
|
|
279
|
+ getlist(){
|
|
280
|
+ var params = {
|
|
281
|
+ storehouse_id:this.storehouse_id,
|
|
282
|
+ good_type:this.good_type,
|
|
283
|
+ keyword:this.keyword,
|
|
284
|
+ page:this.page,
|
|
285
|
+ limit:this.limit,
|
|
286
|
+ start_time:this.start_time,
|
|
287
|
+ end_time:this.end_time,
|
|
288
|
+ }
|
|
289
|
+ getGoodNewQuery(params).then(response=>{
|
|
290
|
+ if(response.data.state == 1){
|
|
291
|
+ var list = response.data.data.list
|
|
292
|
+ console.log("list2332233232323232w",list)
|
|
293
|
+
|
|
294
|
+ if(list.length > 0){
|
|
295
|
+ var arr = []
|
|
296
|
+ for(let i=0;i<list.length;i++){
|
|
297
|
+ if(list[i].xt_warehouse_info.length > 0){
|
|
298
|
+ arr.push(list[i])
|
|
299
|
+ }
|
|
300
|
+ }
|
|
301
|
+ this.tableList = arr
|
|
302
|
+ }
|
|
303
|
+ this.total = response.data.data.total
|
|
304
|
+
|
|
305
|
+ }
|
|
306
|
+ })
|
|
307
|
+ },
|
|
308
|
+ getManufacturName(id){
|
|
309
|
+ var manufacturer_name = ""
|
|
310
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
311
|
+ if(id == this.manufacturerList[i].id){
|
|
312
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name
|
|
313
|
+ }
|
|
314
|
+ }
|
|
315
|
+ return manufacturer_name
|
|
316
|
+ },
|
|
317
|
+ handleSizeChange(val) {
|
|
318
|
+ this.limit = val;
|
|
319
|
+ this.getlist()
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+ },
|
|
323
|
+ handleCurrentChange(val) {
|
|
324
|
+ this.page = val;
|
|
325
|
+ this.getlist()
|
|
326
|
+ },
|
|
327
|
+ seach(){
|
|
328
|
+ this.getlist()
|
|
329
|
+ },
|
|
330
|
+ getGoodTypeName(id){
|
|
331
|
+ var type_name = ""
|
|
332
|
+ for(let i=0;i<this.goodTypeList.length;i++){
|
|
333
|
+ if(id == this.goodTypeList[i].id){
|
|
334
|
+ type_name = this.goodTypeList[i].type_name
|
|
335
|
+ }
|
|
336
|
+ }
|
|
337
|
+ return type_name
|
|
338
|
+ },
|
|
339
|
+ getHouseName(id){
|
|
340
|
+ var storehouse_name = ""
|
|
341
|
+ for(let i=0;i<this.houseList.length;i++){
|
|
342
|
+ if(id == this.houseList[i].id){
|
|
343
|
+ storehouse_name = this.houseList[i].storehouse_name
|
|
344
|
+ }
|
|
345
|
+ }
|
|
346
|
+ return storehouse_name
|
|
347
|
+ },
|
|
348
|
+ getWareInfoCount(val,storehouse_id){
|
|
349
|
+ var count = 0
|
|
350
|
+ if(val.length > 0){
|
|
351
|
+ for(let i=0;i<val.length;i++){
|
|
352
|
+ if(val[i].storehouse_id == storehouse_id){
|
|
353
|
+ count +=val[i].warehousing_count
|
|
354
|
+ }
|
|
355
|
+ }
|
|
356
|
+ }
|
|
357
|
+ if(count > 0){
|
|
358
|
+ return count
|
|
359
|
+ }else{
|
|
360
|
+ return ""
|
|
361
|
+ }
|
|
362
|
+ },
|
|
363
|
+ getStockDrugCount(){
|
|
364
|
+ var params ={
|
|
365
|
+ keywords: this.keywords,
|
|
366
|
+ start_time:this.start_time,
|
|
367
|
+ end_time:this.end_time,
|
|
368
|
+ }
|
|
369
|
+ getStockDrugCount(params).then(response=>{
|
|
370
|
+ if(response.data.state == 1){
|
|
371
|
+ var outlist = response.data.data.outList
|
|
372
|
+ this.outCountList = outlist
|
|
373
|
+ var autoCount = response.data.data.autoCount
|
|
374
|
+ this.autoCountList = autoCount
|
|
375
|
+ var totalCount = response.data.data.totalCount
|
|
376
|
+ this.cancelCountList = totalCount
|
|
377
|
+ }
|
|
378
|
+ })
|
|
379
|
+ },
|
|
380
|
+ getWareInfoCountOne(val,storehouse_id){
|
|
381
|
+ var count = 0
|
|
382
|
+ if(val.length > 0){
|
|
383
|
+ for(let i=0;i<val.length;i++){
|
|
384
|
+ if(val[i].storehouse_id == storehouse_id){
|
|
385
|
+ count +=val[i].stock_count
|
|
386
|
+ }
|
|
387
|
+ }
|
|
388
|
+ }
|
|
389
|
+ if(count > 0){
|
|
390
|
+ return count
|
|
391
|
+ }else{
|
|
392
|
+ return ""
|
|
393
|
+ }
|
|
394
|
+ },
|
|
395
|
+ getOutCount(id){
|
|
396
|
+ var count = 0
|
|
397
|
+ for(let i=0;i<this.outCountList.length;i++){
|
|
398
|
+ if(id == this.outCountList[i].good_id){
|
|
399
|
+ count = this.outCountList[i].count
|
|
400
|
+ }
|
|
401
|
+ }
|
|
402
|
+ return count
|
|
403
|
+ },
|
|
404
|
+ getAutoCount(id){
|
|
405
|
+ var count= 0
|
|
406
|
+ for(let i=0;i<this.autoCountList.length;i++){
|
|
407
|
+ if(id == this.autoCountList[i].good_id){
|
|
408
|
+ count = this.autoCountList[i].count
|
|
409
|
+ }
|
|
410
|
+ }
|
|
411
|
+ return count
|
|
412
|
+ },
|
|
413
|
+ getCancelCount(id){
|
|
414
|
+ var count = 0
|
|
415
|
+ for(let i=0;i<this.cancelCountList.length;i++){
|
|
416
|
+ if(id == this.cancelCountList[i].good_id){
|
|
417
|
+ count = this.cancelCountList[i].count
|
|
418
|
+ }
|
|
419
|
+ }
|
|
420
|
+ return count
|
|
421
|
+ },
|
|
422
|
+ getCancelCountInfo(cancel_stock_info,storehouse_id){
|
|
423
|
+ var count = 0
|
|
424
|
+ if(cancel_stock_info.length >0){
|
|
425
|
+ for(let i=0;i<cancel_stock_info.length;i++){
|
|
426
|
+ if(storehouse_id == cancel_stock_info[i].storehouse_id){
|
|
427
|
+ count += cancel_stock_info[i].count
|
|
428
|
+ }
|
|
429
|
+ }
|
|
430
|
+ }
|
|
431
|
+ return count
|
|
432
|
+ },
|
|
433
|
+ getWareOutInfoCount(warehouse_out_info,storehouse_id){
|
|
434
|
+ var count = 0
|
|
435
|
+ if(warehouse_out_info.length > 0){
|
|
436
|
+ for(let i=0;i<warehouse_out_info.length;i++){
|
|
437
|
+ if(storehouse_id == warehouse_out_info[i].storehouse_id){
|
|
438
|
+ count +=warehouse_out_info[i].count
|
|
439
|
+ }
|
|
440
|
+ }
|
|
441
|
+ }
|
|
442
|
+ return count
|
|
443
|
+ },
|
|
444
|
+ getInCount(id){
|
|
445
|
+ var count= 0
|
|
446
|
+ for(let i=0;i<this.countList.length;i++){
|
|
447
|
+ if(id == this.countList[i].good_id){
|
|
448
|
+ count = this.countList[i].count
|
|
449
|
+ }
|
|
450
|
+ }
|
|
451
|
+ return count
|
|
452
|
+ },
|
|
453
|
+ getOutCount(id){
|
|
454
|
+ var count = 0
|
|
455
|
+ for(let i=0;i<this.outCountList.length;i++){
|
|
456
|
+ if(id == this.outCountList[i].good_id){
|
|
457
|
+ count = this.outCountList[i].count
|
|
458
|
+ }
|
|
459
|
+ }
|
|
460
|
+ return count
|
|
461
|
+ },
|
|
462
|
+ getAutoCount(id){
|
|
463
|
+ var count= 0
|
|
464
|
+ for(let i=0;i<this.autoCountList.length;i++){
|
|
465
|
+ if(id == this.autoCountList[i].good_id){
|
|
466
|
+ count = this.autoCountList[i].count
|
|
467
|
+ }
|
|
468
|
+ }
|
|
469
|
+ return count
|
|
470
|
+ },
|
|
471
|
+ getCancelCount(id){
|
|
472
|
+ var count = 0
|
|
473
|
+ for(let i=0;i<this.cancelCountList.length;i++){
|
|
474
|
+ if(id == this.cancelCountList[i].good_id){
|
|
475
|
+ count = this.cancelCountList[i].count
|
|
476
|
+ }
|
|
477
|
+ }
|
|
478
|
+ return count
|
|
479
|
+ },
|
|
480
|
+ getStockCount(id){
|
|
481
|
+ var stock_count = 0
|
|
482
|
+ for(let i=0;i<this.countList.length;i++){
|
|
483
|
+ if(id == this.countList[i].good_id){
|
|
484
|
+ stock_count = this.countList[i].stock_count
|
|
485
|
+ }
|
|
486
|
+ }
|
|
487
|
+ return stock_count
|
|
488
|
+ },
|
|
489
|
+ getWareInfo(arr){
|
|
490
|
+ var total = 0
|
|
491
|
+ if(arr.length > 0){
|
|
492
|
+ for(let i=0;i<arr.length;i++){
|
|
493
|
+ total += parseInt(arr[i].warehousing_count)
|
|
494
|
+ }
|
|
495
|
+ }else{
|
|
496
|
+ total = ""
|
|
497
|
+ }
|
|
498
|
+ return total
|
|
499
|
+ },
|
|
500
|
+ getOverplus(arr){
|
|
501
|
+ var total = 0
|
|
502
|
+ if(arr.length > 0){
|
|
503
|
+ for(let i=0;i<arr.length;i++){
|
|
504
|
+ total += arr[i].stock_count
|
|
505
|
+ }
|
|
506
|
+ }else{
|
|
507
|
+ total = ""
|
|
508
|
+ }
|
|
509
|
+ return total
|
|
510
|
+ },
|
|
511
|
+ getCancelInfo(arr){
|
|
512
|
+ var total = 0
|
|
513
|
+ if(arr.length > 0){
|
|
514
|
+ for(let i=0;i<arr.length;i++){
|
|
515
|
+ total += arr[i].count
|
|
516
|
+ }
|
|
517
|
+ }else{
|
|
518
|
+ total = ""
|
|
519
|
+ }
|
|
520
|
+ return total
|
|
521
|
+ },
|
|
522
|
+ getOverFlushInfo(arr){
|
|
523
|
+ var total = 0
|
|
524
|
+ if(arr.length >0){
|
|
525
|
+ for(let i=0;i<arr.length;i++){
|
|
526
|
+ total += arr[i].stock_count
|
|
527
|
+ }
|
|
528
|
+ }
|
|
529
|
+ return total
|
|
530
|
+ },
|
|
531
|
+ },
|
|
532
|
+ created(){
|
|
533
|
+ this.getStorehouseList()
|
|
534
|
+ this.getlist()
|
|
535
|
+ this.getStockDrugCount()
|
182
|
536
|
}
|
183
|
537
|
}
|
184
|
538
|
</script>
|