|
@@ -58,7 +58,7 @@
|
58
|
58
|
<div style="display:flex;align-items:center;">
|
59
|
59
|
<el-input v-model="scope.row.prescribing_number" @input="changePrescribingNumber(scope)" style="width:50%" placeholder=""></el-input>
|
60
|
60
|
<!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
|
61
|
|
- <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;" @change="getAllChange(scope)">
|
|
61
|
+ <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;" @change="getPrescribingNumberUnit(scope)">
|
62
|
62
|
<el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
|
63
|
63
|
<el-option :label="scope.row.drug.max_unit" v-if="scope.row.drug.min_unit != scope.row.drug.max_unit" :value="scope.row.drug.max_unit"></el-option>
|
64
|
64
|
</el-select>
|
|
@@ -417,7 +417,7 @@
|
417
|
417
|
scope.row.prescribing_number = 1
|
418
|
418
|
}
|
419
|
419
|
if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
420
|
|
- // scope.row.retail_price = scope.row.drug.min_price * scope.row.prescribing_number
|
|
420
|
+ // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
|
421
|
421
|
if(scope.row.prescribing_number > scope.row.drug.total){
|
422
|
422
|
this.$message.error(scope.row.drug_name + '库存不足')
|
423
|
423
|
}
|
|
@@ -429,6 +429,35 @@
|
429
|
429
|
}
|
430
|
430
|
|
431
|
431
|
},
|
|
432
|
+ getPrescribingNumberUnit(scope){
|
|
433
|
+ if(scope.row.drug.min_unit == scope.row.single_dose_unit){
|
|
434
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
435
|
+ scope.row.prescribing_number = scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day
|
|
436
|
+ }else{
|
|
437
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency)) * scope.row.day / scope.row.drug.min_number)
|
|
438
|
+ }
|
|
439
|
+ }else{
|
|
440
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
441
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose)
|
|
442
|
+ }else{
|
|
443
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose / scope.row.drug.min_number)
|
|
444
|
+ }
|
|
445
|
+ }
|
|
446
|
+ if(scope.row.prescribing_number == 0){
|
|
447
|
+ scope.row.prescribing_number = 1
|
|
448
|
+ }
|
|
449
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
450
|
+ scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
|
|
451
|
+ if(scope.row.prescribing_number > scope.row.drug.total){
|
|
452
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
453
|
+ }
|
|
454
|
+ }else{
|
|
455
|
+ if((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total){
|
|
456
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
457
|
+ }
|
|
458
|
+ scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
|
|
459
|
+ }
|
|
460
|
+ },
|
432
|
461
|
changePrescribingNumber(scope){
|
433
|
462
|
if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
434
|
463
|
if(parseInt(scope.row.prescribing_number) > scope.row.drug.total){
|