feat: 项目管理字段添加和调整

This commit is contained in:
caiyuchao
2025-08-15 16:02:49 +08:00
parent ef6da4f3c6
commit 74e9b23f71
6 changed files with 143 additions and 31 deletions

View File

@@ -21,8 +21,9 @@ export namespace ProjectApi {
startTime: Dayjs | string; // 项目开始时间
endTime: Dayjs | string; // 项目结束时间
status?: number; // 项目状态
envInfo: string; // 环境信息
envFileId: number; // 环境信息附件id
envInfo: number; // 环境信息
operatingSystem: number; // 操作系统
softwareVersion: number; // 软件版本信息
remark: string; // 备注
}
}

View File

@@ -22,5 +22,7 @@
"list": "Project List",
"progress": "Comment",
"updateTime": "Last Modified Time",
"commentNum": "Comment Count"
"commentNum": "Comment Count",
"softwareVersion": "Software Version Info",
"operatingSystem": "Operating System"
}

View File

@@ -2,7 +2,7 @@
"project": "项目",
"operation": "操作",
"creationTime": "创建时间",
"remarks": "软件版本信息",
"remarks": "备注",
"envInfo": "环境信息",
"status": "项目状态",
"endTime": "项目结束时间",
@@ -22,5 +22,7 @@
"list": "项目列表",
"progress": "评论",
"updateTime": "最后修改时间",
"commentNum": "评论数"
"commentNum": "评论数",
"softwareVersion": "软件版本信息",
"operatingSystem": "操作系统"
}

View File

