1、资产管理
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-06-25 09:42:38 +08:00
parent 905fbb5f06
commit 87331ab607
13 changed files with 152 additions and 114 deletions

View File

@@ -1,9 +1,8 @@
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import { renderDict } from "#/utils/render";
import { DictEnum } from '@vben/constants';
import {assetTypeList} from "#/api/property/assetManage/assetType";
import type {AssetTypeVO} from "#/api/property/assetManage/assetType/model";
export const querySchema: FormSchemaGetter = () => [
@@ -16,6 +15,13 @@ export const querySchema: FormSchemaGetter = () => [
component: 'Select',
fieldName: 'model',
label: '资产类型',
componentProps: {
showSearch:true,
placeholder:'根据类型名称搜索...',
onSearch:handleSearch,
onChange:handleChange,
options:typeData
},
},
{
component: 'Select',
@@ -28,8 +34,6 @@ export const querySchema: FormSchemaGetter = () => [
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60},
{
@@ -47,7 +51,7 @@ export const columns: VxeGridProps['columns'] = [
},
{
title: '资产类型',
field: 'modelName',
field: 'model',
},
{
title: '规格',
@@ -66,16 +70,16 @@ export const columns: VxeGridProps['columns'] = [
field: 'unit',
},
{
title: '仓库',
field: 'depotName',
title: '仓库id',
field: 'depotId',
},
{
title: '描述信息',
field: 'msg',
},
{
title: '供应商',
field: 'suppliersName',
title: '供应商id',
field: 'suppliersId',
},
{
title: '入库时间',
@@ -84,11 +88,6 @@ export const columns: VxeGridProps['columns'] = [
{
title: '固定资产',
field: 'type',
slots: {
default: ({ row }) => {
return renderDict(row.type, DictEnum.WY_SF);
},
},
},
{
title: '创建时间',
@@ -121,7 +120,7 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '类型',
fieldName: 'model',
component: 'Select',
component: 'Textarea',
},
{
label: '规格',
@@ -144,9 +143,9 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
},
{
label: '仓库',
label: '仓库id',
fieldName: 'depotId',
component: 'Select',
component: 'Input',
},
{
label: '描述信息',
@@ -156,7 +155,7 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '供应商id',
fieldName: 'suppliersId',
component: 'Select',
component: 'Input',
},
{
label: '入库时间',
@@ -172,8 +171,34 @@ export const modalSchema: FormSchemaGetter = () => [
label: '固定资产类型',
fieldName: 'type',
component: 'Select',
componentProps: {
options: getDictOptions('wy_sf'),
},
componentProps: {},
},
];
let typeData:AssetTypeVO[]=[]
const handleSearch = (val: string) => {
queryAssetsType(val, (d: any[]) => (typeData = d));
};
const handleChange = (val: string) => {
queryAssetsType(val, (d: any[]) => (typeData = d));
};
function queryAssetsType(value: string, callback: any) {
let queryParam={
pageNum:100,
pageSize:1,
assetTypeName:value
}
assetTypeList(queryParam).then(res=>{
const data: any[] = [];
res.rows.forEach((r: any) => {
data.push({
value: r.assetTypeName,
label: r.id,
});
});
callback(data);
})
}