Browse Source

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

XMLWAN 3 years ago
parent
commit
18ecb1aafd

+ 1 - 1
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -2511,7 +2511,7 @@
2511 2511
                   execution_frequency: temp[b].execution_frequency,
2512 2512
                   retail_price: temp[b].retail_price.toString(),
2513 2513
                   remark: '',
2514
-                  day: 1,
2514
+                  day: temp[b].drug_day ? temp[b].drug_day : 1,
2515 2515
                   prescribing_number: temp[b].prescribing_number,
2516 2516
                   single_dose_unit: temp[b].min_unit,
2517 2517
                   prescribing_number_unit: temp[b].max_unit,

+ 31 - 2
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue View File

@@ -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){