refundGoods.vue
6.15 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
<template>
<div id="exportStock" class="contentpanel shopsReport" style="display1: none">
<div class="panel">
<div class="panel-heading"><h1>退货管理</h1></div>
<div class="panel-body">
<div class="row">
<uc-filter :params.sync="params"></uc-filter>
<div class="panel-col">
<a href="javascript:;" class="btn btn-info" @click="submit">搜索</a>
</div>
</div>
<uc-card :rows="cards"></uc-card>
</div>
</div>
<div class="panel">
<div class="panel-heading"><h2>——退货报表——</h2></div>
<div class="panel-body nopadding">
<com-grid :columns="grid.columns" :url="grid.url">
</com-grid>
</div>
</div>
</div>
</template>
<script>
import grid from '../../../../components/grid/index';
import card from './card';
import filer from './filter';
export default {
components: {
comGrid: grid,
ucCard: card,
ucFilter: filer
},
props: {
refundData: {type: Object, default: {}}
},
data() {
return {
cards:[
{name:"退货总数",value:"0",name1:"环比",value1:"0"},
{name:"退货总金额(元)",value:"0",name1:"环比",value1:"0"},
{name:"退货率",value:"0",name1:"环比",value1:"0"}
],
params: {
type: 1,
reqTime: "",
beginTime: "",
endTime: "",
productSkn: "",
productSkc: "",
productSku: "",
factoryCode: "",
sortId: ""
},
grid: {
url: '/report/getReturnGoodsRptList',
columns: [
{
name: 'imageUrl', display: '图片', render: function (item) {
return '<img src="' + item.imageUrl + '">'
}
},
{
name: '', display: 'SKN/SKC/SKU', render: function (item) {
var htmlArr = [];
htmlArr.push('<p>SKN:' + item.productSkn + '</p>');
htmlArr.push('<p>SKC:' + item.productSkc + '</p>');
htmlArr.push('<p>SKU:' + item.productSku + '</p>');
return htmlArr.join("");
}
},
{name: 'factoryCode', display: '厂家编号'},
{name: 'goodsName', display: '商品名称'},
{
name: 'price', display: '价格', render: function (item) {
var htmlArr = [];
htmlArr.push('<p>吊牌价:' + item.retailPrice + '</p>');
htmlArr.push('<p>销售价:' + item.salesPrice + '</p>');
return htmlArr.join("");
}
},
{
name: '', display: '颜色/尺码', render: function (item) {
return '<p>' + item.colorName + '/' + item.sizeName + '</p>';
}
},
{
name: '', display: '商品分类', render: function (item) {
return '<p>' + item.maxSortName + '-' + item.middleSortName + '</p>';
}
},
{name: 'buyNumber', display: '数量'},
{name: 'orderAmount', display: '金额'}
]
}
}
},
ready() {
this.submit();
},
methods: {
submit() {
if(this.params.type==3){
//月报:reqTime截取月份,开始结束时间不传
this.params.reqTime=this.params.reqTime.substring(0,7);
this.params.beginTime=this.params.endTime="";
}else if(this.params.type==1){
//日报:开始结束时间不传
this.params.beginTime=this.params.endTime="";
}else{
//周报:reqTime时间不传
this.params.reqTime="";
}
var data = {
type: this.params.type,
reqTime: this.getTime(this.params.reqTime),
beginTime: this.getTime(this.params.beginTime),
endTime: this.getTime(this.params.endTime),
productSkn: this.params.productSkn,
productSkc: this.params.productSkc,
productSku: this.params.productSku,
factoryCode: this.params.factoryCode,
sortId: this.params.sortId
};
this.$broadcast('grid-reload', data);
},
getTime(time){
if (time !== "") {
time = time.split('/').join("")
}
return time;
}
},
events: {
complete(data){
let result = data.additionInfo;
if (result) {
this.cards[0].value = result.allNumber?result.allNumber:0;
this.cards[0].value1 = result.allNumberRate?result.allNumberRate:0;
this.cards[1].value = result.allAmount?result.allAmount:0;
this.cards[1].value1 = result.allAmountRate?result.allAmountRate:0;
this.cards[2].value = result.returnAmountRate?result.returnAmountRate+ "%":0;
this.cards[2].value1 = result.returnRingRate?result.returnRingRate:0;
}
}
}
}
</script>