|
@@ -212,6 +212,8 @@ export default {
|
212
|
212
|
name: "stockOutDetail",
|
213
|
213
|
|
214
|
214
|
created() {
|
|
215
|
+ this.org_id = this.$store.getters.xt_user.org.id
|
|
216
|
+ console.log("jj233223323223",this.org_id)
|
215
|
217
|
var nowDate = new Date();
|
216
|
218
|
var nowYear = nowDate.getFullYear();
|
217
|
219
|
var nowMonth = nowDate.getMonth() + 1;
|
|
@@ -281,7 +283,8 @@ export default {
|
281
|
283
|
tableData:[],
|
282
|
284
|
tableList:[],
|
283
|
285
|
drugList:[],
|
284
|
|
- tablePrint:[]
|
|
286
|
+ tablePrint:[],
|
|
287
|
+ org_id:0,
|
285
|
288
|
};
|
286
|
289
|
},
|
287
|
290
|
methods: {
|
|
@@ -452,7 +455,7 @@ export default {
|
452
|
455
|
count:0,
|
453
|
456
|
price:item.price,
|
454
|
457
|
remark:item.remark,
|
455
|
|
- total_price:0,
|
|
458
|
+ total_price:0.0,
|
456
|
459
|
dose:item.dose,
|
457
|
460
|
dose_unit:item.dose_unit,
|
458
|
461
|
min_number:item.min_number,
|
|
@@ -507,23 +510,32 @@ export default {
|
507
|
510
|
console.log("hh23233223",this.tablePrint)
|
508
|
511
|
for(let i=0;i<this.tablePrint.length;i++){
|
509
|
512
|
this.tablePrint[i].index = i+1
|
510
|
|
-
|
511
|
513
|
}
|
512
|
514
|
for(let i=0;i<this.tablePrint.length;i++){
|
513
|
|
- this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
|
514
|
|
- this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
|
515
|
|
- this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
|
516
|
|
- this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
|
|
515
|
+ if(this.org_id == 9671 || this.org_id == 9919 ){
|
|
516
|
+ this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
|
|
517
|
+ this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
|
|
518
|
+ this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
|
|
519
|
+ this.tablePrint[i].total = this.getCountSenvenOne(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
|
|
520
|
+ }else{
|
|
521
|
+ this.tablePrint[i].count = this.getCount(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_unit,this.tablePrint[i].min_number)
|
|
522
|
+ this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
|
|
523
|
+ this.tablePrint[i].unit = this.tablePrint[i].dose + this.tablePrint[i].dose_unit + "*" + this.tablePrint[i].min_number +this.tablePrint[i].min_unit +"/"+this.tablePrint[i].max_unit
|
|
524
|
+ this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].price)
|
|
525
|
+ }
|
|
526
|
+
|
|
527
|
+
|
517
|
528
|
}
|
518
|
529
|
console.log("列表数据333333333",this.tablePrint)
|
519
|
|
-
|
|
530
|
+
|
520
|
531
|
import('@/vendor/Export2Excel').then(excel => {
|
521
|
532
|
const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
|
522
|
533
|
const filterVal = ['index','drug_name', 'unit', 'min_unit','count','price','total_price','remark']
|
523
|
|
- let obj = {'index':'合计','total_price':0}
|
|
534
|
+ let obj = {'index':'合计','total_price':0.00}
|
524
|
535
|
for(let i=0;i<this.tablePrint.length;i++){
|
525
|
|
- obj.total_price += this.tablePrint[i].total
|
|
536
|
+ obj.total_price += this.tablePrint[i].total
|
526
|
537
|
}
|
|
538
|
+ obj.total_price = obj.total_price.toFixed(2)
|
527
|
539
|
this.tablePrint.push(obj)
|
528
|
540
|
const data = this.formatJson(filterVal, this.tablePrint)
|
529
|
541
|
console.log("data",data)
|
|
@@ -561,9 +573,9 @@ export default {
|
561
|
573
|
this.tableData[i].total = (this.tableData[i].count * this.tableData[i].price)
|
562
|
574
|
this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price)
|
563
|
575
|
}
|
564
|
|
- let obj = {'index':'合计','total_price':0}
|
|
576
|
+ let obj = {'index':'合计','total_price':0.00}
|
565
|
577
|
for(let i=0;i<this.tableData.length;i++){
|
566
|
|
- obj.total_price += this.tableData[i].total
|
|
578
|
+ obj.total_price += this.tableData[i].total
|
567
|
579
|
}
|
568
|
580
|
|
569
|
581
|
this.tableData.push(obj)
|
|
@@ -628,7 +640,7 @@ export default {
|
628
|
640
|
drug_spec:item.XtBaseDrug.drug_spec,
|
629
|
641
|
min_unit:item.XtBaseDrug.min_unit,
|
630
|
642
|
count:0,
|
631
|
|
- price:item.XtBaseDrug.min_price,
|
|
643
|
+ price:item.XtBaseDrug.last_price,
|
632
|
644
|
remark:item.XtBaseDrug.remark,
|
633
|
645
|
total_price:"",
|
634
|
646
|
dose:item.XtBaseDrug.dose,
|
|
@@ -709,7 +721,29 @@ export default {
|
709
|
721
|
}
|
710
|
722
|
console.log("total23232",total)
|
711
|
723
|
return total*min_price
|
712
|
|
- }
|
|
724
|
+ },
|
|
725
|
+ getCountSix(drug_id,val){
|
|
726
|
+ console.log("val233232",val)
|
|
727
|
+ var count = 0
|
|
728
|
+ for(let i=0;i<val.length;i++){
|
|
729
|
+ count+= val[i].count
|
|
730
|
+ }
|
|
731
|
+ return count
|
|
732
|
+ },
|
|
733
|
+ getCountSenven(drug_id,val,price){
|
|
734
|
+ var count = 0
|
|
735
|
+ for(let i=0;i<val.length;i++){
|
|
736
|
+ count+= val[i].count
|
|
737
|
+ }
|
|
738
|
+ return (count*price).toFixed(2)
|
|
739
|
+ },
|
|
740
|
+ getCountSenvenOne(drug_id,val,price){
|
|
741
|
+ var count = 0
|
|
742
|
+ for(let i=0;i<val.length;i++){
|
|
743
|
+ count+= val[i].count
|
|
744
|
+ }
|
|
745
|
+ return (count*price)
|
|
746
|
+ },
|
713
|
747
|
}
|
714
|
748
|
};
|
715
|
749
|
</script>
|