merchantUser.vue
5.7 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
<template>
<d2-container>
<el-card shadow="never">
<el-form :inline="true" :model="formInline" class="demo-form-inline" size="small">
<el-form-item label="商户名称">
<el-input v-model="formInline.name" placeholder="请输入商户名称" />
</el-form-item>
<el-form-item label="渠道类型">
<el-select v-model="formInline.channel" placeholder="请选择">
<el-option value="" label="全部">全部</el-option>
<el-option value="1" label="广汇代销">广汇代销</el-option>
<el-option value="2" label="金融风控代销">金融风控代销</el-option>
<el-option value="3" label="同盟会渠道">同盟会渠道</el-option>
<el-option value="4" label="金融渠道">金融渠道</el-option>
<el-option value="5" label="亿咖通">亿咖通</el-option>
<el-option value="6" label="特殊渠道(指定产品)">特殊渠道(指定产品)</el-option>
</el-select>
</el-form-item>
<el-form-item label="销售模式">
<el-select v-model="formInline.saleMode" placeholder="请选择">
<el-option value="" label="全部">全部</el-option>
<el-option value="1" label="经销">经销</el-option>
<el-option value="2" label="代销">代销</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" :loading="tableLoading" @click="getList()">搜索</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 表格区域 开始 -->
<div class="table_box">
<el-table v-loading="tableLoading" :data="tableData" stripe style="width: 100%" size="small" border>
<el-table-column type="index" :index="index => {return index+1}" label="序号" width="80" />
<el-table-column prop="name" label="用户名" />
<el-table-column prop="role" label="角色">
<template slot-scope="scope">{{ scope.row.role == 1 ? '入库' : '出库'}}</template>
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" />
<el-table-column prop="channel" label="商户渠道">
<template slot-scope="scope">{{ CHANNELTYPE[scope.row.channel] }}</template>
</el-table-column>
<el-table-column prop="saleMode" label="销售模式">
<template slot-scope="scope">{{ SALEMODETYPE[scope.row.saleMode] }}</template>
</el-table-column>
<el-table-column prop="createdBy" label="创建人" />
<el-table-column prop="createdDate" label="创建时间">
<template slot-scope="scope">{{ DATEFORMATE(scope.row.createdDate, 'YYYY-MM-DD HH:mm:ss') }}</template>
</el-table-column>
<el-table-column prop="updatedDate" label="更新时间">
<template slot-scope="scope">{{ DATEFORMATE(scope.row.updatedDate, 'YYYY-MM-DD HH:mm:ss') }}</template>
</el-table-column>
<el-table-column prop="sendMerchantNo" label="操作" width="260">
<template slot-scope="scope">
<el-button type="primary" size="mini">重置密码</el-button>
<el-button type="primary" size="mini">修改</el-button>
<el-button type="danger" size="mini">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination_list">
<el-pagination
background
layout="sizes, total,prev, pager, next, jumper"
:total="pageTotal"
:page-size="pageSize"
:page-sizes="pageSizes"
@current-change="getList"
@size-change="changePageSize"
/>
</div>
</div>
<!-- 表格区域 end -->
</d2-container>
</template>
<script>
import {
GETDEALERUSERLIST
} from '@/http/interface'
export default {
data() {
return {
formInline: {},
tableData: [],
dialogVisible: false,
tableLoading: false,
pageTotal: 0,
userInfo: {},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
registerDate: [],
tdWidth: 170,
DATEFORMATE: (str, type) => { return this.$Util.dateFormate(str, type) },
deviceTypeList: [],
EXTERNALFLAG: {
'IN': '内部设备',
'EX': '外部设备'
},
CHANNELTYPE: {
1: '广汇代销',
2: '金融风控代销',
3: '同盟会渠道',
4: '金融渠道',
5: '亿咖通',
6: '特殊渠道(指定产品)'
},
SALEMODETYPE: {
1: '经销',
2: '代销'
}
}
},
created() {
},
mounted: function() {
this.getList()
},
methods: {
/**
* 查询列表
*/
getList: function(current) {
const _this = this
const oParams = _this.getParams()
console.log(current)
oParams.pageNum = current || _this.currentPage
_this.tableLoading = true
GETDEALERUSERLIST(oParams).then(res => {
console.log(res)
_this.tableLoading = false
if (res.returnCode == 0) {
const { data } = res
const { total, list } = data
_this.tableData = list || []
_this.pageTotal = total
}
})
},
/**
* 获取查询参数
*/
getParams: function() {
const n = this.formInline
const oParams = {}
oParams.condition = n
oParams.pageSize = this.pageSize
return oParams
},
/**
* 每页展示
*/
changePageSize: function(e) {
this.pageSize = e
this.getList()
}
}
}
</script>
<style lang="scss">
.table_box {
margin: 20px 0;
}
</style>