资产审批

This commit is contained in:
2025-06-25 11:37:28 +08:00
parent f620debe43
commit 8d517b3133
18 changed files with 606 additions and 341 deletions

View File

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