|
@@ -131,6 +131,21 @@
|
131
|
131
|
{{getTime(scope.row.expire_date,"{y}-{h}-{d}")}}
|
132
|
132
|
|
133
|
133
|
</template>
|
|
134
|
+ </el-table-column>
|
|
135
|
+ <el-table-column prop="drug_name" label="剩余库存" align="center">
|
|
136
|
+ <template slot-scope="scope">
|
|
137
|
+ {{scope.row.over_count}}
|
|
138
|
+ </template>
|
|
139
|
+ </el-table-column>
|
|
140
|
+ <el-table-column prop="drug_name" label="使用人" align="center">
|
|
141
|
+ <template slot-scope="scope">
|
|
142
|
+ <span > {{getPatientName(scope.row.patient_id)}}</span>
|
|
143
|
+ </template>
|
|
144
|
+ </el-table-column>
|
|
145
|
+ <el-table-column prop="drug_name" label="剩余库存" align="center">
|
|
146
|
+ <template slot-scope="scope">
|
|
147
|
+ <span > {{getDrugCount(scope.row.over_count,scope.row.BaseDrugLib.max_unit,scope.row.BaseDrugLib.min_unit,scope.row.BaseDrugLib.min_number)}}</span>
|
|
148
|
+ </template>
|
134
|
149
|
</el-table-column>
|
135
|
150
|
<!-- <el-table-column prop="drug_name" label="批号" align="center">
|
136
|
151
|
<template slot-scope="scope">
|
|
@@ -257,6 +272,7 @@
|
257
|
272
|
total:0,
|
258
|
273
|
drug:{},
|
259
|
274
|
houseList:[],
|
|
275
|
+ patientList:[],
|
260
|
276
|
}
|
261
|
277
|
},
|
262
|
278
|
methods:{
|
|
@@ -509,6 +525,7 @@
|
509
|
525
|
var drug = response.data.data.drug
|
510
|
526
|
|
511
|
527
|
this.drug = drug
|
|
528
|
+ this.patientList = response.data.data.patientList
|
512
|
529
|
|
513
|
530
|
this.houseList = response.data.data.houseList
|
514
|
531
|
}
|
|
@@ -552,6 +569,35 @@
|
552
|
569
|
}
|
553
|
570
|
return storehouse_name
|
554
|
571
|
},
|
|
572
|
+ getPatientName(id){
|
|
573
|
+ var name = ""
|
|
574
|
+ for(let i=0;i<this.patientList.length;i++){
|
|
575
|
+ if(id == this.patientList[i].id){
|
|
576
|
+ name = this.patientList[i].name
|
|
577
|
+ }
|
|
578
|
+ }
|
|
579
|
+ return name
|
|
580
|
+ },
|
|
581
|
+ getDrugCount(total,max_unit,min_unit,min_number){
|
|
582
|
+ var max_str = "";
|
|
583
|
+ var min_str = "";
|
|
584
|
+ if (total < min_number) {
|
|
585
|
+ min_str = total + min_unit;
|
|
586
|
+ }
|
|
587
|
+ if (total == 0) {
|
|
588
|
+ min_str = "";
|
|
589
|
+ max_str = "";
|
|
590
|
+ }
|
|
591
|
+ if (total >= min_number) {
|
|
592
|
+ if (parseInt(total / min_number) != 0) {
|
|
593
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
594
|
+ }
|
|
595
|
+ if (total % min_number != 0) {
|
|
596
|
+ min_str = (total % min_number) + min_unit;
|
|
597
|
+ }
|
|
598
|
+ }
|
|
599
|
+ return max_str + min_str;
|
|
600
|
+ }
|
555
|
601
|
}
|
556
|
602
|
}
|
557
|
603
|
</script>
|