|
@@ -7,11 +7,15 @@
|
7
|
7
|
<template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span></template>
|
8
|
8
|
</el-table-column>
|
9
|
9
|
|
10
|
|
- <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
|
|
10
|
+ <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
|
11
|
11
|
<template slot-scope="scope">
|
12
|
12
|
<div style="display:flex;align-items:center;">
|
13
|
|
- <el-input v-model="scope.row.single_dose" @input="getSingleDose(scope)" style="width:65%;"></el-input>
|
14
|
|
- <div>{{scope.row.single_dose_unit}}</div>
|
|
13
|
+ <el-input v-model="scope.row.single_dose" @input="getSingleDose(scope)" style="width:50%;"></el-input>
|
|
14
|
+ <!-- <div>{{scope.row.single_dose_unit}}</div> -->
|
|
15
|
+ <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;" @change="getAllChange(scope)">
|
|
16
|
+ <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
|
|
17
|
+ <el-option :label="scope.row.drug.dose_unit" :value="scope.row.drug.dose_unit"></el-option>
|
|
18
|
+ </el-select>
|
15
|
19
|
</div>
|
16
|
20
|
</template>
|
17
|
21
|
</el-table-column>
|
|
@@ -29,7 +33,7 @@
|
29
|
33
|
</el-table-column>
|
30
|
34
|
<el-table-column align="center" prop="execution_frequency" width="100" label="频率">
|
31
|
35
|
<template slot-scope="scope">
|
32
|
|
- <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
|
|
36
|
+ <el-select v-model="scope.row.execution_frequency" placehold er="请选择" @change="getAllChange(scope)">
|
33
|
37
|
<el-option
|
34
|
38
|
v-for="item,index in efs"
|
35
|
39
|
:key="index"
|
|
@@ -44,16 +48,20 @@
|
44
|
48
|
<el-table-column align="center" prop="day" width="70" label="天数">
|
45
|
49
|
<template slot-scope="scope">
|
46
|
50
|
<div style="display:flex;align-items:center;">
|
47
|
|
- <el-input v-model="scope.row.day" @input="getDay(scope)" placeholder=""></el-input>{{'天'}}
|
|
51
|
+ <el-input v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>{{'天'}}
|
48
|
52
|
</div>
|
49
|
53
|
</template>
|
50
|
54
|
</el-table-column>
|
51
|
55
|
|
52
|
|
- <el-table-column align="center" prop="prescribing_number" width="80" label="总量">
|
|
56
|
+ <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
|
53
|
57
|
<template slot-scope="scope">
|
54
|
58
|
<div style="display:flex;align-items:center;">
|
55
|
|
- <el-input v-model="scope.row.prescribing_number" style="width:60%" placeholder=""></el-input>
|
56
|
|
- <div> {{scope.row.prescribing_number_unit}}</div>
|
|
59
|
+ <el-input v-model="scope.row.prescribing_number" style="width:50%" @input="changePrescribingNumber(scope)" placeholder=""></el-input>
|
|
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)">
|
|
62
|
+ <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
|
|
63
|
+ <el-option :label="scope.row.drug.max_unit" :value="scope.row.drug.max_unit"></el-option>
|
|
64
|
+ </el-select>
|
57
|
65
|
</div>
|
58
|
66
|
</template>
|
59
|
67
|
</el-table-column>
|
|
@@ -89,8 +97,10 @@
|
89
|
97
|
</el-table-column>
|
90
|
98
|
<el-table-column align="center" prop="single_dose" width="80" label="单次用量">
|
91
|
99
|
<template slot-scope="scope">
|
|
100
|
+ <div style="display:flex;align-items:center;">
|
92
|
101
|
<el-input v-model="scope.row.single_dose" @input="getProjectSingleDose(scope)" placeholder=""></el-input>
|
93
|
102
|
<div>{{scope.row.unit}}</div>
|
|
103
|
+ </div>
|
94
|
104
|
|
95
|
105
|
</template>
|
96
|
106
|
</el-table-column>
|
|
@@ -127,10 +137,12 @@
|
127
|
137
|
</div>
|
128
|
138
|
</template>
|
129
|
139
|
</el-table-column>
|
130
|
|
- <el-table-column align="center" prop="name" width="50" label="单价">
|
|
140
|
+ <el-table-column align="center" prop="name" width="70" label="单价">
|
131
|
141
|
<template slot-scope="scope">
|
132
|
|
- <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
|
133
|
|
- <div>{{'元'}}</div>
|
|
142
|
+ <div style="display:flex;align-items:center;">
|
|
143
|
+ <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
|
|
144
|
+ <div>{{'元'}}</div>
|
|
145
|
+ </div>
|
134
|
146
|
|
135
|
147
|
</template>
|
136
|
148
|
</el-table-column>
|
|
@@ -375,6 +387,51 @@
|
375
|
387
|
.catch(() => {});
|
376
|
388
|
|
377
|
389
|
},
|
|
390
|
+ getAllChange(scope){
|
|
391
|
+ if(scope.row.drug.min_unit == scope.row.single_dose_unit){
|
|
392
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
393
|
+ console.log(1)
|
|
394
|
+ scope.row.prescribing_number = scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day
|
|
395
|
+ }else{
|
|
396
|
+ console.log(12)
|
|
397
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency)) * scope.row.day / scope.row.drug.min_number)
|
|
398
|
+ }
|
|
399
|
+ }else{
|
|
400
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
401
|
+ console.log(123)
|
|
402
|
+ scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose)
|
|
403
|
+ }else{
|
|
404
|
+ console.log(1234)
|
|
405
|
+ 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)
|
|
406
|
+ }
|
|
407
|
+ }
|
|
408
|
+ if(scope.row.prescribing_number == 0){
|
|
409
|
+ scope.row.prescribing_number = 1
|
|
410
|
+ }
|
|
411
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
412
|
+ // scope.row.retail_price = scope.row.drug.min_price * scope.row.prescribing_number
|
|
413
|
+ if(scope.row.prescribing_number > scope.row.drug.total){
|
|
414
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
415
|
+ }
|
|
416
|
+ }else{
|
|
417
|
+ if((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total){
|
|
418
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
419
|
+ }
|
|
420
|
+ // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
|
|
421
|
+ }
|
|
422
|
+
|
|
423
|
+ },
|
|
424
|
+ changePrescribingNumber(scope){
|
|
425
|
+ if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
426
|
+ if(parseInt(scope.row.prescribing_number) > scope.row.drug.total){
|
|
427
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
428
|
+ }
|
|
429
|
+ }else{
|
|
430
|
+ if((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total){
|
|
431
|
+ this.$message.error(scope.row.drug_name + '库存不足')
|
|
432
|
+ }
|
|
433
|
+ }
|
|
434
|
+ },
|
378
|
435
|
getSingleDose(scope){
|
379
|
436
|
this.prescription.advices[scope.$index].prescribing_number = scope.row.single_dose * scope.row.day
|
380
|
437
|
},
|