From 8d517b3133fc46b2598950201a11282fac000627 Mon Sep 17 00:00:00 2001 From: mocheng <3057647414@qq.com> Date: Wed, 25 Jun 2025 11:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E4=BA=A7=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/property/assetType/index.ts | 65 +++++++ .../src/api/property/assetType/model.d.ts | 64 ++++++ .../property/assetManage/application/data.ts | 20 +- .../assetManage/asset/asset-modal.vue | 3 +- .../views/property/assetManage/asset/data.ts | 69 +++---- .../property/assetManage/asset/index.vue | 1 - .../property/assetType/assetType-modal.vue | 101 ++++++++++ .../src/views/property/assetType/data.ts | 71 +++++++ .../src/views/property/assetType/index.vue | 182 ++++++++++++++++++ .../clean/cleanOrders/clean-modal.vue | 182 +----------------- .../views/property/clean/cleanOrders/data.ts | 44 ++--- .../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 ++- .../base/shared/src/constants/dict-enum.ts | 1 + 18 files changed, 606 insertions(+), 341 deletions(-) create mode 100644 apps/web-antd/src/api/property/assetType/index.ts create mode 100644 apps/web-antd/src/api/property/assetType/model.d.ts create mode 100644 apps/web-antd/src/views/property/assetType/assetType-modal.vue create mode 100644 apps/web-antd/src/views/property/assetType/data.ts create mode 100644 apps/web-antd/src/views/property/assetType/index.vue diff --git a/apps/web-antd/src/api/property/assetType/index.ts b/apps/web-antd/src/api/property/assetType/index.ts new file mode 100644 index 00000000..ec5852ba --- /dev/null +++ b/apps/web-antd/src/api/property/assetType/index.ts @@ -0,0 +1,65 @@ +import type { AssetTypeVO, AssetTypeForm, AssetTypeQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询资产类型列表 +* @param params +* @returns 资产类型列表 +*/ +export function assetTypeList(params?: AssetTypeQuery) { + return requestClient.get>('/property/assetType/list', { params }); +} + +export function assetTypeselect() { + return requestClient.get('/property/assetType/list'); +} + +/** + * 导出资产类型列表 + * @param params + * @returns 资产类型列表 + */ +export function assetTypeExport(params?: AssetTypeQuery) { + return commonExport('/property/assetType/export', params ?? {}); +} + +/** + * 查询资产类型详情 + * @param id id + * @returns 资产类型详情 + */ +export function assetTypeInfo(id: ID) { + return requestClient.get(`/property/assetType/${id}`); +} + +/** + * 新增资产类型 + * @param data + * @returns void + */ +export function assetTypeAdd(data: AssetTypeForm) { + return requestClient.postWithMsg('/property/assetType', data); +} + +/** + * 更新资产类型 + * @param data + * @returns void + */ +export function assetTypeUpdate(data: AssetTypeForm) { + return requestClient.putWithMsg('/property/assetType', data); +} + +/** + * 删除资产类型 + * @param id id + * @returns void + */ +export function assetTypeRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/property/assetType/${id}`); +} diff --git a/apps/web-antd/src/api/property/assetType/model.d.ts b/apps/web-antd/src/api/property/assetType/model.d.ts new file mode 100644 index 00000000..ad92eb79 --- /dev/null +++ b/apps/web-antd/src/api/property/assetType/model.d.ts @@ -0,0 +1,64 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface AssetTypeVO { + /** + * 主键 + */ + id: string | number; + + /** + * 分类名称 + */ + assetTypeName: string; + + /** + * 排序 + */ + sort: number; + + /** + * 创建时间 + */ + createTime: string; + + /** + * 创建人 + */ + createBy: string; + +} + +export interface AssetTypeForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 分类名称 + */ + assetTypeName?: string; + + /** + * 排序 + */ + sort?: number; + +} + +export interface AssetTypeQuery extends PageQuery { + /** + * 分类名称 + */ + assetTypeName?: string; + + /** + * 排序 + */ + sort?: number; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/assetManage/application/data.ts b/apps/web-antd/src/views/property/assetManage/application/data.ts index 8b14dd49..aad2f7e8 100644 --- a/apps/web-antd/src/views/property/assetManage/application/data.ts +++ b/apps/web-antd/src/views/property/assetManage/application/data.ts @@ -1,5 +1,8 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; +import { renderDict } from "#/utils/render"; +import { DictEnum } from '@vben/constants'; + export const querySchema: FormSchemaGetter = () => [ @@ -59,12 +62,12 @@ export const columns: VxeGridProps['columns'] = [ field: 'id', }, { - title: '资产id', - field: 'assetId', + title: '资产', + field: 'assetName', }, { - title: '领用人id', - field: 'userId', + title: '领用人', + field: 'userName', }, { title: '数量', @@ -73,10 +76,15 @@ export const columns: VxeGridProps['columns'] = [ { title: '状态', field: 'state', + slots: { + default: ({ row }) => { + return renderDict(row.state, DictEnum.WY_ZCSHZT); + }, + }, }, { - title: '审批人id', - field: 'acceptanceUserId', + title: '审批人', + field: 'acceptanceUserName', }, { title: '审批时间', diff --git a/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue b/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue index ca80d29f..c3c13dea 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue +++ b/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue @@ -10,7 +10,8 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { modalSchema } from './data'; -import { assetTypeselect } from "#/api/property/assetManage/assetType"; +import { packageSelectList } from "#/api/system/tenant-package"; +import { assetTypeselect } from "#/api/property/assetType"; import { depotList } from "#/api/property/assetManage/depot"; import { suppliersList } from "#/api/property/assetManage/suppliers"; 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 8251773c..2b381f74 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/data.ts +++ b/apps/web-antd/src/views/property/assetManage/asset/data.ts @@ -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); - }) -} - 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 54433dcf..8c559e90 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/index.vue +++ b/apps/web-antd/src/views/property/assetManage/asset/index.vue @@ -110,7 +110,6 @@ function handleDownloadExcel() {