|
@@ -53,6 +53,7 @@
|
53
|
53
|
<el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
|
54
|
54
|
</div>
|
55
|
55
|
<div>
|
|
56
|
+
|
56
|
57
|
<el-button type="primary" size="small" @click="toPrint">打印</el-button>
|
57
|
58
|
<el-button type="primary" size="small" @click="exportList">导出</el-button>
|
58
|
59
|
</div>
|
|
@@ -68,16 +69,23 @@
|
68
|
69
|
:class="signAndWeighBoxPatients"
|
69
|
70
|
border
|
70
|
71
|
>
|
|
72
|
+
|
71
|
73
|
<el-table-column label="耗材类型" align="center">
|
72
|
74
|
<template slot-scope="scope">
|
73
|
75
|
{{getGoodTypeName(scope.row.good_type_id)}}
|
74
|
76
|
</template>
|
75
|
77
|
</el-table-column>
|
|
78
|
+ <el-table-column label="耗材编码" align="center">
|
|
79
|
+ <template slot-scope="scope">
|
|
80
|
+ <span v-if="scope.row.good_number>0">{{ scope.row.good_number?scope.row.good_number:"" }}</span>
|
|
81
|
+ </template>
|
|
82
|
+ </el-table-column>
|
76
|
83
|
<el-table-column label="耗材名称" align="center">
|
77
|
84
|
<template slot-scope="scope">
|
78
|
85
|
{{scope.row.good_name}}
|
79
|
86
|
</template>
|
80
|
87
|
</el-table-column>
|
|
88
|
+
|
81
|
89
|
<el-table-column label="规格&单位" align="center">
|
82
|
90
|
<template slot-scope="scope">
|
83
|
91
|
{{scope.row.specification_name}}/{{scope.row.packing_unit}}
|
|
@@ -88,6 +96,17 @@
|
88
|
96
|
{{getManufacturName(scope.row.manufacturer)}}
|
89
|
97
|
</template>
|
90
|
98
|
</el-table-column>
|
|
99
|
+ <el-table-column label="经销商" align="center">
|
|
100
|
+ <template slot-scope="scope">
|
|
101
|
+ {{getDearName(scope.row.dealer)}}
|
|
102
|
+ </template>
|
|
103
|
+ </el-table-column>
|
|
104
|
+
|
|
105
|
+ <el-table-column label="单位" align="center">
|
|
106
|
+ <template slot-scope="scope">
|
|
107
|
+ {{scope.row.packing_unit}}
|
|
108
|
+ </template>
|
|
109
|
+ </el-table-column>
|
91
|
110
|
<el-table-column label="期初结余" align="center">
|
92
|
111
|
|
93
|
112
|
<el-table-column prop="stockIn" label="数量" width="100">
|
|
@@ -157,7 +176,7 @@
|
157
|
176
|
</div>
|
158
|
177
|
</template>
|
159
|
178
|
<script>
|
160
|
|
-import { getStorehouseList,getPurchaseStockQuery } from "@/api/drug/drug"
|
|
179
|
+import { getStorehouseList,getPurchaseStockQueryList,getGoodOverCount } from "@/api/drug/drug"
|
161
|
180
|
import {
|
162
|
181
|
getStockDrugCount
|
163
|
182
|
} from "@/api/stock";
|
|
@@ -201,9 +220,10 @@ export default {
|
201
|
220
|
loading:false,
|
202
|
221
|
pickerOptions:{ //禁用当前日期之前的日期
|
203
|
222
|
disabledDate(v) {
|
204
|
|
- return v.getTime() < 1667232000000
|
|
223
|
+ return v.getTime() < 1667491200000
|
205
|
224
|
},
|
206
|
225
|
},
|
|
226
|
+ dealerList:[],
|
207
|
227
|
}
|
208
|
228
|
|
209
|
229
|
},
|
|
@@ -231,6 +251,7 @@ export default {
|
231
|
251
|
this.goodTypeList.push(goodTypeList[i])
|
232
|
252
|
}
|
233
|
253
|
this.patientList = response.data.data.patientList
|
|
254
|
+ this.dealerList = response.data.data.dealerList
|
234
|
255
|
}
|
235
|
256
|
})
|
236
|
257
|
},
|
|
@@ -244,35 +265,37 @@ export default {
|
244
|
265
|
start_time:this.start_time,
|
245
|
266
|
end_time:this.end_time,
|
246
|
267
|
}
|
247
|
|
- getPurchaseStockQuery(params).then(response=>{
|
|
268
|
+ getPurchaseStockQueryList(params).then(response=>{
|
248
|
269
|
if(response.data.state == 1){
|
249
|
270
|
var list = response.data.data.list
|
|
271
|
+
|
250
|
272
|
this.loading = false
|
251
|
273
|
for(let i=0;i<list.length;i++){
|
252
|
274
|
|
253
|
|
- list[i].stockIn = this.getWarehouseInfoStart(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo) //期初结余
|
254
|
|
- list[i].stock_in_price = this.getWarehouseInfoStartPrice(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo)
|
255
|
|
- list[i].stockMoney = this.getWarehouseInfoStartMoney(list[i].StartFlowInfo,list[i].StartOutFlowInfo,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].StartCancelFlowInfo)
|
256
|
|
-
|
|
275
|
+ list[i].stockIn = list[i].GoodStartFlowInfo.over_count
|
|
276
|
+ list[i].stock_in_price = list[i].buy_price
|
|
277
|
+ list[i].stockMoney = (list[i].buy_price * list[i].GoodStartFlowInfo.over_count).toFixed(2)
|
|
278
|
+
|
257
|
279
|
list[i].stockAdd = this.getWarehouseInfoOne(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)//期间增加
|
258
|
|
- list[i].addStockMoney = this.getAddStockMony(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)
|
259
|
|
- list[i].saleStockMoney = this.getSaleStockMony(list[i].StartFlowWarehouseInfo,list[i].WareStartEndStockInventoryProfit)
|
|
280
|
+ list[i].addStockMoney = list[i].buy_price
|
|
281
|
+ list[i].saleStockMoney = (list[i].stockAdd * list[i].buy_price).toFixed(2)
|
260
|
282
|
|
261
|
283
|
list[i].outStock = this.getWarehosueOutInfo(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)//本期减少
|
262
|
|
- list[i].stockOutprice = this.stockOutprice(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
|
263
|
|
- list[i].saleOutMoney = this.getSaleStockMony(list[i].WarehouseOutInfoStart,list[i].WareStartEndStockInventoryLosses,list[i].StartEndCancelFLowInfo)
|
264
|
|
-
|
265
|
|
- // list[i].overStock= this.getEndWarehouseInfo(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
|
266
|
|
-
|
|
284
|
+ list[i].stockOutprice = list[i].retail_price
|
|
285
|
+ list[i].saleOutMoney = (list[i].outStock * list[i].stockOutprice).toFixed(2)
|
|
286
|
+
|
|
287
|
+
|
267
|
288
|
list[i].overStock = list[i].stockIn + list[i].stockAdd - list[i].outStock
|
268
|
|
- list[i].overPrice= this.getEndOverPrice(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
|
269
|
|
- list[i].overMoney = this.getEndSalePrice(list[i].EndFlowInfo,list[i].EndFlowOutInfo,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].EndCancelFLowInfo)
|
|
289
|
+ list[i].overPrice = list[i].buy_price
|
|
290
|
+ list[i].overMoney = (list[i].overStock * list[i].buy_price).toFixed(2)
|
270
|
291
|
|
271
|
292
|
}
|
|
293
|
+ console.log("listwowowoowowowow",list)
|
272
|
294
|
this.tableList = list
|
273
|
295
|
this.total = response.data.data.total
|
274
|
296
|
|
275
|
297
|
this.manufacturerList = response.data.data.manufacturerList
|
|
298
|
+
|
276
|
299
|
|
277
|
300
|
}
|
278
|
301
|
})
|
|
@@ -572,11 +595,7 @@ export default {
|
572
|
595
|
countfive +=arr5[i].count
|
573
|
596
|
}
|
574
|
597
|
}
|
575
|
|
- console.log("countOne",countOne)
|
576
|
|
- console.log("countTwo",countTwo)
|
577
|
|
- console.log("countthree",countthree)
|
578
|
|
- console.log("countfour",countfour)
|
579
|
|
- console.log("*********************")
|
|
598
|
+
|
580
|
599
|
count = countOne - countTwo + countthree - countfour + countfive
|
581
|
600
|
if(count > 0 ){
|
582
|
601
|
return count
|
|
@@ -610,10 +629,7 @@ export default {
|
610
|
629
|
}
|
611
|
630
|
}
|
612
|
631
|
all_count = count + countOne
|
613
|
|
- console.log("count2332323223232o2222222222wide",count)
|
614
|
|
- console.log("countONE23232322323323223",countOne)
|
615
|
|
- console.log("all_count9999999999999wode",all_count)
|
616
|
|
- console.log("-------------------------------------------")
|
|
632
|
+
|
617
|
633
|
if(all_count > 0 ){
|
618
|
634
|
return all_count
|
619
|
635
|
}else{
|
|
@@ -674,7 +690,8 @@ export default {
|
674
|
690
|
}
|
675
|
691
|
},
|
676
|
692
|
open(){
|
677
|
|
- this.start_time = moment().year(2022).month(10).date(1).format('YYYY-MM-DD')
|
|
693
|
+ // this.start_time = moment().year(2022).month(10).date(4).format('YYYY-MM-DD')
|
|
694
|
+ this.start_time = moment().startOf('month').format('YYYY-MM-DD')
|
678
|
695
|
this.end_time = moment(new Date()).add('year',0).format("YYYY-MM-DD")
|
679
|
696
|
this.houseList = []
|
680
|
697
|
this.goodTypeList= []
|
|
@@ -788,6 +805,7 @@ export default {
|
788
|
805
|
count_two +=val3[i].count
|
789
|
806
|
}
|
790
|
807
|
}
|
|
808
|
+
|
791
|
809
|
all_count = count +count_one - count_two
|
792
|
810
|
if(all_count >0){
|
793
|
811
|
return all_count
|
|
@@ -920,11 +938,7 @@ export default {
|
920
|
938
|
total_price_four +=val4[i].count * val4[i].buy_price
|
921
|
939
|
}
|
922
|
940
|
}
|
923
|
|
- console.log("total_price",total_price)
|
924
|
|
- console.log("total_price_three",total_price_three)
|
925
|
|
- console.log("total_price_two",total_price_two)
|
926
|
|
- console.log("total_price_one",total_price_one)
|
927
|
|
- console.log("total_price_four",total_price_four)
|
|
941
|
+
|
928
|
942
|
all_price = total_price- total_price_three +total_price_one - total_price_two + total_price_four
|
929
|
943
|
console.log("arrll_price",all_price)
|
930
|
944
|
if(all_price >0){
|
|
@@ -976,24 +990,25 @@ export default {
|
976
|
990
|
this.$router.push({path:"/purchase/stock/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
|
977
|
991
|
},
|
978
|
992
|
exportList: function() {
|
|
993
|
+
|
979
|
994
|
for(let i=0;i<this.tableList.length;i++){
|
980
|
995
|
this.tableList[i].index = i+1
|
981
|
996
|
this.tableList[i].query_date = this.start_time+"~"+this.end_time
|
982
|
997
|
this.tableList[i].good_type = this.getGoodTypeName(this.tableList[i].good_type_id)
|
983
|
998
|
this.tableList[i].manufacturer_name = this.getManufacturName(this.tableList[i].manufacturer)
|
|
999
|
+ this.tableList[i].dealer_name = this.getDearName(this.tableList[i].dealer)
|
984
|
1000
|
this.tableList[i].specification_name_one = this.tableList[i].specification_name + "/"+this.tableList[i].packing_unit
|
985
|
1001
|
}
|
986
|
1002
|
import('@/vendor/Export2Excel').then(excel => {
|
987
|
|
- const multiHeader = [['序号', '查询日期',' 耗材类型','耗材名称','规格&单位','生产产商', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
|
988
|
|
- const header = ['', '','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
|
989
|
|
- const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:I1', 'J1:L1', 'M1:O1', 'P1:R1']
|
990
|
|
- const filterVal = ['index', 'query_date', 'good_type','good_name','specification_name_one','manufacturer_name','stockIn','stock_in_price','stockMoney','stockAdd','addStockMoney','saleStockMoney','outStock','stockOutprice','saleOutMoney','overStock','overPrice','overMoney']
|
|
1003
|
+ const multiHeader = [['序号', '查询日期',' 耗材类型','耗材编码','耗材名称','规格&单位','生产产商','经销商','单位', '期初结余' , '', '', '本期增加', '', '', '本期减少' , '', '', '期末结余' , '', '']]
|
|
1004
|
+ const header = ['','','','','','','','','', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额', '数量', '进货金额', '销售金额']
|
|
1005
|
+ const merges = ['A1:A2', 'B1:B2','C1:C2','D1:D2','E1:E2','F1:F2','G1:G2','H1:H2','I1:I2', 'J1:L1', 'M1:O1', 'P1:R1','S1:U1']
|
|
1006
|
+ const filterVal = ['index', 'query_date', 'good_type','good_number','good_name','specification_name_one','manufacturer_name','dealer_name','packing_unit','stockIn','stock_in_price','stockMoney','stockAdd','addStockMoney','saleStockMoney','outStock','stockOutprice','saleOutMoney','overStock','overPrice','overMoney']
|
991
|
1007
|
|
992
|
|
- const data = this.formatJson(filterVal, this.tableList)
|
993
|
|
-
|
994
|
|
- const filename = '进销存查询'
|
995
|
|
-
|
996
|
|
-
|
|
1008
|
+ const data = this.formatJson(filterVal, this.tableList)
|
|
1009
|
+ console.log("datae3ooo2o2o2o",data)
|
|
1010
|
+ const filename = '进销存查询'
|
|
1011
|
+
|
997
|
1012
|
excel.export_json_to_excel({
|
998
|
1013
|
multiHeader,
|
999
|
1014
|
header,
|
|
@@ -1002,17 +1017,30 @@ export default {
|
1002
|
1017
|
filename
|
1003
|
1018
|
})
|
1004
|
1019
|
})
|
|
1020
|
+
|
1005
|
1021
|
},
|
1006
|
1022
|
formatJson(filterVal, jsonData) {
|
1007
|
1023
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
1008
|
1024
|
},
|
1009
|
|
-
|
|
1025
|
+ toOverCount(){
|
|
1026
|
+ getGoodOverCount().then(response=>{
|
|
1027
|
+ if(response.data.state == 1){
|
|
1028
|
+ var msg = response.data.data.msg
|
|
1029
|
+ this.$message.success("调试成功")
|
|
1030
|
+ }
|
|
1031
|
+ })
|
|
1032
|
+ },
|
|
1033
|
+ getDearName(id){
|
|
1034
|
+ var dear_name = ""
|
|
1035
|
+ for(let i=0;i<this.dealerList.length;i++){
|
|
1036
|
+ if(id == this.dealerList[i].id){
|
|
1037
|
+ dear_name = this.dealerList[i].dealer_name
|
|
1038
|
+ }
|
|
1039
|
+ }
|
|
1040
|
+ return dear_name
|
|
1041
|
+ },
|
1010
|
1042
|
},
|
1011
|
|
- // created(){
|
1012
|
|
- // this.getStorehouseList()
|
1013
|
|
- // this.getlist()
|
1014
|
|
- // this.getStockDrugCount()
|
1015
|
|
- // }
|
|
1043
|
+
|
1016
|
1044
|
}
|
1017
|
1045
|
</script>
|
1018
|
1046
|
|