|
@@ -22,7 +22,7 @@
|
22
|
22
|
type="primary"
|
23
|
23
|
>汇总导出
|
24
|
24
|
</el-button>
|
25
|
|
-
|
|
25
|
+
|
26
|
26
|
<div class="cell clearfix">
|
27
|
27
|
<label class="title"><span class="name">仓库</span> :</label>
|
28
|
28
|
<el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
|
|
@@ -32,7 +32,7 @@
|
32
|
32
|
:label="option.storehouse_name"
|
33
|
33
|
:value="option.id">
|
34
|
34
|
</el-option>
|
35
|
|
- </el-select>
|
|
35
|
+ </el-select>
|
36
|
36
|
<el-input
|
37
|
37
|
size="small"
|
38
|
38
|
style="width: 200px;"
|
|
@@ -76,10 +76,10 @@
|
76
|
76
|
value-format="yyyy-MM-dd"
|
77
|
77
|
@change="endTimeChange"
|
78
|
78
|
></el-date-picker>
|
79
|
|
-
|
|
79
|
+
|
80
|
80
|
</div>
|
81
|
81
|
|
82
|
|
-
|
|
82
|
+
|
83
|
83
|
<el-row :gutter="12" style="margin-top: 10px">
|
84
|
84
|
<el-table
|
85
|
85
|
:data="tableData"
|
|
@@ -122,7 +122,7 @@
|
122
|
122
|
</template>
|
123
|
123
|
</el-table-column>
|
124
|
124
|
|
125
|
|
-
|
|
125
|
+
|
126
|
126
|
<el-table-column label="操作时间" align="center">
|
127
|
127
|
<template slot-scope="scope">
|
128
|
128
|
<span>{{getTime(scope.row.ctime)}}</span>
|
|
@@ -140,7 +140,7 @@
|
140
|
140
|
</el-table-column>
|
141
|
141
|
<el-table-column label="出货价" align="center">
|
142
|
142
|
<template slot-scope="scope">
|
143
|
|
- <span v-if="org_id == 9919">{{scope.row.last_price}} </span>
|
|
143
|
+ <span v-if="org_id == 9919">{{scope.row.last_price}} </span>
|
144
|
144
|
<span v-else>
|
145
|
145
|
<span v-if="scope.row.price >0"> {{scope.row.price}}</span>
|
146
|
146
|
<span v-if="scope.row.price == 0"> {{getPrice(scope.row.drug_id)}}</span>
|
|
@@ -149,20 +149,20 @@
|
149
|
149
|
</el-table-column>
|
150
|
150
|
<el-table-column label="数量" align="center">
|
151
|
151
|
<template slot-scope="scope">
|
152
|
|
- {{scope.row.count}}
|
|
152
|
+ {{scope.row.count}}
|
153
|
153
|
</template>
|
154
|
154
|
</el-table-column>
|
155
|
155
|
<el-table-column label="单位" align="center">
|
156
|
156
|
<template slot-scope="scope">
|
157
|
|
- {{scope.row.count_unit}}
|
|
157
|
+ {{scope.row.count_unit}}
|
158
|
158
|
</template>
|
159
|
159
|
</el-table-column>
|
160
|
160
|
<el-table-column label="总价" align="center">
|
161
|
161
|
<template slot-scope="scope">
|
162
|
162
|
<span v-if="scope.row.is_total !=1">
|
163
|
|
- <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span>
|
164
|
|
- <span v-if="org_id == 10210 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span>
|
165
|
|
- <span v-if="org_id == 9671 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span>
|
|
163
|
+ <span v-if="org_id == 9919">{{(scope.row.last_price * scope.row.count).toFixed(2)}} </span>
|
|
164
|
+ <span v-if="org_id == 10210 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span>
|
|
165
|
+ <span v-if="org_id == 9671 ">{{(scope.row.price * scope.row.count).toFixed(2)}} </span>
|
166
|
166
|
<span v-if ="org_id!=9919 && org_id!=10210 && org_id!=9671">
|
167
|
167
|
{{scope.row.total_price}}
|
168
|
168
|
</span>
|
|
@@ -200,7 +200,7 @@ export default {
|
200
|
200
|
|
201
|
201
|
created() {
|
202
|
202
|
this.org_id = this.$store.getters.xt_user.org.id
|
203
|
|
-
|
|
203
|
+
|
204
|
204
|
var nowDate = new Date();
|
205
|
205
|
var nowYear = nowDate.getFullYear();
|
206
|
206
|
var nowMonth = nowDate.getMonth() + 1;
|
|
@@ -224,19 +224,19 @@ export default {
|
224
|
224
|
var start_time = window.sessionStorage.getItem('start_out_time')
|
225
|
225
|
var end_time = window.sessionStorage.getItem('end_out_time')
|
226
|
226
|
if(start_time!=null){
|
227
|
|
- this.start_time = start_time
|
|
227
|
+ this.start_time = start_time
|
228
|
228
|
}
|
229
|
229
|
if(end_time!=null){
|
230
|
|
-
|
|
230
|
+
|
231
|
231
|
this.end_time = end_time
|
232
|
232
|
}
|
233
|
|
-
|
|
233
|
+
|
234
|
234
|
this.getDrugOutOrderPrint()
|
235
|
235
|
this.GetConfigInfo();
|
236
|
236
|
this.fetchAllAdminUsers();
|
237
|
237
|
this.getlist()
|
238
|
238
|
this.getBaseDrugLibList()
|
239
|
|
-
|
|
239
|
+
|
240
|
240
|
},
|
241
|
241
|
data() {
|
242
|
242
|
return {
|
|
@@ -327,7 +327,7 @@ export default {
|
327
|
327
|
},
|
328
|
328
|
fetchAllAdminUsers() {
|
329
|
329
|
fetchAllAdminUsers().then(response => {
|
330
|
|
-
|
|
330
|
+
|
331
|
331
|
if (response.data.state == 1) {
|
332
|
332
|
this.adminUserOptions = response.data.data.users;
|
333
|
333
|
}
|
|
@@ -384,7 +384,7 @@ export default {
|
384
|
384
|
}
|
385
|
385
|
});
|
386
|
386
|
},
|
387
|
|
-
|
|
387
|
+
|
388
|
388
|
getTime: function(val) {
|
389
|
389
|
if (val == 0) {
|
390
|
390
|
return "";
|
|
@@ -407,7 +407,7 @@ export default {
|
407
|
407
|
page:this.page,
|
408
|
408
|
limit:this.limit,
|
409
|
409
|
storehouse_id:this.storehouse_id,
|
410
|
|
- }
|
|
410
|
+ }
|
411
|
411
|
getDrugOutDetail(params).then(response=>{
|
412
|
412
|
this.tableData = []
|
413
|
413
|
this.tableList = []
|
|
@@ -443,29 +443,29 @@ export default {
|
443
|
443
|
}
|
444
|
444
|
|
445
|
445
|
total_price += order[i].total_price
|
446
|
|
-
|
|
446
|
+
|
447
|
447
|
}
|
448
|
448
|
|
449
|
449
|
if(order[i].price ==0 ){
|
450
|
450
|
if(order[i].count_unit == order[i].min_unit && order[i].max_unit!=order[i].min_unit){
|
451
|
451
|
order[i].total_price = order[i].count * this.getPrice(order[i].drug_id)
|
452
|
|
-
|
|
452
|
+
|
453
|
453
|
order[i].price = this.getPrice(order[i].drug_id)
|
454
|
454
|
}
|
455
|
|
-
|
|
455
|
+
|
456
|
456
|
if(order[i].count_unit == order[i].max_unit){
|
457
|
457
|
if(order[i].is_sys == 0){
|
458
|
|
- order[i].total_price += order[i].count * this.getPrice(order[i].drug_id)
|
|
458
|
+ order[i].total_price += order[i].count * this.getPrice(order[i].drug_id)
|
459
|
459
|
}else{
|
460
|
460
|
order[i].total_price += order[i].count * this.getPrice(order[i].drug_id) * order[i].min_number
|
461
|
461
|
}
|
462
|
462
|
order[i].price = this.getPrice(order[i].drug_id)
|
463
|
463
|
}
|
464
|
464
|
total_price +=order[i].total_price
|
465
|
|
- }
|
466
|
|
-
|
|
465
|
+ }
|
|
466
|
+
|
467
|
467
|
}
|
468
|
|
-
|
|
468
|
+
|
469
|
469
|
}
|
470
|
470
|
console.log("toal_p3232332332233232",total_price)
|
471
|
471
|
order.push({
|
|
@@ -475,11 +475,11 @@ export default {
|
475
|
475
|
ctime:"",
|
476
|
476
|
total_price:total_price,
|
477
|
477
|
});
|
478
|
|
-
|
|
478
|
+
|
479
|
479
|
for(let i=0;i<order.length;i++){
|
480
|
480
|
order[i].total_price = order[i].total_price.toFixed(2)
|
481
|
481
|
}
|
482
|
|
-
|
|
482
|
+
|
483
|
483
|
console.log("233223322323322332232323",order)
|
484
|
484
|
this.tableData = order
|
485
|
485
|
|
|
@@ -523,10 +523,10 @@ export default {
|
523
|
523
|
}
|
524
|
524
|
}
|
525
|
525
|
}
|
526
|
|
-
|
|
526
|
+
|
527
|
527
|
})
|
528
|
528
|
let list = Object.values(objInfo);
|
529
|
|
-
|
|
529
|
+
|
530
|
530
|
for(let i=0;i<order.length;i++){
|
531
|
531
|
list.map(item=>{
|
532
|
532
|
if(order[i].drug_id == item.drug_id){
|
|
@@ -534,8 +534,8 @@ export default {
|
534
|
534
|
}
|
535
|
535
|
})
|
536
|
536
|
}
|
537
|
|
-
|
538
|
|
-
|
|
537
|
+
|
|
538
|
+
|
539
|
539
|
for(let i=0;i<list.length;i++){
|
540
|
540
|
for(let j=0;j<list[i].child.length;j++){
|
541
|
541
|
if(list[i].child[j].count!=null || list[i].child[j].count != "" || list[i].child[j].count!=0){
|
|
@@ -547,16 +547,16 @@ export default {
|
547
|
547
|
for(let i=0;i<list.length;i++){
|
548
|
548
|
list[i].total_price = list[i].count * list[i].price
|
549
|
549
|
}
|
550
|
|
-
|
551
|
|
- this.tableList = list
|
|
550
|
+
|
|
551
|
+ this.tableList = list
|
552
|
552
|
var total = response.data.data.total
|
553
|
553
|
this.total = total
|
554
|
|
- }
|
555
|
|
- })
|
|
554
|
+ }
|
|
555
|
+ })
|
556
|
556
|
},
|
557
|
557
|
|
558
|
558
|
select(){
|
559
|
|
-
|
|
559
|
+
|
560
|
560
|
},
|
561
|
561
|
|
562
|
562
|
getAdminUser(id){
|
|
@@ -570,13 +570,13 @@ export default {
|
570
|
570
|
},
|
571
|
571
|
|
572
|
572
|
exportList(){
|
573
|
|
-
|
|
573
|
+
|
574
|
574
|
for(let i=0;i<this.tablePrint.length;i++){
|
575
|
575
|
this.tablePrint[i].index = i+1
|
576
|
576
|
}
|
577
|
577
|
for(let i=0;i<this.tablePrint.length;i++){
|
578
|
578
|
if(this.org_id == 9919){
|
579
|
|
-
|
|
579
|
+
|
580
|
580
|
this.tablePrint[i].count = this.getCountSix(this.tablePrint[i].drug_id,this.tablePrint[i].child)
|
581
|
581
|
this.tablePrint[i].total_price = this.getCountSenven(this.tablePrint.drug_id,this.tablePrint[i].child,this.tablePrint[i].price)
|
582
|
582
|
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
|
|
@@ -585,11 +585,11 @@ export default {
|
585
|
585
|
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)
|
586
|
586
|
this.tablePrint[i].total_price = this.getTotalPrice(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
|
587
|
587
|
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
|
588
|
|
- this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
|
|
588
|
+ this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price)
|
589
|
589
|
}
|
590
|
590
|
}
|
591
|
|
-
|
592
|
|
-
|
|
591
|
+
|
|
592
|
+
|
593
|
593
|
import('@/vendor/Export2Excel').then(excel => {
|
594
|
594
|
const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
|
595
|
595
|
const filterVal = ['index','drug_name', 'unit', 'min_unit','count','min_price','total_price','remark']
|
|
@@ -600,8 +600,8 @@ export default {
|
600
|
600
|
obj.total_price = obj.total_price.toFixed(2)
|
601
|
601
|
this.tablePrint.push(obj)
|
602
|
602
|
const data = this.formatJson(filterVal, this.tablePrint)
|
603
|
|
-
|
604
|
|
-
|
|
603
|
+
|
|
604
|
+
|
605
|
605
|
excel.export_json_to_excel({
|
606
|
606
|
header: tHeader,
|
607
|
607
|
data,
|
|
@@ -610,7 +610,7 @@ export default {
|
610
|
610
|
this.downloadLoading = false
|
611
|
611
|
})
|
612
|
612
|
},
|
613
|
|
-
|
|
613
|
+
|
614
|
614
|
formatJson(filterVal, jsonData) {
|
615
|
615
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
616
|
616
|
},
|
|
@@ -641,28 +641,31 @@ export default {
|
641
|
641
|
}else{
|
642
|
642
|
this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].last_price)
|
643
|
643
|
}
|
644
|
|
-
|
|
644
|
+
|
645
|
645
|
}else{
|
646
|
646
|
this.tableData[i].total = (this.tableData[i].count * this.tableData[i].price)
|
647
|
647
|
if(this.tableData[i].count_unit == this.tableData[i].min_unit && this.tableData[i].max_unit!=this.tableData[i].min_unit){
|
648
|
648
|
this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price)
|
649
|
649
|
}
|
650
|
|
- if(this.tableData[i].count_unit == this.tableData[i].max_unit){
|
|
650
|
+ if(this.tableData[i].count_unit == this.tableData[i].max_unit && this.tableData[i].max_unit !=this.tableData[i].min_unit){
|
|
651
|
+ this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price)*this.tableData[i].min_number
|
|
652
|
+ }
|
|
653
|
+ if(this.tableData[i].count_unit == this.tableData[i].max_unit && this.tableData[i].max_unit ==this.tableData[i].min_unit){
|
651
|
654
|
this.tableData[i].total_price = (this.tableData[i].count * this.tableData[i].price)*this.tableData[i].min_number
|
652
|
655
|
}
|
653
|
656
|
}
|
654
|
657
|
}
|
655
|
658
|
}
|
656
|
659
|
const data = this.formatJson(filterVal, this.tableData)
|
657
|
|
-
|
658
|
|
-
|
|
660
|
+
|
|
661
|
+
|
659
|
662
|
excel.export_json_to_excel({
|
660
|
663
|
header: tHeader,
|
661
|
664
|
data,
|
662
|
665
|
filename: '药品出库明细'
|
663
|
666
|
})
|
664
|
667
|
this.downloadLoading = false
|
665
|
|
- })
|
|
668
|
+ })
|
666
|
669
|
},
|
667
|
670
|
|
668
|
671
|
getBaseDrugLibList() {
|
|
@@ -685,7 +688,7 @@ export default {
|
685
|
688
|
for (let i = 0; i < response.data.data.list.length; i++) {
|
686
|
689
|
this.drugList.push(response.data.data.list[i])
|
687
|
690
|
}
|
688
|
|
-
|
|
691
|
+
|
689
|
692
|
}
|
690
|
693
|
})
|
691
|
694
|
},
|
|
@@ -694,7 +697,7 @@ export default {
|
694
|
697
|
start_time:this.start_time,
|
695
|
698
|
end_time:this.end_time,
|
696
|
699
|
order_type:2,
|
697
|
|
- }
|
|
700
|
+ }
|
698
|
701
|
getDrugOutOrderPrint(params).then(response=>{
|
699
|
702
|
if(response.data.state == 1){
|
700
|
703
|
var list = response.data.data.list
|
|
@@ -744,7 +747,7 @@ export default {
|
744
|
747
|
}
|
745
|
748
|
})
|
746
|
749
|
}
|
747
|
|
-
|
|
750
|
+
|
748
|
751
|
let newArr = Object.values(objInfo);
|
749
|
752
|
for(let i=0;i<newArr.length;i++){
|
750
|
753
|
for(let j=0;j<list.length;j++){
|
|
@@ -754,7 +757,7 @@ export default {
|
754
|
757
|
}
|
755
|
758
|
}
|
756
|
759
|
this.tablePrint = newArr
|
757
|
|
-
|
|
760
|
+
|
758
|
761
|
}
|
759
|
762
|
})
|
760
|
763
|
},
|
|
@@ -793,11 +796,11 @@ export default {
|
793
|
796
|
}else{
|
794
|
797
|
arr[i].count = arr[i].count
|
795
|
798
|
}
|
796
|
|
- }
|
|
799
|
+ }
|
797
|
800
|
for(let j=0;j<arr.length;j++){
|
798
|
801
|
total +=arr[j].count
|
799
|
802
|
}
|
800
|
|
-
|
|
803
|
+
|
801
|
804
|
return (total*min_price).toFixed(2)
|
802
|
805
|
},
|
803
|
806
|
|
|
@@ -809,30 +812,30 @@ export default {
|
809
|
812
|
}else{
|
810
|
813
|
arr[i].count = arr[i].count
|
811
|
814
|
}
|
812
|
|
- }
|
|
815
|
+ }
|
813
|
816
|
for(let j=0;j<arr.length;j++){
|
814
|
817
|
total +=arr[j].count
|
815
|
818
|
}
|
816
|
|
-
|
|
819
|
+
|
817
|
820
|
return total*min_price
|
818
|
821
|
},
|
819
|
822
|
getCountSix(drug_id,val){
|
820
|
|
-
|
821
|
|
- var count = 0
|
|
823
|
+
|
|
824
|
+ var count = 0
|
822
|
825
|
for(let i=0;i<val.length;i++){
|
823
|
826
|
count+= val[i].count
|
824
|
827
|
}
|
825
|
828
|
return count
|
826
|
829
|
},
|
827
|
830
|
getCountSenven(drug_id,val,price){
|
828
|
|
- var count = 0
|
|
831
|
+ var count = 0
|
829
|
832
|
for(let i=0;i<val.length;i++){
|
830
|
833
|
count+= val[i].count
|
831
|
834
|
}
|
832
|
835
|
return (count*price).toFixed(2)
|
833
|
836
|
},
|
834
|
837
|
getCountSenvenOne(drug_id,val,price){
|
835
|
|
- var count = 0
|
|
838
|
+ var count = 0
|
836
|
839
|
for(let i=0;i<val.length;i++){
|
837
|
840
|
count+= val[i].count
|
838
|
841
|
}
|
|
@@ -872,7 +875,7 @@ export default {
|
872
|
875
|
changeHouseList(){
|
873
|
876
|
this.houseList = []
|
874
|
877
|
this.getlist()
|
875
|
|
- }
|
|
878
|
+ }
|
876
|
879
|
}
|
877
|
880
|
};
|
878
|
881
|
</script>
|