fix: 修改客户经纪

master
wx-jincw 9 months ago
parent 1d03f857b5
commit d55a68ed75

@ -60,3 +60,22 @@ export function exportClue(query) {
params: query
})
}
// 分页查询业务线索列表,访客归类
export function pageListClueVisitsNum(query) {
return request({
url: '/biz/clue/getVisitsNum',
method: 'get',
params: query
})
}
// 修改访客的经纪人
export function clueChangeUserId(data) {
return request({
url: '/biz/clue/changeUserId',
method: 'post',
data: data
})
}

@ -0,0 +1,185 @@
<template>
<el-dialog
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="dialogVisible"
:title="title"
append-to-body
>
<el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="100px">
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
clearable
@keyup.enter.native="handleQuery"
/>
</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>
</el-form-item>
</el-form>
<el-table ref="table" :data="list" style="width: 100%" highlight-current-row @selection-change="handleSelectionChange"
@select="handleSelect" @select-all="handleSelectAll" @row-click="rowClick" v-loading="loading">
<el-table-column type="" width="50" align="center">
<template slot-scope="scope">
<i v-if="scope.row.userId === selectionUserId" style="color: #1890ff;" class="el-icon-circle-check"></i>
</template>
</el-table-column>
<el-table-column label="用户名称" key="userName" prop="userName"
:show-overflow-tooltip="true" />
<el-table-column label="所属代理商" prop="deptName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="用户昵称" key="nickName" prop="nickName"
:show-overflow-tooltip="true"/>
<el-table-column label="城市" prop="city" />
<el-table-column label="手机号码" key="phonenumber" prop="phonenumber"
width="110"/>
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :disabled="!selectionUserId" @click="changeUser" >确认转入该经纪人</el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { clueChangeUserId } from "@/api/biz/clue";
import {
listUserByType
} from "@/api/system/user";
export default {
name: 'BrokerChange',
props: {
oldBroker: [String, Number]
},
data() {
return {
loading: false,
dialogVisible: false,
title: '转入经纪人选择',
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
userName: '',
userType: "jj",
phonenumber: '',
},
list: [],
selectionUserId: ''
}
},
methods: {
show() {
this.list = [];
this.dialogVisible = true;
this.getList();
},
cancel() {
this.dialogVisible = false
},
getList() {
this.loading = true;
listUserByType(this.queryParams).then(response => {
this.list = response.rows || [];
this.total = response.total;
this.loading = false;
}).catch(e => {
this.loading = false;
});
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
userName: '',
userType: "jj",
phonenumber: ''
};
this.getList();
},
rowClick(row) {
this.selectionUserId = row.userId;
},
// handleSelectionChange(sel) {
// // this.selection = sel || [];
// },
// handleSelect(row) {
// this.selection.forEach(val => {
// this.$refs.table.toggleRowSelection(val, false);
// });
// this.selection = [row];
// this.$nextTick(() => {
// // this.$refs.table.toggleRowSelection(row, true);
// // this.selection.forEach(val => {
// // if (row.userId !== val.userId) {
// // this.$nextTick(() => {
// // this.$refs.table.toggleRowSelection(val, false);
// // });
// // }
// // });
// // this.$nextTick(() => {
// // this.selection = [row];
// // })
// });
// },
// handleSelectAll() {
// //
// this.$refs.table.clearSelection();
// },
changeUser() {
if (this.selectionUserId && this.oldBroker) {
clueChangeUserId({
oldUserId: this.oldBroker,
newUserId: this.selectionUserId,
}).then(response => {
this.$emit('changeUser', this.selectionUserId);
this.cancel();
});
}
},
// getAllIds(data) {
// let ids = [];
// // id
// ids.push(data.id);
// // children children
// if (data.children && Array.isArray(data.children)) {
// // children
// data.children.forEach(child => {
// // getAllIds id ids
// ids = ids.concat(this.getAllIds(child));
// });
// }
// return ids;
// },
}
}
</script>
<style>
</style>

