supplier-collection.vue
5.18 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<template>
<div class="container resource close-left-menu">
<div class="pop-banner clearfix">
<div class="operate-btns">
<a class="fbtn fb-Print2 ml-10" @click='printRk'>打印</a>
</div>
<h3 class="current-module">供应商入库汇总</h3>
</div>
<div class="order-orderlist-view clearfix">
<div class="pd-form form-label4em mb-40 fast-search-form">
<div class="group-row">
<div class="form-group">
<div class="control">
<input type="text" maxlength="20" v-rule v-model="suppliername" placeholder='供应商名称' title='供应商名称'>
</div>
</div>
<div class="form-group form-label">
<!-- <label for="cn1" class="label">结算日期</label> -->
<div class="control control-date" style="height:34px;overflow: inherit;">
<div style="width:44%;float:left;">
<datepicker :target.sync="startDate" :readonly="readonlyFlag" placeholder="申领开始日期" title='结算开始日期' styleobj="width:100% !important;border-radius:8px 0px 0px 8px !important;"></datepicker>
</div>
<div class="text-and">至</div>
<div style="width:48%;float:left;">
<datepicker :target.sync="endDate" :readonly="readonlyFlag" title='申领结束日期' placeholder="申领结束日期" styleobj="width:100% !important;border-radius:0px 8px 8px 0px !important;"></datepicker>
</div>
</div>
</div>
</div>
<div class="group-row t-right">
<button v-on:click="getData(true)" class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle">查 询</button>
</div>
</div>
<table class="itable itable-td-long-text">
<thead id="t_header">
<tr>
<th class="w40">序号</th>
<th class="w100">供应商名称</th>
<th class="w100">入库数量</th>
<th class="w100">入库金额(元)</th>
<th class="w100">退货数量</th>
<th class="w100">退货金额(元)</th>
<th class="w100">合计数量</th>
<th class="w100">合计金额(元)</th>
</tr>
</thead>
<tbody class="txt_v">
<tr v-if="list.length==0">
<td colspan="10" >
暂无符合条件的记录
</td>
</tr>
<tr v-else v-for='item in list'>
<td>{{$index+1}}</td>
<td class="t-left">{{item.suppliername}}</td>
<td class="t-right">{{item.rkAccount | numDigit 2 | numFmt}}</td>
<td class="t-right">{{item.rkDetailsum | numDigit 2 | numFmt}}</td>
<td class="t-right">{{item.rpiAccount | numDigit 2 | numFmt}}</td>
<td class="pr10 t-right">{{item.rpiDetailsum | numDigit 2 | numFmt}}</td>
<td class="t-right">{{item.account | numDigit 2 | numFmt}}</td>
<td class="t-right">{{item.detailsum | numDigit 2 | numFmt}}</td>
</tr>
</tbody>
</table>
<div class="pagination m-20-0">
<pagination
@page-change="getData(false)"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages">
</pagination>
</div>
</div>
</div>
</template>
<script >
module.exports = {
data: function () {
return {
list:[],
startDate:'',
endDate:'',
suppliername:'',
search: {
pageSize: 50,
page: 1,
totalPages: 0,
},
};
},
methods: {
// 获取当前时间和之前一个月时间
Date:function(){
var self = this;
// 结束日趋
var nowdate = new Date();
var y = nowdate.getFullYear();
var m = nowdate.getMonth()+1;
m=m<10?'0'+m:m;
var d = nowdate.getDate();
d=d<10?'0'+d:d;
self.endDate = y+'-'+m+'-'+d;
// 开始日期
nowdate.setMonth(nowdate.getMonth()-1);
var yn = nowdate.getFullYear();
var mn = nowdate.getMonth()+1;
mn=mn<10?'0'+mn:mn;
var dn= nowdate.getDate();
dn=dn<10?'0'+dn:dn;
self.startDate = yn+'-'+mn+'-'+dn;
},
getData: function (flag) {
var self = this;
self.list=[];
if(flag){
self.search.page = 1;
}
Ajax.post('/procurment/queryRkAndRpiReport',{'page':self.search.page,'pageSize':self.search.pageSize,'suppliername':self.suppliername,'startDate':self.startDate,'endDate':self.endDate})
.then(function (response){
var data = response.data.data;
if(response.data.errorCode==0){
self.$set('list',data.list);
self.search.totalPages = data.totalPages;
self.search.total = data.total;
}
})
},
// 打印
printRk:function(){
var self = this;
Ajax.post('/procurment/printRkAndRpiReport',{'suppliername':self.suppliername,'startDate':self.startDate,'endDate':self.endDate})
.then(function (response){
var res = response.data.data;
window.open(res);
})
}
},
route: {
activate: function () {
this.Date();
this.getData(false);
}
},
watch:{
}
};
</script>