|
@@ -0,0 +1,417 @@
|
|
1
|
+<template>
|
|
2
|
+ <!--患者发药-->
|
|
3
|
+ <div class="main-contain new-main-contain">
|
|
4
|
+ <div class="position">
|
|
5
|
+ <bread-crumb :crumbs="crumbs"></bread-crumb>
|
|
6
|
+ </div>
|
|
7
|
+ <div
|
|
8
|
+ class="app-container"
|
|
9
|
+ style="display: flex; flex: 1; padding: 10px 20px 0px 20px"
|
|
10
|
+ >
|
|
11
|
+ <div class="mainLeft">
|
|
12
|
+ <div>
|
|
13
|
+ <div
|
|
14
|
+ class="list"
|
|
15
|
+ style="display: flex; justify-content: space-between"
|
|
16
|
+ >
|
|
17
|
+ <el-input
|
|
18
|
+ size="small"
|
|
19
|
+ style="width: 200px"
|
|
20
|
+ v-model="keywords"
|
|
21
|
+ class="filter-item"
|
|
22
|
+ placeholder="请输入耗材名称"
|
|
23
|
+ clearable
|
|
24
|
+ />
|
|
25
|
+ <el-button
|
|
26
|
+
|
|
27
|
+ size="small"
|
|
28
|
+ class="filter-item"
|
|
29
|
+ type="primary"
|
|
30
|
+ @click="searchAction"
|
|
31
|
+ >搜索
|
|
32
|
+ </el-button>
|
|
33
|
+ </div>
|
|
34
|
+
|
|
35
|
+ <el-table
|
|
36
|
+ height="80vh"
|
|
37
|
+ ref="table01"
|
|
38
|
+ :data="drugList"
|
|
39
|
+ highlight-current-row
|
|
40
|
+ @current-change="handleCurrentChange"
|
|
41
|
+ border
|
|
42
|
+ style="width: 100%"
|
|
43
|
+ v-if="state == 1"
|
|
44
|
+ :row-style="{ color: '#303133' }"
|
|
45
|
+ :header-cell-style="{
|
|
46
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
47
|
+ color: '#606266',
|
|
48
|
+ }"
|
|
49
|
+ >
|
|
50
|
+ <el-table-column prop="date" label="药品名称" align="center">
|
|
51
|
+ <template slot-scope="scope">
|
|
52
|
+ {{scope.row.drug_name}}
|
|
53
|
+ </template>
|
|
54
|
+ </el-table-column>
|
|
55
|
+ <el-table-column prop="name" label="规格" align="center">
|
|
56
|
+ <template slot-scope="scope">
|
|
57
|
+ {{scope.row.dose}}{{ scope.row.dose_unit }} * {{ scope.row.min_number }}{{ scope.row.min_unit }} /{{ scope.row.max_unit }}
|
|
58
|
+ </template>
|
|
59
|
+ </el-table-column>
|
|
60
|
+
|
|
61
|
+ <el-table-column prop="name" label="厂家" align="center">
|
|
62
|
+ <template slot-scope="scope">
|
|
63
|
+ {{getManufacturerName(scope.row.manufacturer)}}
|
|
64
|
+ </template>
|
|
65
|
+ </el-table-column>
|
|
66
|
+ </el-table>
|
|
67
|
+
|
|
68
|
+ </div>
|
|
69
|
+ </div>
|
|
70
|
+
|
|
71
|
+ <div class="mainRight">
|
|
72
|
+ <div class="titlelist">
|
|
73
|
+ <div>
|
|
74
|
+ <div>日期:{{nowTime}} 盘点人:{{user_name}}
|
|
75
|
+ </div>
|
|
76
|
+ </div>
|
|
77
|
+
|
|
78
|
+ </div>
|
|
79
|
+ <el-divider style="margin-top: 10px"></el-divider>
|
|
80
|
+ <div>
|
|
81
|
+ <el-table
|
|
82
|
+ :height="tableHeight"
|
|
83
|
+ :data="infoList"
|
|
84
|
+ border
|
|
85
|
+ style="width: 100%"
|
|
86
|
+ :row-style="{ color: '#303133' }"
|
|
87
|
+ :header-cell-style="{
|
|
88
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
89
|
+ color: '#606266',
|
|
90
|
+ }"
|
|
91
|
+ >
|
|
92
|
+ <el-table-column label="入库单号" align="center">
|
|
93
|
+ <template slot-scope="scope">
|
|
94
|
+ {{scope.row.warehousing_order}}
|
|
95
|
+ </template>
|
|
96
|
+ </el-table-column>
|
|
97
|
+ <el-table-column label="入库数量" align="center">
|
|
98
|
+ <template slot-scope="scope">
|
|
99
|
+ {{scope.row.warehousing_count}}
|
|
100
|
+ </template>
|
|
101
|
+ </el-table-column>
|
|
102
|
+ <el-table-column label="有效期" align="center">
|
|
103
|
+ <template slot-scope="scope">
|
|
104
|
+ {{getTime(scope.row.expiry_date)}}
|
|
105
|
+ </template>
|
|
106
|
+ </el-table-column>
|
|
107
|
+ <el-table-column label="批号" align="center">
|
|
108
|
+ <template slot-scope="scope">
|
|
109
|
+ {{scope.row.batch_number}}
|
|
110
|
+ </template>
|
|
111
|
+ </el-table-column>
|
|
112
|
+ <el-table-column label="进货价" align="center">
|
|
113
|
+ <template slot-scope="scope">
|
|
114
|
+ {{scope.row.price}}
|
|
115
|
+ </template>
|
|
116
|
+ </el-table-column>
|
|
117
|
+ <el-table-column label="剩余库存" align="center">
|
|
118
|
+ <template slot-scope="scope">
|
|
119
|
+ {{scope.row.stock_max_number}}{{ scope.row.max_unit }}
|
|
120
|
+ {{scope.row.stock_min_number}}{{ scope.row.min_unit }}
|
|
121
|
+ </template>
|
|
122
|
+ </el-table-column>
|
|
123
|
+ <el-table-column prop="name" label="盘点原因" width="100" align="center">
|
|
124
|
+ <template slot-scope="scope">
|
|
125
|
+ <el-select v-model="scope.row.type" placeholder="请选择">
|
|
126
|
+ <el-option
|
|
127
|
+ v-for="item in reasonList"
|
|
128
|
+ :key="item.id"
|
|
129
|
+ :label="item.name"
|
|
130
|
+ :value="item.id">
|
|
131
|
+ </el-option>
|
|
132
|
+ </el-select>
|
|
133
|
+ </template>
|
|
134
|
+ </el-table-column>
|
|
135
|
+ <el-table-column label="盘点后数量" align="center" width="220">
|
|
136
|
+ <template slot-scope="scope">
|
|
137
|
+ <el-input style="width:80px" v-model="scope.row.last_stock_max_number" type="number"></el-input>
|
|
138
|
+ {{scope.row.max_unit}}
|
|
139
|
+ <el-input style="width:60px" v-model="scope.row.last_stock_min_number" type="number"></el-input>
|
|
140
|
+ {{scope.row.min_unit}}
|
|
141
|
+ </template>
|
|
142
|
+ </el-table-column>
|
|
143
|
+ <el-table-column label="操作" align="center">
|
|
144
|
+ <template slot-scope="scope">
|
|
145
|
+ <span><el-button type="danger" @click="UpdateDrugWarehouseInfo(scope.row)">保存</el-button></span>
|
|
146
|
+ </template>
|
|
147
|
+ </el-table-column>
|
|
148
|
+
|
|
149
|
+ </el-table>
|
|
150
|
+ </div>
|
|
151
|
+
|
|
152
|
+ </div>
|
|
153
|
+
|
|
154
|
+ </div>
|
|
155
|
+ </div>
|
|
156
|
+ </template>
|
|
157
|
+
|
|
158
|
+ <script>
|
|
159
|
+
|
|
160
|
+ import BreadCrumb from "@/xt_pages/components/bread-crumb";
|
|
161
|
+ import {
|
|
162
|
+ getDrugInventoryList,
|
|
163
|
+ getDrugInventoryByDrugId,
|
|
164
|
+ updateDrugInventoryWarehouseInfo
|
|
165
|
+ } from "@/api/pharmacy";
|
|
166
|
+ const moment = require("moment");
|
|
167
|
+ import { uParseTime } from '@/utils/tools'
|
|
168
|
+ export default {
|
|
169
|
+ components: {
|
|
170
|
+ BreadCrumb,
|
|
171
|
+ },
|
|
172
|
+ data() {
|
|
173
|
+ return {
|
|
174
|
+ nowTime: moment(new Date()).format("YYYY-MM-DD HH:MM:SS"),
|
|
175
|
+ patient_id: 0,
|
|
176
|
+ crumbs: [
|
|
177
|
+ { path: false, name: "药品管理" },
|
|
178
|
+ { path: "/Pharmacy/patiantDispensing", name: "药品盘点" },
|
|
179
|
+ ],
|
|
180
|
+ tableHeight: 400,
|
|
181
|
+ start_time: moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
|
|
182
|
+ start_time2: moment(new Date()).add("year", 0).format("YYYY-MM-DD HH:mm"),
|
|
183
|
+ state: 1, //1待发药,2已发药
|
|
184
|
+ waitmount: 0, //待发药人数
|
|
185
|
+ waitmount_data: [],
|
|
186
|
+ alreadmount: 0, //已发药人数
|
|
187
|
+ alreadmount_data: [],
|
|
188
|
+ keywords: "",
|
|
189
|
+ tableData: [],
|
|
190
|
+ propsTable: [],
|
|
191
|
+ tableData_list: [],
|
|
192
|
+ isVisibility: false,
|
|
193
|
+ isVisibilityTwo:false,
|
|
194
|
+ currentRow: null,
|
|
195
|
+ dialogVisible: false,
|
|
196
|
+ is_open: "2",
|
|
197
|
+ banshift: [
|
|
198
|
+ { value: 0, text: "全部班" },
|
|
199
|
+ { value: 1, text: "上午" },
|
|
200
|
+ { value: 2, text: "下午" },
|
|
201
|
+ { value: 3, text: "晚上" },
|
|
202
|
+ ],
|
|
203
|
+ shift: 0, //班次
|
|
204
|
+ fen: [],
|
|
205
|
+ partition: 0, //分区
|
|
206
|
+ drugList:[],
|
|
207
|
+ baseList:[],
|
|
208
|
+ org_id:'',
|
|
209
|
+ patients:{},
|
|
210
|
+ doctors:[],
|
|
211
|
+ diagnosearr:[],
|
|
212
|
+ diagnosis:'',
|
|
213
|
+ goodList:[],
|
|
214
|
+ manufacturerList:[],
|
|
215
|
+ user_name:this.$store.getters.xt_user.user.user_name,
|
|
216
|
+ infoList:[],
|
|
217
|
+ reasonList:[
|
|
218
|
+ {id:6,name:"默认"},
|
|
219
|
+ {id:1,name:"到期退货"},
|
|
220
|
+ {id:2,name:"异常退货"},
|
|
221
|
+ {id:3,name:"退货"},
|
|
222
|
+ {id:4,name:"损坏"},
|
|
223
|
+ {id:5,name:"不计入报损分析"},
|
|
224
|
+ {id:7,name:"有效期到期"},
|
|
225
|
+ ],
|
|
226
|
+ };
|
|
227
|
+ },
|
|
228
|
+ watch: {},
|
|
229
|
+ created() {
|
|
230
|
+ this.org_id = this.$store.getters.xt_user.org.id
|
|
231
|
+
|
|
232
|
+ this.getDrugInventoryList()
|
|
233
|
+ },
|
|
234
|
+ methods:{
|
|
235
|
+ getTime(val) {
|
|
236
|
+ if(val < 0){
|
|
237
|
+ return ""
|
|
238
|
+ }
|
|
239
|
+ if(val == ""){
|
|
240
|
+ return ""
|
|
241
|
+ }else {
|
|
242
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
243
|
+ }
|
|
244
|
+ },
|
|
245
|
+ searchAction(){
|
|
246
|
+ this.getDrugInventoryList()
|
|
247
|
+ },
|
|
248
|
+ getDrugInventoryList(){
|
|
249
|
+ var params = {
|
|
250
|
+ keywords:this.keywords
|
|
251
|
+ }
|
|
252
|
+ getDrugInventoryList(params).then(response=>{
|
|
253
|
+ if(response.data.state ==1){
|
|
254
|
+ var list = response.data.data.drugList
|
|
255
|
+ console.log("HHHHHHHHH000000000000000000000",list)
|
|
256
|
+ this.drugList = list
|
|
257
|
+ this.$refs.table01.setCurrentRow(this.drugList[0])
|
|
258
|
+ this.manufacturerList = response.data.data.manufacturerList
|
|
259
|
+ }
|
|
260
|
+ })
|
|
261
|
+ },
|
|
262
|
+ getManufacturerName(id){
|
|
263
|
+ var manufacturer_name = ""
|
|
264
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
265
|
+ if(id == this.manufacturerList[i].id){
|
|
266
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name
|
|
267
|
+ }
|
|
268
|
+ }
|
|
269
|
+ return manufacturer_name
|
|
270
|
+ },
|
|
271
|
+ handleCurrentChange(val){
|
|
272
|
+ console.log("valo9oooooooooooooo",val)
|
|
273
|
+ getDrugInventoryByDrugId(val.id).then(response=>{
|
|
274
|
+ if(response.data.state ==1){
|
|
275
|
+
|
|
276
|
+ this.infoList = []
|
|
277
|
+ var infoList = response.data.data.infoList
|
|
278
|
+ for(let i=0;i<infoList.length;i++){
|
|
279
|
+ infoList[i].type = 6
|
|
280
|
+ infoList[i].last_stock_max_number = infoList[i].stock_max_number
|
|
281
|
+ infoList[i].last_stock_min_number = infoList[i].stock_min_number
|
|
282
|
+ this.infoList.push(infoList[i])
|
|
283
|
+ }
|
|
284
|
+
|
|
285
|
+ console.log("infoList====================",this.infoList)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+ }
|
|
289
|
+ })
|
|
290
|
+ },
|
|
291
|
+ UpdateDrugWarehouseInfo(row){
|
|
292
|
+ console.log("row===============",row)
|
|
293
|
+ var stock_in_number = 0
|
|
294
|
+ var now_in_number = 0
|
|
295
|
+ stock_in_number = row.warehousing_count * row.XtBaseDrug.min_number
|
|
296
|
+
|
|
297
|
+ now_in_number = row.last_stock_max_number * row.XtBaseDrug.min_number + row.last_stock_min_number
|
|
298
|
+ if(parseInt(row.last_stock_max_number)<0 && parseInt(row.last_stock_min_number)<0){
|
|
299
|
+ this.$message.error("盘点后数量不能为负数!")
|
|
300
|
+ return false
|
|
301
|
+ }
|
|
302
|
+ console.log("stock_in_number",stock_in_number)
|
|
303
|
+ console.log("now_in_number",now_in_number)
|
|
304
|
+ if(parseInt(now_in_number) >parseInt(stock_in_number)){
|
|
305
|
+ this.$message.error("该批次盘点后数量不能大于或等于入库数量!")
|
|
306
|
+ return false
|
|
307
|
+ }
|
|
308
|
+ var params = {
|
|
309
|
+ id:row.id,
|
|
310
|
+ stock_max_number:parseInt(row.stock_max_number),
|
|
311
|
+ stock_min_number:parseInt(row.stock_min_number),
|
|
312
|
+ last_stock_max_number:parseInt(row.last_stock_max_number),
|
|
313
|
+ last_stock_min_number:parseInt(row.last_stock_min_number),
|
|
314
|
+ drug_id:row.drug_id,
|
|
315
|
+ storehouse_id:parseInt(row.storehouse_id),
|
|
316
|
+ is_type:parseInt(row.type),
|
|
317
|
+ specification_name:row.XtBaseDrug.dose + row.XtBaseDrug.dose_unit + "*"+row.XtBaseDrug.min_number+row.min_unit+"/"+row.XtBaseDrug.max_unit
|
|
318
|
+ }
|
|
319
|
+ console.log("params22222222222222",params)
|
|
320
|
+ updateDrugInventoryWarehouseInfo(params).then(response=>{
|
|
321
|
+ if(response.data.state ==1){
|
|
322
|
+ var msg = response.data.data.msg
|
|
323
|
+ this.$message.success("保存成功!")
|
|
324
|
+ row.id =row.drug_id
|
|
325
|
+ this.handleCurrentChange(row)
|
|
326
|
+ }
|
|
327
|
+ })
|
|
328
|
+ }
|
|
329
|
+ }
|
|
330
|
+ };
|
|
331
|
+ </script>
|
|
332
|
+
|
|
333
|
+ <style rel="stylesheet/css" lang="scss" scoped>
|
|
334
|
+ .new-main-contain {
|
|
335
|
+ height: 100%;
|
|
336
|
+ display: flex;
|
|
337
|
+ flex-direction: column;
|
|
338
|
+ }
|
|
339
|
+
|
|
340
|
+ .app-container {
|
|
341
|
+ height: 100%;
|
|
342
|
+ }
|
|
343
|
+ .mainLeft {
|
|
344
|
+ width: 400px;
|
|
345
|
+ height: 100%;
|
|
346
|
+ display: flex;
|
|
347
|
+ flex-direction: column;
|
|
348
|
+
|
|
349
|
+ .el-radio {
|
|
350
|
+ margin-right: 5px;
|
|
351
|
+ }
|
|
352
|
+
|
|
353
|
+ .list {
|
|
354
|
+ margin: 10px 0;
|
|
355
|
+ }
|
|
356
|
+ }
|
|
357
|
+ .mainRight {
|
|
358
|
+ margin-left: 10px;
|
|
359
|
+ flex: 1;
|
|
360
|
+ height: 100%;
|
|
361
|
+ display: flex;
|
|
362
|
+ flex-direction: column;
|
|
363
|
+ overflow-y: auto;
|
|
364
|
+ .titlelist {
|
|
365
|
+ display: flex;
|
|
366
|
+ justify-content: space-between;
|
|
367
|
+ white-space: nowrap;
|
|
368
|
+ color: #909399;
|
|
369
|
+ font-size: 14px;
|
|
370
|
+ /deep/ .el-input__inner {
|
|
371
|
+ font-size: 13px !important;
|
|
372
|
+ }
|
|
373
|
+ }
|
|
374
|
+ .el-table {
|
|
375
|
+ margin-top: -13px;
|
|
376
|
+ }
|
|
377
|
+ .el-button {
|
|
378
|
+ height: 34px;
|
|
379
|
+ width: 65px;
|
|
380
|
+ }
|
|
381
|
+ /deep/ .el-divider {
|
|
382
|
+ height: 2px;
|
|
383
|
+ margin-top: 10px;
|
|
384
|
+ }
|
|
385
|
+
|
|
386
|
+ /deep/ .el-table__body-wrapper {
|
|
387
|
+ overflow-x: scroll !important;
|
|
388
|
+ }
|
|
389
|
+ }
|
|
390
|
+
|
|
391
|
+ /deep/ .el-input__inner {
|
|
392
|
+ padding-right: 15px;
|
|
393
|
+ }
|
|
394
|
+
|
|
395
|
+ /deep/ .el-table--scrollable-x .el-table__body-wrapper {
|
|
396
|
+ overflow: auto;
|
|
397
|
+ overflow-x: hidden;
|
|
398
|
+ }
|
|
399
|
+ /deep/ .gutter {
|
|
400
|
+ width: 15px !important;
|
|
401
|
+ display: inline-block !important;
|
|
402
|
+ }
|
|
403
|
+ /deep/ .el-table__fixed-right-patch {
|
|
404
|
+ width: 15px !important;
|
|
405
|
+ }
|
|
406
|
+
|
|
407
|
+ /deep/ .el-table__fixed-right {
|
|
408
|
+ bottom: 0 !important;
|
|
409
|
+ left: auto;
|
|
410
|
+ right: 0;
|
|
411
|
+ }
|
|
412
|
+ /deep/ .el-table__body-wrapper::-webkit-scrollbar {
|
|
413
|
+ width: 15px !important;
|
|
414
|
+ height: 15px !important;
|
|
415
|
+ }
|
|
416
|
+ </style>
|
|
417
|
+
|