@ -48,66 +48,7 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
:disabled="!deptId"
v-hasPermi="['system:user:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:user:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:user:remove']"
>删除
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="info"-->
<!-- plain-->
<!-- icon="el-icon-upload2"-->
<!-- size="mini"-->
<!-- @click="handleImport"-->
<!-- v-hasPermi="['system:user:import']"-->
<!-- >导入</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:user:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @sort-change="handleSortChange" :height="tableHeight - 150"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center"/>
@ -145,7 +86,7 @@
<el-table-column
label="操作"
align="center"
width="160"
width="80"
class-name="small-padding fixed-width"
fixed="right"
>
@ -155,36 +96,8 @@
type="text"
icon="el-icon-view"
@click="handleRead(scope.row)"
>查看
>查看客户
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除
</el-button>
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)"
v-hasPermi="['system:user:resetPwd', 'system:user:edit']">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleResetPwd" icon="el-icon-key"
v-hasPermi="['system:user:resetPwd']">重置密码
</el-dropdown-item>
<el-dropdown-item command="handleAuthRole" icon="el-icon-circle-check"
v-hasPermi="['system:user:edit']">分配角色
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
@ -337,13 +250,14 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<ClientList ref="clientList"></ClientList>
</div>
</template>
<script>
import AutoTableHeight from '@/views/broker/AutoTableHeight';
import {listBrokerByTree} from "@/api/broker/broker";
import {listArea} from "@/api/system/area";
import ClientList from "./ClientList";
import {
listUserByType,
listUser,
@ -363,7 +277,7 @@ export default {
name: "BrokerUser",
mixins: [AutoTableHeight],
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: {Treeselect},
components: {Treeselect, ClientList},
props: {
rowData: {
type: Object,
@ -436,7 +350,7 @@ export default {
phonenumber: undefined,
status: undefined,
deptId: undefined,
userType: "kh",
userType: "jj",
deptIds: [],
},
//
@ -684,26 +598,27 @@ export default {
this.title = "添加用户";
this.readonly = false;
this.form.deptId = this.deptId;
this.form.userType = "kh"
this.form.userType = "jj"
this.form.password = this.initPassword;
this.form.registrationTime = new Date();
});
},
handleRead(row) {
this.getbrokerList();
this.reset();
const userId = row.userId || this.ids;
getUser(userId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.$set(this.form, "postIds", response.postIds);
this.$set(this.form, "roleIds", response.roleIds);
this.open = true;
this.readonly = true;
this.title = "修改用户";
this.form.password = "";
});
this.$refs.clientList.show(row);
// this.getbrokerList();
// this.reset();
// const userId = row.userId || this.ids;
// getUser(userId).then(response => {
// this.form = response.data;
// this.postOptions = response.posts;
// this.roleOptions = response.roles;
// this.$set(this.form, "postIds", response.postIds);
// this.$set(this.form, "roleIds", response.roleIds);
// this.open = true;
// this.readonly = true;
// this.title = "";
// this.form.password = "";
// });
},
/** 修改按钮操作 */
handleUpdate(row) {

@ -0,0 +1,101 @@
<template>
<el-dialog
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="dialogVisible"
:title="title"
>
<el-table
v-loading="loading" :data="list" style="width: 100%">
<el-table-column prop="avatarLink" label="头像" width="80">
<template slot-scope="scope">
<img :src="getAvatar(scope.row)" class="avatar" style="width: 40px; height: 40px; border-radius: 50%"/>
</template>
</el-table-column>
<el-table-column prop="nickName" label="姓名" width="180"></el-table-column>
<el-table-column prop="phone" label="电话" min-width="180"></el-table-column>
<!-- <el-table-column prop="address" label="地址"></el-table-column> -->
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="goChangeUser" >经纪人转移</el-button>
<el-button @click="cancel"> </el-button>
</div>
<BrokerChange ref="brokerChange" :oldBroker="queryParams.brokerId" @changeUser="changeUser"></BrokerChange>
</el-dialog>
</template>
<script>
import { pageListClueVisitsNum } from "@/api/biz/clue";
import BrokerChange from "./BrokerChange";
export default {
name: 'ClientList',
components: { BrokerChange },
data() {
return {
loading: false,
dialogVisible: false,
title: '经纪人客户',
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
hasOrder: '1',
dataType: '0',
brokerId: '',
},
list: [],
currentRow: {},
}
},
methods: {
show(row) {
this.currentRow = row || {};
this.list = [];
this.queryParams.brokerId = this.currentRow.userId;
this.dialogVisible = true;
this.getList();
},
cancel() {
this.dialogVisible = false
},
getAvatar(row) {
if (!row.avatarLink) {
return require("@/assets/images/profile.jpg");
}
if (row.avatarLink.indexOf('http') === 0) {
return row.avatarLink;
}
return process.env.VUE_APP_BASE_API + row.avatarLink;
},
getList() {
this.loading = true;
pageListClueVisitsNum(this.queryParams).then(response => {
this.list = response.rows || [];
this.total = response.total;
this.loading = false;
}).catch(e => {
this.loading = false;
});
},
goChangeUser() {
this.$refs.brokerChange.show();
},
changeUser() {
this.getList();
}
}
}
</script>
<style>
</style>
Loading…
Cancel
Save