|
|
@ -2,43 +2,29 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
|
<el-form-item label="姓名" prop="name"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.name" |
|
|
|
placeholder="请输入姓名" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable size="small" |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="邮箱" prop="email"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.email" |
|
|
|
placeholder="请输入邮箱" |
|
|
|
clearable |
|
|
|
size="small" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.email" placeholder="请输入邮箱" clearable size="small" |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> |
|
|
|
<el-option |
|
|
|
v-for="dict in statusOptions" |
|
|
|
:key="dict.dictValue" |
|
|
|
:label="dict.dictLabel" |
|
|
|
:value="dict.dictValue" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> |
|
|
|
<el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" |
|
|
|
:value="dict.dictValue" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item label="来源" prop="source"> |
|
|
|
<!-- <el-form-item label="来源" prop="source"> |
|
|
|
<el-select v-model="queryParams.source" placeholder="请选择来源" clearable size="small"> |
|
|
|
<el-option |
|
|
|
v-for="dict in sourceOptions" |
|
|
@ -48,26 +34,18 @@ |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> --> |
|
|
|
<el-form-item label="会员角色" prop="userRole"> |
|
|
|
<el-select v-model="queryParams.userRole" placeholder="请选择会员角色" clearable size="small"> |
|
|
|
<el-option |
|
|
|
v-for="dict in userRoleOptions" |
|
|
|
:key="dict.dictValue" |
|
|
|
:label="dict.dictLabel" |
|
|
|
:value="dict.dictValue" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="会员角色" prop="userRole"> |
|
|
|
<el-select v-model="queryParams.userRole" placeholder="请选择会员角色" clearable size="small"> |
|
|
|
<el-option v-for="dict in userRoleOptions" :key="dict.dictValue" :label="dict.dictLabel" |
|
|
|
:value="dict.dictValue" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="认证级别" prop="authLevel"> |
|
|
|
<el-select v-model="queryParams.authLevel" placeholder="请选择用户认证级别" clearable size="small"> |
|
|
|
<el-option |
|
|
|
v-for="dict in authLevelOptions" |
|
|
|
:key="dict.dictValue" |
|
|
|
:label="dict.dictLabel" |
|
|
|
:value="dict.dictValue" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-select v-model="queryParams.authLevel" placeholder="请选择用户认证级别" clearable size="small"> |
|
|
|
<el-option v-for="dict in authLevelOptions" :key="dict.dictValue" :label="dict.dictLabel" |
|
|
|
:value="dict.dictValue" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|
|
@ -75,7 +53,7 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
plain |
|
|
@ -108,14 +86,8 @@ |
|
|
|
>删除</el-button> |
|
|
|
</el-col> --> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="warning" |
|
|
|
plain |
|
|
|
icon="el-icon-download" |
|
|
|
size="mini" |
|
|
|
@click="handleExport" |
|
|
|
v-hasPermi="['user:userCustomer:export']" |
|
|
|
>导出</el-button> |
|
|
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" |
|
|
|
v-hasPermi="['user:userCustomer:export']">导出</el-button> |
|
|
|
</el-col> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> |
|
|
@ -124,73 +96,55 @@ |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column label="用户id" align="center" prop="userId" /> |
|
|
|
<el-table-column label="姓名" align="center" prop="name" /> |
|
|
|
<el-table-column label="头像路径" align="center" prop="headImgPath" > |
|
|
|
<template width="90" slot-scope="scope"> |
|
|
|
<el-image |
|
|
|
style="width: 80px; height: 80px" |
|
|
|
:src="scope.row.headImgPath" |
|
|
|
@click="previewImage(scope.row.headImgPath)" |
|
|
|
:preview-src-list="srcList" |
|
|
|
></el-image> |
|
|
|
|
|
|
|
<!-- <img style="width:80px;height:80px;border:none;" :src="scope.row.chainIconUrl"> --> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="邮箱" align="center" prop="email" /> |
|
|
|
<!-- <el-table-column label="父级编号" align="center" prop="parentId" /> --> |
|
|
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="addTime" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ parseTime(scope.row.addTime, '{y}-{m}-{d}') }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="会员角色" align="center" prop="userRole" :formatter="userRoleFormat"/> |
|
|
|
<el-table-column label="用户认证级别" align="center" prop="authLevel" :formatter="authLevelFormat" /> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="状态" align="center" key="status" > |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch |
|
|
|
v-model="scope.row.status" |
|
|
|
active-value="normal" |
|
|
|
inactive-value="frozen" |
|
|
|
@change="handleStatusChange(scope.row)" |
|
|
|
></el-switch> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope" > |
|
|
|
<el-button v-if="scope.row.authLevel=='1'||scope.row.authLevel=='2'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['user:userCustomer:edit']" |
|
|
|
>修改认证级别 |
|
|
|
<el-table-column label="头像路径" align="center" prop="headImgPath"> |
|
|
|
<template width="90" slot-scope="scope"> |
|
|
|
<el-image style="width: 80px; height: 80px" :src="scope.row.headImgPath" |
|
|
|
@click="previewImage(scope.row.headImgPath)" :preview-src-list="srcList"></el-image> |
|
|
|
|
|
|
|
<!-- <img style="width:80px;height:80px;border:none;" :src="scope.row.chainIconUrl"> --> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="邮箱" align="center" prop="email" /> |
|
|
|
<!-- <el-table-column label="父级编号" align="center" prop="parentId" /> --> |
|
|
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="addTime" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ parseTime(scope.row.addTime, '{y}-{m}-{d}') }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="会员角色" align="center" prop="userRole" :formatter="userRoleFormat" /> |
|
|
|
<el-table-column label="用户认证级别" align="center" prop="authLevel" :formatter="authLevelFormat" /> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="状态" align="center" key="status"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch v-model="scope.row.status" active-value="normal" inactive-value="frozen" |
|
|
|
@change="handleStatusChange(scope.row)"></el-switch> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="scope.row.authLevel == '1' || scope.row.authLevel == '2'" size="mini" type="text" |
|
|
|
@click="handleUpdate(scope.row)" v-hasPermi="['user:userCustomer:edit']">修改认证级别 |
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<pagination |
|
|
|
v-show="total>0" |
|
|
|
:total="total" |
|
|
|
:page.sync="queryParams.pageNum" |
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" /> |
|
|
|
|
|
|
|
<!-- 添加或修改个人用户对话框 --> |
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
|
|
|
|
<el-form-item label="认证级别"> |
|
|
|
<el-radio-group v-model="form.authLevel"> |
|
|
|
<el-radio label="2" >初级认证</el-radio> |
|
|
|
<el-radio label="3" >高级认证</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
<el-radio-group v-model="form.authLevel"> |
|
|
|
<el-radio :label="2">初级认证</el-radio> |
|
|
|
<el-radio :label="3">高级认证</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
@ -202,7 +156,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { listUserCustomer, getUserCustomer, delUserCustomer, addUserCustomer, updateUserCustomer, exportUserCustomer,changeUserStatus } from "@/api/user/userCustomer"; |
|
|
|
import { listUserCustomer, getUserCustomer, delUserCustomer, addUserCustomer, updateUserCustomer, exportUserCustomer, changeUserStatus } from "@/api/user/userCustomer"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "UserCustomer", |
|
|
@ -229,11 +183,11 @@ export default { |
|
|
|
|
|
|
|
statusOptions: [], |
|
|
|
// 来源状态字典 |
|
|
|
sourceOptions: [], |
|
|
|
sourceOptions: [], |
|
|
|
|
|
|
|
userRoleOptions: [], |
|
|
|
userRoleOptions: [], |
|
|
|
|
|
|
|
authLevelOptions: [], |
|
|
|
authLevelOptions: [], |
|
|
|
// 弹出层标题 |
|
|
|
title: "", |
|
|
|
// 是否显示弹出层 |
|
|
@ -283,18 +237,18 @@ export default { |
|
|
|
created() { |
|
|
|
this.getList(); |
|
|
|
this.getDicts("user_status").then(response => { |
|
|
|
this.statusOptions = response.data; |
|
|
|
}); |
|
|
|
|
|
|
|
this.getDicts("source").then(response => { |
|
|
|
this.sourceOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("user_role").then(response => { |
|
|
|
this.userRoleOptions = response.data; |
|
|
|
}); |
|
|
|
this.statusOptions = response.data; |
|
|
|
}); |
|
|
|
|
|
|
|
this.getDicts("source").then(response => { |
|
|
|
this.sourceOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("user_role").then(response => { |
|
|
|
this.userRoleOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("auth_level").then(response => { |
|
|
|
this.authLevelOptions = response.data; |
|
|
|
}); |
|
|
|
this.authLevelOptions = response.data; |
|
|
|
}); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** 查询个人用户列表 */ |
|
|
@ -302,42 +256,42 @@ export default { |
|
|
|
this.loading = true; |
|
|
|
listUserCustomer(this.queryParams).then(response => { |
|
|
|
this.userCustomerList = response.rows; |
|
|
|
this.total = response.total; |
|
|
|
this.total = Number(response.total); |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 状态字典 |
|
|
|
statusFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.statusOptions, row.status); |
|
|
|
}, |
|
|
|
|
|
|
|
// 来源字典 |
|
|
|
sourceFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.sourceOptions, row.source); |
|
|
|
}, |
|
|
|
// 角色字典 |
|
|
|
userRoleFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.userRoleOptions, row.userRole); |
|
|
|
}, |
|
|
|
statusFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.statusOptions, row.status); |
|
|
|
}, |
|
|
|
|
|
|
|
// 来源字典 |
|
|
|
sourceFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.sourceOptions, row.source); |
|
|
|
}, |
|
|
|
// 角色字典 |
|
|
|
userRoleFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.userRoleOptions, row.userRole); |
|
|
|
}, |
|
|
|
|
|
|
|
// 级别字典 |
|
|
|
authLevelFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.authLevelOptions, row.authLevel); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 用户状态修改 |
|
|
|
handleStatusChange(row) { |
|
|
|
let text = row.status === "0" ? "启用" : "停用"; |
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.name + '"用户吗?').then(function() { |
|
|
|
return changeUserStatus(row.userId, row.status); |
|
|
|
}).then(() => { |
|
|
|
this.$modal.msgSuccess(text + "成功"); |
|
|
|
}).catch(function() { |
|
|
|
row.status = row.status === "0" ? "1" : "0"; |
|
|
|
}); |
|
|
|
}, |
|
|
|
authLevelFormat(row, column) { |
|
|
|
return this.selectDictLabel(this.authLevelOptions, row.authLevel); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 用户状态修改 |
|
|
|
handleStatusChange(row) { |
|
|
|
let text = row.status === "0" ? "启用" : "停用"; |
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.name + '"用户吗?').then(function () { |
|
|
|
return changeUserStatus(row.userId, row.status); |
|
|
|
}).then(() => { |
|
|
|
this.$modal.msgSuccess(text + "成功"); |
|
|
|
}).catch(function () { |
|
|
|
row.status = row.status === "0" ? "1" : "0"; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 取消按钮 |
|
|
|
cancel() { |
|
|
|
this.open = false; |
|
|
@ -385,7 +339,7 @@ export default { |
|
|
|
// 多选框选中数据 |
|
|
|
handleSelectionChange(selection) { |
|
|
|
this.ids = selection.map(item => item.userId) |
|
|
|
this.single = selection.length!==1 |
|
|
|
this.single = selection.length !== 1 |
|
|
|
this.multiple = !selection.length |
|
|
|
}, |
|
|
|
/** 新增按钮操作 */ |
|
|
@ -421,6 +375,7 @@ export default { |
|
|
|
this.getList(); |
|
|
|
}); |
|
|
|
} |
|
|
|
console.log(this.open) |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
@ -428,28 +383,28 @@ export default { |
|
|
|
handleDelete(row) { |
|
|
|
const userIds = row.userId || this.ids; |
|
|
|
this.$confirm('是否确认删除个人用户编号为"' + userIds + '"的数据项?', "警告", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(function() { |
|
|
|
return delUserCustomer(userIds); |
|
|
|
}).then(() => { |
|
|
|
this.getList(); |
|
|
|
this.msgSuccess("删除成功"); |
|
|
|
}) |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(function () { |
|
|
|
return delUserCustomer(userIds); |
|
|
|
}).then(() => { |
|
|
|
this.getList(); |
|
|
|
this.msgSuccess("删除成功"); |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 导出按钮操作 */ |
|
|
|
handleExport() { |
|
|
|
const queryParams = this.queryParams; |
|
|
|
this.$confirm('是否确认导出所有个人用户数据项?', "警告", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(function() { |
|
|
|
return exportUserCustomer(queryParams); |
|
|
|
}).then(response => { |
|
|
|
this.download(response.msg); |
|
|
|
}) |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(function () { |
|
|
|
return exportUserCustomer(queryParams); |
|
|
|
}).then(response => { |
|
|
|
this.download(response.msg); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|