feat: 项目管理负责人查询

This commit is contained in:
caiyuchao
2025-05-28 10:17:09 +08:00
parent 1b6cf48967
commit f0949b211a
2 changed files with 49 additions and 29 deletions

View File

@@ -26,6 +26,11 @@ export function getCustomerPage(params: PageParam) {
);
}
/** 查询客户分页 */
export function getCustomerList() {
return requestClient.get<CustomerApi.Customer[]>('/license/customer/list');
}
/** 查询客户详情 */
export function getCustomer(id: number) {
return requestClient.get<CustomerApi.Customer>(
@@ -54,7 +59,7 @@ export function exportCustomer(params: any) {
}
/** 客户名称是否唯一 */
async function isCustomerNameUnique(
export async function isCustomerNameUnique(
name: string,
id?: CustomerApi.Customer['id'],
) {
@@ -64,7 +69,7 @@ async function isCustomerNameUnique(
}
/** 客户编号是否唯一 */
async function isCustomerCodeUnique(
export async function isCustomerCodeUnique(
code: number,
id?: CustomerApi.Customer['id'],
) {
@@ -74,8 +79,6 @@ async function isCustomerCodeUnique(
}
/** 查询当前最大sn */
async function getMaxSn() {
export async function getMaxSn() {
return requestClient.get<boolean>('/license/customer/max-sn');
}
export { getMaxSn, isCustomerCodeUnique, isCustomerNameUnique };

View File

@@ -4,6 +4,7 @@ import type { ProjectApi } from '#/api/license/project';
import { useAccess } from '@vben/access';
import { getCustomerList } from '#/api/license/customer';
import { getSimpleUserList } from '#/api/system/user';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
@@ -20,15 +21,6 @@ export function useFormSchema(): VbenFormSchema[] {
show: () => false,
},
},
{
fieldName: 'customerId',
label: '客户ID',
rules: 'required',
component: 'Input',
componentProps: {
placeholder: '请输入客户ID',
},
},
{
fieldName: 'name',
label: '项目名称',
@@ -47,6 +39,25 @@ export function useFormSchema(): VbenFormSchema[] {
placeholder: '请输入项目编号',
},
},
{
fieldName: 'customerId',
label: '所属客户',
rules: 'required',
component: 'ApiSelect',
componentProps: {
api: async () => {
const data = await getCustomerList();
return data.map((item) => ({
// label: `${item.name}${item.code}`,
label: item.name,
value: item.id,
}));
},
showSearch: true,
filterOption: (input: string, option: any) =>
option.label.toLowerCase().includes(input.toLowerCase()),
},
},
{
fieldName: 'contractCode',
label: '合同编号',
@@ -59,12 +70,23 @@ export function useFormSchema(): VbenFormSchema[] {
{
fieldName: 'businessStatus',
label: '商务状态',
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_BUSINESS_STATUS, 'number'),
placeholder: '请选择商务状态',
},
},
{
fieldName: 'status',
label: '项目状态',
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_PROJECT_STATUS, 'number'),
placeholder: '请选择项目状态',
},
},
{
fieldName: 'businessOwner',
label: '业务负责人',
@@ -153,16 +175,6 @@ export function useFormSchema(): VbenFormSchema[] {
valueFormat: 'x',
},
},
{
fieldName: 'status',
label: '项目状态',
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_PROJECT_STATUS, 'number'),
placeholder: '请选择项目状态',
},
},
{
fieldName: 'envInfo',
label: '环境信息',
@@ -344,6 +356,11 @@ export function useGridColumns(
title: '项目编号',
minWidth: 120,
},
{
field: 'customerName',
title: '所属客户',
minWidth: 120,
},
{
field: 'contractCode',
title: '合同编号',
@@ -359,27 +376,27 @@ export function useGridColumns(
},
},
{
field: 'businessOwner',
field: 'businessOwnerName',
title: '业务负责人',
minWidth: 120,
},
{
field: 'customerOwner',
field: 'customerOwnerName',
title: '客户对接人',
minWidth: 120,
},
{
field: 'technicalOwnerA',
field: 'technicalOwnerAName',
title: '技术负责人1',
minWidth: 120,
},
{
field: 'technicalOwnerB',
field: 'technicalOwnerBName',
title: '技术负责人2',
minWidth: 120,
},
{
field: 'technicalOwnerC',
field: 'technicalOwnerCName',
title: '技术负责人3',
minWidth: 120,
},