Commit f100f654 authored by 沈翠玲's avatar 沈翠玲

法务专员和风控专员

parent a2426bb6
import request from '@/utils/http/index'; import request from '@/utils/http/index';
function jsonToUrlParam(json) {
return Object.keys(json).map(key => key + '=' + json[key]).join('&');
}
export const saveUser = (data) => { export const saveUser = (data) => {
return request.post('/user/save', data); return request.post('/user/save', data);
}; };
...@@ -12,7 +14,7 @@ export const deleteUsers = (ids) => { ...@@ -12,7 +14,7 @@ export const deleteUsers = (ids) => {
return request.get('/user/batchDeleteByIds', { ids }); return request.get('/user/batchDeleteByIds', { ids });
}; };
export const saveLeaderGroup = (data) => { export const saveLeaderGroup = (data) => {
return request.post(`/leaderGroup/add?username=${data.username}&password=${data.password}&phone=${data.phone}&status=${data.status}&role=${data.role}`); return request.post(`/leaderGroup/add?${jsonToUrlParam(data)}`);
}; };
export const getleaderGroupPage = (params) => { export const getleaderGroupPage = (params) => {
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
showModal.value = false; showModal.value = false;
}; };
const openModal = (account) => { const openModal = (account) => {
account && (form.value = account); account && (form.value = account.staff);
getDefualtRoles().then((res) => { getDefualtRoles().then((res) => {
options.value = res.result; options.value = res.result;
}); });
......
...@@ -45,41 +45,11 @@ ...@@ -45,41 +45,11 @@
columns: [ columns: [
{ type: 'checkbox', width: 60, fixed: 'left' }, { type: 'checkbox', width: 60, fixed: 'left' },
{ field: 'leader.username', width: 110, title: '领导用户名称', search: { el: 'input', labelWidth: 85 } }, { field: 'leader.username', width: 110, title: '领导用户名称', search: { el: 'input', labelWidth: 85 } },
{ field: 'leader.phone', title: '领导手机号', search: { el: 'input', labelWidth: 85 } },
{ field: 'staff.username', width: 110, title: '员工用户名称', search: { el: 'input', labelWidth: 85 } }, { field: 'staff.username', width: 110, title: '员工用户名称', search: { el: 'input', labelWidth: 85 } },
{
showOverflow: 'tooltip',
slots: {
default: ({ row }) => {
return (
<>{Array.from(new Set(row.staff.tenantNames)).join(',')}</>
);
},
},
field: 'tenantNames',
enum: Tenantlist,
search: { el: 'select', props: { filterable: true }, key: 'tenantId', labelWidth: 85 },
fieldNames: { label: 'name', value: 'id' },
title: '员工调解中心'
},
{
showOverflow: 'tooltip',
slots: {
default: ({ row }) => {
return (
<>{Array.from(new Set(row.staff.roleNames)).join(',')}</>
);
},
},
field: 'role',
enum: Rolelist,
search: { el: 'select', props: { filterable: true }, key: 'roleCode', labelWidth: 85 },
fieldNames: { label: 'roleName', value: 'roleCode' },
title: '员工角色'
},
{ {
field: 'staff.phone', field: 'staff.phone',
title: '员工手机号', title: '员工手机号',
width: 160,
search: { el: 'input', props: { clearable: true }, labelWidth: 85 }, search: { el: 'input', props: { clearable: true }, labelWidth: 85 },
}, },
{ {
...@@ -91,8 +61,8 @@ ...@@ -91,8 +61,8 @@
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
return ( return (
<ElTag type={row.status == 'enable' ? 'primary' : 'danger'}> <ElTag type={row.staff.status == 'enable' ? 'primary' : 'danger'}>
{row.status == 'enable' ? '启用' : '禁用'} {row.staff.status == 'enable' ? '启用' : '禁用'}
</ElTag> </ElTag>
); );
}, },
...@@ -103,11 +73,6 @@ ...@@ -103,11 +73,6 @@
title: '员工创建时间', title: '员工创建时间',
width: 170, width: 170,
}, },
{
field: 'staff.updateTime',
title: '员工更新时间',
width: 170,
},
{ {
field: 'action', field: 'action',
title: '操作', title: '操作',
...@@ -121,7 +86,7 @@ ...@@ -121,7 +86,7 @@
编辑 编辑
</ElButton> </ElButton>
<ElButton link type="primary" icon={Edit} onClick={() => handleDisable(row)}> <ElButton link type="primary" icon={Edit} onClick={() => handleDisable(row)}>
{row.status == 'enable' ? '禁用' : '启用'} {row.staff.status == 'enable' ? '禁用' : '启用'}
</ElButton> </ElButton>
</> </>
); );
...@@ -154,7 +119,7 @@ ...@@ -154,7 +119,7 @@
const editAccount = (row) => accountFormModalRef.value.openModal(JSON.parse(JSON.stringify(row))); const editAccount = (row) => accountFormModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
const handleDisable = async (row) => { const handleDisable = async (row) => {
await ElMessageBox.confirm( await ElMessageBox.confirm(
`是否确认${row.status == 'enable' ? '禁用' : '启用'}该用户?`, `是否确认${row.staff.status == 'enable' ? '禁用' : '启用'}该用户?`,
'提示', '提示',
{ {
confirmButtonText: '确认', confirmButtonText: '确认',
...@@ -164,13 +129,12 @@ ...@@ -164,13 +129,12 @@
); );
// 修改的状态 // 修改的状态
const status = row.status === 'enable' ? 'disable' : 'enable'; const status = row.staff.status === 'enable' ? 'disable' : 'enable';
await saveLeaderGroup({ await saveLeaderGroup({
...row, ...row.staff,
status, status
}); });
row.staff.status = status;
row.status = status;
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: `${status == 'enable' ? '启用' : '禁用'}成功!`, message: `${status == 'enable' ? '启用' : '禁用'}成功!`,
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
showModal.value = false; showModal.value = false;
}; };
const openModal = (account) => { const openModal = (account) => {
account && (form.value = account); account && (form.value = account.staff);
getDefualtRoles().then((res) => { getDefualtRoles().then((res) => {
options.value = res.result; options.value = res.result;
}); });
......
...@@ -45,41 +45,11 @@ ...@@ -45,41 +45,11 @@
columns: [ columns: [
{ type: 'checkbox', width: 60, fixed: 'left' }, { type: 'checkbox', width: 60, fixed: 'left' },
{ field: 'leader.username', width: 110, title: '领导用户名称', search: { el: 'input', labelWidth: 85 } }, { field: 'leader.username', width: 110, title: '领导用户名称', search: { el: 'input', labelWidth: 85 } },
{ field: 'leader.phone', title: '领导手机号', search: { el: 'input', labelWidth: 85 } },
{ field: 'staff.username', width: 110, title: '员工用户名称', search: { el: 'input', labelWidth: 85 } }, { field: 'staff.username', width: 110, title: '员工用户名称', search: { el: 'input', labelWidth: 85 } },
{
showOverflow: 'tooltip',
slots: {
default: ({ row }) => {
return (
<>{Array.from(new Set(row.staff.tenantNames)).join(',')}</>
);
},
},
field: 'tenantNames',
enum: Tenantlist,
search: { el: 'select', props: { filterable: true }, key: 'tenantId', labelWidth: 85 },
fieldNames: { label: 'name', value: 'id' },
title: '员工调解中心'
},
{
showOverflow: 'tooltip',
slots: {
default: ({ row }) => {
return (
<>{Array.from(new Set(row.staff.roleNames)).join(',')}</>
);
},
},
field: 'role',
enum: Rolelist,
search: { el: 'select', props: { filterable: true }, key: 'roleCode', labelWidth: 85 },
fieldNames: { label: 'roleName', value: 'roleCode' },
title: '员工角色'
},
{ {
field: 'staff.phone', field: 'staff.phone',
title: '员工手机号', title: '员工手机号',
width: 160,
search: { el: 'input', props: { clearable: true }, labelWidth: 85 }, search: { el: 'input', props: { clearable: true }, labelWidth: 85 },
}, },
{ {
...@@ -91,8 +61,8 @@ ...@@ -91,8 +61,8 @@
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
return ( return (
<ElTag type={row.status == 'enable' ? 'primary' : 'danger'}> <ElTag type={row.staff.status == 'enable' ? 'primary' : 'danger'}>
{row.status == 'enable' ? '启用' : '禁用'} {row.staff.status == 'enable' ? '启用' : '禁用'}
</ElTag> </ElTag>
); );
}, },
...@@ -103,11 +73,6 @@ ...@@ -103,11 +73,6 @@
title: '员工创建时间', title: '员工创建时间',
width: 170, width: 170,
}, },
{
field: 'staff.updateTime',
title: '员工更新时间',
width: 170,
},
{ {
field: 'action', field: 'action',
title: '操作', title: '操作',
...@@ -121,7 +86,7 @@ ...@@ -121,7 +86,7 @@
编辑 编辑
</ElButton> </ElButton>
<ElButton link type="primary" icon={Edit} onClick={() => handleDisable(row)}> <ElButton link type="primary" icon={Edit} onClick={() => handleDisable(row)}>
{row.status == 'enable' ? '禁用' : '启用'} {row.staff.status == 'enable' ? '禁用' : '启用'}
</ElButton> </ElButton>
</> </>
); );
...@@ -154,7 +119,7 @@ ...@@ -154,7 +119,7 @@
const editAccount = (row) => accountFormModalRef.value.openModal(JSON.parse(JSON.stringify(row))); const editAccount = (row) => accountFormModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
const handleDisable = async (row) => { const handleDisable = async (row) => {
await ElMessageBox.confirm( await ElMessageBox.confirm(
`是否确认${row.status == 'enable' ? '禁用' : '启用'}该用户?`, `是否确认${row.staff.status == 'enable' ? '禁用' : '启用'}该用户?`,
'提示', '提示',
{ {
confirmButtonText: '确认', confirmButtonText: '确认',
...@@ -164,13 +129,12 @@ ...@@ -164,13 +129,12 @@
); );
// 修改的状态 // 修改的状态
const status = row.status === 'enable' ? 'disable' : 'enable'; const status = row.staff.status === 'enable' ? 'disable' : 'enable';
await saveLeaderGroup({ await saveLeaderGroup({
...row, ...row.staff,
status, status
}); });
row.staff.status = status;
row.status = status;
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: `${status == 'enable' ? '启用' : '禁用'}成功!`, message: `${status == 'enable' ? '启用' : '禁用'}成功!`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment