list.vue
6.95 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="订单号">
<Input v-model.trim="query.orderCode" :maxlength="11" />
</filter-item>
<filter-item label="SKN">
<Input v-model.trim="query.productSkn" :maxlength="9" />
</filter-item>
<filter-item label="SKU">
<Input v-model.trim="query.productSku" :maxlength="9" />
</filter-item>
<filter-item label="收货人">
<Input v-model.trim="query.userName" />
</filter-item>
<filter-item label="买家昵称">
<Input v-model.trim="query.nickName" />
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.prodName" />
</filter-item>
<filter-item label="订单状态">
<Select v-model.trim="query.orderStatusStr" clearable>
<Option v-for="option in orderStatusArr" :key="option.id" :value="option.id">
{{ option.name }}
</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button type="primary" @click="exportExcel">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
<list-tabs @change-tabs="onChangeTabs"></list-tabs>
<data-table :table-cols="tableCols" :table-data="tableData"></data-table>
<Page :total="pageData.total" :current="pageData.current" :page-size="20" show-total @on-change="pageChange">
</Page>
</layout-list>
</layout-body>
</template>
<script>
import { ListTabs, DataTable } from './components';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
components: { ListTabs, DataTable },
data() {
return {
query: {
orderCode: '',
productSkn: '',
productSku: '',
prodName: '',
nickName: '',
userName: '',
orderStatus: '',
pageSize: 20,
pageNo: 1,
orderStatusStr: '',
queryType: 1,
},
orderStatusArr: [
{ id: 1, name: 'a' },
{ id: 2, name: 'b' },
{ id: 3, name: 'c' },
],
pageData: {
total: 100,
current: 1,
},
tableData: [
{
orderCode: '11111',
parentOrderCode: '1111-22222',
createTime: '2020-04-08 12:39:39',
buyerNickeName: '小乌贼',
receiver: '收货人',
paymentStatus: '支付状态',
orderStatus: '订单状态',
realAmount: '实收金额',
orderGoods: [
{
imageUrl: 'fdsafdsa', //商品图片
prodcutName: 'Converse RENEW工装大衣', //商品名称
prodcutCode: '10019501-A01',
sizeName: 'M', // 尺码名称
colorName: '黑', // 颜色名称
price: '¥120.00', //单价
buyNums: '2', //购买数量
productSkn: '34556778', // 商品skn
productSku: '34556778', // 商品sku
},
{
imageUrl: 'fdsafdsa', //商品图片
prodcutName: 'Converse RENEW工装大衣', //商品名称
prodcutCode: '10019501-A01',
sizeName: 'M', // 尺码名称
colorName: '黑', // 颜色名称
price: '¥120.00', //单价
buyNums: '2', //购买数量
productSkn: '34556778', // 商品skn
productSku: '34556778', // 商品sku
},
{
imageUrl: 'fdsafdsa', //商品图片
prodcutName: 'Converse RENEW工装大衣', //商品名称
prodcutCode: '10019501-A01',
sizeName: 'M', // 尺码名称
colorName: '黑', // 颜色名称
price: '¥120.00', //单价
buyNums: '2', //购买数量
productSkn: '34556778', // 商品skn
productSku: '34556778', // 商品sku
},
],
},
{
orderCode: '2222222',
parentOrderCode: '1111-22222',
createTime: '2020-04-08 12:39:39',
buyerNickeName: '小乌贼',
receiver: '收货人',
paymentStatus: '支付状态',
orderStatus: '订单状态',
realAmount: '实收金额',
orderGoods: [
{
imageUrl: 'fdsafdsa', //商品图片
prodcutName: 'Converse RENEW工装大衣', //商品名称
prodcutCode: '10019501-A01',
sizeName: 'M', // 尺码名称
colorName: '黑', // 颜色名称
price: '¥120.00', //单价
buyNums: '2', //购买数量
productSkn: '34556778', // 商品skn
productSku: '34556778', // 商品sku
},
],
},
],
tableCols: [
{ title: '图片', width: '8%' },
{ title: '商品信息', width: '20%' },
{ title: '单价', width: '8%' },
{ title: '数量', width: '5%' },
{ title: 'SKN', width: '5%' },
{ title: 'SKU', width: '5%' },
{ title: '买家昵称', width: '5%' },
{ title: '收货人', width: '5%' },
{ title: '支付状态', width: '5%' },
{ title: '实收金额', width: '5%' },
{ title: '订单状态', width: '5%' },
{ title: '操作', width: '10%' },
],
};
},
created() {
this.orderService = new OrderService();
},
methods: {
onChangeTabs(type) {
this.query.queryType = +type;
this.reset();
},
search() {
this.orderService.orderList(this.query).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
pageChange(page) {
this.pageData.current = page;
this.query.pageNo = page;
this.search();
},
reset() {
this.query.orderCode = '';
this.query.productSkn = '';
this.query.productSku = '';
this.query.prodName = '';
this.query.nickName = '';
this.query.userName = '';
this.query.orderStatus = 0;
this.query.pageSize = 20;
this.query.pageNo = 1;
this.query.orderStatusStr = '';
this.search();
},
exportExcel() {},
},
};
</script>
<style lang="scss">
table.order-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>