|
@@ -210,7 +210,7 @@
|
210
|
210
|
|
211
|
211
|
<script>
|
212
|
212
|
import { getDictionaryDataConfig } from '@/utils/data'
|
213
|
|
- import { delHisAddition, delHisAdvice, delHisProject, getInitData } from '@/api/his/his'
|
|
213
|
+ import { delHisAddition, delHisAdvice, delHisProject, getInitData,getHisDoctorAdviceInfo } from '@/api/his/his'
|
214
|
214
|
|
215
|
215
|
export default {
|
216
|
216
|
props: {
|
|
@@ -225,7 +225,9 @@
|
225
|
225
|
advices: [],
|
226
|
226
|
project: [],
|
227
|
227
|
drugways: [],
|
228
|
|
- efs: []
|
|
228
|
+ efs: [],
|
|
229
|
+ drugList:[],
|
|
230
|
+ adviceList:{}
|
229
|
231
|
}
|
230
|
232
|
}
|
231
|
233
|
}
|
|
@@ -316,6 +318,7 @@
|
316
|
318
|
} else {
|
317
|
319
|
this.drugways = response.data.data.drugways
|
318
|
320
|
this.efs = response.data.data.efs
|
|
321
|
+ this.drugList = response.data.data.drugs
|
319
|
322
|
}
|
320
|
323
|
})
|
321
|
324
|
|
|
@@ -492,6 +495,56 @@
|
492
|
495
|
}
|
493
|
496
|
},
|
494
|
497
|
changePrescribingNumber(scope) {
|
|
498
|
+ // var max_number = 0
|
|
499
|
+ // if(scope.row.prescribing_number_unit == scope.row.drug.max_unit){
|
|
500
|
+ // max_number = parseInt(scope.row.prescribing_number) * scope.row.drug.min_number
|
|
501
|
+ // }
|
|
502
|
+ // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
|
|
503
|
+ // max_number = parseInt(scope.row.prescribing_number)
|
|
504
|
+ // }
|
|
505
|
+ // console.log("修改的数量",max_number)
|
|
506
|
+ // //查询该药品库存
|
|
507
|
+ // if(this.drugList.length > 0){
|
|
508
|
+ // var stock_number = 0
|
|
509
|
+ // for(let i=0;i<this.drugList.length;i++){
|
|
510
|
+ // if(scope.row.id == this.drugList[i].id){
|
|
511
|
+ // for(let j=0;j<this.drugList[i].stock_in.length;j++){
|
|
512
|
+ // stock_number += this.drugList[i].stock_in[j].stock_max_number * this.drugList[i].min_number + this.drugList[i].stock_in[j].stock_min_number
|
|
513
|
+ // }
|
|
514
|
+ // }
|
|
515
|
+ // }
|
|
516
|
+ // console.log("库存数量",stock_number)
|
|
517
|
+ // }
|
|
518
|
+ // if(scope.row.advice_id > 0){
|
|
519
|
+ // //获取该药品上一次出库的的数量
|
|
520
|
+ // getHisDoctorAdviceInfo(scope.row.advice_id).then(response=>{
|
|
521
|
+ // if(response.data.state == 1){
|
|
522
|
+ // var out_count = 0
|
|
523
|
+ // var adviceList = response.data.data.advice
|
|
524
|
+ // if(adviceList.prescribing_number_unit == adviceList.drug.max_number){
|
|
525
|
+ // out_count = adviceList.prescribing_number * adviceList.drug.min_number
|
|
526
|
+ // }
|
|
527
|
+ // if(adviceList.prescribing_number_unit == adviceList.drug.min_unit){
|
|
528
|
+ // out_count = adviceList.prescribing_number
|
|
529
|
+ // }
|
|
530
|
+
|
|
531
|
+ // //如果更改的数量大于修改之前的数量
|
|
532
|
+ // if(max_number > out_count){
|
|
533
|
+ // if((max_number - out_count)>stock_number){
|
|
534
|
+ // this.$message.error(scope.row.drug_name + '库存不足')
|
|
535
|
+ // }
|
|
536
|
+ // }
|
|
537
|
+ // }
|
|
538
|
+ // })
|
|
539
|
+ // }
|
|
540
|
+
|
|
541
|
+ // if(scope.row.advice_id == 0){
|
|
542
|
+ // if(max_number > stock_number){
|
|
543
|
+ // this.$message.error(scope.row.drug_name + '库存不足')
|
|
544
|
+ // }
|
|
545
|
+ // }
|
|
546
|
+
|
|
547
|
+
|
495
|
548
|
if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
|
496
|
549
|
if (parseInt(scope.row.prescribing_number) > scope.row.drug.total) {
|
497
|
550
|
this.$message.error(scope.row.drug_name + '库存不足')
|
|
@@ -550,7 +603,8 @@
|
550
|
603
|
num = 1
|
551
|
604
|
}
|
552
|
605
|
return num
|
553
|
|
- }
|
|
606
|
+ },
|
|
607
|
+
|
554
|
608
|
}, mounted() {
|
555
|
609
|
this.getInitData()
|
556
|
610
|
|