@@ -262,13 +262,16 @@ enum DICT_TYPE {
// ========== LICENSE 模块 ==========
LIC_BUSINESS_STATUS = 'lic_business_status', // 商务状态
LIC_CUSTOMER_TYPE = 'lic_customer_type', // 客户类型
LIC_ENV_INFO = 'lic_env_info', // 环境信息
LIC_LICENSE_STATUS = 'lic_license_status', // License 状态
LIC_NE_4G = 'lic_ne_4g', // NE 列表 4G
LIC_NE_5G = 'lic_ne_5g', // NE 列表 5G
LIC_NE_23G = 'lic_ne_23g', // NE 列表 2/3G
LIC_NE_ADD = 'lic_ne_add', // NE 列表 增值业务
LIC_NE_ALL = 'lic_ne_all', // NE 列表 一体化
LIC_OPERATING_SYSTEM = 'lic_operating_system', // 操作系统
LIC_PROJECT_STATUS = 'lic_project_status', // 项目状态
LIC_SOFTWARE_VERSION = 'lic_software_version', // 软件版本信息
MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型
// ========== Member 会员模块 ==========
MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型

View File

@@ -4,6 +4,8 @@ import type { CustomerApi } from '#/api/license/customer';
import { ref } from 'vue';
import { useAccess } from '@vben/access';
import { z } from '#/adapter/form';
import {
isCustomerCodeUnique,
@@ -13,6 +15,8 @@ import { getAreaTree } from '#/api/system/area';
import { $t } from '#/locales';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
const { hasAccessByRoles } = useAccess();
export const formData = ref<CustomerApi.Customer>();
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
@@ -97,6 +101,10 @@ export function useFormSchema(): VbenFormSchema[] {
label: $t('customer.contacts'),
rules: 'required',
component: 'Input',
dependencies: {
triggerFields: ['id'],
show: (values) => !values.id || hasAccessByRoles(['business']),
},
},
{
fieldName: 'areaIds',
@@ -119,11 +127,19 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'role',
label: $t('customer.role'),
component: 'Input',
dependencies: {
triggerFields: ['id'],
show: (values) => !values.id || hasAccessByRoles(['business']),
},
},
{
fieldName: 'phone',
label: $t('customer.phone'),
component: 'Input',
dependencies: {
triggerFields: ['id'],
show: (values) => !values.id || hasAccessByRoles(['business']),
},
},
{
fieldName: 'email',
@@ -214,6 +230,7 @@ export function useGridColumns(): VxeTableGridOptions<CustomerApi.Customer>['col
field: 'contacts',
title: $t('customer.contacts'),
minWidth: 120,
visible: hasAccessByRoles(['business']),
},
{
field: 'areaNames',
@@ -224,11 +241,13 @@ export function useGridColumns(): VxeTableGridOptions<CustomerApi.Customer>['col
field: 'role',
title: $t('customer.role'),
minWidth: 120,
visible: hasAccessByRoles(['business']),
},
{
field: 'phone',
title: $t('customer.phone'),
minWidth: 120,
visible: hasAccessByRoles(['business']),
},
{
field: 'email',

View File

@@ -12,13 +12,14 @@ import {
isProjectCodeUnique,
isProjectNameUnique,
} from '#/api/license/project';
// import { getSimpleUserList } from '#/api/system/user';
import { getSimpleUserList } from '#/api/system/user';
import { $t } from '#/locales';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
const { hasAccessByCodes } = useAccess();
let userList = await getSimpleUserList();
userList = userList.filter((item) => item.nickname !== '管理员'); // 过滤掉系统用户
// const userList = await getSimpleUserList();
const { hasAccessByCodes } = useAccess();
export const formData = ref<ProjectApi.Project>();
/** 新增/修改的表单 */
@@ -100,9 +101,12 @@ export function useFormSchema(): VbenFormSchema[] {
{
fieldName: 'contractCode',
label: $t('project.contractCode'),
rules: 'required',
rules: z.string().min(1, '请输入没有合同请填0'),
component: 'Input',
help: '没有合同的项目请填0',
componentProps: {
placeholder: '请输入没有合同请填0',
},
},
{
fieldName: 'businessStatus',
@@ -126,7 +130,16 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'businessOwner',
label: $t('project.businessOwner'),
rules: 'required',
component: 'Input',
component: 'Select',
componentProps: {
options: userList,
allowClear: true,
showSearch: true,
fieldNames: { label: 'nickname', value: 'id' },
filterOption: (input: string, option: any) => {
return option.nickname.toLowerCase().includes(input.toLowerCase());
},
},
},
{
fieldName: 'customerOwner',
@@ -138,17 +151,44 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'technicalOwnerA',
label: $t('project.technicalOwnerA'),
rules: 'required',
component: 'Input',
component: 'Select',
componentProps: {
options: userList,
allowClear: true,
showSearch: true,
fieldNames: { label: 'nickname', value: 'id' },
filterOption: (input: string, option: any) => {
return option.nickname.toLowerCase().includes(input.toLowerCase());
},
},
},
{
fieldName: 'technicalOwnerB',
label: $t('project.technicalOwnerB'),
component: 'Input',
component: 'Select',
componentProps: {
options: userList,
allowClear: true,
showSearch: true,
fieldNames: { label: 'nickname', value: 'id' },
filterOption: (input: string, option: any) => {
return option.nickname.toLowerCase().includes(input.toLowerCase());
},
},
},
{
fieldName: 'technicalOwnerC',
label: $t('project.technicalOwnerC'),
component: 'Input',
component: 'Select',
componentProps: {
options: userList,
allowClear: true,
showSearch: true,
fieldNames: { label: 'nickname', value: 'id' },
filterOption: (input: string, option: any) => {
return option.nickname.toLowerCase().includes(input.toLowerCase());
},
},
},
{
fieldName: 'startTime',
@@ -173,19 +213,28 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'envInfo',
label: $t('project.envInfo'),
rules: 'required',
component: 'Input',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_ENV_INFO, 'number'),
},
},
// {
// fieldName: 'envFileId',
// label: $t('project.envInfoFile'),
// component: 'Input',
// },
{
fieldName: 'remark',
label: $t('project.remarks'),
component: 'Textarea',
fieldName: 'softwareVersion',
label: $t('project.softwareVersion'),
rules: 'required',
formItemClass: 'col-span-2',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_SOFTWARE_VERSION, 'number'),
},
},
{
fieldName: 'operatingSystem',
label: $t('project.operatingSystem'),
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_OPERATING_SYSTEM, 'number'),
},
},
];
}
@@ -231,9 +280,15 @@ export function useGridFormSchema(): VbenFormSchema[] {
{
fieldName: 'technicalOwner',
label: $t('project.technicalOwner'),
component: 'Input',
component: 'Select',
componentProps: {
options: userList,
allowClear: true,
showSearch: true,
fieldNames: { label: 'nickname', value: 'id' },
filterOption: (input: string, option: any) => {
return option.nickname.toLowerCase().includes(input.toLowerCase());
},
},
},
{
@@ -272,9 +327,15 @@ export function useGridFormSchema(): VbenFormSchema[] {
{
fieldName: 'businessOwner',
label: $t('project.businessOwner'),
component: 'Input',
component: 'Select',
componentProps: {
options: userList,
allowClear: true,
showSearch: true,
fieldNames: { label: 'nickname', value: 'id' },
filterOption: (input: string, option: any) => {
return option.nickname.toLowerCase().includes(input.toLowerCase());
},
},
},
{
@@ -380,7 +441,7 @@ export function useGridColumns(
},
},
{
field: 'businessOwner',
field: 'businessOwnerName',
title: $t('project.businessOwner'),
minWidth: 120,
},
@@ -391,17 +452,17 @@ export function useGridColumns(
minWidth: 120,
},
{
field: 'technicalOwnerA',
field: 'technicalOwnerAName',
title: $t('project.technicalOwnerA'),
minWidth: 120,
},
{
field: 'technicalOwnerB',
field: 'technicalOwnerBName',
title: $t('project.technicalOwnerB'),
minWidth: 120,
},
{
field: 'technicalOwnerC',
field: 'technicalOwnerCName',
title: $t('project.technicalOwnerC'),
minWidth: 120,
},
@@ -417,13 +478,37 @@ export function useGridColumns(
title: $t('project.envInfo'),
visible: false,
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.LIC_ENV_INFO },
},
},
{
field: 'remark',
title: $t('project.remarks'),
field: 'softwareVersion',
title: $t('project.softwareVersion'),
visible: false,
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.LIC_SOFTWARE_VERSION },
},
},
{
field: 'operatingSystem',
title: $t('project.operatingSystem'),
visible: false,
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.LIC_OPERATING_SYSTEM },
},
},
// {
// field: 'remark',
// title: $t('project.remarks'),
// visible: false,
// minWidth: 120,
// },
{
field: 'commentNum',
title: $t('project.commentNum'),