|
@@ -0,0 +1,341 @@
|
|
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
|
+ 耗材名称:{{this.$route.query.good_name}}
|
|
9
|
+ <!-- 库存:
|
|
10
|
+ 厂家: -->
|
|
11
|
+ </div>
|
|
12
|
+ <div class="cell clearfix">
|
|
13
|
+ <span>日期查询:</span>
|
|
14
|
+ <el-date-picker
|
|
15
|
+ size="small"
|
|
16
|
+ v-model="start_time"
|
|
17
|
+ prefix-icon="el-icon-date"
|
|
18
|
+ :editable="false"
|
|
19
|
+ style="width: 196px;"
|
|
20
|
+ type="date"
|
|
21
|
+ placeholder="选择日期时间"
|
|
22
|
+ align="right"
|
|
23
|
+ format="yyyy-MM-dd"
|
|
24
|
+ value-format="yyyy-MM-dd"
|
|
25
|
+ @change="startTimeChange"
|
|
26
|
+ ></el-date-picker>-
|
|
27
|
+ <el-date-picker
|
|
28
|
+ size="small"
|
|
29
|
+ v-model="end_time"
|
|
30
|
+ prefix-icon="el-icon-date"
|
|
31
|
+ :editable="false"
|
|
32
|
+ style="width: 196px;margin-right:10px;"
|
|
33
|
+ type="date"
|
|
34
|
+ placeholder="选择日期时间"
|
|
35
|
+ align="right"
|
|
36
|
+ format="yyyy-MM-dd"
|
|
37
|
+ value-format="yyyy-MM-dd"
|
|
38
|
+ @change="endTimeChange"
|
|
39
|
+ ></el-date-picker>
|
|
40
|
+
|
|
41
|
+ <span>出入库方式:</span>
|
|
42
|
+ <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
|
|
43
|
+ <el-option
|
|
44
|
+ v-for="(item,index) in stockType"
|
|
45
|
+ :key="index"
|
|
46
|
+ :label="item.name"
|
|
47
|
+ :value="item.id">
|
|
48
|
+ </el-option>
|
|
49
|
+ </el-select>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+ </div>
|
|
53
|
+
|
|
54
|
+ <el-table
|
|
55
|
+ :data="tableList"
|
|
56
|
+ border
|
|
57
|
+ style="width: 100%">
|
|
58
|
+ <el-table-column prop="date" label="序号" width="180" align="center">
|
|
59
|
+ <template slot-scope="scope">
|
|
60
|
+ {{scope.$index + 1}}
|
|
61
|
+ </template>
|
|
62
|
+ </el-table-column>
|
|
63
|
+ <el-table-column prop="drug_type" label="出入库方式" width="180" align="center">
|
|
64
|
+ <template slot-scope="scope">
|
|
65
|
+ <span v-if="scope.row.stock_way == 4">入库</span>
|
|
66
|
+ <span v-if="scope.row.stock_way == 2">出库</span>
|
|
67
|
+ </template>
|
|
68
|
+ </el-table-column>
|
|
69
|
+ <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
|
|
70
|
+ <template slot-scope="scope">
|
|
71
|
+ <span v-if="scope.row.stock_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
|
|
72
|
+ <span v-if="scope.row.stock_way == 4">{{scope.row.warehousing_order}}</span>
|
|
73
|
+
|
|
74
|
+ </template>
|
|
75
|
+ </el-table-column>
|
|
76
|
+ <el-table-column prop="drug_name" label="操作日期" align="center">
|
|
77
|
+ <template slot-scope="scope">
|
|
78
|
+ {{getTime(scope.row.ctime)}}
|
|
79
|
+ </template>
|
|
80
|
+ </el-table-column>
|
|
81
|
+ <el-table-column prop="drug_name" label="出入库数量" align="center">
|
|
82
|
+ <template slot-scope="scope">
|
|
83
|
+ <span v-if="scope.row.stock_way == 4 && scope.row.warehousing_count!=0"> {{scope.row.warehousing_count}}</span>
|
|
84
|
+ <span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
|
|
85
|
+ </template>
|
|
86
|
+ </el-table-column>
|
|
87
|
+ <el-table-column prop="drug_name" label="库存剩余量" align="center">
|
|
88
|
+ <template slot-scope="scope">
|
|
89
|
+ <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span>
|
|
90
|
+ </template>
|
|
91
|
+ </el-table-column>
|
|
92
|
+ <el-table-column prop="drug_name" label="进/出货单价" align="center">
|
|
93
|
+ <template slot-scope="scope">
|
|
94
|
+ <span v-if="scope.row.stock_way == 4"> {{scope.row.price}}</span>
|
|
95
|
+ <span v-if="scope.row.stock_way == 2">{{scope.row.price}}</span>
|
|
96
|
+ </template>
|
|
97
|
+ </el-table-column>
|
|
98
|
+ <el-table-column prop="drug_name" label="有效期" align="center">
|
|
99
|
+ <template slot-scope="scope" >
|
|
100
|
+ <span v-if="scope.row.stock_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
|
|
101
|
+ <span v-if="scope.row.stock_way == 2">{{getTime(scope.row.expiry_date)}}</span>
|
|
102
|
+ </template>
|
|
103
|
+ </el-table-column>
|
|
104
|
+ <el-table-column prop="drug_name" label="批号" align="center">
|
|
105
|
+ <template slot-scope="scope" >
|
|
106
|
+ <span v-if="scope.row.stock_way == 2"> {{scope.row.number}}</span>
|
|
107
|
+ <span v-if="scope.row.stock_way == 4">{{scope.row.number}}</span>
|
|
108
|
+ </template>
|
|
109
|
+ </el-table-column>
|
|
110
|
+ <el-table-column prop="drug_name" label="供应商" align="center">
|
|
111
|
+ <template slot-scope="scope">
|
|
112
|
+ <span v-if="scope.row.stock_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
|
|
113
|
+ <span v-if="scope.row.stock_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
|
|
114
|
+ </template>
|
|
115
|
+ </el-table-column>
|
|
116
|
+ </el-table>
|
|
117
|
+
|
|
118
|
+ <el-pagination
|
|
119
|
+ @size-change="handleSizeChange"
|
|
120
|
+ @current-change="handleCurrentChange"
|
|
121
|
+ :page-sizes="[10, 50, 100,500,1000]"
|
|
122
|
+ :page-size="10"
|
|
123
|
+ background
|
|
124
|
+ align="right"
|
|
125
|
+ style="margin-top:20px;"
|
|
126
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
127
|
+ :total="total"
|
|
128
|
+ >
|
|
129
|
+ </el-pagination>
|
|
130
|
+ </div>
|
|
131
|
+ </div>
|
|
132
|
+</template>
|
|
133
|
+<script>
|
|
134
|
+ import { uParseTime } from '@/utils/tools'
|
|
135
|
+ import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
136
|
+ import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
|
|
137
|
+ export default {
|
|
138
|
+ name: 'stockIn',
|
|
139
|
+ created() {
|
|
140
|
+ // var drugCategory = getDictionaryDataConfig('system','drug_category')
|
|
141
|
+ // this.drugCategory.push(...drugCategory)
|
|
142
|
+ // this.drugTypeList = getDictionaryDataConfig('system','drug_type')
|
|
143
|
+ this.getlist()
|
|
144
|
+ this.getOutList()
|
|
145
|
+ },
|
|
146
|
+ components: {
|
|
147
|
+ BreadCrumb
|
|
148
|
+ },
|
|
149
|
+ data() {
|
|
150
|
+ return {
|
|
151
|
+ crumbs: [
|
|
152
|
+ { path: false, name: '库存管理' },
|
|
153
|
+ { path: '/stock/drugs/stock/query', name: '药品库存查询' },
|
|
154
|
+ { path:'/drugstock/in/drugstockflow',name:'库存流水'}
|
|
155
|
+ ],
|
|
156
|
+ keywords: '',
|
|
157
|
+ total: 0,
|
|
158
|
+ multipleSelection: [],
|
|
159
|
+ signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
|
|
160
|
+ start_time: '',
|
|
161
|
+ end_time: '',
|
|
162
|
+ page: 1,
|
|
163
|
+ limit: 10,
|
|
164
|
+ goodType: [],
|
|
165
|
+ goodInfo: [],
|
|
166
|
+ tempArr: [],
|
|
167
|
+ sameRowArr: [],
|
|
168
|
+ WarehouseInfo: {
|
|
169
|
+ loading: false,
|
|
170
|
+ warehouseInfoDate: []
|
|
171
|
+ },
|
|
172
|
+ tableData:[],
|
|
173
|
+ drug_category:0,
|
|
174
|
+ stock_type:0,
|
|
175
|
+ drugCategory:[
|
|
176
|
+ {id:0,name:"全部"}
|
|
177
|
+ ],
|
|
178
|
+ drugTypeList:[],
|
|
179
|
+ tableList:[],
|
|
180
|
+ manufacturerList:[],
|
|
181
|
+ stockType:[
|
|
182
|
+ {id:0,name:"全部"},
|
|
183
|
+ {id:1,name:"手动出库"},
|
|
184
|
+ {id:2,name:"自动出库"},
|
|
185
|
+ {id:3,name:"入库"},
|
|
186
|
+ ],
|
|
187
|
+
|
|
188
|
+ }
|
|
189
|
+ },
|
|
190
|
+ methods:{
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+ handleSizeChange(val) {
|
|
194
|
+ this.limit = val
|
|
195
|
+ this.GetAllDrugStockQueryList()
|
|
196
|
+ },
|
|
197
|
+ handleCurrentChange(val) {
|
|
198
|
+ this.page = val
|
|
199
|
+ this.GetAllDrugStockQueryList()
|
|
200
|
+ },
|
|
201
|
+
|
|
202
|
+ startTimeChange: function(val) {
|
|
203
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
|
|
204
|
+
|
|
205
|
+ if (time > 0) {
|
|
206
|
+ this.$message.error("开始时间不能大于结束时间");
|
|
207
|
+ this.start_time = "";
|
|
208
|
+ } else {
|
|
209
|
+ this.GetAllDrugStockQueryList();
|
|
210
|
+ }
|
|
211
|
+ },
|
|
212
|
+ endTimeChange: function(val) {
|
|
213
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
|
|
214
|
+ if (time < 0) {
|
|
215
|
+ this.$message.error("结束时间不能小于开始时间");
|
|
216
|
+ this.end_time = "";
|
|
217
|
+ } else {
|
|
218
|
+ this.GetAllDrugStockQueryList();
|
|
219
|
+ }
|
|
220
|
+ },
|
|
221
|
+ changeDrug(){},
|
|
222
|
+ getManufacturer(id){
|
|
223
|
+ var name = ""
|
|
224
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
225
|
+ if(id == this.manufacturerList[i].id){
|
|
226
|
+ name = this.manufacturerList[i].name
|
|
227
|
+ }
|
|
228
|
+ }
|
|
229
|
+ return name
|
|
230
|
+ },
|
|
231
|
+ getTime(val) {
|
|
232
|
+ if(val < 0){
|
|
233
|
+ return ""
|
|
234
|
+ }
|
|
235
|
+ if(val == ""){
|
|
236
|
+ return ""
|
|
237
|
+ }else {
|
|
238
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
239
|
+ }
|
|
240
|
+ },
|
|
241
|
+ //入库详情
|
|
242
|
+ getlist(){
|
|
243
|
+ var params= {
|
|
244
|
+ limit:this.limit,
|
|
245
|
+ page:this.page,
|
|
246
|
+ id:this.$route.query.id,
|
|
247
|
+ start_time:this.start_time,
|
|
248
|
+ end_time:this.end_time,
|
|
249
|
+ }
|
|
250
|
+ getStockInList(params).then(response=>{
|
|
251
|
+ if(response.data.state == 1){
|
|
252
|
+ var list = response.data.data.list
|
|
253
|
+ for(let i=0;i<list.length;i++){
|
|
254
|
+ list[i].stock_way = 4
|
|
255
|
+ this.tableList.push(list[i])
|
|
256
|
+ }
|
|
257
|
+ var total = response.data.data.total
|
|
258
|
+ this.total = total
|
|
259
|
+ console.log("入库数据",this.tableList)
|
|
260
|
+ var manufacturerList = response.data.data.manufacturerList
|
|
261
|
+ this.manufacturerList = manufacturerList
|
|
262
|
+ }
|
|
263
|
+ })
|
|
264
|
+ },
|
|
265
|
+ // getOutList(){
|
|
266
|
+ // var params= {
|
|
267
|
+ // limit:this.limit,
|
|
268
|
+ // page:this.page,
|
|
269
|
+ // id:this.$route.query.id,
|
|
270
|
+ // start_time:this.start_time,
|
|
271
|
+ // end_time:this.end_time,
|
|
272
|
+ // }
|
|
273
|
+ // getStockOutList(params).then(response=>{
|
|
274
|
+ // if(response.data.state == 1){
|
|
275
|
+ // var outlist = response.data.data.outList
|
|
276
|
+ // console.log("出库数据",outlist)
|
|
277
|
+ // for(let i=0;i<outlist.length;i++){
|
|
278
|
+ // outlist[i].stock_way = 2
|
|
279
|
+ // this.tableList.push(outlist[i])
|
|
280
|
+ // }
|
|
281
|
+ // console.log("hhhhhhhhhhh",this.tableList)
|
|
282
|
+ // }
|
|
283
|
+ // })
|
|
284
|
+ // }
|
|
285
|
+ }
|
|
286
|
+ }
|
|
287
|
+</script>
|
|
288
|
+<style rel="stylesheet/css" lang="scss" scoped>
|
|
289
|
+ .information {
|
|
290
|
+ border: 1px #dcdfe6 solid;
|
|
291
|
+ padding: 30px 20px 30px 20px;
|
|
292
|
+
|
|
293
|
+ .border {
|
|
294
|
+ border-bottom: 1px #dcdfe6 solid;
|
|
295
|
+ margin: 0px 0 20px 0;
|
|
296
|
+ }
|
|
297
|
+
|
|
298
|
+ }
|
|
299
|
+
|
|
300
|
+ .title {
|
|
301
|
+ background: #409eff;
|
|
302
|
+ height: 44px;
|
|
303
|
+ line-height: 44px;
|
|
304
|
+ padding: 0 0 0 10px;
|
|
305
|
+ color: #fff;
|
|
306
|
+ margin: 0 0 10px 0;
|
|
307
|
+ }
|
|
308
|
+
|
|
309
|
+ .edit_separater {
|
|
310
|
+ border-top: 1px solid rgb(233, 233, 233);
|
|
311
|
+ margin-top: 15px;
|
|
312
|
+ margin-bottom: 15px;
|
|
313
|
+ }
|
|
314
|
+</style>
|
|
315
|
+
|
|
316
|
+<style>
|
|
317
|
+ .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
|
318
|
+ font-size: 12px;
|
|
319
|
+ }
|
|
320
|
+
|
|
321
|
+ .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
|
322
|
+ background: #6fb5fa;
|
|
323
|
+ }
|
|
324
|
+
|
|
325
|
+ .count {
|
|
326
|
+ color: #bd2c00;
|
|
327
|
+ }
|
|
328
|
+
|
|
329
|
+ .el-table td,
|
|
330
|
+ .el-table th.is-leaf,
|
|
331
|
+ .el-table--border,
|
|
332
|
+ .el-table--group {
|
|
333
|
+ border-color: #d0d3da;
|
|
334
|
+ }
|
|
335
|
+
|
|
336
|
+ .el-table--border::after,
|
|
337
|
+ .el-table--group::after,
|
|
338
|
+ .el-table::before {
|
|
339
|
+ background-color: #d0d3da;
|
|
340
|
+ }
|
|
341
|
+</style>
|