From 69b4bf86bd2c79719c24a779437fe1b68b201833 Mon Sep 17 00:00:00 2001 From: wuxueyu <714453439@qq.com> Date: Wed, 6 Aug 2025 01:01:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=84=E7=A7=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/business/business.js | 126 ------- .../business.ts => bussiness/bussiness.ts} | 0 src/apis/equipment/index.ts | 49 +++ src/apis/equipment/type.ts | 277 ++++++++++++++ src/router/route.ts | 2 +- src/types/auto-imports.d.ts | 2 +- src/types/equipment.d.ts | 179 +++++++++ .../bussiness.vue} | 0 .../components/BiddingDetailModal.vue | 2 +- .../components/InformationTable.vue | 344 ++++++++++++++++++ .../bidding/information-retrieval/types.ts | 64 ++++ 11 files changed, 916 insertions(+), 129 deletions(-) delete mode 100644 src/apis/business/business.js rename src/apis/{business/business.ts => bussiness/bussiness.ts} (100%) create mode 100644 src/apis/equipment/index.ts create mode 100644 src/apis/equipment/type.ts create mode 100644 src/types/equipment.d.ts rename src/views/{business-data/business.vue => bussiness-data/bussiness.vue} (100%) create mode 100644 src/views/project-management/bidding/information-retrieval/components/InformationTable.vue create mode 100644 src/views/project-management/bidding/information-retrieval/types.ts diff --git a/src/apis/business/business.js b/src/apis/business/business.js deleted file mode 100644 index 11e6c85..0000000 --- a/src/apis/business/business.js +++ /dev/null @@ -1,126 +0,0 @@ -// @/apis/bussiness/bussiness.js - 根据后端接口重新编写 -import http from '@/utils/http'; - -const { request } = http; - -// 获取文件夹列表(分页) -export function getFolderListApi(params) { - return request({ - url: '/businessData/folder/list', - method: 'get', - params: { - page: params?.page || 1, - pageSize: params?.pageSize || 10, - folderName: params?.folderName - } - }); -} - -// 获取文件列表(分页) -export function getFilesApi(params) { - return request({ - url: '/businessData/file/list', - method: 'get', - params: { - page: params?.page || 1, - pageSize: params?.pageSize || 10, - folderId: params?.folderId || 0 - } - }); -} - -// 创建文件夹 -export function createFolderApi(data) { - return request({ - url: '/businessData/folder/creatFolder', - method: 'post', - data: { - name: data.name, - parentId: data.parentId || 0 - } - }); -} - -// 重命名文件夹 -export function updateFolderApi(folderId, newName) { - return request({ - url: '/businessData/folder/rename', - method: 'put', - params: { - folderId: folderId, - newName: newName - } - }); -} - -// 删除文件夹 -export function deleteFolderApi(folderId) { - return request({ - url: '/businessData/folder/delete', - method: 'delete', - params: { - folderId: folderId - } - }); -} - -// 上传文件 -export function uploadFileApi(file, folderId, onUploadProgress, cancelToken) { - const formData = new FormData(); - formData.append('file', file); - - return request({ - url: '/businessData/file/add', - method: 'post', - params: { - folderId: folderId - }, - data: formData, - onUploadProgress, - cancelToken, - headers: { - 'Content-Type': 'multipart/form-data' - } - }); -} - -// 下载文件 -export function downloadFileApi(fileId) { - return request({ - url: '/businessData/file/download', - method: 'get', - params: { - fileId: fileId - }, - responseType: 'blob' - }); -} - -// 删除文件 -export function deleteFileApi(fileId) { - return request({ - url: '/businessData/file/delete', - method: 'delete', - params: { - fileId: fileId - } - }); -} - -// 预览文件(后端没有提供预览接口,使用下载接口) -export function previewFileApi(fileId) { - return request({ - url: '/businessData/file/download', - method: 'get', - params: { - fileId: fileId - }, - responseType: 'blob' - }); -} - -// 重命名文件(后端没有提供重命名接口,需要先删除再上传) -export function updateFileNameApi(fileId, data) { - // 注意:后端没有提供文件重命名接口,这里返回一个Promise.reject - return Promise.reject(new Error('后端暂不支持文件重命名功能')); -} \ No newline at end of file diff --git a/src/apis/business/business.ts b/src/apis/bussiness/bussiness.ts similarity index 100% rename from src/apis/business/business.ts rename to src/apis/bussiness/bussiness.ts diff --git a/src/apis/equipment/index.ts b/src/apis/equipment/index.ts new file mode 100644 index 0000000..3cf43b6 --- /dev/null +++ b/src/apis/equipment/index.ts @@ -0,0 +1,49 @@ +import http from '@/utils/http' +import type * as T from '@/types/equipment.d' + +const BASE_URL = '/equipment' + +/** @desc 分页查询设备列表 */ +export function pageEquipment(query: T.EquipmentPageQuery) { + return http.get(`${BASE_URL}/page`, query) +} + +/** @desc 查询设备列表 */ +export function listEquipment(query?: T.EquipmentPageQuery) { + return http.get(`${BASE_URL}/list`, query) +} + +/** @desc 查询设备详情 */ +export function getEquipmentDetail(equipmentId: string) { + return http.get(`${BASE_URL}/detail/${equipmentId}`) +} + +/** @desc 新增设备 */ +export function createEquipment(data: T.EquipmentReq) { + return http.post(`${BASE_URL}`, data) +} + +/** @desc 更新设备 */ +export function updateEquipment(equipmentId: string, data: T.EquipmentReq) { + return http.put(`${BASE_URL}/${equipmentId}`, data) +} + +/** @desc 删除设备 */ +export function deleteEquipment(equipmentId: string) { + return http.del(`${BASE_URL}/${equipmentId}`) +} + +/** @desc 设备状态变更 */ +export function changeEquipmentStatus(equipmentId: string, status: string) { + return http.put(`${BASE_URL}/${equipmentId}/status`, { status }) +} + +/** @desc 设备分配 */ +export function assignEquipment(equipmentId: string, userId: string) { + return http.put(`${BASE_URL}/${equipmentId}/assign`, { userId }) +} + +/** @desc 设备归还 */ +export function returnEquipment(equipmentId: string) { + return http.put(`${BASE_URL}/${equipmentId}/return`) +} \ No newline at end of file diff --git a/src/apis/equipment/type.ts b/src/apis/equipment/type.ts new file mode 100644 index 0000000..6509850 --- /dev/null +++ b/src/apis/equipment/type.ts @@ -0,0 +1,277 @@ +/** + * 设备列表查询请求 + */ +export interface EquipmentListReq { + /** 最低价格 */ + minPrice?: number + /** 最高价格 */ + maxPrice?: number + /** 设备名称 */ + equipmentName?: string + /** 设备类型 */ + equipmentType?: string + /** 设备状态 */ + equipmentStatus?: string + /** 设备序列号 */ + equipmentSn?: string + /** 资产编号 */ + assetCode?: string + /** 品牌 */ + brand?: string + /** 位置状态 */ + locationStatus?: string + /** 健康状态 */ + healthStatus?: string + /** 负责人 */ + responsiblePerson?: string + /** 使用状态 */ + useStatus?: string + /** 项目ID */ + projectId?: string + /** 使用人ID */ + userId?: string + /** 设备型号 */ + equipmentModel?: string + /** 配置规格/参数 */ + specification?: string + /** 设备当前物理位置 */ + physicalLocation?: string + /** 供应商名称 */ + supplierName?: string + /** 采购订单号 */ + purchaseOrder?: string + /** 维护人员 */ + maintenancePerson?: string + /** 次户号 */ + accountNumber?: string + /** 数量 */ + quantity?: number + /** 单价 */ + unitPrice?: number + /** 总价 */ + totalPrice?: number + /** 盘点依据 */ + inventoryBasis?: string + /** 动态记录 */ + dynamicRecord?: string + /** 资产备注 */ + assetRemark?: string + /** 采购时间开始 */ + purchaseTimeStart?: string + /** 采购时间结束 */ + purchaseTimeEnd?: string + /** 入库时间开始 */ + inStockTimeStart?: string + /** 入库时间结束 */ + inStockTimeEnd?: string + /** 启用时间开始 */ + activationTimeStart?: string + /** 启用时间结束 */ + activationTimeEnd?: string + /** 当前页码 */ + pageNum?: number + /** 每页大小 */ + pageSize?: number + /** 排序字段 */ + orderBy?: string + /** 排序方向 */ + orderDirection?: string + /** 页码 */ + page?: number + /** 库存条码 */ + inventoryBarcode?: string +} + +/** + * 分页响应格式 + */ +export interface PageResult { + code: number + msg: string + rows: T[] + total: number +} + +/** + * 设备信息响应 + */ +export interface EquipmentResp { + /** 设备ID */ + equipmentId: string + /** 资产编号 */ + assetCode?: string + /** 设备名称 */ + equipmentName: string + /** 设备类型 */ + equipmentType: string + /** 设备类型描述 */ + equipmentTypeLabel?: string + /** 设备型号 */ + equipmentModel: string + /** 设备SN */ + equipmentSn: string + /** 品牌 */ + brand?: string + /** 配置规格/参数 */ + specification?: string + /** 设备状态 */ + equipmentStatus: string + /** 设备状态描述 */ + equipmentStatusLabel?: string + /** 使用状态 */ + useStatus: string + /** 位置状态 */ + locationStatus?: string + /** 位置状态描述 */ + locationStatusLabel?: string + /** 设备当前物理位置 */ + physicalLocation?: string + /** 负责人 */ + responsiblePerson?: string + /** 健康状态 */ + healthStatus?: string + /** 健康状态描述 */ + healthStatusLabel?: string + /** 采购时间 */ + purchaseTime?: string + /** 入库时间 */ + inStockTime?: string + /** 启用时间 */ + activationTime?: string + /** 预计报废时间 */ + expectedScrapTime?: string + /** 实际报废时间 */ + actualScrapTime?: string + /** 状态变更时间 */ + statusChangeTime?: string + /** 采购订单 */ + purchaseOrder?: string + /** 供应商名称 */ + supplierName?: string + /** 采购价格 */ + purchasePrice?: number + /** 当前净值 */ + currentNetValue?: number + /** 折旧方法 */ + depreciationMethod?: string + /** 折旧年限 */ + depreciationYears?: number + /** 残值 */ + salvageValue?: number + /** 保修截止日期 */ + warrantyExpireDate?: string + /** 上次维护日期 */ + lastMaintenanceDate?: string + /** 下次维护日期 */ + nextMaintenanceDate?: string + /** 维护人员 */ + maintenancePerson?: string + /** 库存条码 */ + inventoryBarcode?: string + /** 资产备注 */ + assetRemark?: string + /** 项目ID */ + projectId?: string + /** 项目名称 */ + projectName?: string + /** 使用人ID */ + userId?: string + /** 使用人 */ + name?: string + /** 创建时间 */ + createTime?: string + /** 更新时间 */ + updateTime?: string + /** 次户号 */ + accountNumber?: string + /** 数量 */ + quantity?: number + /** 单价 */ + unitPrice?: number + /** 总价 */ + totalPrice?: number + /** 盘点依据 */ + inventoryBasis?: string + /** 动态记录 */ + dynamicRecord?: string +} + +/** + * 设备请求 + */ +export interface EquipmentReq { + /** 设备名称 */ + equipmentName: string + /** 设备型号 */ + equipmentModel: string + /** 设备类型 */ + equipmentType: string + /** 设备状态 */ + equipmentStatus: string + /** 使用状态 */ + useStatus: string + /** 设备序列号 */ + equipmentSn: string + /** 资产编号 */ + assetCode?: string + /** 品牌 */ + brand?: string + /** 配置规格/参数 */ + specification?: string + /** 位置状态 */ + locationStatus?: string + /** 设备当前物理位置 */ + physicalLocation?: string + /** 负责人 */ + responsiblePerson?: string + /** 健康状态 */ + healthStatus?: string + /** 采购时间 */ + purchaseTime?: string + /** 入库时间 */ + inStockTime?: string + /** 启用时间 */ + activationTime?: string + /** 预计报废时间 */ + expectedScrapTime?: string + /** 实际报废时间 */ + actualScrapTime?: string + /** 采购订单 */ + purchaseOrder?: string + /** 供应商名称 */ + supplierName?: string + /** 采购价格 */ + purchasePrice?: number + /** 当前净值 */ + currentNetValue?: number + /** 折旧方法 */ + depreciationMethod?: string + /** 折旧年限 */ + depreciationYears?: number + /** 残值 */ + salvageValue?: number + /** 保修截止日期 */ + warrantyExpireDate?: string + /** 上次维护日期 */ + lastMaintenanceDate?: string + /** 下次维护日期 */ + nextMaintenanceDate?: string + /** 维护人员 */ + maintenancePerson?: string + /** 库存条码 */ + inventoryBarcode?: string + /** 资产备注 */ + assetRemark?: string + /** 次户号 */ + accountNumber?: string + /** 数量 */ + quantity?: number + /** 单价 */ + unitPrice?: number + /** 总价 */ + totalPrice?: number + /** 盘点依据 */ + inventoryBasis?: string + /** 动态记录 */ + dynamicRecord?: string +} diff --git a/src/router/route.ts b/src/router/route.ts index 2cc71a8..0854679 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -1050,7 +1050,7 @@ export const systemRoutes: RouteRecordRaw[] = [ children: [ { path: '/user/profile', - name: 'UserProfile', + name: 'UsersProfile', component: () => import('@/views/user/profile/index.vue'), meta: { title: '个人中心', diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index eab6be6..369aad4 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -70,6 +70,6 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' import('vue') } diff --git a/src/types/equipment.d.ts b/src/types/equipment.d.ts new file mode 100644 index 0000000..2e423b4 --- /dev/null +++ b/src/types/equipment.d.ts @@ -0,0 +1,179 @@ +export interface EquipmentPageQuery { + equipmentName?: string + equipmentType?: string + equipmentStatus?: string + equipmentSn?: string + assetCode?: string + brand?: string + locationStatus?: string + healthStatus?: string + responsiblePerson?: string + useStatus?: string + projectId?: string + userId?: string + equipmentModel?: string + specification?: string + physicalLocation?: string + supplierName?: string + maintenancePerson?: string + inventoryBarcode?: string + assetRemark?: string + // 新增搜索字段 + usingDepartment?: string + invoice?: string + barcode?: string + importer?: string + page?: number + pageSize?: number + orderBy?: string + orderDirection?: string +} + +export interface EquipmentReq { + equipmentName: string + equipmentModel: string + equipmentType: string + equipmentStatus: string + useStatus: string + equipmentSn: string + assetCode?: string + brand?: string + specification?: string + locationStatus?: string + physicalLocation?: string + responsiblePerson?: string + healthStatus?: string + purchaseTime?: string + inStockTime?: string + activationTime?: string + expectedScrapTime?: string + actualScrapTime?: string + statusChangeTime?: string + purchaseOrder?: string + supplierName?: string + purchasePrice?: number + currentNetValue?: number + depreciationMethod?: string + depreciationYears?: number + salvageValue?: number + warrantyExpireDate?: string + lastMaintenanceDate?: string + nextMaintenanceDate?: string + maintenancePerson?: string + inventoryBarcode?: string + assetRemark?: string + // 新增字段 + usingDepartment?: string + borrowingTime?: string + returnTime?: string + outStockTime?: string + totalUsageTime?: string + depreciationRate?: number + depreciationMethodDesc?: string + invoice?: string + invoiceStatus?: string + attachments?: string + photos?: string + barcode?: string + importer?: string + inventoryTimeStatus1?: string + inventoryTimeStatus2?: string + inventoryTimeStatus3?: string + inventoryCheckTimeStatus1?: string + inventoryCheckTimeStatus2?: string + inventoryCheckTimeStatus3?: string +} + +export interface EquipmentResp { + equipmentId: string + assetCode?: string + equipmentName: string + equipmentType: string + equipmentTypeLabel?: string + equipmentModel: string + equipmentSn: string + brand?: string + specification?: string + equipmentStatus: string + equipmentStatusLabel?: string + useStatus: string + locationStatus?: string + locationStatusLabel?: string + physicalLocation?: string + responsiblePerson?: string + healthStatus?: string + healthStatusLabel?: string + purchaseTime?: string + inStockTime?: string + activationTime?: string + expectedScrapTime?: string + actualScrapTime?: string + statusChangeTime?: string + purchaseOrder?: string + supplierName?: string + purchasePrice?: number + currentNetValue?: number + depreciationMethod?: string + depreciationYears?: number + salvageValue?: number + warrantyExpireDate?: string + lastMaintenanceDate?: string + nextMaintenanceDate?: string + maintenancePerson?: string + inventoryBarcode?: string + assetRemark?: string + // 新增字段 + usingDepartment?: string + borrowingTime?: string + returnTime?: string + outStockTime?: string + totalUsageTime?: string + depreciationRate?: number + depreciationMethodDesc?: string + invoice?: string + invoiceStatus?: string + attachments?: string + photos?: string + barcode?: string + importer?: string + inventoryTimeStatus1?: string + inventoryTimeStatus2?: string + inventoryTimeStatus3?: string + inventoryCheckTimeStatus1?: string + inventoryCheckTimeStatus2?: string + inventoryCheckTimeStatus3?: string + projectId?: string + projectName?: string + userId?: string + name?: string + createTime?: string + updateTime?: string +} + +export interface EquipmentTypeOption { + label: string + value: string +} + +export interface EquipmentStatusOption { + label: string + value: string + color: string +} + +export interface LocationStatusOption { + label: string + value: string + color: string +} + +export interface HealthStatusOption { + label: string + value: string + color: string +} + +export interface DepreciationMethodOption { + label: string + value: string +} \ No newline at end of file diff --git a/src/views/business-data/business.vue b/src/views/bussiness-data/bussiness.vue similarity index 100% rename from src/views/business-data/business.vue rename to src/views/bussiness-data/bussiness.vue diff --git a/src/views/project-management/bidding/information-retrieval/components/BiddingDetailModal.vue b/src/views/project-management/bidding/information-retrieval/components/BiddingDetailModal.vue index 992779f..09b8f91 100644 --- a/src/views/project-management/bidding/information-retrieval/components/BiddingDetailModal.vue +++ b/src/views/project-management/bidding/information-retrieval/components/BiddingDetailModal.vue @@ -73,7 +73,7 @@ + + \ No newline at end of file diff --git a/src/views/project-management/bidding/information-retrieval/types.ts b/src/views/project-management/bidding/information-retrieval/types.ts new file mode 100644 index 0000000..c4f8347 --- /dev/null +++ b/src/views/project-management/bidding/information-retrieval/types.ts @@ -0,0 +1,64 @@ +// 项目状态枚举 +export enum ProjectStatus { + NOT_STARTED = 'not_started', + IN_PROGRESS = 'in_progress', + COMPLETED = 'completed', + PAUSED = 'paused', + CANCELLED = 'cancelled' +} + +// 项目数据接口 +export interface ProjectData { + id: number + projectName: string + unitCount: number + startDate: string + endDate: string + status: ProjectStatus + progress: number + manager: string + isMyProject: boolean + description?: string + location?: string + client?: string + budget?: number + team?: string[] +} + +// 选项卡类型 +export type TabKey = 'all' | 'my' | 'pending' + +// 项目筛选条件 +export interface ProjectFilter { + keyword?: string + status?: ProjectStatus + manager?: string + dateRange?: [string, string] +} + +// 项目统计信息 +export interface ProjectStats { + total: number + inProgress: number + completed: number + notStarted: number + myProjects: number +} + +// 招标详情 +export interface BiddingDetail { + id: number + projectName: string + biddingUnit: string + budgetAmount: number + deadline: string + crawlingTime: string + projectLocation: string + projectDuration: string + biddingScope: string + qualificationRequirements: string + sourcePlatform: string + biddingDocuments: string + biddingContent: string + contentItems?: string[] +}