客户关系添加分配功能
This commit is contained in:
@ -3,134 +3,142 @@ import { praseStrEmpty } from "@/utils/ruoyi";
|
||||
|
||||
// 查询用户列表
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户详细
|
||||
export function getUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + praseStrEmpty(userId),
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/' + praseStrEmpty(userId),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户列表根据roleId
|
||||
export function getUsersByRoleId() {
|
||||
return request({
|
||||
url: '/system/user/listbyroleid',
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/listbyroleid',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据roleid查询用户列表
|
||||
export function getUserOnlyByRoleId(roleId) {
|
||||
return request({
|
||||
url: '/system/user/onlybyroleid/' + roleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 新增用户
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/system/user',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
export function delUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + userId,
|
||||
method: 'delete'
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/' + userId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出用户
|
||||
export function exportUser(query) {
|
||||
return request({
|
||||
url: '/system/user/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd(userId, password) {
|
||||
const data = {
|
||||
userId,
|
||||
password
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/resetPwd',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
const data = {
|
||||
userId,
|
||||
password
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/resetPwd',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus(userId, status) {
|
||||
const data = {
|
||||
userId,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
const data = {
|
||||
userId,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) {
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/avatar',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/profile/avatar',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 下载用户导入模板
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/system/user/importTemplate',
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: '/system/user/importTemplate',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
@ -122,6 +122,15 @@
|
||||
v-hasPermi="['benyi:customer:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-s-custom"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate_fp"
|
||||
v-hasPermi="['benyi:customer:edit']"
|
||||
>分配</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@ -191,6 +200,7 @@
|
||||
/>
|
||||
<el-table-column label="录入时间" align="center" prop="createTime" />
|
||||
<el-table-column label="过保时间" align="center" prop="gbtime" />
|
||||
<el-table-column label="已分配给" align="center" prop="fpid" :formatter="userByRoleFormat" />
|
||||
<el-table-column
|
||||
label="转换跟进"
|
||||
show-overflow-tooltip
|
||||
@ -350,6 +360,30 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加或修改本一-客户关系管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open_fp" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分配给" prop="fpid">
|
||||
<el-select v-model="form.fpid" placeholder="请选择分配给哪个管理员">
|
||||
<el-option
|
||||
v-for="dict in customerUserOptions"
|
||||
:key="dict.userId"
|
||||
:label="dict.nickName"
|
||||
:value="dict.userId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -362,7 +396,7 @@ import {
|
||||
updateCustomer,
|
||||
exportCustomer,
|
||||
} from "@/api/benyi/customer";
|
||||
import { listUser } from "@/api/system/user";
|
||||
import { listUser, getUserOnlyByRoleId } from "@/api/system/user";
|
||||
import { provinceAndCityDataPlus, CodeToText } from "element-china-area-data";
|
||||
|
||||
export default {
|
||||
@ -386,10 +420,16 @@ export default {
|
||||
customerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// roleId
|
||||
roleId: 108,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
open_fp: false,
|
||||
gxOptions: [],
|
||||
lyOptions: [],
|
||||
roleId: 108,
|
||||
// 角色找人选项
|
||||
customerUserOptions: [],
|
||||
// 用户选项
|
||||
userOptions: [],
|
||||
|
||||
@ -401,6 +441,8 @@ export default {
|
||||
pageSize: 50,
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@ -430,6 +472,7 @@ export default {
|
||||
xfxm: undefined,
|
||||
xfjz: undefined,
|
||||
gbtime: undefined,
|
||||
fpid: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -456,6 +499,7 @@ export default {
|
||||
this.lyOptions = response.data;
|
||||
});
|
||||
this.getUserList();
|
||||
this.getUsersByRole();
|
||||
},
|
||||
methods: {
|
||||
//排序
|
||||
@ -477,6 +521,24 @@ export default {
|
||||
this.userOptions = response.rows;
|
||||
});
|
||||
},
|
||||
/** 根据roleid查询用户列表 */
|
||||
getUsersByRole() {
|
||||
getUserOnlyByRoleId(this.roleId).then((response) => {
|
||||
this.customerUserOptions = response.data;
|
||||
});
|
||||
},
|
||||
// 通过roleid查询的教师字典翻译
|
||||
userByRoleFormat(row, column) {
|
||||
var actions = [];
|
||||
var datas = this.customerUserOptions;
|
||||
Object.keys(datas).map((key) => {
|
||||
if (datas[key].userId == "" + row.fpid) {
|
||||
actions.push(datas[key].nickName);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return actions.join("");
|
||||
},
|
||||
// 教师字典翻译
|
||||
userFormat(row, column) {
|
||||
var actions = [];
|
||||
@ -516,6 +578,7 @@ export default {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.open_fp = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
@ -544,6 +607,7 @@ export default {
|
||||
createTime: undefined,
|
||||
createTime: undefined,
|
||||
gbtime: undefined,
|
||||
fpid: undefined,
|
||||
};
|
||||
this.selectedOptions = new Array();
|
||||
this.resetForm("form");
|
||||
@ -582,6 +646,16 @@ export default {
|
||||
this.title = "修改本一-客户关系管理";
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate_fp(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getCustomer(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open_fp = true;
|
||||
this.title = "分配客户";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
@ -591,6 +665,7 @@ export default {
|
||||
if (response.code === 200) {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.open_fp = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
|
@ -43,6 +43,7 @@ public class ByCustomerController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('benyi:customer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ByCustomer byCustomer) {
|
||||
byCustomer.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
startPage();
|
||||
List<ByCustomer> list = byCustomerService.selectByCustomerList(byCustomer);
|
||||
return getDataTable(list);
|
||||
@ -112,15 +113,25 @@ public class ByCustomerController extends BaseController {
|
||||
@Log(title = "本一-客户关系管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ByCustomer byCustomer) {
|
||||
if (byCustomer.getZhgj().equals("") || byCustomer.getZhgj().equals(null)) {
|
||||
|
||||
if (byCustomer.getZhgj() != null) {
|
||||
byCustomer.setZhgj(byCustomer.getZhgj());
|
||||
}else {
|
||||
byCustomer.setZhgj("无");
|
||||
}
|
||||
if (byCustomer.getBz().equals("") || byCustomer.getBz().equals(null)) {
|
||||
byCustomer.setBz("无");
|
||||
}
|
||||
if (byCustomer.getXfxm().equals("") || byCustomer.getXfxm().equals(null)) {
|
||||
|
||||
if (byCustomer.getXfxm() != null) {
|
||||
byCustomer.setXfxm(byCustomer.getXfxm());
|
||||
}else {
|
||||
byCustomer.setXfxm("无");
|
||||
}
|
||||
|
||||
if (byCustomer.getBz() != null) {
|
||||
byCustomer.setBz(byCustomer.getBz());
|
||||
}else {
|
||||
byCustomer.setBz("无");
|
||||
}
|
||||
|
||||
return toAjax(byCustomerService.updateByCustomer(byCustomer));
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,9 @@ public class ByCustomer extends BaseEntity {
|
||||
//@Excel(name = "创建人", type = Excel.Type.EXPORT, targetAttr = "user_name")
|
||||
private Long createUserid;
|
||||
|
||||
// 被分配者
|
||||
private Long fpid;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ -336,6 +339,7 @@ public class ByCustomer extends BaseEntity {
|
||||
.append("xfjz", getXfjz())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("gbtime", getGbtime())
|
||||
.append("fpid", getFpid())
|
||||
.toString();
|
||||
}
|
||||
|
||||
@ -355,4 +359,12 @@ public class ByCustomer extends BaseEntity {
|
||||
public void setGbtime(Date gbtime) {
|
||||
this.gbtime = gbtime;
|
||||
}
|
||||
|
||||
public Long getFpid() {
|
||||
return fpid;
|
||||
}
|
||||
|
||||
public void setFpid(Long fpid) {
|
||||
this.fpid = fpid;
|
||||
}
|
||||
}
|
||||
|
@ -170,6 +170,18 @@ public class SysUserController extends BaseController {
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据roleId获取用户信息列表
|
||||
*/
|
||||
//@PreAuthorize("@ss.hasPermi('system:user:query')")
|
||||
@GetMapping(value = {"/onlybyroleid/{roleId}"})
|
||||
public AjaxResult getUserOnlyByRoleId(@PathVariable Long roleId) {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
List<SysUser> list = userService.selectUserOnlyByRoleId(roleId);
|
||||
ajax.put(AjaxResult.DATA_TAG, list);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
|
@ -56,11 +56,19 @@ public interface SysUserMapper
|
||||
/**
|
||||
* 根据roleId查询用户列表
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectUserListByRoleId(SysUser user);
|
||||
|
||||
/**
|
||||
* 根据roleId查询用户列表
|
||||
*
|
||||
* @param roleId 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectUserOnlyByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 新增用户信息
|
||||
*
|
||||
|
@ -59,6 +59,14 @@ public interface ISysUserService
|
||||
*/
|
||||
public List<SysUser> selectUserListByRoleId(SysUser user);
|
||||
|
||||
/**
|
||||
* 根据roleId查询用户列表
|
||||
*
|
||||
* @param roleId 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectUserOnlyByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询用户所属角色组
|
||||
*
|
||||
|
@ -114,6 +114,19 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
return userMapper.selectUserListByRoleId(sysUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据roleId查询用户列表
|
||||
*
|
||||
* @param roleId 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysUser> selectUserOnlyByRoleId(Long roleId) {
|
||||
return userMapper.selectUserOnlyByRoleId(roleId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户所属角色组
|
||||
*
|
||||
|
@ -20,6 +20,7 @@
|
||||
<result property="shiid" column="shiid"/>
|
||||
<result property="khly" column="khly"/>
|
||||
<result property="createUserid" column="create_userid"/>
|
||||
<result property="fpid" column="fpid"/>
|
||||
<result property="bz" column="bz"/>
|
||||
<result property="zhgj" column="zhgj"/>
|
||||
<result property="state" column="state"/>
|
||||
@ -30,7 +31,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectByCustomerVo">
|
||||
select id, name, sflx, lxdh, wx, dy, qt, schoolname, rs, sheng, shengid, shi, shiid, khly, create_userid, bz, zhgj, state, xfxm, xfjz, gbtime, create_time from by_customer
|
||||
select id, name, sflx, lxdh, wx, dy, qt, fpid, schoolname, rs, sheng, shengid, shi, shiid, khly, create_userid, bz, zhgj, state, xfxm, xfjz, gbtime, create_time from by_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectByCustomerList" parameterType="ByCustomer" resultMap="ByCustomerResult">
|
||||
@ -49,7 +50,8 @@
|
||||
<if test="shi != null and shi != ''">and shi = #{shi}</if>
|
||||
<if test="shiid != null and shiid != ''">and shiid = #{shiid}</if>
|
||||
<if test="khly != null and khly != ''">and khly = #{khly}</if>
|
||||
<if test="createUserid != null ">and create_userid = #{createUserid}</if>
|
||||
<if test="createUserid != null ">and create_userid = #{createUserid} or fpid = #{createUserid}</if>
|
||||
<if test="fpid != null ">and fpid = #{fpid}</if>
|
||||
<if test="bz != null and bz != ''">and bz = #{bz}</if>
|
||||
<if test="zhgj != null and zhgj != ''">and zhgj = #{zhgj}</if>
|
||||
<if test="state != null and state != ''">and state = #{state}</if>
|
||||
@ -83,6 +85,7 @@
|
||||
<if test="shiid != null and shiid != ''">shiid,</if>
|
||||
<if test="khly != null and khly != ''">khly,</if>
|
||||
<if test="createUserid != null ">create_userid,</if>
|
||||
<if test="fpid != null ">fpid,</if>
|
||||
<if test="bz != null and bz != ''">bz,</if>
|
||||
<if test="zhgj != null and zhgj != ''">zhgj,</if>
|
||||
<if test="state != null and state != ''">state,</if>
|
||||
@ -107,6 +110,7 @@
|
||||
<if test="shiid != null and shiid != ''">#{shiid},</if>
|
||||
<if test="khly != null and khly != ''">#{khly},</if>
|
||||
<if test="createUserid != null ">#{createUserid},</if>
|
||||
<if test="fpid != null ">#{fpid},</if>
|
||||
<if test="bz != null and bz != ''">#{bz},</if>
|
||||
<if test="zhgj != null and zhgj != ''">#{zhgj},</if>
|
||||
<if test="state != null and state != ''">#{state},</if>
|
||||
@ -134,6 +138,7 @@
|
||||
<if test="shiid != null and shiid != ''">shiid = #{shiid},</if>
|
||||
<if test="khly != null and khly != ''">khly = #{khly},</if>
|
||||
<if test="createUserid != null ">create_userid = #{createUserid},</if>
|
||||
<if test="fpid != null ">fpid = #{fpid},</if>
|
||||
<if test="bz != null and bz != ''">bz = #{bz},</if>
|
||||
<if test="zhgj != null and zhgj != ''">zhgj = #{zhgj},</if>
|
||||
<if test="state != null and state != ''">state = #{state},</if>
|
||||
|
@ -137,6 +137,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectUserOnlyByRoleId" parameterType="Long" resultMap="SysUserResult">
|
||||
select * FROM sys_user where del_flag = '0' and user_id in (select user_id from sys_user_role where role_id = #{roleId});
|
||||
</select>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
||||
select count(1) from sys_user where user_name = #{userName}
|
||||
</select>
|
||||
|
Reference in New Issue
Block a user