balance-query2.vue
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
<div class="container resource close-left-menu contaNEW">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a href="javascript:history.go(-1)" class="fbtn fb-return">返回</a>
<a href="javascript:;" class="fbtn fb-download" @click='download'>导出</a>
</div>
<h3 class="current-module">库存结存金额分析</h3>
</div>
<table class="itable itable-thead-13px itable-td-long-text">
<thead id="t_header">
<tr>
<th class="w50">序号</th>
<th class="w140">商品名称</th>
<th class="w140">规格</th>
<th class="w70">单位</th>
<th class="w120">生产厂商</th>
<th class="w120">注册证号</th>
<th class="w120">单价</th>
<th class="w120">总金额</th>
</tr>
</thead>
<tbody>
<tr v-for='item in goodsList'>
<td>{{$index+1}}</td>
<td class="t-left pr10">{{item.goodsname}}</td>
<td class="pr10">{{item.goodsspec}}</td>
<td>{{item.unit}}</td>
<td class="t-left pr10">{{item.producer}}</td>
<td class="t-left pr10">{{item.registkey}}</td>
<td class="t-right pr10">{{item.saleprice| numDigit 2}}元</td>
<td class="t-right">{{item.sumprice| numDigit 2}}元</td>
</tr>
</tbody>
</table>
<pagination
@page-change="getGoodS(false)"
:class="['m-20-0']"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages"
></pagination>
</div>
</template>
<script>
module.exports = {
data: function() {
return {
goodsList:[],
search: {
page:1,
totalPages:0,
pageSize:50,
total:0,
},
}
},
methods: {
getData: function(flag) {
var self = this;
if(flag){
this.search.page=1;
}
Ajax.post('/billType/getmfmedstockbalancedetails',self.search)
.then(function(response) {
var data=response.data.data;
if(response.data.errorCode==0){
self.$set('goodsList',data.list);
self.search.totalPages = data.totalPages;
self.search.total = data.total;
}else{
layer.msg(response.data.message);
}
});
},
download:function(){
var self= this;
Ajax.post('/billType/exportmfmedstockbalancedetail')
.then(function(response) {
var data=response.data.data;
if(response.data.errorCode>0){
layer.msg(response.data.message);
}else{
window.open(response.data);
}
});
}
},
route: {
activate: function() {
this.getData();
}
},
}
</script>