payment-print-detail.vue
6.66 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<template>
<layout-print>
<h2>代销结算明细</h2>
<p>供应商:{{supplierName}}</p>
<p>对账日期:{{date}}</p>
<h4>商品款</h4>
<div class="stock-list">
<table width="100%">
<thead>
<tr>
<th v-for="item in tableCols">{{item.title}}</th>
</tr>
</thead>
<tbody>
<tr v-for="item in tableData">
<td>{{item.productSku}}</td>
<td>{{item.productName}}</td>
<td>{{item.factoryCode}}</td>
<td>{{item.sizeName}}</td>
<td>{{item.salesAmount}}</td>
<td>{{item.salesNums}}</td>
<td>{{item.brandName}}</td>
<td>{{item.clearingInterval}}</td>
</tr>
</tbody>
</table>
</div>
<h4 class="mgt20">代销抵冲</h4>
<div class="stock-list">
<table width="100%">
<thead>
<tr>
<th v-for="item in tableCols2">{{item.title}}</th>
</tr>
</thead>
<tbody>
<tr v-for="item in tableData2">
<td>{{item.productSku}}</td>
<td>{{item.productName}}</td>
<td>{{item.factoryCode}}</td>
<td>{{item.sizeName}}</td>
<td>{{item.salesAmount}}</td>
<td>{{item.agencyTypeDesc}}</td>
<td>{{item.brandName}}</td>
<td>{{item.clearingInterval}}</td>
</tr>
</tbody>
</table>
</div>
<p class="price">费用小计:¥{{deduction}}</p>
<p class="price">实际应付款(元):¥{{count}}</p>
<p class="price"><b>总计:¥{{count}}</b></p>
<p><b>请您按照上述商品款小计金额开具发票。</b></p>
<div class="seal">盖章确认</div>
<p>请您在SPM系统将结算对账单和库存对账单各打印一份,并盖章确认后与发票一并寄至:</p>
<p>江苏省南京市建邺区嘉陵江东街18号南京国家广告产业园05栋17楼 --品牌经理(210000)</p>
<p>电话:025-87781000</p>
<p>传真:025-87781000</p>
<p><br><br>以下为贵公司汇款信息及地址,请核对。如有变更请将新的信息盖章同账单一并寄至我公司。并请及时与我公司商品部联系,在业务系统中进行更新。<br><br></p>
<p>公司名称: </p>
<p>开户行名称:</p>
<p>帐 号:</p>
<p>地 址: </p>
<p>财务联系人:</p>
<p>联系电话:</p>
<p><br>备注:盖章确认后发现对账单存在任何问题的,我公司不承担任何责任。</p>
</layout-print>
</template>
<script>
import _ from 'lodash';
import detail from '../payment/store/detail-print';
import FinanceService from 'services/finance/finance-service';
import moment from 'moment';
export default {
data() {
return _.assign(detail.call(this), {
deduction: 0,
count: 0
});
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
date() {
return moment(this.$route.query.createTime).startOf('month').format("YYYY-MM-DD");
},
supplierName() {
return this.$route.query.supplierName;
}
},
methods: {
search() {
let params = {
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
productSku: +this.filters.sku.model,
pageSize: +this.$route.query.totalCount,
pageNo: this.$route.query.page
};
params = _.pickBy(params, val => val);
this.FinanceService.settlementList(params).then(ret => {
let list = _.get(ret, 'data.records', []);
let list1 = []; // 商品款
let list2 = []; // 代销抵冲
let deduction, count;
let type1 = ['销售出库', '换货入库', '换货出库', '退货入库', '促销出库', '盘亏', 'vip折扣', '优惠券分摊'];
let type2 = ['其他抵冲', '折扣抵冲', '经销抵冲'];
_.each(list, item => {
if (type1.indexOf(item.agencyTypeDesc) > -1) {
list1.push(item);
}
if(type2.indexOf(item.agencyTypeDesc) > -1) {
list2.push(item);
}
});
this.tableData = list1;
this.tableData2 = list2;
count = _.sum(_.map(list1, 'salesAmount'));
deduction = _.sum(_.map(list2, 'salesAmount'));
this.tableData.push(
{
productSku: '合计',
salesAmount: count
}
);
this.tableData2.push(
{
productSku: '合计',
salesAmount: deduction
}
);
this.deduction = deduction;
this.count = count;
});
}
}
};
</script>
<style lang="scss" scoped>
h2 {
line-height: 50px;
border-bottom: 1px solid #f2f2f2;
margin-bottom: 10px;
}
h4 {
font-size: 16px;
text-align: center;
font-weight: bold;
}
.print-detail {
margin-bottom: 20px;
color: #333;
}
p {
line-height: 20px;
}
.price {
font-size: 16px;
line-height: 20px;
margin-top: 15px;
text-align: right;
b {
font-size: 18px;
}
}
.seal {
text-align: right;
padding-right: 250px;
line-height: 50px;
font-weight: bold;
}
.mgt20 {
margin-top: 20px;
}
.stock-list {
table,
th,
td {
border: 1px solid black;
color: #333;
font-size: 12px;
text-align: center;
padding: 8px 0;
}
table {
border-spacing: 0;
border-collapse: collapse;
margin-top: 10px;
}
}
</style>