Commit 6decb858 authored by 沈翠玲's avatar 沈翠玲

法务专员和风控专员

parent 5c5357dd
...@@ -11,3 +11,14 @@ export const getUserPage = (params) => { ...@@ -11,3 +11,14 @@ export const getUserPage = (params) => {
export const deleteUsers = (ids) => { export const deleteUsers = (ids) => {
return request.get('/login/batchDeleteByIds', { ids }); return request.get('/login/batchDeleteByIds', { ids });
}; };
export const saveLeaderGroup = (data) => {
return request.post(`/leaderGroup/add?username=${data.username}&password=${data.password}&phone=${data.phone}&status=${data.status}&role=${data.role}`);
};
export const getleaderGroupPage = (params) => {
return request.get('/leaderGroup/page', params);
};
export const batchDeleteByIds = (ids) => {
return request.get('/leaderGroup/batchDeleteByIds', { ids });
};
\ No newline at end of file
...@@ -243,10 +243,20 @@ ...@@ -243,10 +243,20 @@
} }
.dataScreen-main-title { .dataScreen-main-title {
position: absolute; position: absolute;
top: 1px; top: 10px;
left: 0; left: 0;
z-index: 99;
box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; align-items: center;
width: 270px;
height: 25px;
padding-left: 30px;
font-size: 14px;
color: #ffffff;
letter-spacing: 5px;
background: url("./images/map-title-bg.png") no-repeat;
background-size: 100% 100%;
span { span {
margin-bottom: 12px; margin-bottom: 12px;
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
...@@ -255,10 +265,6 @@ ...@@ -255,10 +265,6 @@
color: #ffffff; color: #ffffff;
letter-spacing: 1px; letter-spacing: 1px;
} }
img {
width: 68px;
height: 7px;
}
} }
.dataScreen-main-chart { .dataScreen-main-chart {
width: 100%; width: 100%;
......
...@@ -18,26 +18,23 @@ ...@@ -18,26 +18,23 @@
<div class="dataScreen-lf"> <div class="dataScreen-lf">
<div class="dataScreen-top"> <div class="dataScreen-top">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>实时在案案人统计</span> 实时在案案人统计
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<RealTimeAccessChart /> <!-- <RealTimeAccessChart /> -->
</div> </div>
</div> </div>
<div class="dataScreen-center"> <div class="dataScreen-center">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>案人性别比例</span> 案人性别比例
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<MaleFemaleRatioChart /> <!-- <MaleFemaleRatioChart /> -->
</div> </div>
</div> </div>
<div class="dataScreen-bottom"> <div class="dataScreen-bottom">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>案人年龄比例</span> 案人年龄比例
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<AgeRatioChart /> <AgeRatioChart />
...@@ -71,8 +68,7 @@ ...@@ -71,8 +68,7 @@
</div> </div>
<div class="dataScreen-cb"> <div class="dataScreen-cb">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>历史30天调解催记趋势</span> 历史30天调解催记趋势
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<OverNext30Chart /> <OverNext30Chart />
...@@ -82,8 +78,7 @@ ...@@ -82,8 +78,7 @@
<div class="dataScreen-rg"> <div class="dataScreen-rg">
<div class="dataScreen-top"> <div class="dataScreen-top">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>调解中心案件量排名</span> 调解中心案件量排名
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<HotPlateChart /> <HotPlateChart />
...@@ -91,8 +86,7 @@ ...@@ -91,8 +86,7 @@
</div> </div>
<div class="dataScreen-center"> <div class="dataScreen-center">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>年度案件量对比</span> 年度案件量对比
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<AnnualUseChart /> <AnnualUseChart />
...@@ -100,8 +94,7 @@ ...@@ -100,8 +94,7 @@
</div> </div>
<div class="dataScreen-bottom"> <div class="dataScreen-bottom">
<div class="dataScreen-main-title"> <div class="dataScreen-main-title">
<span>案源数据统计</span> 案源数据统计
<img src="./images/dataScreen-title.png" alt="" />
</div> </div>
<div class="dataScreen-main-chart"> <div class="dataScreen-main-chart">
<PlatformSourceChart /> <PlatformSourceChart />
......
...@@ -109,9 +109,10 @@ ...@@ -109,9 +109,10 @@
import addModel from './components/addModel.vue'; import addModel from './components/addModel.vue';
import { useDict } from '@/hooks/useDict'; import { useDict } from '@/hooks/useDict';
import { useAuthStore } from '@/stores/modules/auth'; import { useAuthStore } from '@/stores/modules/auth';
import { useUserStore } from '@/stores/modules/user';
const activeName = ref('created'); const activeName = ref('created');
const userStore = useUserStore();
const { authButtonListGet } = useAuthStore(); // 获取用户权限列表 const { authButtonListGet } = useAuthStore(); // 获取用户权限列表
const { PaymentForm, ContractStatus, FlowStatus } = useDict("PaymentForm", "ContractStatus", "FlowStatus"); const { PaymentForm, ContractStatus, FlowStatus } = useDict("PaymentForm", "ContractStatus", "FlowStatus");
const addModelRef = ref() const addModelRef = ref()
...@@ -294,7 +295,7 @@ ...@@ -294,7 +295,7 @@
default({ row }) { default({ row }) {
return ( return (
<> <>
<ElButton type="primary" link onClick={() => addConstant(row, true)} disabled={row.legalFlowStatus=== 'pass' && row.financeFlowStatus === 'pass'}> <ElButton type="primary" link onClick={() => addConstant(row, true)} v-show={row.createBy === userStore.userInfo.id} disabled={row.legalFlowStatus=== 'pass' && row.financeFlowStatus === 'pass'}>
修改 修改
</ElButton> </ElButton>
<ElButton type="primary" link onClick={() => apply(row, 'finance')} v-show={authButtonListGet.includes('finance_apply')} disabled={row.legalFlowStatus || row.financeFlowStatus === 'pass'}> <ElButton type="primary" link onClick={() => apply(row, 'finance')} v-show={authButtonListGet.includes('finance_apply')} disabled={row.legalFlowStatus || row.financeFlowStatus === 'pass'}>
......
...@@ -128,17 +128,15 @@ ...@@ -128,17 +128,15 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="label" rowspan="2">个人及夫妻名下车辆</td> <td class="label">个人及夫妻名下车辆数量</td>
<td class="label">数量</td> <td colspan="2"><el-input class="line-input" v-model="form.carNum" placeholder="" /></td>
<td ><el-input class="line-input" v-model="form.carNum" placeholder="" /></td> <td class="label">个人及夫妻名下房产数量</td>
<td class="label" rowspan="2">个人及夫妻名下房产</td> <td colspan="2"><el-input class="line-input" v-model="form.houseNum" placeholder="" /></td>
<td class="label">数量</td>
<td ><el-input class="line-input" v-model="form.houseNum" placeholder="" /></td>
</tr> </tr>
<tr> <tr>
<td class="label">总价值</td> <td class="label">个人及夫妻名下车辆总价值</td>
<td><el-input class="line-input" v-model="form.carPrice" placeholder="" /></td> <td colspan="2"><el-input class="line-input" v-model="form.carPrice" placeholder="" /></td>
<td class="label">总价值</td> <td class="label">个人及夫妻名下房产总价值</td>
<td colspan="2"><el-input class="line-input" v-model="form.housePrice" placeholder="" /></td> <td colspan="2"><el-input class="line-input" v-model="form.housePrice" placeholder="" /></td>
</tr> </tr>
<tr> <tr>
...@@ -438,8 +436,8 @@ const handleQuery = () => { ...@@ -438,8 +436,8 @@ const handleQuery = () => {
} }
getDebtInfo(form.value.idCard).then(res => { getDebtInfo(form.value.idCard).then(res => {
if(res.result) { if(res.result) {
res.result.creditCard = res.result.creditCard || [] res.result.creditCard = []
res.result.lending = res.result.lending || [] res.result.lending = []
form.value = res.result form.value = res.result
cardConfig.data = res.result.creditCard cardConfig.data = res.result.creditCard
creditArr.value = res.result.lending creditArr.value = res.result.lending
......
...@@ -26,9 +26,11 @@ ...@@ -26,9 +26,11 @@
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { ElButton, ElMessageBox, ElMessage, ElTag } from 'element-plus'; import { ElButton, ElMessageBox, ElMessage, ElTag } from 'element-plus';
import { getUserPage, saveUser, deleteUsers } from '@/api/user'; import { getUserPage, saveUser, deleteUsers } from '@/api/user';
import { useDict } from '@/hooks/useDict';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { getTenantPage } from '@/api/tenant'; import { getTenantPage } from '@/api/tenant';
import { getRolePage } from '@/api/role'; import { getRolePage } from '@/api/role';
const { Status } = useDict("Status");
const proTable = ref(); const proTable = ref();
const accountFormModalRef = ref(); const accountFormModalRef = ref();
...@@ -78,6 +80,7 @@ ...@@ -78,6 +80,7 @@
field: 'status', field: 'status',
title: '状态', title: '状态',
width: 100, width: 100,
enum: Status,
search: { el: 'select', props: { clearable: true }, labelWidth: 85 }, search: { el: 'select', props: { clearable: true }, labelWidth: 85 },
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
......
<template>
<vxe-modal
resize
v-model="showModal"
:title="modalTitle"
@hide="onHide"
width="400px"
show-footer
esc-closable
>
<el-form ref="formRef" inline :model="form" :rules="rules" label-width="80px">
<el-row :gutter="10">
<el-col :span="24">
<el-form-item class="w-full" label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="密码" prop="password">
<el-input v-model="form.password" placeholder="请输入密码" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="用户名称" prop="username">
<el-input v-model="form.username" placeholder="请输入用户名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio value="enable">启用</el-radio>
<el-radio value="disable">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</template>
</vxe-modal>
</template>
<script setup>
import { computed } from 'vue';
import { ref } from 'vue';
import { saveLeaderGroup } from '@/api/user';
import { getDefualtRoles } from '@/api/role';
import { ElMessage } from 'element-plus';
const emits = defineEmits(['success']);
const formRef = ref();
const showModal = ref(false);
const loading = ref(false);
const form = ref({
username: '',
password: '',
phone: '',
status: 'enable',
});
const options = ref([]);
const validatePhone = (rule, value, callback) => {
const reg = /^1[3-9]\d{9}$/;
if (!value) {
callback(new Error('请输入手机号'));
} else if (!reg.test(value)) {
callback(new Error('请输入正确的手机号'));
} else {
callback();
}
};
const rules = ref({
username: { required: true, message: '请输入用户名称', trigger: 'blur' },
password: { required: true, message: '请输入密码', trigger: 'blur' },
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' },
],
});
const currentAccount = ref(null);
const isEdit = computed(() => !!currentAccount.value);
const modalTitle = computed(() => (isEdit.value ? '编辑账号' : '新增账号'));
const submitForm = async () => {
try {
await formRef.value.validate();
loading.value = true;
await saveLeaderGroup({...form.value, role: 'legal_affairs_commissioner'});
ElMessage({
type: 'success',
message: isEdit.value ? '修改成功!' : '添加成功!',
plain: true,
});
emits('success');
showModal.value = false;
} catch {}
loading.value = false;
};
const onHide = () => {
form.value = {
username: '',
roles: [],
password: '',
phone: '',
status: 'enable',
};
formRef.value.clearValidate();
currentAccount.value = null;
showModal.value = false;
};
const openModal = (account) => {
account && (form.value = account);
getDefualtRoles().then((res) => {
options.value = res.result;
});
currentAccount.value = account;
showModal.value = true;
};
defineExpose({
openModal,
});
</script>
<style lang="scss" scoped></style>
<template>
<div class="table-box">
<ProTable ref="proTable" :config="config" :api="getleaderGroupPage" :paramCallback="paramCallback">
<template #left_buttons>
<el-button
v-permission="'legal_member_add'"
type="primary"
:icon="Plus"
@click="accountFormModalRef?.openModal()"
>新增</el-button
>
<el-button v-permission="'legal_member_del'" type="danger" :icon="Delete" @click="handleDelete"
>删除</el-button
>
</template>
</ProTable>
<AccountFormModal ref="accountFormModalRef" @success="query" />
</div>
</template>
<script setup lang="jsx" name="accountManage">
import ProTable from '@/components/ProTable/index.vue';
import AccountFormModal from './components/AccountFormModal.vue';
import { Delete, Edit, Plus } from '@element-plus/icons-vue';
import { reactive, ref } from 'vue';
import { ElButton, ElMessageBox, ElMessage, ElTag } from 'element-plus';
import { getleaderGroupPage, saveLeaderGroup, batchDeleteByIds } from '@/api/user';
import { useDict } from '@/hooks/useDict';
import { onMounted } from 'vue';
import { getTenantPage } from '@/api/tenant';
import { getRolePage } from '@/api/role';
const { Status } = useDict("Status");
const proTable = ref();
const accountFormModalRef = ref();
const Rolelist = ref([]);
const Tenantlist = ref([]);
const paramCallback = (param) => {
const obj = JSON.parse(JSON.stringify(param));
obj['staffRole'] = 'legal_affairs_commissioner'
return obj;
};
const config = reactive({
columns: [
{ type: 'checkbox', width: 60, fixed: 'left' },
{ field: 'leader.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',
title: '员工手机号',
width: 160,
search: { el: 'input', props: { clearable: true }, labelWidth: 85 },
},
{
field: 'staff.status',
title: '员工状态',
width: 100,
enum: Status,
search: { el: 'select', props: { clearable: true }, labelWidth: 85 },
slots: {
default: ({ row }) => {
return (
<ElTag type={row.status == 'enable' ? 'primary' : 'danger'}>
{row.status == 'enable' ? '启用' : '禁用'}
</ElTag>
);
},
},
},
{
field: 'staff.createTime',
title: '员工创建时间',
width: 170,
},
{
field: 'staff.updateTime',
title: '员工更新时间',
width: 170,
},
{
field: 'action',
title: '操作',
width: 200,
fixed: 'right',
slots: {
default: ({ row }) => {
return (
<>
<ElButton link type="primary" icon={Edit} onClick={() => editAccount(row)}>
编辑
</ElButton>
<ElButton link type="primary" icon={Edit} onClick={() => handleDisable(row)}>
{row.status == 'enable' ? '禁用' : '启用'}
</ElButton>
</>
);
},
},
},
],
});
const handleDelete = async () => {
const list = proTable.value.element.getCheckboxRecords();
if (list.length) {
await ElMessageBox.confirm('是否确认删除选中账户?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
const ids = list.map((v) => v.id).join(',');
await batchDeleteByIds(ids);
ElMessage({
type: 'success',
message: '删除成功!',
plain: true,
});
query();
}
};
const editAccount = (row) => accountFormModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
const handleDisable = async (row) => {
await ElMessageBox.confirm(
`是否确认${row.status == 'enable' ? '禁用' : '启用'}该用户?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
);
// 修改的状态
const status = row.status === 'enable' ? 'disable' : 'enable';
await saveLeaderGroup({
...row,
status,
});
row.status = status;
ElMessage({
type: 'success',
message: `${status == 'enable' ? '启用' : '禁用'}成功!`,
plain: true,
});
};
const query = () => proTable.value?.search();
onMounted(() => {
query();
getRolePage({ current: 1, size: 9999999 }).then(res => {
if (res.success) {
Rolelist.value = res.result.content
}
})
getTenantPage({ current: 1, size: 9999999, status: 'enable' }).then(res => {
if (res.success) {
Tenantlist.value = res.result.content
console.log('Tenantlist.value', Tenantlist.value)
}
})
});
</script>
<style lang="scss" scoped></style>
<template>
<vxe-modal
resize
v-model="showModal"
:title="modalTitle"
@hide="onHide"
width="400px"
show-footer
esc-closable
>
<el-form ref="formRef" inline :model="form" :rules="rules" label-width="80px">
<el-row :gutter="10">
<el-col :span="24">
<el-form-item class="w-full" label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="密码" prop="password">
<el-input v-model="form.password" placeholder="请输入密码" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="用户名称" prop="username">
<el-input v-model="form.username" placeholder="请输入用户名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item class="w-full" label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio value="enable">启用</el-radio>
<el-radio value="disable">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="default" @click="showModal = false">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</template>
</vxe-modal>
</template>
<script setup>
import { computed } from 'vue';
import { ref } from 'vue';
import { saveLeaderGroup } from '@/api/user';
import { getDefualtRoles } from '@/api/role';
import { ElMessage } from 'element-plus';
const emits = defineEmits(['success']);
const formRef = ref();
const showModal = ref(false);
const loading = ref(false);
const form = ref({
username: '',
password: '',
phone: '',
status: 'enable',
});
const options = ref([]);
const validatePhone = (rule, value, callback) => {
const reg = /^1[3-9]\d{9}$/;
if (!value) {
callback(new Error('请输入手机号'));
} else if (!reg.test(value)) {
callback(new Error('请输入正确的手机号'));
} else {
callback();
}
};
const rules = ref({
username: { required: true, message: '请输入用户名称', trigger: 'blur' },
password: { required: true, message: '请输入密码', trigger: 'blur' },
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
{ validator: validatePhone, trigger: 'blur' },
],
});
const currentAccount = ref(null);
const isEdit = computed(() => !!currentAccount.value);
const modalTitle = computed(() => (isEdit.value ? '编辑账号' : '新增账号'));
const submitForm = async () => {
try {
await formRef.value.validate();
loading.value = true;
await saveLeaderGroup({...form.value, role: 'risk_control_commissioner'});
ElMessage({
type: 'success',
message: isEdit.value ? '修改成功!' : '添加成功!',
plain: true,
});
emits('success');
showModal.value = false;
} catch {}
loading.value = false;
};
const onHide = () => {
form.value = {
username: '',
roles: [],
password: '',
phone: '',
status: 'enable',
};
formRef.value.clearValidate();
currentAccount.value = null;
showModal.value = false;
};
const openModal = (account) => {
account && (form.value = account);
getDefualtRoles().then((res) => {
options.value = res.result;
});
currentAccount.value = account;
showModal.value = true;
};
defineExpose({
openModal,
});
</script>
<style lang="scss" scoped></style>
<template>
<div class="table-box">
<ProTable ref="proTable" :config="config" :api="getleaderGroupPage" :paramCallback="paramCallback">
<template #left_buttons>
<el-button
v-permission="'risk_member_add'"
type="primary"
:icon="Plus"
@click="accountFormModalRef?.openModal()"
>新增</el-button
>
<el-button v-permission="'risk_member_del'" type="danger" :icon="Delete" @click="handleDelete"
>删除</el-button
>
</template>
</ProTable>
<AccountFormModal ref="accountFormModalRef" @success="query" />
</div>
</template>
<script setup lang="jsx" name="accountManage">
import ProTable from '@/components/ProTable/index.vue';
import AccountFormModal from './components/AccountFormModal.vue';
import { Delete, Edit, Plus } from '@element-plus/icons-vue';
import { reactive, ref } from 'vue';
import { ElButton, ElMessageBox, ElMessage, ElTag } from 'element-plus';
import { getleaderGroupPage, saveLeaderGroup, batchDeleteByIds } from '@/api/user';
import { useDict } from '@/hooks/useDict';
import { onMounted } from 'vue';
import { getTenantPage } from '@/api/tenant';
import { getRolePage } from '@/api/role';
const { Status } = useDict("Status");
const proTable = ref();
const accountFormModalRef = ref();
const Rolelist = ref([]);
const Tenantlist = ref([]);
const paramCallback = (param) => {
const obj = JSON.parse(JSON.stringify(param));
obj['staffRole'] = 'risk_control_commissioner'
return obj;
};
const config = reactive({
columns: [
{ type: 'checkbox', width: 60, fixed: 'left' },
{ field: 'leader.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',
title: '员工手机号',
width: 160,
search: { el: 'input', props: { clearable: true }, labelWidth: 85 },
},
{
field: 'staff.status',
title: '员工状态',
width: 100,
enum: Status,
search: { el: 'select', props: { clearable: true }, labelWidth: 85 },
slots: {
default: ({ row }) => {
return (
<ElTag type={row.status == 'enable' ? 'primary' : 'danger'}>
{row.status == 'enable' ? '启用' : '禁用'}
</ElTag>
);
},
},
},
{
field: 'staff.createTime',
title: '员工创建时间',
width: 170,
},
{
field: 'staff.updateTime',
title: '员工更新时间',
width: 170,
},
{
field: 'action',
title: '操作',
width: 200,
fixed: 'right',
slots: {
default: ({ row }) => {
return (
<>
<ElButton link type="primary" icon={Edit} onClick={() => editAccount(row)}>
编辑
</ElButton>
<ElButton link type="primary" icon={Edit} onClick={() => handleDisable(row)}>
{row.status == 'enable' ? '禁用' : '启用'}
</ElButton>
</>
);
},
},
},
],
});
const handleDelete = async () => {
const list = proTable.value.element.getCheckboxRecords();
if (list.length) {
await ElMessageBox.confirm('是否确认删除选中账户?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
});
const ids = list.map((v) => v.id).join(',');
await batchDeleteByIds(ids);
ElMessage({
type: 'success',
message: '删除成功!',
plain: true,
});
query();
}
};
const editAccount = (row) => accountFormModalRef.value.openModal(JSON.parse(JSON.stringify(row)));
const handleDisable = async (row) => {
await ElMessageBox.confirm(
`是否确认${row.status == 'enable' ? '禁用' : '启用'}该用户?`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
);
// 修改的状态
const status = row.status === 'enable' ? 'disable' : 'enable';
await saveLeaderGroup({
...row,
status,
});
row.status = status;
ElMessage({
type: 'success',
message: `${status == 'enable' ? '启用' : '禁用'}成功!`,
plain: true,
});
};
const query = () => proTable.value?.search();
onMounted(() => {
query();
getRolePage({ current: 1, size: 9999999 }).then(res => {
if (res.success) {
Rolelist.value = res.result.content
}
})
getTenantPage({ current: 1, size: 9999999, status: 'enable' }).then(res => {
if (res.success) {
Tenantlist.value = res.result.content
console.log('Tenantlist.value', Tenantlist.value)
}
})
});
</script>
<style lang="scss" scoped></style>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<RoleFormModal ref="roleModalRef" @success="query" /> <RoleFormModal ref="roleModalRef" @success="query" />
<AllocationMenuModal ref="allocationMenuModalRef" @success="query" /> <AllocationMenuModal ref="allocationMenuModalRef" @success="query" />
<AllocationUserModal ref="allocationUserModalRef" /> <AllocationUserModal ref="allocationUserModalRef" @success="query" />
</div> </div>
</template> </template>
......
...@@ -55,8 +55,9 @@ export default defineConfig(({ command, mode }) => { ...@@ -55,8 +55,9 @@ export default defineConfig(({ command, mode }) => {
port: VITE_PORT, port: VITE_PORT,
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://192.168.31.128:8080', // target: 'http://192.168.31.189:8080',
target: 'http://8.152.205.9:8080', target: 'http://192.168.31.128:8080',
// target: 'http://8.152.205.9:8080',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
}, },
......
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