diff --git a/src/apis/equipment/approval.ts b/src/apis/equipment/approval.ts new file mode 100644 index 0000000..7867d6e --- /dev/null +++ b/src/apis/equipment/approval.ts @@ -0,0 +1,49 @@ +import http from '@/utils/http' +import type { EquipmentApprovalReq, EquipmentApprovalResp, EquipmentApprovalListReq } from './type' + +/** + * 设备审批管理API + */ +export const equipmentApprovalApi = { + /** + * 分页查询待审批的设备采购申请 + */ + getPendingApprovals: (params: EquipmentApprovalListReq) => { + return http.get>>('/equipment/approval/pending', { params }) + }, + + /** + * 分页查询已审批的设备采购申请 + */ + getApprovedApprovals: (params: EquipmentApprovalListReq) => { + return http.get>>('/equipment/approval/approved', { params }) + }, + + /** + * 审批通过 + */ + approve: (approvalId: string, data: EquipmentApprovalReq) => { + return http.post>(`/equipment/approval/${approvalId}/approve`, data) + }, + + /** + * 审批拒绝 + */ + reject: (approvalId: string, data: EquipmentApprovalReq) => { + return http.post>(`/equipment/approval/${approvalId}/reject`, data) + }, + + /** + * 获取审批详情 + */ + getApprovalDetail: (approvalId: string) => { + return http.get>(`/equipment/approval/${approvalId}`) + }, + + /** + * 获取审批统计信息 + */ + getApprovalStats: () => { + return http.get>('/equipment/approval/stats') + } +} diff --git a/src/apis/equipment/type.ts b/src/apis/equipment/type.ts index 6509850..854fa3c 100644 --- a/src/apis/equipment/type.ts +++ b/src/apis/equipment/type.ts @@ -275,3 +275,117 @@ export interface EquipmentReq { /** 动态记录 */ dynamicRecord?: string } + +/** + * 设备审批状态枚举 + */ +export enum ApprovalStatus { + PENDING = 'PENDING', + APPROVED = 'APPROVED', + REJECTED = 'REJECTED' +} + +/** + * 设备审批业务类型枚举 + */ +export enum BusinessType { + PROCUREMENT = 'PROCUREMENT', + BORROW = 'BORROW', + RETURN = 'RETURN' +} + +/** + * 设备审批列表查询请求 + */ +export interface EquipmentApprovalListReq { + /** 设备名称 */ + equipmentName?: string + /** 申请人 */ + applicantName?: string + /** 审批状态 */ + approvalStatus?: ApprovalStatus + /** 业务类型 */ + businessType?: BusinessType + /** 申请时间开始 */ + applyTimeStart?: string + /** 申请时间结束 */ + applyTimeEnd?: string + /** 审批时间开始 */ + approvalTimeStart?: string + /** 审批时间结束 */ + approvalTimeEnd?: string + /** 当前页码 */ + page?: number + /** 页码(后端可能期望的字段名) */ + pageNum?: number + /** 每页大小 */ + pageSize?: number + /** 排序字段 */ + orderBy?: string + /** 排序方向 */ + orderDirection?: string +} + +/** + * 设备审批请求 + */ +export interface EquipmentApprovalReq { + /** 审批意见 */ + approvalComment?: string + /** 审批结果 */ + approvalResult: 'APPROVED' | 'REJECTED' + /** 审批人 */ + approverName?: string + /** 审批人ID */ + approverId?: string +} + +/** + * 设备审批响应 + */ +export interface EquipmentApprovalResp { + /** 审批ID */ + approvalId: string + /** 设备ID */ + equipmentId: string + /** 设备名称 */ + equipmentName: string + /** 设备类型 */ + equipmentType: string + /** 设备型号 */ + equipmentModel: string + /** 品牌 */ + brand?: string + /** 供应商名称 */ + supplierName?: string + /** 采购价格 */ + purchasePrice?: number + /** 总价 */ + totalPrice?: number + /** 数量 */ + quantity?: number + /** 申请人 */ + applicantName: string + /** 申请人ID */ + applicantId: string + /** 申请时间 */ + applyTime: string + /** 申请原因 */ + applyReason?: string + /** 业务类型 */ + businessType: BusinessType + /** 审批状态 */ + approvalStatus: ApprovalStatus + /** 审批人 */ + approverName?: string + /** 审批人ID */ + approverId?: string + /** 审批时间 */ + approvalTime?: string + /** 审批意见 */ + approvalComment?: string + /** 创建时间 */ + createTime: string + /** 更新时间 */ + updateTime: string +} diff --git a/src/router/route.ts b/src/router/route.ts index ebc3a84..ba06fd2 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -324,73 +324,7 @@ export const systemRoutes: RouteRecordRaw[] = [ // }, // ], // }, - { - path: '/asset-management', - name: 'AssetManagement', - component: Layout, - redirect: '/asset-management/device/inventory', - meta: { title: '资产管理', icon: 'property-safety', hidden: false, sort: 3 }, - children: [ - { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty1', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '设备管理', icon: 'copyright', hidden: false }, - children: [ - { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty11', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '库存管理', hidden: false }, - }, - { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty12', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '设备采购', hidden: false }, - }, - { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty13', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '在线管理', hidden: false }, - children: [ - { - path: '/asset-management/intellectual-property11', - name: 'IntellectualProperty14', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '无人机', hidden: false }, - }, - { - path: '/asset-management/intellectual-property12', - name: 'IntellectualProperty15', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '机巢', hidden: false }, - }, - { - path: '/asset-management/intellectual-property13', - name: 'IntellectualProperty16', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '其他智能终端', hidden: false }, - }, - { - path: '/asset-management/intellectual-property14', - name: 'IntellectualProperty17', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '车辆管理', hidden: false }, - }, - ], - }, - ], - }, - { - path: '/asset-management/intellectual-property', - name: 'IntellectualProperty', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '其他资产', icon: 'copyright', hidden: false }, - }, - ], - }, + { path: '/products-services', name: 'ProductsServices', @@ -1327,7 +1261,7 @@ export const systemRoutes: RouteRecordRaw[] = [ }, { path: '/system-resource/device-management/online', - name: 'DeviceOnline', + name: 'SystemResourceDeviceOnline', component: () => import('@/components/ParentView/index.vue'), redirect: '/system-resource/device-management/online/drone', meta: { @@ -1338,7 +1272,7 @@ export const systemRoutes: RouteRecordRaw[] = [ children: [ { path: '/system-resource/device-management/online/drone', - name: 'DeviceDrone', + name: 'SystemResourceDeviceDrone', component: () => import('@/views/system-resource/device-management/index.vue'), meta: { title: '无人机', @@ -1348,7 +1282,7 @@ export const systemRoutes: RouteRecordRaw[] = [ }, { path: '/system-resource/device-management/online/nest', - name: 'DeviceNest', + name: 'SystemResourceDeviceNest', component: () => import('@/views/system-resource/device-management/index.vue'), meta: { title: '机巢', @@ -1358,7 +1292,7 @@ export const systemRoutes: RouteRecordRaw[] = [ }, { path: '/system-resource/device-management/online/smart-terminal', - name: 'DeviceSmartTerminal', + name: 'SystemResourceDeviceSmartTerminal', component: () => import('@/views/system-resource/device-management/index.vue'), meta: { title: '其他智能终端', diff --git a/src/stores/modules/route.ts b/src/stores/modules/route.ts index 40ce43e..909490b 100644 --- a/src/stores/modules/route.ts +++ b/src/stores/modules/route.ts @@ -226,6 +226,79 @@ const storeSetup = () => { { id: 2013, parentId: 2010, + title: '审批台', + type: 2, + path: '/asset-management/device-management/approval', + name: 'DeviceApproval', + component: 'system-resource/device-management/approval/index', + icon: 'check-circle', + isExternal: false, + isCache: false, + isHidden: false, + sort: 3, + }, + { + id: 2014, + parentId: 2010, + title: '在线管理', + type: 1, + path: '/asset-management/device-management/online', + name: 'DeviceOnline', + component: 'Layout', + redirect: '/asset-management/device-management/online/drone', + icon: 'cloud', + isExternal: false, + isCache: false, + isHidden: false, + sort: 4, + children: [ + { + id: 20141, + parentId: 2014, + title: '无人机', + type: 2, + path: '/asset-management/device-management/online/drone', + name: 'DeviceDrone', + component: 'system-resource/device-management/index', + icon: 'drone', + isExternal: false, + isCache: false, + isHidden: false, + sort: 1, + }, + { + id: 20142, + parentId: 2014, + title: '机巢', + type: 2, + path: '/asset-management/device-management/online/nest', + name: 'DeviceNest', + component: 'system-resource/device-management/index', + icon: 'nest', + isExternal: false, + isCache: false, + isHidden: false, + sort: 2, + }, + { + id: 20143, + parentId: 2014, + title: '其他智能终端', + type: 2, + path: '/asset-management/device-management/online/smart-terminal', + name: 'DeviceSmartTerminal', + component: 'system-resource/device-management/index', + icon: 'terminal', + isExternal: false, + isCache: false, + isHidden: false, + sort: 3, + }, + ], + }, + { + id: 2015, + parentId: 2010, title: '设备详情', type: 2, path: '/asset-management/device-management/device-detail/:id', @@ -235,7 +308,7 @@ const storeSetup = () => { isExternal: false, isCache: false, isHidden: true, - sort: 3, + sort: 5, }, ], }, diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 369aad4..eab6be6 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, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' import('vue') } diff --git a/src/utils/http.ts b/src/utils/http.ts index 063186a..5894b18 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -70,10 +70,10 @@ http.interceptors.response.use( if (data && data.rows !== undefined && data.data === undefined) { data.data = data.rows } - + // 兼容不同的API响应结构 const { success, code, msg } = data - + // 检查响应类型是否是blob if (response.request.responseType === 'blob') { const contentType = data.type @@ -96,7 +96,7 @@ http.interceptors.response.use( return response } } - + // 判断请求是否成功:明确的success字段为true,或者code为200都视为成功 const isSuccess = success !== undefined ? success : (code === 200 || code === '200') if (isSuccess) { @@ -139,17 +139,17 @@ const request = async (config: AxiosRequestConfig): Promise { // 处理返回数据结构,兼容rows和data字段 const responseData = res.data - + // 如果返回的数据中有rows字段但没有data字段,将rows赋值给data if (responseData.rows !== undefined && responseData.data === undefined) { responseData.data = responseData.rows } - + // 如果返回的code是200但没有设置success字段,将success设置为true if ((responseData.code === 200 || responseData.code === '200') && responseData.success === undefined) { responseData.success = true } - + return responseData }) .catch((err: { msg: string }) => Promise.reject(err)) @@ -168,7 +168,7 @@ const requestRaw = async (config: AxiosRequestConfig): Promise { @@ -183,7 +183,7 @@ const requestRaw = async (config: AxiosRequestConfig): Promise Promise.reject(error), ) - + return rawAxios.request(config) } @@ -225,3 +225,7 @@ export default { requestRaw, download, } + +export const updateContract = (contractId, contractData) => { + return http.put(`/contract/${contractId}`, contractData) +} diff --git a/src/views/project-management/contract/revenue-contract/ContractDetail.vue b/src/views/project-management/contract/revenue-contract/ContractDetail.vue new file mode 100644 index 0000000..dbba383 --- /dev/null +++ b/src/views/project-management/contract/revenue-contract/ContractDetail.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/project-management/contract/revenue-contract/index.vue b/src/views/project-management/contract/revenue-contract/index.vue index 6a6c018..0e79d54 100644 --- a/src/views/project-management/contract/revenue-contract/index.vue +++ b/src/views/project-management/contract/revenue-contract/index.vue @@ -1,28 +1,28 @@ \ No newline at end of file + diff --git a/src/views/system-resource/device-management/approval/components/ApprovalActionModal.vue b/src/views/system-resource/device-management/approval/components/ApprovalActionModal.vue new file mode 100644 index 0000000..5480187 --- /dev/null +++ b/src/views/system-resource/device-management/approval/components/ApprovalActionModal.vue @@ -0,0 +1,339 @@ + + + + + diff --git a/src/views/system-resource/device-management/approval/components/ApprovalDetailModal.vue b/src/views/system-resource/device-management/approval/components/ApprovalDetailModal.vue new file mode 100644 index 0000000..2312339 --- /dev/null +++ b/src/views/system-resource/device-management/approval/components/ApprovalDetailModal.vue @@ -0,0 +1,362 @@ + + + + + diff --git a/src/views/system-resource/device-management/approval/components/ApprovalSearch.vue b/src/views/system-resource/device-management/approval/components/ApprovalSearch.vue new file mode 100644 index 0000000..e90f809 --- /dev/null +++ b/src/views/system-resource/device-management/approval/components/ApprovalSearch.vue @@ -0,0 +1,303 @@ + + + + + diff --git a/src/views/system-resource/device-management/approval/index.vue b/src/views/system-resource/device-management/approval/index.vue new file mode 100644 index 0000000..858d248 --- /dev/null +++ b/src/views/system-resource/device-management/approval/index.vue @@ -0,0 +1,829 @@ + + + + +