|
@@ -27,14 +27,14 @@
|
27
|
27
|
>
|
28
|
28
|
<el-date-picker
|
29
|
29
|
size="small"
|
30
|
|
- v-model="value1"
|
|
30
|
+ v-model="start_time"
|
31
|
31
|
type="date"
|
32
|
32
|
style="margin-left:5px;width:140px;"
|
33
|
33
|
placeholder="选择日期">
|
34
|
34
|
</el-date-picker>
|
35
|
35
|
<el-date-picker
|
36
|
36
|
size="small"
|
37
|
|
- v-model="value2"
|
|
37
|
+ v-model="end_time"
|
38
|
38
|
type="date"
|
39
|
39
|
style="margin-left:5px;width:140px;"
|
40
|
40
|
placeholder="选择日期">
|
|
@@ -42,49 +42,61 @@
|
42
|
42
|
</div>
|
43
|
43
|
<div>
|
44
|
44
|
<el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
|
45
|
|
- <el-button size="small" type="primary">核对</el-button>
|
|
45
|
+ <el-button size="small" type="primary" @click="toCheck">核对</el-button>
|
46
|
46
|
<el-button size="small" type="primary" @click="print">打印</el-button>
|
47
|
|
- <el-button size="small" type="primary">导出</el-button>
|
|
47
|
+ <el-button size="small" type="primary" @click="exportList">导出</el-button>
|
48
|
48
|
</div>
|
49
|
49
|
</div>
|
50
|
|
- <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
|
51
|
|
- <el-table-column
|
52
|
|
- prop="date"
|
53
|
|
- label="盘点编号">
|
|
50
|
+ <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
|
|
51
|
+ <el-table-column type="selection" width="55" align="center"> </el-table-column>
|
|
52
|
+ <el-table-column prop="date" label="盘点编号" align="center">
|
|
53
|
+ <template slot-scope="scope">
|
|
54
|
+ {{scope.row.warehousing_order}}
|
|
55
|
+ </template>
|
54
|
56
|
</el-table-column>
|
55
|
|
- <el-table-column
|
56
|
|
- prop="date"
|
57
|
|
- label="盘点日期">
|
|
57
|
+ <el-table-column prop="date" label="盘点日期" align="center">
|
|
58
|
+ <template slot-scope="scope">
|
|
59
|
+ {{getTime(scope.row.start_time)}}
|
|
60
|
+ </template>
|
|
61
|
+ </el-table-column>
|
|
62
|
+ <el-table-column prop="name" label="盘点数量" align="center">
|
|
63
|
+ <template slot-scope="scope">
|
|
64
|
+ {{scope.row.count}}
|
|
65
|
+ </template>
|
58
|
66
|
</el-table-column>
|
59
|
|
- <el-table-column
|
60
|
|
- prop="name"
|
61
|
|
- label="盘点人">
|
|
67
|
+ <el-table-column prop="name" label="盘点人" align="center">
|
|
68
|
+ <template slot-scope="scope">
|
|
69
|
+ {{getDoctorName(scope.row.creator)}}
|
|
70
|
+ </template>
|
62
|
71
|
</el-table-column>
|
63
|
|
- <el-table-column
|
64
|
|
- prop="name"
|
65
|
|
- label="审核日期">
|
|
72
|
+ <el-table-column prop="name" label="审核日期" align="center">
|
|
73
|
+ <template slot-scope="scope">
|
|
74
|
+ {{getTime(scope.row.checker_time)}}
|
|
75
|
+ </template>
|
66
|
76
|
</el-table-column>
|
67
|
|
- <el-table-column
|
68
|
|
- prop="name"
|
69
|
|
- label="审核人">
|
|
77
|
+ <el-table-column prop="name" label="审核人" align="center">
|
|
78
|
+ <template slot-scope="scope">
|
|
79
|
+ {{getDoctorName(scope.row.checker)}}
|
|
80
|
+ </template>
|
70
|
81
|
</el-table-column>
|
71
|
|
- <el-table-column
|
72
|
|
- prop="name"
|
73
|
|
- label="状态">
|
|
82
|
+ <el-table-column prop="name" label="状态" align="center">
|
|
83
|
+ <template slot-scope="scope">
|
|
84
|
+ <span v-if="scope.row.checker_status == 1">已核对</span>
|
|
85
|
+ <span v-if="scope.row.checker_status == 2">未核对</span>
|
|
86
|
+ </template>
|
74
|
87
|
</el-table-column>
|
75
|
|
- <el-table-column
|
76
|
|
- label="操作">
|
|
88
|
+ <el-table-column label="操作" align="center">
|
77
|
89
|
<template slot-scope="scope">
|
78
|
|
- <el-button type="text" size="small" >编辑</el-button>
|
79
|
|
- <el-button type="text" size="small" >删除</el-button>
|
|
90
|
+ <el-button type="primary" size="small" @click="editInventory(scope.row.id,scope.row.checker_status,scope.$index)">编辑</el-button>
|
|
91
|
+ <el-button type="danger" size="small" @click="deleteDrugInventory(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
|
80
|
92
|
</template>
|
81
|
93
|
</el-table-column>
|
82
|
94
|
</el-table>
|
83
|
95
|
<el-pagination
|
84
|
96
|
@size-change="handleSizeChange"
|
85
|
97
|
@current-change="handleCurrentChange"
|
86
|
|
- :page-sizes="[5, 10, 50, 100]"
|
87
|
|
- :page-size="5"
|
|
98
|
+ :page-sizes="[10, 20, 40, 100]"
|
|
99
|
+ :page-size="10"
|
88
|
100
|
background
|
89
|
101
|
style="margin-top:20px;text-align: right"
|
90
|
102
|
layout="total, sizes, prev, pager, next, jumper"
|
|
@@ -186,11 +198,11 @@
|
186
|
198
|
{{scope.row.retail_price}}
|
187
|
199
|
</template>
|
188
|
200
|
</el-table-column>
|
189
|
|
- <el-table-column prop="name" label="新零售价" width="100">
|
|
201
|
+ <!-- <el-table-column prop="name" label="新零售价" width="100">
|
190
|
202
|
<template slot-scope="scope">
|
191
|
203
|
{{scope.row.new_price}}
|
192
|
204
|
</template>
|
193
|
|
- </el-table-column>
|
|
205
|
+ </el-table-column> -->
|
194
|
206
|
<el-table-column prop="name" label="生产厂商" width="100">
|
195
|
207
|
<template slot-scope="scope">
|
196
|
208
|
{{scope.row.manufacturer}}
|
|
@@ -234,6 +246,7 @@
|
234
|
246
|
:visible.sync="editdialogVisible"
|
235
|
247
|
width="1200px">
|
236
|
248
|
<el-form :model="form" class="modifyDialog" label-width="120px">
|
|
249
|
+
|
237
|
250
|
<el-form-item label="耗材ID">
|
238
|
251
|
<el-input v-model="form.drug_id"></el-input>
|
239
|
252
|
</el-form-item>
|
|
@@ -292,12 +305,120 @@
|
292
|
305
|
<el-button type="primary" @click="saveInventory">确 定</el-button>
|
293
|
306
|
</span>
|
294
|
307
|
</el-dialog>
|
|
308
|
+
|
|
309
|
+ <el-dialog
|
|
310
|
+ title="药品盘点核对"
|
|
311
|
+ :visible.sync="checkDialogVisible"
|
|
312
|
+ width="30%"
|
|
313
|
+ >
|
|
314
|
+ <span>
|
|
315
|
+ <el-form :model="form">
|
|
316
|
+ <el-row>
|
|
317
|
+ <el-col>
|
|
318
|
+ <el-form-item label="核对时间">
|
|
319
|
+ <el-date-picker
|
|
320
|
+ size="small"
|
|
321
|
+ v-model="check_time"
|
|
322
|
+ type="date"
|
|
323
|
+ style="margin-left:5px;width:140px;"
|
|
324
|
+ placeholder="选择日期">
|
|
325
|
+ </el-date-picker>
|
|
326
|
+ </el-form-item>
|
|
327
|
+ </el-col>
|
|
328
|
+ </el-row>
|
|
329
|
+ <el-row>
|
|
330
|
+ <el-col>
|
|
331
|
+ <el-form-item label="核对人">
|
|
332
|
+ <el-select v-model="checker" placeholder="请选择">
|
|
333
|
+ <el-option
|
|
334
|
+ v-for="item in doctorList"
|
|
335
|
+ :key="item.admin_user_id"
|
|
336
|
+ :label="item.user_name"
|
|
337
|
+ :value="item.admin_user_id">
|
|
338
|
+ </el-option>
|
|
339
|
+ </el-select>
|
|
340
|
+ </el-form-item>
|
|
341
|
+ </el-col>
|
|
342
|
+ </el-row>
|
|
343
|
+ </el-form>
|
|
344
|
+ </span>
|
|
345
|
+ <span slot="footer" class="dialog-footer">
|
|
346
|
+ <el-button @click="checkDialogVisible = false">取 消</el-button>
|
|
347
|
+ <el-button type="primary" @click="SaveDrugCheckedInventory">保 存</el-button>
|
|
348
|
+ </span>
|
|
349
|
+ </el-dialog>
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+ <el-dialog
|
|
353
|
+ title="库房调价"
|
|
354
|
+ :visible.sync="modifydialogVisible"
|
|
355
|
+ width="1200px">
|
|
356
|
+ <el-form :model="form" class="modifyDialog" label-width="120px">
|
|
357
|
+
|
|
358
|
+ <el-form-item label="耗材ID">
|
|
359
|
+ <el-input v-model="form.drug_id"></el-input>
|
|
360
|
+ </el-form-item>
|
|
361
|
+ <el-form-item label="药品名称">
|
|
362
|
+ <el-autocomplete
|
|
363
|
+ class="checkSearch"
|
|
364
|
+ popper-class="my-autocomplete"
|
|
365
|
+ v-model="form.drug_name"
|
|
366
|
+ :fetch-suggestions="querySearchAsync"
|
|
367
|
+ :trigger-on-focus="true"
|
|
368
|
+ placeholder="请输入药品名称"
|
|
369
|
+ @select="handleSelect"
|
|
370
|
+ style="width:160px;"
|
|
371
|
+ >
|
|
372
|
+ <i class="el-icon-search el-input__icon" slot="suffix"></i>
|
|
373
|
+ <template slot-scope="{ item }">
|
|
374
|
+ <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
|
|
375
|
+ </template>
|
|
376
|
+ </el-autocomplete>
|
|
377
|
+ </el-form-item>
|
|
378
|
+ <el-form-item label="规格">
|
|
379
|
+ <el-input v-model="form.specification_name" :disabled="true"></el-input>
|
|
380
|
+ </el-form-item>
|
|
381
|
+ <el-form-item label="单位">
|
|
382
|
+ <el-input v-model="form.warehousing_unit"></el-input>
|
|
383
|
+ </el-form-item>
|
|
384
|
+ <el-form-item label="进货价">
|
|
385
|
+ <el-input v-model="form.last_price"></el-input>
|
|
386
|
+ </el-form-item>
|
|
387
|
+ <el-form-item label="零售价">
|
|
388
|
+ <el-input v-model="form.retail_price"></el-input>
|
|
389
|
+ </el-form-item>
|
|
390
|
+ <el-form-item label="盘点数量">
|
|
391
|
+ <el-input v-model="form.count"></el-input>
|
|
392
|
+ </el-form-item>
|
|
393
|
+ <el-form-item label="库存">
|
|
394
|
+ <el-input v-model="form.total" :disabled="true"></el-input>
|
|
395
|
+ </el-form-item>
|
|
396
|
+ <el-form-item label="产地">
|
|
397
|
+ <el-input v-model="form.drug_origin_place"></el-input>
|
|
398
|
+ </el-form-item>
|
|
399
|
+ <el-form-item label="批准文号">
|
|
400
|
+ <el-input v-model="form.number"></el-input>
|
|
401
|
+ </el-form-item>
|
|
402
|
+ <el-form-item label="生产厂商">
|
|
403
|
+ <el-input v-model="form.manufacturer"></el-input>
|
|
404
|
+ </el-form-item>
|
|
405
|
+ <el-form-item label="备注">
|
|
406
|
+ <div style="display:flex;">
|
|
407
|
+ <el-input v-model="form.remark"></el-input>
|
|
408
|
+ </div>
|
|
409
|
+ </el-form-item>
|
|
410
|
+ </el-form>
|
|
411
|
+ <span slot="footer" class="dialog-footer">
|
|
412
|
+ <el-button @click="modifydialogVisible = false">取 消</el-button>
|
|
413
|
+ <el-button type="primary" @click="modifyInventory">确 定</el-button>
|
|
414
|
+ </span>
|
|
415
|
+ </el-dialog>
|
295
|
416
|
</div>
|
296
|
417
|
</template>
|
297
|
418
|
|
298
|
419
|
<script>
|
299
|
420
|
import { uParseTime } from '@/utils/tools'
|
300
|
|
-import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory} from "@/api/drug/drug"
|
|
421
|
+import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory,getDrugInventoryList,SaveDrugCheckedInventory,getDrugInventoryDetail,modifyInventory} from "@/api/drug/drug"
|
301
|
422
|
export default {
|
302
|
423
|
name: "drugInventory",
|
303
|
424
|
data() {
|
|
@@ -338,6 +459,18 @@ export default {
|
338
|
459
|
},
|
339
|
460
|
total: 0,
|
340
|
461
|
editdialogVisible:false,
|
|
462
|
+ limit:10,
|
|
463
|
+ page:1,
|
|
464
|
+ start_time:"",
|
|
465
|
+ end_time:"",
|
|
466
|
+ tableList:[],
|
|
467
|
+ doctorList:[],
|
|
468
|
+ checkDialogVisible:false,
|
|
469
|
+ ids:"",
|
|
470
|
+ checker:this.$store.getters.xt_user.user.id,
|
|
471
|
+ check_time:new Date(),
|
|
472
|
+ id:"",
|
|
473
|
+ modifydialogVisible:false,
|
341
|
474
|
}
|
342
|
475
|
},
|
343
|
476
|
methods:{
|
|
@@ -345,11 +478,21 @@ export default {
|
345
|
478
|
|
346
|
479
|
},
|
347
|
480
|
print(){
|
348
|
|
- this.$router.push({path:'/stock/stockModifyPricePrint'})
|
|
481
|
+ if(this.ids == ""){
|
|
482
|
+ this.$message.error("请勾选打印数据")
|
|
483
|
+ return false
|
|
484
|
+ }
|
|
485
|
+ this.$router.push({path:'/stock/drugs/inventoryPrint?ids='+this.ids})
|
349
|
486
|
|
350
|
487
|
},
|
351
|
|
- handleSizeChange(){},
|
352
|
|
- handleCurrentChange(){},
|
|
488
|
+ handleSizeChange(val){
|
|
489
|
+ this.limit = val
|
|
490
|
+ this.getlist()
|
|
491
|
+ },
|
|
492
|
+ handleCurrentChange(val){
|
|
493
|
+ this.page = val
|
|
494
|
+ this.getlist()
|
|
495
|
+ },
|
353
|
496
|
querySearchAsync(keyword, cb) {
|
354
|
497
|
let key = '';
|
355
|
498
|
if (keyword != undefined) {
|
|
@@ -548,6 +691,9 @@ export default {
|
548
|
691
|
if(this.tableData[i].manufacturer == 0){
|
549
|
692
|
this.tableData[i].manufacturer = ""
|
550
|
693
|
}
|
|
694
|
+ if(this.tableData[i].batch_number == undefined){
|
|
695
|
+ this.tableData[i].batch_number = ""
|
|
696
|
+ }
|
551
|
697
|
}
|
552
|
698
|
var params = {
|
553
|
699
|
tableData:this.tableData
|
|
@@ -560,10 +706,166 @@ export default {
|
560
|
706
|
this.editdialogVisible = false
|
561
|
707
|
}
|
562
|
708
|
})
|
|
709
|
+ },
|
|
710
|
+ getlist(){
|
|
711
|
+ var params = {
|
|
712
|
+ limit:this.limit,
|
|
713
|
+ page:this.page,
|
|
714
|
+ keyword:this.searchKey,
|
|
715
|
+ start_time:this.start_time,
|
|
716
|
+ end_time:this.end_time,
|
|
717
|
+ }
|
|
718
|
+ console.log("params2332332",params)
|
|
719
|
+ getDrugInventoryList(params).then(response=>{
|
|
720
|
+ if(response.data.state == 1){
|
|
721
|
+ this.total = response.data.data.total
|
|
722
|
+ this.tableList = response.data.data.list
|
|
723
|
+ console.log("表格",this.tableList)
|
|
724
|
+ this.doctorList = response.data.data.doctorList
|
|
725
|
+ console.log("医生",this.doctorList)
|
|
726
|
+ }
|
|
727
|
+ })
|
|
728
|
+ },
|
|
729
|
+ getDoctorName(id){
|
|
730
|
+ var name = ""
|
|
731
|
+ for(let i=0;i<this.doctorList.length;i++){
|
|
732
|
+ if(id == this.doctorList[i].admin_user_id){
|
|
733
|
+ name = this.doctorList[i].user_name
|
|
734
|
+ }
|
|
735
|
+ }
|
|
736
|
+ return name
|
|
737
|
+ },
|
|
738
|
+ changePrice(val){
|
|
739
|
+ var arr = []
|
|
740
|
+ for(let i=0;i<val.length;i++){
|
|
741
|
+ arr.push(val[i].id)
|
563
|
742
|
}
|
564
|
|
-
|
|
743
|
+ var str = arr.join(",")
|
|
744
|
+ console.log("str",str)
|
|
745
|
+ this.ids = str
|
|
746
|
+ },
|
|
747
|
+ toCheck(){
|
|
748
|
+ if(this.ids.length <=0){
|
|
749
|
+ this.$message.error("请勾选核对数据")
|
|
750
|
+ return
|
|
751
|
+ }else{
|
|
752
|
+ this.checkDialogVisible = true
|
|
753
|
+ }
|
|
754
|
+ },
|
|
755
|
+ SaveDrugCheckedInventory(){
|
|
756
|
+ var params = {
|
|
757
|
+ ids:this.ids,
|
|
758
|
+ check_time:this.getTime(this.check_time),
|
|
759
|
+ checker:this.checker,
|
|
760
|
+ }
|
|
761
|
+ console.log("params",params)
|
|
762
|
+ SaveDrugCheckedInventory(params).then(response=>{
|
|
763
|
+ if(response.data.state == 1){
|
|
764
|
+ this.$message.success("保存成功")
|
|
765
|
+ var msg = response.data.data.msg
|
|
766
|
+ this.checkDialogVisible = false
|
|
767
|
+ this.getlist()
|
|
768
|
+ }
|
|
769
|
+ })
|
|
770
|
+ },
|
|
771
|
+ editInventory(id,check_status){
|
|
772
|
+ if(check_status == 1){
|
|
773
|
+ this.$message.error("已核对不能编辑")
|
|
774
|
+ return false
|
|
775
|
+ }
|
|
776
|
+ getDrugInventoryDetail(id).then(response=>{
|
|
777
|
+ if(response.data.state == 1){
|
|
778
|
+ var detail = response.data.data.detail
|
|
779
|
+ this.id = detail.id
|
|
780
|
+ this.form.drug_id = detail.drug_id
|
|
781
|
+ this.form.drug_name = detail.drug_name
|
|
782
|
+ this.form.specification_name = detail.specification_name
|
|
783
|
+ this.form.retail_price = detail.retail_price
|
|
784
|
+ this.form.warehousing_order =detail.warehousing_order
|
|
785
|
+ this.form.number = detail.number
|
|
786
|
+
|
|
787
|
+ this.form.manufacturer = detail.manufacturer
|
|
788
|
+ this.form.remark = detail.remark
|
|
789
|
+ this.form.warehousing_unit = detail.warehousing_unit
|
|
790
|
+ this.form.total = parseInt(detail.total)
|
|
791
|
+
|
|
792
|
+ this.form.last_price = detail.last_price
|
|
793
|
+
|
|
794
|
+ this.form.count = parseInt(detail.count)
|
|
795
|
+ this.form.drug_origin_place = detail.drug_origin_place
|
|
796
|
+ this.modifydialogVisible = true
|
|
797
|
+ }
|
|
798
|
+ })
|
|
799
|
+ },
|
|
800
|
+ modifyInventory(){
|
|
801
|
+ var params = {
|
|
802
|
+ id:this.id,
|
|
803
|
+ drug_id:this.form.drug_id,
|
|
804
|
+ drug_name:this.form.drug_name,
|
|
805
|
+ specification_name:this.form.specification_name,
|
|
806
|
+ warehousing_unit:this.form.warehouseing_unit,
|
|
807
|
+ last_price:this.form.last_price,
|
|
808
|
+ retail_price:this.form.retail_price,
|
|
809
|
+ count:this.form.count,
|
|
810
|
+ total:this.form.total,
|
|
811
|
+ drug_origin_place:this.form.drug_origin_place,
|
|
812
|
+ batch_number:this.form.batch_number,
|
|
813
|
+ manufacturer:this.form.manufacturer,
|
|
814
|
+ remark:this.form.remark,
|
|
815
|
+ }
|
|
816
|
+ modifyInventory(params).then(response=>{
|
|
817
|
+ if(response.data.state == 1){
|
|
818
|
+ var inventory = response.data.data.inventory
|
|
819
|
+ this.modifydialogVisible = false
|
|
820
|
+ this.getlist()
|
|
821
|
+ }
|
|
822
|
+ })
|
|
823
|
+ },
|
|
824
|
+ deleteDrugInventory(id,check_status){
|
|
825
|
+ if(check_status == 1){
|
|
826
|
+ this.$message.error("已核对的不能编辑")
|
|
827
|
+ return
|
|
828
|
+ }
|
|
829
|
+ this.$confirm('是否删除所选内容?', '提示', {
|
|
830
|
+ confirmButtonText: '确定',
|
|
831
|
+ cancelButtonText: '取消',
|
|
832
|
+ type: 'warning'
|
|
833
|
+ }).then(() => {
|
|
834
|
+ let params = {
|
|
835
|
+ id:id,
|
|
836
|
+ }
|
|
837
|
+ deleteDrugInventory(params).then(response => {
|
|
838
|
+ if (response.data.state == 1) {
|
|
839
|
+ var msg = response.data.data.msg
|
|
840
|
+ this.$message.success("保存成功")
|
|
841
|
+ this.tableList.splice(index,1)
|
|
842
|
+ }
|
|
843
|
+ })
|
|
844
|
+ }).catch(() => {
|
|
845
|
+ this.loading = false
|
|
846
|
+ });
|
|
847
|
+ },
|
|
848
|
+ exportList(){
|
|
849
|
+
|
|
850
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
851
|
+ const tHeader = ['药品名称', '规格', '单位','零售价','当前库存','盘点数','亏损金额']
|
|
852
|
+ const filterVal = ['drug_name', 'spe', 'count','retail_price','total','count','']
|
|
853
|
+ const data = this.formatJson(filterVal, this.tableList)
|
|
854
|
+
|
|
855
|
+ excel.export_json_to_excel({
|
|
856
|
+ header: tHeader,
|
|
857
|
+ data,
|
|
858
|
+ filename: '耗材盘点'
|
|
859
|
+ })
|
|
860
|
+ this.downloadLoading = false
|
|
861
|
+ })
|
|
862
|
+ },
|
|
863
|
+ formatJson(filterVal, jsonData) {
|
|
864
|
+ return jsonData.map(v => filterVal.map(j => v[j]));
|
|
865
|
+ },
|
565
|
866
|
},
|
566
|
867
|
created(){
|
|
868
|
+ this.getlist()
|
567
|
869
|
},
|
568
|
870
|
mounted() {
|
569
|
871
|
},
|