fix: 修复可选客户项目;字段名等

This commit is contained in:
caiyuchao
2025-08-25 18:36:57 +08:00
parent 0636850977
commit a31d0fa349
8 changed files with 61 additions and 35 deletions

View File

@@ -47,6 +47,13 @@ export function getCustomerList() {
return requestClient.get<CustomerApi.Customer[]>('/license/customer/list');
}
/** 查询可选择的客户列表 */
export function getLicenseCustomerList() {
return requestClient.get<CustomerApi.Customer[]>(
'/license/customer/license-list',
);
}
/** 查询客户详情 */
export function getCustomer(id: number) {
return requestClient.get<CustomerApi.Customer>(

View File

@@ -43,6 +43,16 @@ export function getProjectList(params: any) {
});
}
/** 查询可选择的项目列表 */
export function getLicenseProjectList(params: any) {
return requestClient.get<ProjectApi.Project[]>(
'/license/project/license-list',
{
params,
},
);
}
/** 查询项目详情 */
export function getProject(id: number) {
return requestClient.get<ProjectApi.Project>(`/license/project/get?id=${id}`);

View File

@@ -9,6 +9,8 @@
"licenseContent": "License Content",
"applicant": "Applicant",
"approver": "License Administrator",
"approverName": "Approver",
"approveTime": "Approval Time",
"status": "Status",
"remark": "Remark",
"creationTime": "Creation Time",

View File

@@ -23,6 +23,6 @@
"progress": "Comment",
"updateTime": "Last Modified Time",
"commentNum": "Comment Count",
"softwareVersion": "Operating System Platform",
"operatingSystem": "Software Version"
"softwareVersion": "Software Version",
"operatingSystem": "Operating System Platform"
}

View File

@@ -9,6 +9,8 @@
"licenseContent": "License内容",
"applicant": "申请人",
"approver": "License管理员",
"approverName": "审批人",
"approveTime": "审批时间",
"status": "状态",
"remark": "说明",
"creationTime": "创建时间",
@@ -35,5 +37,5 @@
"reapply": "重新申请",
"reapplyAction": "重新申请{0}",
"history": "历史",
"applyCount": "申请次数"
"applyCount": "license申请次数"
}

View File

@@ -23,6 +23,6 @@
"progress": "评论",
"updateTime": "最后修改时间",
"commentNum": "评论数",
"softwareVersion": "操作系统平台",
"operatingSystem": "软件版本"
"softwareVersion": "软件版本",
"operatingSystem": "操作系统平台"
}

View File

@@ -12,9 +12,9 @@ import { formatDate, formatDateTime } from '@vben/utils';
import dayjs, { Dayjs } from 'dayjs';
import { z } from '#/adapter/form';
import { getCustomerList } from '#/api/license/customer';
import { getLicenseCustomerList } from '#/api/license/customer';
import { isLicenseSnUnique } from '#/api/license/license';
import { getProjectList } from '#/api/license/project';
import { getLicenseProjectList } from '#/api/license/project';
import { getLicenseAdminList, getSimpleUserList } from '#/api/system/user';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';
@@ -46,7 +46,7 @@ export function useFormSchema(): VbenFormSchema[] {
},
componentProps: {
api: async () => {
customerList.value = await getCustomerList();
customerList.value = await getLicenseCustomerList();
return customerList.value;
},
allowClear: true,
@@ -71,7 +71,7 @@ export function useFormSchema(): VbenFormSchema[] {
},
dependencies: {
componentProps: async (values) => {
projectList.value = await getProjectList({
projectList.value = await getLicenseProjectList({
customerId: values.customerId,
});
const hasProject = projectList.value.find((project) => {
@@ -304,12 +304,12 @@ export function useGridColumns(): VxeTableGridOptions<LicenseApi.License>['colum
return [
{
field: 'customerName',
title: $t('license.customer'),
title: $t('customer.customerName'),
minWidth: 120,
},
{
field: 'projectName',
title: $t('license.project'),
title: $t('project.name'),
minWidth: 120,
},
{
@@ -367,7 +367,7 @@ export function useGridColumns(): VxeTableGridOptions<LicenseApi.License>['colum
{
field: 'applyCount',
title: $t('license.applyCount'),
minWidth: 70,
minWidth: 120,
},
{
field: 'operation',
@@ -384,11 +384,11 @@ export function useDetailSchema(): DescriptionItemSchema[] {
return [
{
field: 'customerName',
label: $t('license.customer'),
label: $t('customer.customerName'),
},
{
field: 'projectName',
label: $t('license.project'),
label: $t('project.name'),
},
{
field: 'serialNo',
@@ -465,6 +465,11 @@ export function useDetailSchema(): DescriptionItemSchema[] {
return formatDateTime(data?.applicationTime) as string;
},
},
{
field: 'approverName',
label: $t('license.approverName'),
hidden: (data) => data.status !== 3,
},
{
field: 'status',
label: $t('license.status'),

View File

@@ -225,15 +225,6 @@ export function useFormSchema(): VbenFormSchema[] {
options: getDictOptions(DICT_TYPE.LIC_ENV_INFO, 'number'),
},
},
{
fieldName: 'softwareVersion',
label: $t('project.softwareVersion'),
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_SOFTWARE_VERSION, 'number'),
},
},
{
fieldName: 'operatingSystem',
label: $t('project.operatingSystem'),
@@ -243,6 +234,15 @@ export function useFormSchema(): VbenFormSchema[] {
options: getDictOptions(DICT_TYPE.LIC_OPERATING_SYSTEM, 'number'),
},
},
{
fieldName: 'softwareVersion',
label: $t('project.softwareVersion'),
rules: 'required',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.LIC_SOFTWARE_VERSION, 'number'),
},
},
];
}
@@ -409,7 +409,7 @@ export function useGridColumns(
},
{
field: 'customerName',
title: $t('project.belongCustomer'),
title: $t('customer.customerName'),
minWidth: 120,
},
{
@@ -490,16 +490,6 @@ export function useGridColumns(
props: { type: DICT_TYPE.LIC_ENV_INFO },
},
},
{
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'),
@@ -510,6 +500,16 @@ export function useGridColumns(
props: { type: DICT_TYPE.LIC_OPERATING_SYSTEM },
},
},
{
field: 'softwareVersion',
title: $t('project.softwareVersion'),
visible: false,
minWidth: 120,
cellRender: {
name: 'CellDict',
props: { type: DICT_TYPE.LIC_SOFTWARE_VERSION },
},
},
// {
// field: 'remark',
// title: $t('project.remarks'),
@@ -524,7 +524,7 @@ export function useGridColumns(
{
field: 'applyCount',
title: $t('license.applyCount'),
minWidth: 70,
minWidth: 120,
},
{
field: 'updateTime',