index.vue
5.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
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
<template>
<LayoutContent :breads="[{title: '店铺列表'}]">
<LayoutFilter @on-filter="onFilter" @on-clear="onClear">
<i-form ref="filterForm" inline :model="filter">
<i-form-item prop="uid">
<i-input placeholder="输入uid" v-model="filter.uid"></i-input>
</i-form-item>
<i-form-item prop="certName">
<i-input placeholder="商家名称" v-model="filter.certName"></i-input>
</i-form-item>
<i-form-item prop="mobile">
<i-input placeholder="手机号" v-model="filter.mobile"></i-input>
</i-form-item>
<i-form-item prop="validStatus">
<i-select placeholder="选择状态" v-model="filter.validStatus" style="width: 100px;">
<i-option :value="1">已入驻</i-option>
<i-option :value="9">已退驻</i-option>
</i-select>
</i-form-item>
<i-form-item prop="entryType">
<i-select placeholder="商家类型" v-model="filter.entryType" style="width: 100px">
<i-option :value="1">普通入驻</i-option>
<i-option :value="2">超级入驻</i-option>
<i-option :value="3">前期白名单</i-option>
</i-select>
</i-form-item>
</i-form>
</LayoutFilter>
<LayoutTable
:page="page"
:total="total"
:columns="columns"
:data="data"
@on-page-change="onPageChange">
</LayoutTable>
</LayoutContent>
</template>
<script>
import dayjs from 'dayjs';
import Api from '@/api/api';
import qs from 'qs';
import ISelect from "../../../node_modules/iview/src/components/select/select";
import IOption from "../../../node_modules/iview/src/components/select/option";
const api = new Api();
export default {
components: {
IOption,
ISelect},
name: 'SendRecordPage',
data() {
return {
filter: {
certName: '',
mobile: '',
uid: '',
validStatus: '',
entryType: ''
},
page: 1,
total: 0,
data: [],
columns: [{
title: 'UID',
key: 'uid',
width: 100
},
{
title: '商家类型',
render(h, {row}) {
return h('span', {}, ['','普通入驻', '超级入驻', '前期白名单'][row.entryType]);
},
width: 100
},
{
title: '商家名称',
key: 'certName',
width: 100
}, {
title: '手机号',
key: 'mobile',
width: 150
}, {
title: '身份证',
key: 'certNo',
width: 200
}, {
title: '上架SKUP',
key: 'selfSkuNum',
width: 100
}, {
title: '违规次数',
key: 'breakRuleTimes',
width: 100
},
{
title: '账户余额',
render(h, {row}) {
let color = parseInt(row.money, 10) > 999 ? 'inherit' : 'red';
return h('span', {style: {color: color}}, row.money);
},
width: 100
},
{
title: '入驻时间',
render(h, {row}) {
return (
<span>{dayjs(row.enterTime).format('YYYY-MM-DD HH:mm:ss')}</span>
);
},
width: 150
}, {
title: '退出入驻时间',
render(h, {row}) {
return (
<span>{row.quitTime ? dayjs(row.quitTime).format('YYYY-MM-DD HH:mm:ss') : ''}</span>
);
},
width: 150
}, {
title: '入驻状态',
key: 'validStatusDesc',
width: 100
}]
};
},
created() {
this.$nextTick(() => {
const {page, certName, mobile, uid, validStatus} = qs.parse(location.search ? location.search.slice(1) : '');
this.filter.certName = certName ? decodeURIComponent(certName) : this.filter.certName;
this.filter.mobile = mobile || this.filter.mobile;
this.filter.uid = uid || this.filter.uid;
this.filter.validStatus = validStatus ? parseInt(validStatus) : this.filter.validStatus;
this.page = page ? parseInt(page) : 1;
this.fetchData(this.filter, this.page);
});
},
methods: {
onFilter() {
this.fetchData(this.filter);
},
onClear() {
this.$refs.filterForm.resetFields();
this.fetchData(this.filter);
},
onPageChange(page) {
this.fetchData(this.filter, page);
},
async fetchData(params, page = 1) {
this.page = page;
this.$Loading.start();
const result = await api._get('/ufoPlatform/storedSeller/queryStoredSeller', Object.assign({
page,
}, this.getParams(params)));
if (result.code === 200) {
// console.log('listData:', result);
this.total = result.data.total;
this.data = result.data.list;
this.$Loading.finish();
} else {
result.message && this.$Message.warning(result.message);
this.$Loading.error();
}
},
getParams(params) {
return {
certName: params.certName,
mobile: params.mobile,
uid: params.uid,
validStatus: parseInt(params.validStatus) >= 0 ? params.validStatus : void 0,
entryType: parseInt(params.entryType) >= 0 ? params.entryType : void 0,
};
}
},
};
</script>
<style>
</style>