客户管理的更改
This commit is contained in:
parent
40f08c6c79
commit
7183a5dd6b
@ -2,8 +2,7 @@
|
|||||||
<div class="system-dept-container layout-padding">
|
<div class="system-dept-container layout-padding">
|
||||||
<el-card shadow="hover" class="layout-padding-auto">
|
<el-card shadow="hover" class="layout-padding-auto">
|
||||||
<div class="system-dept-search mb15">
|
<div class="system-dept-search mb15">
|
||||||
<span>手机号:</span>
|
<el-input size="default" placeholder="请输入用户名称" v-model="state.tableData.param.username" class="ml10" style="max-width: 250px;margin-right: 20px;" clearable> </el-input>
|
||||||
<el-input size="default" placeholder="请输入" v-model="state.tableData.param.phone" class="ml10" style="max-width: 250px;margin-right: 20px;"> </el-input>
|
|
||||||
<el-button @click="getTableData" size="default" type="primary" class="ml10" style="margin-right: 15px;">
|
<el-button @click="getTableData" size="default" type="primary" class="ml10" style="margin-right: 15px;">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<ele-Search />
|
<ele-Search />
|
||||||
@ -29,13 +28,14 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" :selectable="selectable" width="55" />
|
<el-table-column type="selection" :selectable="selectable" width="100" />
|
||||||
<el-table-column prop="account" label="账户" show-overflow-tooltip width="255px"align="center"></el-table-column>
|
<el-table-column prop="username" label="账户" show-overflow-tooltipalign="center"></el-table-column>
|
||||||
<el-table-column prop="nickName" label="昵称" show-overflow-tooltip width="255px" align="center"></el-table-column>
|
<el-table-column prop="nickName" label="昵称" show-overflow-tooltip align="center"></el-table-column>
|
||||||
<el-table-column prop="phone" label="手机号" show-overflow-tooltip width="255px" align="center"></el-table-column>
|
<el-table-column prop="phone" label="手机号" show-overflow-tooltip align="center"></el-table-column>
|
||||||
<el-table-column prop="registerTime" label="注册时间" :formatter="dateFormatter" show-overflow-tooltip width="255px" align="center"></el-table-column>
|
<el-table-column prop="mail" label="邮箱" show-overflow-tooltip align="center"></el-table-column>
|
||||||
<el-table-column prop="state" label="状态" show-overflow-tooltip width="255px" align="center"></el-table-column>
|
<el-table-column prop="registerTime" label="注册时间" :formatter="dateFormatter" show-overflow-tooltip align="center"></el-table-column>
|
||||||
<el-table-column label="操作" width="350px" align="center">
|
<!-- <el-table-column prop="state" label="状态" show-overflow-tooltip width="255px" align="center"></el-table-column> -->
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" text type="primary" :disabled="scope.row.enable?true:false" @click="scope.row.enable=!scope.row.enable">启用</el-button>
|
<el-button size="small" text type="primary" :disabled="scope.row.enable?true:false" @click="scope.row.enable=!scope.row.enable">启用</el-button>
|
||||||
<el-button size="small" text type="primary" :disabled="scope.row.enable?false:true" @click="scope.row.enable=!scope.row.enable">禁用</el-button>
|
<el-button size="small" text type="primary" :disabled="scope.row.enable?false:true" @click="scope.row.enable=!scope.row.enable">禁用</el-button>
|
||||||
@ -126,6 +126,9 @@ import { Delete, Download, Plus, ZoomIn } from '@element-plus/icons-vue'
|
|||||||
import type { ComponentSize, FormInstance, FormRules, UploadFile, UploadProps, UploadUserFile } from 'element-plus'
|
import type { ComponentSize, FormInstance, FormRules, UploadFile, UploadProps, UploadUserFile } from 'element-plus'
|
||||||
import { baseUrlHost } from '../../api/baseUrlHost';
|
import { baseUrlHost } from '../../api/baseUrlHost';
|
||||||
import { clientsApi } from '/@/api/clients';
|
import { clientsApi } from '/@/api/clients';
|
||||||
|
import { userApi } from '/@/api/user';
|
||||||
|
|
||||||
|
const userapi = userApi();
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
{
|
{
|
||||||
@ -147,7 +150,8 @@ const state = reactive({
|
|||||||
total: 0,
|
total: 0,
|
||||||
loading: false,
|
loading: false,
|
||||||
param: {
|
param: {
|
||||||
phone:'',
|
username:'',
|
||||||
|
usertype:2,
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
},
|
},
|
||||||
@ -181,10 +185,17 @@ const clientApi = clientsApi();
|
|||||||
const getTableData = async() => {
|
const getTableData = async() => {
|
||||||
try {
|
try {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
let res = await clientApi.getClientsList(state.tableData.param);
|
let res = await userapi.getUserList(state.tableData.param);
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
if(res?.success){
|
if(res?.success){
|
||||||
state.tableData.data = res.data.records;
|
state.tableData.data = res.data.records.map((item:any) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
nickName:item.nickName || '暂无',
|
||||||
|
phone: item.phone || '暂无',
|
||||||
|
mail: item.mail || '暂无',
|
||||||
|
}
|
||||||
|
});
|
||||||
state.tableData.total = res.data.total;
|
state.tableData.total = res.data.total;
|
||||||
}else{
|
}else{
|
||||||
ElMessage.error('客户列表获取失败!');
|
ElMessage.error('客户列表获取失败!');
|
||||||
@ -221,7 +232,8 @@ const switchState = (scope,staus) => {
|
|||||||
// 重置
|
// 重置
|
||||||
const reset = () =>{
|
const reset = () =>{
|
||||||
state.tableData.param = {
|
state.tableData.param = {
|
||||||
name: '',
|
username: '',
|
||||||
|
usertype:2,
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user