From 87331ab60744c9a4cc6e8828a6579e25b613e32c Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Wed, 25 Jun 2025 09:42:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E8=B5=84=E4=BA=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => assetManage}/assetType/index.ts | 0 .../{ => assetManage}/assetType/model.d.ts | 0 .../views/property/assetManage/asset/data.ts | 69 +++++++++++++------ .../property/assetManage/asset/index.vue | 1 + .../assetType/assetType-modal.vue | 2 +- .../{ => assetManage}/assetType/data.ts | 22 +++--- .../{ => assetManage}/assetType/index.vue | 28 ++------ .../views/property/resident/person/data.ts | 10 ++- .../views/property/resident/person/index.vue | 29 ++++---- .../resident/person/person-detail.vue | 27 ++++---- .../property/resident/person/person-modal.vue | 9 ++- .../resident/person/query-unit-list.vue | 44 +++++++++--- .../resident/person/query-user-list.vue | 25 ++++--- 13 files changed, 152 insertions(+), 114 deletions(-) rename apps/web-antd/src/api/property/{ => assetManage}/assetType/index.ts (100%) rename apps/web-antd/src/api/property/{ => assetManage}/assetType/model.d.ts (100%) rename apps/web-antd/src/views/property/{ => assetManage}/assetType/assetType-modal.vue (98%) rename apps/web-antd/src/views/property/{ => assetManage}/assetType/data.ts (75%) rename apps/web-antd/src/views/property/{ => assetManage}/assetType/index.vue (84%) diff --git a/apps/web-antd/src/api/property/assetType/index.ts b/apps/web-antd/src/api/property/assetManage/assetType/index.ts similarity index 100% rename from apps/web-antd/src/api/property/assetType/index.ts rename to apps/web-antd/src/api/property/assetManage/assetType/index.ts diff --git a/apps/web-antd/src/api/property/assetType/model.d.ts b/apps/web-antd/src/api/property/assetManage/assetType/model.d.ts similarity index 100% rename from apps/web-antd/src/api/property/assetType/model.d.ts rename to apps/web-antd/src/api/property/assetManage/assetType/model.d.ts diff --git a/apps/web-antd/src/views/property/assetManage/asset/data.ts b/apps/web-antd/src/views/property/assetManage/asset/data.ts index 2b381f74..8251773c 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/data.ts +++ b/apps/web-antd/src/views/property/assetManage/asset/data.ts @@ -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); + }) +} + diff --git a/apps/web-antd/src/views/property/assetManage/asset/index.vue b/apps/web-antd/src/views/property/assetManage/asset/index.vue index 8c559e90..54433dcf 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/index.vue +++ b/apps/web-antd/src/views/property/assetManage/asset/index.vue @@ -110,6 +110,7 @@ function handleDownloadExcel() {