😎职位管理模块增加在职人员信息

This commit is contained in:
zuohuaijun 2024-12-06 01:39:00 +08:00
parent 410b47a522
commit a4dd277da1
7 changed files with 65 additions and 2 deletions

View File

@ -47,4 +47,10 @@ public partial class SysPos : EntityTenant
/// </summary>
[SugarColumn(ColumnDescription = "状态", DefaultValue = "1")]
public StatusEnum Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 在职人数
/// </summary>
[SugarColumn(IsIgnore = true)]
public List<SysUser> UserList { get; set; }
}

View File

@ -40,9 +40,11 @@ public class SysPosService : IDynamicApiController, ITransient
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code))
.Select((u, a, b) => new PagePosOutput
{
TenantName = b.Name
TenantName = b.Name,
UserList = SqlFunc.Subqueryable<SysUser>().Where(m => m.PosId == u.Id ||
SqlFunc.Subqueryable<SysUserExtOrg>().Where(m => m.Id == m.UserId && m.PosId == u.Id).Any()).ToList()
}, true)
.OrderBy(u => new { u.OrderNo, u.Id })
.OrderBy(u => (new { u.OrderNo, u.Id }))
.ToPagedListAsync(input.Page, input.PageSize);
}

View File

@ -13,6 +13,7 @@
*/
import { StatusEnum } from './status-enum';
import { SysUser } from './sys-user';
/**
*
*
@ -123,6 +124,14 @@ export interface AddPosInput {
*/
status?: StatusEnum;
/**
*
*
* @type {Array<SysUser>}
* @memberof AddPosInput
*/
userList?: Array<SysUser> | null;
/**
*
*

View File

@ -13,6 +13,7 @@
*/
import { StatusEnum } from './status-enum';
import { SysUser } from './sys-user';
/**
*
*
@ -131,6 +132,14 @@ export interface PagePosOutput {
*/
status?: StatusEnum;
/**
*
*
* @type {Array<SysUser>}
* @memberof PagePosOutput
*/
userList?: Array<SysUser> | null;
/**
*
*

View File

@ -13,6 +13,7 @@
*/
import { StatusEnum } from './status-enum';
import { SysUser } from './sys-user';
/**
*
*
@ -131,6 +132,14 @@ export interface PosOutput {
*/
status?: StatusEnum;
/**
*
*
* @type {Array<SysUser>}
* @memberof PosOutput
*/
userList?: Array<SysUser> | null;
/**
*
*

View File

@ -13,6 +13,7 @@
*/
import { StatusEnum } from './status-enum';
import { SysUser } from './sys-user';
/**
*
*
@ -123,6 +124,14 @@ export interface UpdatePosInput {
*/
status?: StatusEnum;
/**
*
*
* @type {Array<SysUser>}
* @memberof UpdatePosInput
*/
userList?: Array<SysUser> | null;
/**
*
*

View File

@ -41,6 +41,23 @@
<el-tag v-if="row.status === 1" type="success">启用</el-tag>
<el-tag v-else type="danger">禁用</el-tag>
</template>
<template #row_userCount="{ row }">
{{ row.userList?.length }}
</template>
<template #row_userList="{ row }">
<el-popover placement="bottom" width="280" trigger="hover" v-if="row.userList?.length">
<template #reference>
<el-text type="primary" class="cursor-default">
<el-icon><ele-InfoFilled /></el-icon>
</el-text>
</template>
<el-table :data="row.userList" stripe border>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="account" label="账号" />
<el-table-column prop="realName" label="姓名" />
</el-table>
</el-popover>
</template>
<template #row_record="{ row }">
<ModifyRecord :data="row" />
</template>
@ -97,6 +114,8 @@ const options = useVxeTable<PagePosOutput>(
{ type: 'seq', title: '序号', width: 60, fixed: 'left' },
{ field: 'name', title: '职位名称', minWidth: 200, showOverflow: 'tooltip' },
{ field: 'code', title: '职位编码', minWidth: 200, showOverflow: 'tooltip' },
{ field: 'userCount', title: '在职人数', width: 100, showOverflow: 'tooltip', slots: { default: 'row_userCount' } },
{ field: 'userList', title: '人员明细', width: 100, showOverflow: 'tooltip', slots: { default: 'row_userList' } },
{ field: 'orderNo', title: '排序', width: 80, showOverflow: 'tooltip' },
{ field: 'status', title: '状态', width: 80, showOverflow: 'tooltip', slots: { default: 'row_status' } },
{ field: '', title: '修改记录', width: 100, showOverflow: 'tooltip', slots: { default: 'row_record' } },