|
@@ -53,6 +53,16 @@
|
53
|
53
|
{{getTime(scope.row.start_time)}}
|
54
|
54
|
</template>
|
55
|
55
|
</el-table-column>
|
|
56
|
+ <el-table-column prop="date" label="药品名称" align="center">
|
|
57
|
+ <template slot-scope="scope">
|
|
58
|
+ {{scope.row.drug_name}}
|
|
59
|
+ </template>
|
|
60
|
+ </el-table-column>
|
|
61
|
+ <el-table-column prop="date" label="药品规格" align="center">
|
|
62
|
+ <template slot-scope="scope">
|
|
63
|
+ {{scope.row.specification_name}}
|
|
64
|
+ </template>
|
|
65
|
+ </el-table-column>
|
56
|
66
|
<el-table-column prop="name" label="盘点数量" align="center">
|
57
|
67
|
<template slot-scope="scope">
|
58
|
68
|
{{scope.row.count}}
|
|
@@ -82,7 +92,6 @@
|
82
|
92
|
<el-table-column label="操作" align="center" width="260">
|
83
|
93
|
<template slot-scope="scope">
|
84
|
94
|
<el-button type="primary" size="small" @click="editInventory(scope.row.id,scope.row.checker_status,scope.$index)">编辑</el-button>
|
85
|
|
- <el-button type="primary" size="small" @click="toProof(scope.row.id)">校正</el-button>
|
86
|
95
|
<el-button type="danger" size="small" @click="deleteDrugInventory(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
|
87
|
96
|
|
88
|
97
|
</template>
|
|
@@ -138,8 +147,18 @@
|
138
|
147
|
<el-form-item label="规格">
|
139
|
148
|
<el-input v-model="form.specification_name" :disabled="true"></el-input>
|
140
|
149
|
</el-form-item>
|
141
|
|
- <el-form-item label="单位">
|
|
150
|
+ <!-- <el-form-item label="单位">
|
142
|
151
|
<el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
|
|
152
|
+ </el-form-item> -->
|
|
153
|
+ <el-form-item prop="max_unit" label="单位">
|
|
154
|
+ <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
|
|
155
|
+ <el-option
|
|
156
|
+ v-for="(item,index) in getDataConfig('hemodialysis','units')"
|
|
157
|
+ :key="index"
|
|
158
|
+ :label="item.name"
|
|
159
|
+ :value="item.name">
|
|
160
|
+ </el-option>
|
|
161
|
+ </el-select>
|
143
|
162
|
</el-form-item>
|
144
|
163
|
<el-form-item label="进货价">
|
145
|
164
|
<el-input v-model="form.last_price" :disabled="true"></el-input>
|
|
@@ -231,7 +250,7 @@
|
231
|
250
|
width="100"
|
232
|
251
|
label="操作">
|
233
|
252
|
<template slot-scope="scope">
|
234
|
|
- <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
|
|
253
|
+ <el-button type="text" size="small" @click="toEdit(scope.row,scope.$index)">编辑</el-button>
|
235
|
254
|
<el-button type="text" size="small" @click="toDelete(scope.$index)">删除</el-button>
|
236
|
255
|
|
237
|
256
|
</template>
|
|
@@ -273,8 +292,28 @@
|
273
|
292
|
<el-form-item label="规格">
|
274
|
293
|
<el-input v-model="form.specification_name" :disabled="true"></el-input>
|
275
|
294
|
</el-form-item>
|
276
|
|
- <el-form-item label="单位">
|
|
295
|
+ <el-form-item label="批次">
|
|
296
|
+ <el-select v-model="form.batch_number" filterable placeholder="请选择" @change="changeNumber">
|
|
297
|
+ <el-option
|
|
298
|
+ v-for="(item,index) in numberList"
|
|
299
|
+ :key="index"
|
|
300
|
+ :label="item.batch_number"
|
|
301
|
+ :value="item.id">
|
|
302
|
+ </el-option>
|
|
303
|
+ </el-select>
|
|
304
|
+ </el-form-item>
|
|
305
|
+ <!-- <el-form-item label="单位">
|
277
|
306
|
<el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
|
|
307
|
+ </el-form-item> -->
|
|
308
|
+ <el-form-item prop="warehousing_unit" label="单位">
|
|
309
|
+ <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
|
|
310
|
+ <el-option
|
|
311
|
+ v-for="(item,index) in getDataConfig('hemodialysis','units')"
|
|
312
|
+ :key="index"
|
|
313
|
+ :label="item.name"
|
|
314
|
+ :value="item.name">
|
|
315
|
+ </el-option>
|
|
316
|
+ </el-select>
|
278
|
317
|
</el-form-item>
|
279
|
318
|
<el-form-item label="进货价">
|
280
|
319
|
<el-input v-model="form.last_price" :disabled="true"></el-input>
|
|
@@ -381,14 +420,24 @@
|
381
|
420
|
<el-form-item label="规格">
|
382
|
421
|
<el-input v-model="form.specification_name" :disabled="true"></el-input>
|
383
|
422
|
</el-form-item>
|
384
|
|
- <el-form-item label="单位">
|
385
|
|
- <el-input v-model="form.warehousing_unit"></el-input>
|
|
423
|
+ <!-- <el-form-item label="单位">
|
|
424
|
+ <el-input v-model="form.warehousing_unit" :disabled="true"></el-input>
|
|
425
|
+ </el-form-item> -->
|
|
426
|
+ <el-form-item prop="warehousing_unit" label="单位">
|
|
427
|
+ <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
|
|
428
|
+ <el-option
|
|
429
|
+ v-for="(item,index) in getDataConfig('hemodialysis','units')"
|
|
430
|
+ :key="index"
|
|
431
|
+ :label="item.name"
|
|
432
|
+ :value="item.name">
|
|
433
|
+ </el-option>
|
|
434
|
+ </el-select>
|
386
|
435
|
</el-form-item>
|
387
|
436
|
<el-form-item label="进货价">
|
388
|
|
- <el-input v-model="form.last_price"></el-input>
|
|
437
|
+ <el-input v-model="form.last_price" :disabled="true"></el-input>
|
389
|
438
|
</el-form-item>
|
390
|
439
|
<el-form-item label="零售价">
|
391
|
|
- <el-input v-model="form.retail_price"></el-input>
|
|
440
|
+ <el-input v-model="form.retail_price" :disabled="true"></el-input>
|
392
|
441
|
</el-form-item>
|
393
|
442
|
<el-form-item label="盘点数量">
|
394
|
443
|
<el-input v-model="form.count"></el-input>
|
|
@@ -397,13 +446,13 @@
|
397
|
446
|
<el-input v-model="form.total" :disabled="true"></el-input>
|
398
|
447
|
</el-form-item>
|
399
|
448
|
<el-form-item label="产地">
|
400
|
|
- <el-input v-model="form.drug_origin_place"></el-input>
|
|
449
|
+ <el-input v-model="form.drug_origin_place" :disabled="true"></el-input>
|
401
|
450
|
</el-form-item>
|
402
|
451
|
<el-form-item label="批准文号">
|
403
|
|
- <el-input v-model="form.number"></el-input>
|
|
452
|
+ <el-input v-model="form.number" :disabled="true"></el-input>
|
404
|
453
|
</el-form-item>
|
405
|
454
|
<el-form-item label="生产厂商">
|
406
|
|
- <el-input v-model="form.manufacturer"></el-input>
|
|
455
|
+ <el-input v-model="form.manufacturer" :disabled="true"></el-input>
|
407
|
456
|
</el-form-item>
|
408
|
457
|
<el-form-item label="备注">
|
409
|
458
|
<div style="display:flex;">
|
|
@@ -441,8 +490,18 @@
|
441
|
490
|
</template>
|
442
|
491
|
</el-autocomplete>
|
443
|
492
|
</el-form-item>
|
444
|
|
- <el-form-item label="单位">
|
|
493
|
+ <!-- <el-form-item label="单位">
|
445
|
494
|
<el-input v-model="form.warehousing_unit"></el-input>
|
|
495
|
+ </el-form-item> -->
|
|
496
|
+ <el-form-item prop="warehousing_unit" label="单位">
|
|
497
|
+ <el-select v-model="form.warehousing_unit" style="width:160px;" placeholder="单位" @change="changeMaxUnit">
|
|
498
|
+ <el-option
|
|
499
|
+ v-for="(item,index) in getDataConfig('hemodialysis','units')"
|
|
500
|
+ :key="index"
|
|
501
|
+ :label="item.name"
|
|
502
|
+ :value="item.name">
|
|
503
|
+ </el-option>
|
|
504
|
+ </el-select>
|
446
|
505
|
</el-form-item>
|
447
|
506
|
<el-form-item label="盘点数量">
|
448
|
507
|
<el-input v-model="form.count"></el-input>
|
|
@@ -471,8 +530,9 @@
|
471
|
530
|
|
472
|
531
|
<script>
|
473
|
532
|
import { uParseTime } from '@/utils/tools'
|
474
|
|
-import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory,getDrugInventoryList,SaveDrugCheckedInventory,getDrugInventoryDetail,modifyInventory,SaveDrugProofInventory} from "@/api/drug/drug"
|
|
533
|
+import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory,getDrugInventoryList,SaveDrugCheckedInventory,getDrugInventoryDetail,modifyInventory,SaveDrugProofInventory,getDrugWarehouseInfoTotal} from "@/api/drug/drug"
|
475
|
534
|
import { getDrugBatchNumber } from "@/api/drug/drug_stock"
|
|
535
|
+import { getDataConfig } from '@/utils/data'
|
476
|
536
|
export default {
|
477
|
537
|
name: "drugInventory",
|
478
|
538
|
data() {
|
|
@@ -529,11 +589,14 @@ export default {
|
529
|
589
|
modifydialogVisible:false,
|
530
|
590
|
numberList:[],
|
531
|
591
|
profdialogVisible:false,
|
|
592
|
+ index:"",
|
|
593
|
+ unitList:[],
|
532
|
594
|
}
|
533
|
595
|
},
|
534
|
596
|
methods:{
|
535
|
597
|
changeNumber(val){
|
536
|
598
|
this.form.warehouse_info_id = val
|
|
599
|
+ this.getDrugWarehouseInfoTotal(val)
|
537
|
600
|
},
|
538
|
601
|
search(){
|
539
|
602
|
this.getlist()
|
|
@@ -620,7 +683,8 @@ export default {
|
620
|
683
|
this.form.manufacturer = val.manufacturer
|
621
|
684
|
this.form.remark = val.remark
|
622
|
685
|
this.form.warehousing_unit = val.max_unit
|
623
|
|
- this.form.total = this.getTotal(total,val.max_unit,val.min_unit,val.min_number)
|
|
686
|
+ this.form.total = ""
|
|
687
|
+ // this.form.total = this.getTotal(total,val.max_unit,val.min_unit,val.min_number)
|
624
|
688
|
this.form.batch_number = val.batch_number
|
625
|
689
|
this.form.last_price = val.last_price
|
626
|
690
|
this.form.specification_name = val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
|
|
@@ -705,8 +769,7 @@ export default {
|
705
|
769
|
toDelete(index){
|
706
|
770
|
this.tableData.splice(index,1)
|
707
|
771
|
},
|
708
|
|
- toEdit(val){
|
709
|
|
- console.log("val2323223",val)
|
|
772
|
+ toEdit(val,index){
|
710
|
773
|
this.form.id= val.id
|
711
|
774
|
this.form.drug_id = val.drug_id,
|
712
|
775
|
this.form.drug_name = val.drug_name
|
|
@@ -724,7 +787,7 @@ export default {
|
724
|
787
|
this.form.expiry_date = val.expiry_date
|
725
|
788
|
this.form.product_date =val.product_date
|
726
|
789
|
this.form.count = val.count
|
727
|
|
-
|
|
790
|
+ this.index = index
|
728
|
791
|
this.editdialogVisible = true
|
729
|
792
|
},
|
730
|
793
|
saveInventory(){
|
|
@@ -747,6 +810,24 @@ export default {
|
747
|
810
|
this.tableData[i].product_date = this.form.product_date
|
748
|
811
|
this.tableData[i].count =this.form.count
|
749
|
812
|
}
|
|
813
|
+ if(this.index == i){
|
|
814
|
+ this.tableData[i].drug_id = this.form.drug_id
|
|
815
|
+ this.tableData[i].drug_name = this.form.drug_name
|
|
816
|
+ this.tableData[i].retail_price = this.form.retail_price
|
|
817
|
+ this.tableData[i].warehousing_order = this.form.warehousing_order
|
|
818
|
+ this.tableData[i].number = this.form.number
|
|
819
|
+ this.tableData[i].dealer = this.form.dealer
|
|
820
|
+ this.tableData[i].manufacturer = this.form.manufacturer
|
|
821
|
+ this.tableData[i].remark = this.form.remark
|
|
822
|
+ this.tableData[i].warehouseing_unit = this.form.warehousing_unit
|
|
823
|
+ this.tableData[i].total = this.form.total
|
|
824
|
+ this.tableData[i].batch_number = this.form.batch_number
|
|
825
|
+ this.tableData[i].last_price = this.form.last_price
|
|
826
|
+ this.tableData[i].specification_name = this.form.specification_name
|
|
827
|
+ this.tableData[i].expiry_date = this.form.expiry_date
|
|
828
|
+ this.tableData[i].product_date = this.form.product_date
|
|
829
|
+ this.tableData[i].count =this.form.count
|
|
830
|
+ }
|
750
|
831
|
}
|
751
|
832
|
this.editdialogVisible = false
|
752
|
833
|
},
|
|
@@ -864,6 +945,7 @@ export default {
|
864
|
945
|
getDrugInventoryDetail(id).then(response=>{
|
865
|
946
|
if(response.data.state == 1){
|
866
|
947
|
var detail = response.data.data.detail
|
|
948
|
+ console.log("detial2323223",detail)
|
867
|
949
|
this.id = detail.id
|
868
|
950
|
this.form.drug_id = detail.drug_id
|
869
|
951
|
this.form.drug_name = detail.drug_name
|
|
@@ -878,9 +960,12 @@ export default {
|
878
|
960
|
this.form.total = detail.total
|
879
|
961
|
|
880
|
962
|
this.form.last_price = detail.last_price
|
881
|
|
-
|
|
963
|
+
|
882
|
964
|
this.form.count = parseInt(detail.count)
|
883
|
965
|
this.form.drug_origin_place = detail.drug_origin_place
|
|
966
|
+ this.form.stock_max_number = detail.stock_max_number
|
|
967
|
+ this.form.stock_min_number = detail.stock_min_number
|
|
968
|
+ this.form.warehouse_info_id = detail.warehouse_info_id
|
884
|
969
|
this.modifydialogVisible = true
|
885
|
970
|
}
|
886
|
971
|
})
|
|
@@ -891,7 +976,7 @@ export default {
|
891
|
976
|
drug_id:this.form.drug_id,
|
892
|
977
|
drug_name:this.form.drug_name,
|
893
|
978
|
specification_name:this.form.specification_name,
|
894
|
|
- warehousing_unit:this.form.warehouseing_unit,
|
|
979
|
+ warehousing_unit:this.form.warehousing_unit,
|
895
|
980
|
last_price:this.form.last_price,
|
896
|
981
|
retail_price:this.form.retail_price,
|
897
|
982
|
count:this.form.count,
|
|
@@ -900,7 +985,12 @@ export default {
|
900
|
985
|
batch_number:this.form.batch_number,
|
901
|
986
|
manufacturer:this.form.manufacturer,
|
902
|
987
|
remark:this.form.remark,
|
|
988
|
+ stock_max_number:this.form.stock_max_number,
|
|
989
|
+ stock_min_number:this.form.stock_min_number,
|
|
990
|
+ warehouse_info_id:this.form.warehouse_info_id,
|
903
|
991
|
}
|
|
992
|
+ console.log("params2222",params)
|
|
993
|
+
|
904
|
994
|
modifyInventory(params).then(response=>{
|
905
|
995
|
if(response.data.state == 1){
|
906
|
996
|
var inventory = response.data.data.inventory
|
|
@@ -933,7 +1023,7 @@ export default {
|
933
|
1023
|
this.loading = false
|
934
|
1024
|
});
|
935
|
1025
|
},
|
936
|
|
- exportList(){
|
|
1026
|
+ exportList(){
|
937
|
1027
|
|
938
|
1028
|
import('@/vendor/Export2Excel').then(excel => {
|
939
|
1029
|
const tHeader = ['药品名称', '规格', '单位','零售价','当前库存','盘点数','亏损金额']
|
|
@@ -1013,9 +1103,39 @@ export default {
|
1013
|
1103
|
changeEndTime(val){
|
1014
|
1104
|
this.end_time = this.getTime(val)
|
1015
|
1105
|
this.getlist()
|
1016
|
|
- }
|
|
1106
|
+ },
|
|
1107
|
+ getDrugWarehouseInfoTotal(val){
|
|
1108
|
+ var params = {
|
|
1109
|
+ id:val,
|
|
1110
|
+ }
|
|
1111
|
+ getDrugWarehouseInfoTotal(params).then(response=>{
|
|
1112
|
+ if(response.data.state == 1){
|
|
1113
|
+ var list = response.data.data.list
|
|
1114
|
+ console.log("list",list)
|
|
1115
|
+
|
|
1116
|
+ if(list.stock_max_number > 0){
|
|
1117
|
+ this.form.total = list.stock_max_number + list.XtBaseDrug.max_unit
|
|
1118
|
+ this.form.stock_max_number = list.stock_max_number
|
|
1119
|
+ }
|
|
1120
|
+ if(list.stock_min_number >0 ){
|
|
1121
|
+ this.form.total = list.stock_min_number + list.XtBaseDrug.min_unit
|
|
1122
|
+ this.form.stock_min_number = list.stock_min_number
|
|
1123
|
+ }
|
|
1124
|
+
|
|
1125
|
+ }
|
|
1126
|
+ })
|
|
1127
|
+ },
|
|
1128
|
+ getDataConfig(module, filed_name) {
|
|
1129
|
+ return getDataConfig(module, filed_name)
|
|
1130
|
+ },
|
|
1131
|
+ changeMaxUnit(val){
|
|
1132
|
+ console.log("val23232",val)
|
|
1133
|
+ this.form.warehousing_unit = val
|
|
1134
|
+ }
|
1017
|
1135
|
},
|
1018
|
1136
|
created(){
|
|
1137
|
+ this.unitList = this.getDataConfig('hemodialysis','units')
|
|
1138
|
+ console.log("单位",this.unitList)
|
1019
|
1139
|
this.getlist()
|
1020
|
1140
|
},
|
1021
|
1141
|
mounted() {
|