|
@@ -0,0 +1,448 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="app-container" style="padding-left:0px;margin: 0px;"
|
|
4
|
+ v-loading="loading"
|
|
5
|
+ element-loading-text="拼命加载中">
|
|
6
|
+ <el-input v-model="keyword" style="width:200px" placeholder="请输入药品名称" ></el-input>
|
|
7
|
+ <el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
|
|
8
|
+ <el-table
|
|
9
|
+ :row-style="{ color: '#303133' }"
|
|
10
|
+ :header-cell-style="{
|
|
11
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
12
|
+ color: '#606266'
|
|
13
|
+ }"
|
|
14
|
+ :data="tableList"
|
|
15
|
+ :class="signAndWeighBoxPatients"
|
|
16
|
+ border
|
|
17
|
+ :cell-class-name="cellStyle"
|
|
18
|
+ >
|
|
19
|
+ <el-table-column label="药品名称" align="center">
|
|
20
|
+ <template slot-scope="scope">
|
|
21
|
+ {{ scope.row.drug.drug_name }}
|
|
22
|
+ </template>
|
|
23
|
+ </el-table-column>
|
|
24
|
+ <el-table-column label="规格&单位" align="center">
|
|
25
|
+ <template slot-scope="scope">
|
|
26
|
+ {{ scope.row.drug.dose}}{{ scope.row.drug.dose_unit }} * {{ scope.row.drug.min_number }}{{ scope.row.drug.min_unit }} /{{ scope.row.drug.max_unit }}
|
|
27
|
+ </template>
|
|
28
|
+ </el-table-column>
|
|
29
|
+ <el-table-column label="生产厂家" align="center">
|
|
30
|
+ <template slot-scope="scope">
|
|
31
|
+ {{ getManufacturName(scope.row.drug.manufacturer) }}
|
|
32
|
+ </template>
|
|
33
|
+ </el-table-column>
|
|
34
|
+
|
|
35
|
+ <el-table-column label="入库数量" align="center">
|
|
36
|
+ <template slot-scope="scope">
|
|
37
|
+ {{scope.row.sum_in_count}} {{scope.row.drug.min_unit }}
|
|
38
|
+ </template>
|
|
39
|
+ </el-table-column>
|
|
40
|
+
|
|
41
|
+ <el-table-column label="出库数量" align="center">
|
|
42
|
+ <template slot-scope="scope">
|
|
43
|
+ {{scope.row.sum_act_out_count}} {{scope.row.drug.min_unit }}
|
|
44
|
+ </template>
|
|
45
|
+ </el-table-column>
|
|
46
|
+
|
|
47
|
+ <el-table-column label="退库数量" align="center">
|
|
48
|
+ <template slot-scope="scope">
|
|
49
|
+ {{scope.row.sum_cancel_count}} {{scope.row.drug.min_unit }}
|
|
50
|
+ </template>
|
|
51
|
+ </el-table-column>
|
|
52
|
+
|
|
53
|
+ <el-table-column label="实际出库" align="center">
|
|
54
|
+ <template slot-scope="scope">
|
|
55
|
+ <span>
|
|
56
|
+ {{scope.row.sum_out_count}} {{scope.row.drug.min_unit }}
|
|
57
|
+ </span>
|
|
58
|
+ </template>
|
|
59
|
+ </el-table-column>
|
|
60
|
+
|
|
61
|
+ <el-table-column label="剩余库存" align="center">
|
|
62
|
+ <template slot-scope="scope">
|
|
63
|
+ <span>
|
|
64
|
+ {{ scope.row.flush_count }} {{scope.row.drug.min_unit }}
|
|
65
|
+ </span>
|
|
66
|
+ </template>
|
|
67
|
+ </el-table-column>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+ <el-table-column label="操作" align="center" width="200px">
|
|
72
|
+
|
|
73
|
+ <template slot-scope="scope">
|
|
74
|
+ <el-button
|
|
75
|
+ size="small"
|
|
76
|
+ type="primary"
|
|
77
|
+ @click="toClick(scope.row)"
|
|
78
|
+ >库存流水
|
|
79
|
+ </el-button>
|
|
80
|
+ <el-button
|
|
81
|
+ size="small"
|
|
82
|
+ type="primary"
|
|
83
|
+ @click="toClickOne(scope.row)"
|
|
84
|
+ >批次
|
|
85
|
+ </el-button>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+ </template>
|
|
89
|
+ </el-table-column>
|
|
90
|
+ </el-table>
|
|
91
|
+ <el-pagination
|
|
92
|
+ @size-change="handleSizeChange"
|
|
93
|
+ @current-change="handleCurrentChange"
|
|
94
|
+ :page-sizes="[10, 50, 100,200,300,400,500,1000]"
|
|
95
|
+ :page-size="10"
|
|
96
|
+ background
|
|
97
|
+ align="right"
|
|
98
|
+ style="margin-top:20px;"
|
|
99
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
100
|
+ :total="total"
|
|
101
|
+ >
|
|
102
|
+ </el-pagination>
|
|
103
|
+ </div>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+ </div>
|
|
113
|
+ </template>
|
|
114
|
+ <script>
|
|
115
|
+ import { getSelfDrugQuery,getGoodWarehouseOutInfoById,toSendGoodInfomation,getCheckGoodBatchList } from "@/api/drug/drug"
|
|
116
|
+ import {
|
|
117
|
+ getStockDrugCount
|
|
118
|
+ } from "@/api/stock";
|
|
119
|
+ import { uParseTime } from '@/utils/tools'
|
|
120
|
+ const moment = require('moment')
|
|
121
|
+ export default {
|
|
122
|
+
|
|
123
|
+ data(){
|
|
124
|
+ return{
|
|
125
|
+ tableList:[],
|
|
126
|
+ goodList:[
|
|
127
|
+ {id:1,name:"全部耗材"},
|
|
128
|
+ {id:2,name:"库存预警"},
|
|
129
|
+ {id:3,name:"库存为零"},
|
|
130
|
+ {id:4,name:"库存不为零"},
|
|
131
|
+ ],
|
|
132
|
+ houseList:[],
|
|
133
|
+ storehouse_id:0,
|
|
134
|
+ good_type:1,
|
|
135
|
+ multipleSelection: [],
|
|
136
|
+ signAndWeighBoxPatients: "sign-and-weigh-box-patients",
|
|
137
|
+ manufacturerList:[],
|
|
138
|
+ page:1,
|
|
139
|
+ total:0,
|
|
140
|
+ limit:10,
|
|
141
|
+ pageone:1,
|
|
142
|
+ totalone:0,
|
|
143
|
+ keyword:"",
|
|
144
|
+ goodTypeList:[],
|
|
145
|
+ start_time:"",
|
|
146
|
+ end_time:"",
|
|
147
|
+ countList:[],
|
|
148
|
+ outCountList:[],
|
|
149
|
+ autoCountList:[],
|
|
150
|
+ cancelCountList:[],
|
|
151
|
+ org_id:this.$store.getters.xt_user.org_id,
|
|
152
|
+ dialogVisible:false,
|
|
153
|
+ start_first_time:moment().startOf('month').format("YYYY-MM-DD"),
|
|
154
|
+ end_first_time:moment().endOf('month').format("YYYY-MM-DD"),
|
|
155
|
+ tableData:[],
|
|
156
|
+ good_id:0,
|
|
157
|
+ patientList:[],
|
|
158
|
+ good_name:"",
|
|
159
|
+ specification_name:"",
|
|
160
|
+ loading:false,
|
|
161
|
+ warehouseInfoByList:[],
|
|
162
|
+ cancelStockInfoByList:[],
|
|
163
|
+ warehouseOutByList:[],
|
|
164
|
+ flushList:[],
|
|
165
|
+ type_name:0,
|
|
166
|
+ storehouseId:0,
|
|
167
|
+ dealerList:[],
|
|
168
|
+ checkdialogVisible:false,
|
|
169
|
+ checkData:[],
|
|
170
|
+ outData:[],
|
|
171
|
+ total:0,
|
|
172
|
+ manufacturerList:[],
|
|
173
|
+ dealerList:[],
|
|
174
|
+ }
|
|
175
|
+
|
|
176
|
+ },
|
|
177
|
+ methods:{
|
|
178
|
+
|
|
179
|
+ changeGoodName(){
|
|
180
|
+ this.getlist()
|
|
181
|
+ },
|
|
182
|
+ toClick(val){
|
|
183
|
+
|
|
184
|
+ var manufacturer_name = ""
|
|
185
|
+ var specification_name = ""
|
|
186
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
187
|
+ if(val.drug.manufacturer == this.manufacturerList[i].id){
|
|
188
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name
|
|
189
|
+ }
|
|
190
|
+ }
|
|
191
|
+ specification_name = val.drug.specification_name + "/" + val.drug.packing_unit
|
|
192
|
+
|
|
193
|
+ this.$router.push({path:"/stock/selfwarehouse/selfdrugflow?drug_id="+val.drug_id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.drug.packing_unit+"&overCount="+val.flush_count})
|
|
194
|
+ },
|
|
195
|
+ toClickOne(val){
|
|
196
|
+ var manufacturer_name = ""
|
|
197
|
+ var specification_name = ""
|
|
198
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
199
|
+ if(val.drug.manufacturer == this.manufacturerList[i].id){
|
|
200
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name
|
|
201
|
+ }
|
|
202
|
+ }
|
|
203
|
+ specification_name = val.drug.specification_name + "/" + val.drug.packing_unit
|
|
204
|
+
|
|
205
|
+ this.$router.push({path:"/stock/selfwarehouse/selfdrugbatchnumber?drug_id="+val.drug_id+"&manufacturer="+manufacturer_name+"&packing_unit="+val.drug.packing_unit+"&overCount="+val.flush_count})
|
|
206
|
+ },
|
|
207
|
+
|
|
208
|
+ open(){
|
|
209
|
+
|
|
210
|
+ this.getlist()
|
|
211
|
+ },
|
|
212
|
+ getlist(){
|
|
213
|
+ var params = {
|
|
214
|
+ limit:this.limit,
|
|
215
|
+ page:this.page,
|
|
216
|
+ keyword :this.keyword,
|
|
217
|
+ }
|
|
218
|
+ getSelfDrugQuery(params).then(response=>{
|
|
219
|
+ if(response.data.state == 1){
|
|
220
|
+ var list = response.data.data.list
|
|
221
|
+
|
|
222
|
+ this.tableList =list
|
|
223
|
+ var total = response.data.data.total
|
|
224
|
+ this.total = total
|
|
225
|
+ this.manufacturerList = response.data.data.manufacturerList
|
|
226
|
+ this.dealerList =response.data.data.dealerList
|
|
227
|
+ this.total = response.data.data.total
|
|
228
|
+ this.loading = false
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+ }
|
|
232
|
+ })
|
|
233
|
+ },
|
|
234
|
+ getManufacturName(id){
|
|
235
|
+ var manufacturer_name = ""
|
|
236
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
237
|
+ if(id == this.manufacturerList[i].id){
|
|
238
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name
|
|
239
|
+ }
|
|
240
|
+ }
|
|
241
|
+ return manufacturer_name
|
|
242
|
+ },
|
|
243
|
+ getDearName(id){
|
|
244
|
+ var dear_name = ""
|
|
245
|
+ for(let i=0;i<this.dealerList.length;i++){
|
|
246
|
+ if(id == this.dealerList[i].id){
|
|
247
|
+ dear_name = this.dealerList[i].dealer_name
|
|
248
|
+ }
|
|
249
|
+ }
|
|
250
|
+ return dear_name
|
|
251
|
+ },
|
|
252
|
+ handleSizeChange(val) {
|
|
253
|
+ this.limit = val;
|
|
254
|
+ this.getlist()
|
|
255
|
+ },
|
|
256
|
+ handleCurrentChange(val) {
|
|
257
|
+ this.page = val;
|
|
258
|
+ this.getlist()
|
|
259
|
+ },
|
|
260
|
+ handleSizeChangeOne(val) {
|
|
261
|
+ this.limitone = val;
|
|
262
|
+ this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
|
|
263
|
+ },
|
|
264
|
+ handleCurrentChangeOne(val) {
|
|
265
|
+ this.pageone = val;
|
|
266
|
+ this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
|
|
267
|
+ },
|
|
268
|
+ seach(){
|
|
269
|
+ this.getlist()
|
|
270
|
+ },
|
|
271
|
+ startFirstTimeChange(){
|
|
272
|
+ this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
|
|
273
|
+ },
|
|
274
|
+ endEndTimeChange(){
|
|
275
|
+ this.toDialogClick(this.good_id,this.good_name,this.specification_name,this.storehouseId)
|
|
276
|
+ },
|
|
277
|
+ getTime(val) {
|
|
278
|
+ if(val < 0){
|
|
279
|
+ return ""
|
|
280
|
+ }
|
|
281
|
+ if(val == ""){
|
|
282
|
+ return ""
|
|
283
|
+ }else {
|
|
284
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
285
|
+ }
|
|
286
|
+ },
|
|
287
|
+ getTimeOne(val) {
|
|
288
|
+ if(val < 0){
|
|
289
|
+ return ""
|
|
290
|
+ }
|
|
291
|
+ if(val == ""){
|
|
292
|
+ return ""
|
|
293
|
+ }else {
|
|
294
|
+ return uParseTime(val, '{y}-{m}-{d} {h}:{i}')
|
|
295
|
+ }
|
|
296
|
+ },
|
|
297
|
+ getName(id){
|
|
298
|
+ var name = ""
|
|
299
|
+ for(let i=0;i<this.patientList.length;i++){
|
|
300
|
+ if(id == this.patientList[i].id){
|
|
301
|
+ name = this.patientList[i].name
|
|
302
|
+ }
|
|
303
|
+ }
|
|
304
|
+ return name
|
|
305
|
+ },
|
|
306
|
+
|
|
307
|
+ // 合并单元格样式
|
|
308
|
+ cellStyle({ row, column, rowIndex, columnIndex }) {
|
|
309
|
+ let arr = [5,6, 7, 8, 9,10,11];
|
|
310
|
+ if (arr.indexOf(columnIndex) > -1) {
|
|
311
|
+ return "spanClass";
|
|
312
|
+ }
|
|
313
|
+ },
|
|
314
|
+ exportList(){
|
|
315
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
316
|
+
|
|
317
|
+ if(this.org_id!=0 && this.org_id!=9956){
|
|
318
|
+ if(this.tableList!=null && this.tableList.length > 0){
|
|
319
|
+ for(let i=0;i<this.tableList.length;i++){
|
|
320
|
+ this.tableList[i].index = i+1
|
|
321
|
+ this.tableList[i].type_name = this.getGoodTypeName(this.tableList[i].good_type_id)
|
|
322
|
+ this.tableList[i].spec = this.tableList[i].specification_name +"/"+ this.tableList[i].packing_unit
|
|
323
|
+ this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
|
|
324
|
+ this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
|
|
325
|
+ this.tableList[i].stock_in_count = this.GetExportStockInCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
326
|
+ this.tableList[i].stock_out_count =this.getExportStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
327
|
+ this.tableList[i].stock_cancel_count = this.getExportCancelStockInfo(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
328
|
+ this.tableList[i].act_out_count = this.getExportActStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
329
|
+ this.tableList[i].over_count = this.getExportOverCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
330
|
+ this.tableList[i].sum_count = this.getOverCount(this.tableList[i].xt_warehouse_info)
|
|
331
|
+
|
|
332
|
+ }
|
|
333
|
+ }
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+ const tHeader = ['序号','耗材类型', '耗材名称', '规格&单位','生产厂商','经销商','批准文号','国家编码','入库数量','出库数量','退库数量','实际出库','剩余库存','总库存']
|
|
337
|
+ const filterVal = ['index','type_name', 'good_name', 'spec','manufacturer_name','dealer_name','number','social_security_directory_code','stock_in_count','act_out_count','stock_cancel_count','stock_out_count','over_count','sum_count']
|
|
338
|
+
|
|
339
|
+ const data = this.formatJson(filterVal, this.tableList)
|
|
340
|
+
|
|
341
|
+ excel.export_json_to_excel({
|
|
342
|
+ header: tHeader,
|
|
343
|
+ data,
|
|
344
|
+ filename: '库存查询'
|
|
345
|
+ })
|
|
346
|
+ this.downloadLoading = false
|
|
347
|
+ }
|
|
348
|
+
|
|
349
|
+ if(this.org_id == 0 || this.org_id == 9956){
|
|
350
|
+
|
|
351
|
+ if(this.tableList!=null && this.tableList.length > 0){
|
|
352
|
+ for(let i=0;i<this.tableList.length;i++){
|
|
353
|
+ this.tableList[i].index = i+1
|
|
354
|
+ this.tableList[i].type_name = this.getGoodTypeName(this.tableList[i].good_type_id)
|
|
355
|
+ this.tableList[i].spec = this.tableList[i].specification_name +"/"+ this.tableList[i].packing_unit
|
|
356
|
+ this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
|
|
357
|
+ this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
|
|
358
|
+ this.tableList[i].stock_in_count = this.GetExportStockInCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
359
|
+ this.tableList[i].stock_out_count =this.getExportStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
360
|
+ this.tableList[i].stock_cancel_count = this.getExportCancelStockInfo(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
361
|
+ this.tableList[i].act_out_count = this.getExportActStockOutCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
362
|
+ this.tableList[i].over_count = this.getExportOverCount(this.tableList[i].xt_good_stock,this.tableList[i].id)
|
|
363
|
+ this.tableList[i].sum_count = this.getOverCount(this.tableList[i].xt_warehouse_info)
|
|
364
|
+
|
|
365
|
+ }
|
|
366
|
+ }
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+ const tHeader = ['序号','耗材编码','耗材类型', '耗材名称', '规格&单位','生产厂商','经销商','批准文号','国家编码','入库数量','出库数量','退库数量','实际出库','剩余库存','总库存']
|
|
370
|
+ const filterVal = ['index','good_number','type_name', 'good_name', 'spec','manufacturer_name','dealer_name','number','social_security_directory_code','stock_in_count','act_out_count','stock_cancel_count','stock_out_count','over_count','sum_count']
|
|
371
|
+
|
|
372
|
+ const data = this.formatJson(filterVal, this.tableList)
|
|
373
|
+
|
|
374
|
+ excel.export_json_to_excel({
|
|
375
|
+ header: tHeader,
|
|
376
|
+ data,
|
|
377
|
+ filename: '库存查询'
|
|
378
|
+ })
|
|
379
|
+ this.downloadLoading = false
|
|
380
|
+ }
|
|
381
|
+
|
|
382
|
+ })
|
|
383
|
+ },
|
|
384
|
+ formatJson(filterVal, jsonData) {
|
|
385
|
+ return jsonData.map(v => filterVal.map(j => v[j]));
|
|
386
|
+ },
|
|
387
|
+ toPrint(){
|
|
388
|
+ this.$router.push("/good/new/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&keyword="+this.keyword+"&storehouse_id="+this.storehouse_id+"&page="+this.page+"&limit="+this.limit+"&good_type="+this.good_type)
|
|
389
|
+ },
|
|
390
|
+ },
|
|
391
|
+ created(){
|
|
392
|
+ this.getlist()
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+ }
|
|
396
|
+ }
|
|
397
|
+ </script>
|
|
398
|
+
|
|
399
|
+ <style>
|
|
400
|
+ .app-container{
|
|
401
|
+ /* padding-left: 0;
|
|
402
|
+ margin-left: 0; */
|
|
403
|
+ }
|
|
404
|
+ .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
|
405
|
+ font-size: 12px;
|
|
406
|
+ }
|
|
407
|
+
|
|
408
|
+ .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
|
409
|
+ background: #6fb5fa;
|
|
410
|
+ }
|
|
411
|
+
|
|
412
|
+ .count {
|
|
413
|
+ color: #bd2c00;
|
|
414
|
+ }
|
|
415
|
+
|
|
416
|
+ .el-table td,
|
|
417
|
+ .el-table th.is-leaf,
|
|
418
|
+ .el-table--border,
|
|
419
|
+ .el-table--group {
|
|
420
|
+ border-color: #d0d3da;
|
|
421
|
+ }
|
|
422
|
+
|
|
423
|
+ .el-table--border::after,
|
|
424
|
+ .el-table--group::after,
|
|
425
|
+ .el-table::before {
|
|
426
|
+ background-color: #d0d3da;
|
|
427
|
+ }
|
|
428
|
+
|
|
429
|
+ /* 合并表格线样式 */
|
|
430
|
+ .spanClass .cell {
|
|
431
|
+ padding: 0 !important;
|
|
432
|
+ }
|
|
433
|
+
|
|
434
|
+ .spanClass .cell tr {
|
|
435
|
+ display: inline-block;
|
|
436
|
+ width: 100%;
|
|
437
|
+ }
|
|
438
|
+
|
|
439
|
+ .spanClass .cell tr td {
|
|
440
|
+ padding: 10px 0;
|
|
441
|
+ border-bottom: 1px solid #ebeef5;
|
|
442
|
+ display: block;
|
|
443
|
+ width: 100%;
|
|
444
|
+ }
|
|
445
|
+ .spanClass .cell tr:last-of-type td {
|
|
446
|
+ border-bottom: none;
|
|
447
|
+ }
|
|
448
|
+ </style>
|