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

@@ -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',