|
@@ -0,0 +1,315 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs="crumbs"></bread-crumb>
|
|
5
|
+ </div>
|
|
6
|
+ <div class="app-container ">
|
|
7
|
+ <div class="cell clearfix">
|
|
8
|
+ 药品名称:<span>{{getName(this.$route.query.drug_id)}}</span>
|
|
9
|
+ 库存: {{this.$route.query.overCount}}{{ drug.min_unit }}
|
|
10
|
+ 规格:<span>{{drug.dose}}{{drug.dose_unit}}*{{drug.min_number}}{{drug.min_unit}}/{{drug.max_unit}}</span>
|
|
11
|
+ 厂家:<span>{{this.$route.query.manufacturer}}</span>
|
|
12
|
+ </div>
|
|
13
|
+ <div class="cell clearfix">
|
|
14
|
+ <span>日期查询:</span>
|
|
15
|
+ <el-date-picker
|
|
16
|
+ size="small"
|
|
17
|
+ v-model="start_time"
|
|
18
|
+ prefix-icon="el-icon-date"
|
|
19
|
+ :editable="false"
|
|
20
|
+ style="width: 196px;"
|
|
21
|
+ type="date"
|
|
22
|
+ placeholder="选择日期时间"
|
|
23
|
+ align="right"
|
|
24
|
+ format="yyyy-MM-dd"
|
|
25
|
+ value-format="yyyy-MM-dd"
|
|
26
|
+ @change="startTimeChange"
|
|
27
|
+ ></el-date-picker>-
|
|
28
|
+ <el-date-picker
|
|
29
|
+ size="small"
|
|
30
|
+ v-model="end_time"
|
|
31
|
+ prefix-icon="el-icon-date"
|
|
32
|
+ :editable="false"
|
|
33
|
+ style="width: 196px;margin-right:10px;"
|
|
34
|
+ type="date"
|
|
35
|
+ placeholder="选择日期时间"
|
|
36
|
+ align="right"
|
|
37
|
+ format="yyyy-MM-dd"
|
|
38
|
+ value-format="yyyy-MM-dd"
|
|
39
|
+ @change="endTimeChange"
|
|
40
|
+ ></el-date-picker>
|
|
41
|
+
|
|
42
|
+ <span>出入库方式:</span>
|
|
43
|
+ <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
|
|
44
|
+ <el-option
|
|
45
|
+ v-for="(item,index) in stockType"
|
|
46
|
+ :key="index"
|
|
47
|
+ :label="item.name"
|
|
48
|
+ :value="item.id">
|
|
49
|
+ </el-option>
|
|
50
|
+ </el-select>
|
|
51
|
+
|
|
52
|
+ <!-- <span>
|
|
53
|
+ <el-button type="primary" size="small" @click="toExprot">导出</el-button>
|
|
54
|
+
|
|
55
|
+ <el-button type="primary" size="small" @click="toTongBu">同步</el-button>
|
|
56
|
+ </span> -->
|
|
57
|
+
|
|
58
|
+ </div>
|
|
59
|
+
|
|
60
|
+ <el-table
|
|
61
|
+ :data="tableList"
|
|
62
|
+ border
|
|
63
|
+ style="width: 100%">
|
|
64
|
+ <el-table-column prop="date" label="序号" width="180" align="center">
|
|
65
|
+ <template slot-scope="scope">
|
|
66
|
+ {{scope.$index + 1}}
|
|
67
|
+ </template>
|
|
68
|
+ </el-table-column>
|
|
69
|
+ <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
|
|
70
|
+ <template slot-scope="scope">
|
|
71
|
+ <span v-if="scope.row.consumable_type == 1">手动入库</span>
|
|
72
|
+ <span v-if="scope.row.consumable_type == 2">手动出库</span>
|
|
73
|
+ <span v-if="scope.row.consumable_type == 3">自动出库</span>
|
|
74
|
+ <span v-if="scope.row.consumable_type == 4">手动退库</span>
|
|
75
|
+ <span v-if="scope.row.consumable_type == 7">自动退库</span>
|
|
76
|
+ <span v-if="scope.row.consumable_type == 5">报损数量</span>
|
|
77
|
+ <span v-if="scope.row.consumable_type == 10">盘盈</span>
|
|
78
|
+ <span v-if="scope.row.consumable_type == 11">盘亏</span>
|
|
79
|
+ <span v-if="scope.row.consumable_type == 12">调拨出库</span>
|
|
80
|
+ <span v-if="scope.row.consumable_type == 13">调拨入库</span>
|
|
81
|
+ <span v-if="scope.row.consumable_type == 15">结算出库</span>
|
|
82
|
+ <span v-if="scope.row.consumable_type == 20">处方出库</span>
|
|
83
|
+ </template>
|
|
84
|
+ </el-table-column>
|
|
85
|
+ <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
|
|
86
|
+ <template slot-scope="scope">
|
|
87
|
+ <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
|
|
88
|
+ <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 12 || scope.row.consumable_type == 15 || scope.row.consumable_type==20">{{scope.row.warehouse_out_order_number}}</span>
|
|
89
|
+ <span v-if="scope.row.consumable_type == 4 || scope.row.consumable_type == 7">{{scope.row.cancel_order_number}}</span>
|
|
90
|
+ <span v-if="scope.row.consumable_type == 5">{{scope.row.warehouse_out_order_number}}</span>
|
|
91
|
+ <span v-if="scope.row.consumable_type == 10 || scope.row.consumable_type == 11 || scope.row.consumable_type == 13">{{scope.row.warehousing_order}}</span>
|
|
92
|
+ </template>
|
|
93
|
+ </el-table-column>
|
|
94
|
+ <el-table-column prop="drug_name" label="出库日期" align="center">
|
|
95
|
+ <template slot-scope="scope">
|
|
96
|
+ {{getTime(scope.row.ctime,"{y}-{h}-{d}")}}
|
|
97
|
+ </template>
|
|
98
|
+ </el-table-column>
|
|
99
|
+ <el-table-column prop="drug_name" label="操作日期" align="center">
|
|
100
|
+ <template slot-scope="scope">
|
|
101
|
+ {{getTime(scope.row.operate_time,"{y}-{h}-{d}")}}
|
|
102
|
+ </template>
|
|
103
|
+ </el-table-column>
|
|
104
|
+
|
|
105
|
+ <el-table-column prop="drug_name" label="数量&单位" align="center">
|
|
106
|
+ <template slot-scope="scope">
|
|
107
|
+ <span v-if="scope.row.consumable_type != 2 && scope.row.consumable_type != 3 && scope.row.consumable_type != 5 && scope.row.consumable_type != 7">{{scope.row.count}}{{scope.row.max_unit}}</span>
|
|
108
|
+ <span v-if="(scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 5 || scope.row.consumable_type == 7) && parseInt(scope.row.count/scope.row.drug.min_number) >0">{{parseInt(scope.row.count/scope.row.drug.min_number)}}{{scope.row.drug.max_unit}}</span>
|
|
109
|
+ <span v-if="(scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 5 || scope.row.consumable_type == 7) && scope.row.count%scope.row.drug.min_number >0">{{scope.row.count%scope.row.drug.min_number}}{{scope.row.drug.min_unit}}</span>
|
|
110
|
+ </template>
|
|
111
|
+ </el-table-column>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+ <el-table-column prop="drug_name" label="有效期" align="center">
|
|
116
|
+ <template slot-scope="scope">
|
|
117
|
+ {{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}
|
|
118
|
+
|
|
119
|
+ </template>
|
|
120
|
+ </el-table-column>
|
|
121
|
+
|
|
122
|
+ <el-table-column prop="drug_name" label="使用人" align="center">
|
|
123
|
+ <template slot-scope="scope">
|
|
124
|
+ <span > {{getPatientName(scope.row.patient_id)}}</span>
|
|
125
|
+ </template>
|
|
126
|
+ </el-table-column>
|
|
127
|
+ <!-- <el-table-column prop="drug_name" label="剩余库存" align="center">
|
|
128
|
+ <template slot-scope="scope">
|
|
129
|
+ {{ scope.row.over_count }} {{ drug.min_unit }}
|
|
130
|
+ </template>
|
|
131
|
+ </el-table-column> -->
|
|
132
|
+ <el-table-column prop="remark" label="备注" align="center">
|
|
133
|
+ <template slot-scope="scope">
|
|
134
|
+ <span > {{scope.row.remark}}</span>
|
|
135
|
+ </template>
|
|
136
|
+ </el-table-column>
|
|
137
|
+ </el-table>
|
|
138
|
+
|
|
139
|
+ <el-pagination
|
|
140
|
+ @size-change="handleSizeChange"
|
|
141
|
+ @current-change="handleCurrentChange"
|
|
142
|
+ :page-sizes="[10, 50, 100,500,1000]"
|
|
143
|
+ :page-size="10"
|
|
144
|
+ background
|
|
145
|
+ align="right"
|
|
146
|
+ style="margin-top:20px;"
|
|
147
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
148
|
+ :total="total"
|
|
149
|
+ >
|
|
150
|
+ </el-pagination>
|
|
151
|
+ </div>
|
|
152
|
+
|
|
153
|
+ <setting-dialog
|
|
154
|
+ ref="dialog"
|
|
155
|
+ ></setting-dialog>
|
|
156
|
+
|
|
157
|
+ </div>
|
|
158
|
+ </template>
|
|
159
|
+
|
|
160
|
+ <script>
|
|
161
|
+
|
|
162
|
+ import { uParseTime } from '@/utils/tools'
|
|
163
|
+ import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
164
|
+ import { getSelfDrugFlow } from '@/api/drug/drug'
|
|
165
|
+ export default {
|
|
166
|
+ components: {
|
|
167
|
+ BreadCrumb
|
|
168
|
+ },
|
|
169
|
+ data(){
|
|
170
|
+ return{
|
|
171
|
+ crumbs: [
|
|
172
|
+ { path: false, name: '库存管理' },
|
|
173
|
+ { path: '/stock/drugs/stock/query', name: '药品库存查询' },
|
|
174
|
+ { path:'/drugstock/in/drugstockflow',name:'库存流水'}
|
|
175
|
+ ],
|
|
176
|
+ keywords: '',
|
|
177
|
+ total: 0,
|
|
178
|
+ multipleSelection: [],
|
|
179
|
+ signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
|
|
180
|
+ start_time: '',
|
|
181
|
+ end_time: '',
|
|
182
|
+ page: 1,
|
|
183
|
+ limit: 10,
|
|
184
|
+ goodType: [],
|
|
185
|
+ goodInfo: [],
|
|
186
|
+ tempArr: [],
|
|
187
|
+ sameRowArr: [],
|
|
188
|
+ WarehouseInfo: {
|
|
189
|
+ loading: false,
|
|
190
|
+ warehouseInfoDate: []
|
|
191
|
+ },
|
|
192
|
+ tableData:[],
|
|
193
|
+ drug_category:0,
|
|
194
|
+ stock_type:0,
|
|
195
|
+ drugCategory:[
|
|
196
|
+ {id:0,name:"全部"}
|
|
197
|
+ ],
|
|
198
|
+ drugTypeList:[],
|
|
199
|
+ tableList:[],
|
|
200
|
+ manufacturerList:[],
|
|
201
|
+ list:[],
|
|
202
|
+ stockType:[
|
|
203
|
+ {id:0,name:"全部"},
|
|
204
|
+ {id:1,name:"手动入库"},
|
|
205
|
+ {id:2,name:"手动出库"},
|
|
206
|
+ {id:3,name:"自动出库"},
|
|
207
|
+ {id:4,name:"手动退库"},
|
|
208
|
+ {id:10,name:"盘盈"},
|
|
209
|
+ {id:11,name:"盘亏"},
|
|
210
|
+ {id:12,name:"调拨出库"},
|
|
211
|
+ {id:13,name:"调拨入库"},
|
|
212
|
+ {id:15,name:"结算出库"}
|
|
213
|
+ ],
|
|
214
|
+ outList:[],
|
|
215
|
+ countList:[],
|
|
216
|
+ outCountList:[],
|
|
217
|
+ autoCountList:[],
|
|
218
|
+ drugOutList:[],
|
|
219
|
+ total:0,
|
|
220
|
+ houseList:[],
|
|
221
|
+ patientList:[],
|
|
222
|
+ drug:{},
|
|
223
|
+ patients:[]
|
|
224
|
+ }
|
|
225
|
+ },
|
|
226
|
+ created(){
|
|
227
|
+ this.getlist()
|
|
228
|
+ },
|
|
229
|
+ methods:{
|
|
230
|
+ startTimeChange: function(val) {
|
|
231
|
+ this.tableList = []
|
|
232
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
|
|
233
|
+
|
|
234
|
+ if (time > 0) {
|
|
235
|
+ this.$message.error("开始时间不能大于结束时间");
|
|
236
|
+ this.start_time = "";
|
|
237
|
+ } else {
|
|
238
|
+
|
|
239
|
+ this.getlist()
|
|
240
|
+
|
|
241
|
+ }
|
|
242
|
+ },
|
|
243
|
+ endTimeChange: function(val) {
|
|
244
|
+ this.tableList = []
|
|
245
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
|
|
246
|
+ if (time < 0) {
|
|
247
|
+ this.$message.error("结束时间不能小于开始时间");
|
|
248
|
+ this.end_time = "";
|
|
249
|
+ } else {
|
|
250
|
+ this.getlist()
|
|
251
|
+ }
|
|
252
|
+ },
|
|
253
|
+ changeDrug(val){
|
|
254
|
+ this.tableList= []
|
|
255
|
+ this.stock_type = val
|
|
256
|
+ this.getlist()
|
|
257
|
+ },
|
|
258
|
+ handleSizeChange(val) {
|
|
259
|
+ this.limit = val
|
|
260
|
+ this.getlist()
|
|
261
|
+ },
|
|
262
|
+ handleCurrentChange(val) {
|
|
263
|
+ this.page = val
|
|
264
|
+ this.getlist()
|
|
265
|
+ },
|
|
266
|
+ getlist(){
|
|
267
|
+ var params = {
|
|
268
|
+ drug_id:this.$route.query.drug_id,
|
|
269
|
+ start_time:this.start_time,
|
|
270
|
+ end_time:this.end_time,
|
|
271
|
+ page:this.page,
|
|
272
|
+ limit:this.limit,
|
|
273
|
+ patient_id:this.$route.query.patient_id,
|
|
274
|
+ }
|
|
275
|
+ getSelfDrugFlow(params).then(response=>{
|
|
276
|
+ if(response.data.state ==1){
|
|
277
|
+ var list = response.data.data.list
|
|
278
|
+
|
|
279
|
+ this.tableList =list
|
|
280
|
+ var total = response.data.data.total
|
|
281
|
+ this.total = total
|
|
282
|
+ this.drug =response.data.data.drug
|
|
283
|
+ this.patientList= response.data.data.patients
|
|
284
|
+ }
|
|
285
|
+ })
|
|
286
|
+ },
|
|
287
|
+ getName(drug_id){
|
|
288
|
+ var name = ""
|
|
289
|
+ if(drug_id == this.drug.id){
|
|
290
|
+ name = this.drug.drug_name
|
|
291
|
+ }
|
|
292
|
+ return name
|
|
293
|
+ },
|
|
294
|
+ getTime(val) {
|
|
295
|
+ if(val < 0){
|
|
296
|
+ return ""
|
|
297
|
+ }
|
|
298
|
+ if(val == ""){
|
|
299
|
+ return ""
|
|
300
|
+ }else {
|
|
301
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
302
|
+ }
|
|
303
|
+ },
|
|
304
|
+ getPatientName(id){
|
|
305
|
+ var name = ""
|
|
306
|
+ for(let i=0;i<this.patientList.length;i++){
|
|
307
|
+ if(id == this.patientList[i].id){
|
|
308
|
+ name = this.patientList[i].name
|
|
309
|
+ }
|
|
310
|
+ }
|
|
311
|
+ return name
|
|
312
|
+ },
|
|
313
|
+ }
|
|
314
|
+ }
|
|
315
|
+</script>
|