|
@@ -13,7 +13,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="onSearch">查询</el-button>
|
|
|
+ <el-button type="primary" @click="search">查询</el-button>
|
|
|
<el-button type="primary" @click="resetSearch">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -28,16 +28,20 @@
|
|
|
<el-table-column prop="name" label="姓名"></el-table-column>
|
|
|
<el-table-column prop="nikeName" label="昵称"></el-table-column>
|
|
|
<el-table-column prop="phone" label="手机号"></el-table-column>
|
|
|
- <el-table-column prop="level" label="用户等级"></el-table-column>
|
|
|
- <el-table-column prop="status" label="状态">
|
|
|
+ <el-table-column prop="level" label="用户等级">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.status === "1" ? "启用" : "禁用" }}
|
|
|
+ {{ scope.row.level === "0" ? "员工" : "游客" }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <!-- <el-table-column prop="status" label="状态">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.status === "1" ? "启用" : "禁用" }}
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" @click="handleEdit(scope.$index, scope.row)"
|
|
|
- >编辑</el-button
|
|
|
+ >审核</el-button
|
|
|
>
|
|
|
<!-- <el-button
|
|
|
size="mini"
|
|
@@ -45,7 +49,7 @@
|
|
|
@click="handleToggleStatus(scope.$index, scope.row)">
|
|
|
{{ scope.row.status === '1' ? '禁用' : '启用' }}
|
|
|
</el-button> -->
|
|
|
- <el-button type="danger" @click="handleDel(scope.$index, scope.row)"
|
|
|
+ <el-button type="danger" @click="handleDel(scope.$index, scope.row)"
|
|
|
>删除</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -65,26 +69,30 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 编辑表单对话框 -->
|
|
|
- <el-dialog title="编辑信息" :visible.sync="dialogFormVisible">
|
|
|
+ <el-dialog title="审核信息" :visible.sync="dialogFormVisible">
|
|
|
<el-form :model="editForm">
|
|
|
+ <el-form-item label="微信名称" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="editForm.nikeName" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="姓名" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="editForm.name" autocomplete="off"></el-input>
|
|
|
+ <el-input v-model="editForm.name" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="年龄" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="editForm.age" autocomplete="off"></el-input>
|
|
|
+ <el-form-item label="手机号" :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="editForm.phone" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitEdit">确 定</el-button>
|
|
|
+ <el-button type="danger" @click="submitAudit(1)">不通过</el-button>
|
|
|
+ <el-button type="primary" @click="submitAudit(0)">通过</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {getInfoList,deleteUserInfo} from'@/api/applet'
|
|
|
-import { status } from 'nprogress';
|
|
|
+import { getInfoList, deleteUserInfo, toExamine } from "@/api/applet";
|
|
|
+import { status } from "nprogress";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -111,48 +119,10 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.search()
|
|
|
+ mounted() {
|
|
|
+ this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- async fetchData() {
|
|
|
- try {
|
|
|
- // 假设这是一个 API 调用
|
|
|
- const response = await this.$api.getUsers({
|
|
|
- page: this.pagination.currentPage,
|
|
|
- pageSize: this.pagination.pageSize,
|
|
|
- ...this.searchForm,
|
|
|
- });
|
|
|
- this.tableData = response.data;
|
|
|
- this.pagination.total = response.total;
|
|
|
- } catch (error) {
|
|
|
- this.$message.error("获取数据失败");
|
|
|
- }
|
|
|
- },
|
|
|
- handleSizeChange(val) {
|
|
|
- this.pagination.pageSize = val;
|
|
|
- this.fetchData();
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.pagination.currentPage = val;
|
|
|
- this.fetchData();
|
|
|
- },
|
|
|
- onSearch() {
|
|
|
- // 实现搜索逻辑
|
|
|
- console.log("搜索条件:", this.searchForm);
|
|
|
- // 这里应该调用API进行搜索,然后更新tableData
|
|
|
- },
|
|
|
- resetSearch() {
|
|
|
- this.searchForm = {
|
|
|
- name: "",
|
|
|
- status: "",
|
|
|
- };
|
|
|
- },
|
|
|
- handleEdit(index, row) {
|
|
|
- /* this.dialogFormVisible = true;
|
|
|
- this.editForm = { ...row };
|
|
|
- this.editIndex = index; */
|
|
|
- },
|
|
|
handleToggleStatus(index, row) {
|
|
|
// 切换状态
|
|
|
this.tableData[index].status = row.status === "1" ? "0" : "1";
|
|
@@ -170,32 +140,87 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/* 删除 */
|
|
|
- handleDel(row){
|
|
|
- let _this=this;
|
|
|
- let par={
|
|
|
- id:row.id,
|
|
|
- }
|
|
|
- _this.$confirm("您是否确认删除该记录?","提示",{
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- }).then((res)=>{
|
|
|
+ handleDel(index, row) {
|
|
|
+ let _this = this;
|
|
|
+ let par = {
|
|
|
+ id: row.id,
|
|
|
+ };
|
|
|
+ _this
|
|
|
+ .$confirm("您是否确认删除该记录?", "提示", {
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
// console.log("AAA")
|
|
|
- deleteUserInfo(par).then(res=>{
|
|
|
- _this.search();
|
|
|
- })
|
|
|
- }).catch(()=>{
|
|
|
+ deleteUserInfo(par).then((res) => {
|
|
|
+ _this.search();
|
|
|
+ });
|
|
|
})
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ const params = {
|
|
|
+ ...this.searchForm,
|
|
|
+ page: this.pagination.currentPage,
|
|
|
+ pageSize: this.pagination.pageSize,
|
|
|
+ };
|
|
|
+
|
|
|
+ getInfoList(params).then((res) => {
|
|
|
+ if (res.status !== 200) return;
|
|
|
+ this.tableData = res.data.dataList;
|
|
|
+ // 使用 Number() 函数确保 currentPage 是数字类型
|
|
|
+ this.pagination.currentPage = Number(res.data.page);
|
|
|
+ this.pagination.pageSize = Number(res.data.pageSize);
|
|
|
+ this.pagination.total = Number(res.data.totalRecord);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pagination.pageSize = val;
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.pagination.currentPage = val;
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+
|
|
|
+ resetSearch() {
|
|
|
+ this.searchForm = {
|
|
|
+ name: "",
|
|
|
+ status: "",
|
|
|
+ };
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ handleEdit(index, row) {
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ this.editForm = {
|
|
|
+ id: row.id,
|
|
|
+ name: row.name,
|
|
|
+ nikeName: row.nikeName,
|
|
|
+ phone: row.phone,
|
|
|
+ };
|
|
|
+ this.editIndex = index;
|
|
|
+ },
|
|
|
+ submitAudit(level) {
|
|
|
+ const data = { id: this.editForm.id, level: level };
|
|
|
+ toExamine(data)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ this.$message.success(
|
|
|
+ level === 0 ? "审核通过成功" : "审核不通过成功"
|
|
|
+ );
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ this.search();
|
|
|
+ } else {
|
|
|
+ this.$message.error("审核操作失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$message.error("审核操作失败:" + err.message);
|
|
|
+ });
|
|
|
},
|
|
|
- search(){
|
|
|
- getInfoList().then(res=>{
|
|
|
- if(res.status !==200) return
|
|
|
- this.tableData=res.data.dataList
|
|
|
- this.pagination.currentPage=res.data.page
|
|
|
- this.pagination.pageSize=res.data.pageSize
|
|
|
- this.pagination.total=res.data.totalRecord
|
|
|
- })
|
|
|
- }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -204,4 +229,8 @@ export default {
|
|
|
.search-list-form {
|
|
|
padding: 20px;
|
|
|
}
|
|
|
+.pagination-container {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
</style>
|