From 71478a4818764a9f99f6d581771ff9bd9df94721 Mon Sep 17 00:00:00 2001 From: yangk Date: Thu, 21 May 2026 19:01:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(oa/erp):=20=E5=AE=8C=E5=96=84=E9=A2=84?= =?UTF-8?q?=E6=8A=95=E5=B7=A5=E6=97=B6=E5=88=86=E9=85=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加员工级可分配明细查询接口 - 重构预投工时分配页面界面,优化搜索表单布局 - 替换月份输入框为日期选择器组件 - 添加预投项目下拉选择功能 - 实现工时分配详情表格展示 - 集成员工工时分配去向管理功能 - 添加工时分配验证机制 - 优化表格列显示配置 - 实现已回写单据删除限制功能 - 添加工时格式化显示功能 - 集成项目信息获取接口 - 实现工时分配状态自动计算 - 添加工时超分配警告提示 - 重构表单提交数据构建逻辑 --- src/api/oa/erp/timesheetPreAlloc/index.ts | 15 +- src/api/oa/erp/timesheetPreAlloc/types.ts | 77 +- src/views/oa/erp/timesheetPreAlloc/index.vue | 737 +++++++++++++----- .../oa/erp/timesheetPreAllocDetail/index.vue | 594 +++++++------- 4 files changed, 898 insertions(+), 525 deletions(-) diff --git a/src/api/oa/erp/timesheetPreAlloc/index.ts b/src/api/oa/erp/timesheetPreAlloc/index.ts index 4ed38a7..a6b6fd5 100644 --- a/src/api/oa/erp/timesheetPreAlloc/index.ts +++ b/src/api/oa/erp/timesheetPreAlloc/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { TimesheetPreAllocVO, TimesheetPreAllocForm, TimesheetPreAllocQuery } from '@/api/oa/erp/timesheetPreAlloc/types'; +import { TimesheetPreAllocVO, TimesheetPreAllocForm, TimesheetPreAllocQuery, PreAllocDetailVO } from '@/api/oa/erp/timesheetPreAlloc/types'; /** * 查询预投工时分配列表 @@ -20,13 +20,24 @@ export const listTimesheetPreAlloc = (query?: TimesheetPreAllocQuery): AxiosProm * 查询预投工时分配详细 * @param allocId */ -export const getTimesheetPreAlloc = (allocId: string | number): AxiosPromise => { +export const getTimesheetPreAlloc = (allocId: string | number): AxiosPromise => { return request({ url: '/oa/erp/timesheetPreAlloc/' + allocId, method: 'get' }); }; +/** + * 查询当前部门指定月份、来源预投项目的员工级可分配明细 + */ +export const getStaffAllocDetails = (query: { monthCode: string; projectId: string | number }): AxiosPromise => { + return request({ + url: '/oa/erp/timesheetPreAlloc/getStaffAllocDetails', + method: 'get', + params: query + }); +}; + /** * 新增预投工时分配 * @param data diff --git a/src/api/oa/erp/timesheetPreAlloc/types.ts b/src/api/oa/erp/timesheetPreAlloc/types.ts index 4d52921..262d353 100644 --- a/src/api/oa/erp/timesheetPreAlloc/types.ts +++ b/src/api/oa/erp/timesheetPreAlloc/types.ts @@ -20,7 +20,7 @@ export interface TimesheetPreAllocVO { standardMonthId: string | number; /** - * 项目ID(备件、物流) + * 来源预投项目ID */ projectId: string | number; @@ -98,7 +98,7 @@ export interface TimesheetPreAllocForm extends BaseEntity { standardMonthId?: string | number; /** - * 项目ID(备件、物流) + * 来源预投项目ID */ projectId?: string | number; @@ -152,6 +152,11 @@ export interface TimesheetPreAllocForm extends BaseEntity { */ remark?: string; + /** + * 员工级分配明细 + */ + staffAllocList?: PreAllocStaffAlloc[]; + } export interface TimesheetPreAllocQuery extends PageQuery { @@ -172,7 +177,7 @@ export interface TimesheetPreAllocQuery extends PageQuery { standardMonthId?: string | number; /** - * 项目ID(备件、物流) + * 来源预投项目ID */ projectId?: string | number; @@ -227,5 +232,71 @@ export interface TimesheetPreAllocQuery extends PageQuery { params?: any; } +export interface PreAllocTarget { + /** + * 目标实际项目ID + */ + targetProjectId?: string | number; + + /** + * 目标项目编码 + */ + targetProjectCode?: string; + + /** + * 目标项目名称 + */ + targetProjectName?: string; + + /** + * 分配工时(天) + */ + allocHours?: number; +} + +export interface PreAllocStaffAlloc { + /** + * 员工用户ID + */ + staffUserId?: string | number; + + /** + * 员工姓名 + */ + staffName?: string; + + /** + * 来源预投工时(天) + */ + sourceHours?: number; + + /** + * 已分配工时(天) + */ + allocatedHours?: number; + + /** + * 未分配工时(天) + */ + remainingHours?: number; + + /** + * 目标项目分配明细 + */ + allocItems?: PreAllocTarget[]; +} + +export interface PreAllocDetailVO extends TimesheetPreAllocVO { + /** + * 未分配工时(天) + */ + remainingTotalHours: number; + + /** + * 员工级分配明细 + */ + staffAllocList: PreAllocStaffAlloc[]; +} + diff --git a/src/views/oa/erp/timesheetPreAlloc/index.vue b/src/views/oa/erp/timesheetPreAlloc/index.vue index 41b61e3..f9e639a 100644 --- a/src/views/oa/erp/timesheetPreAlloc/index.vue +++ b/src/views/oa/erp/timesheetPreAlloc/index.vue @@ -3,60 +3,40 @@
- + - - - - - - - - - - - - - - - - - + - - + + + + - - - - - + + - - - - - - - - - - - 搜索 重置 @@ -73,64 +53,75 @@ 新增 - 修改 + + 修改 + - 删除 + 删除 + 导出 - + - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + - - + + @@ -138,55 +129,106 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ dict.label }} - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
+
+ 来源预投工时 + {{ formatHours(sourceTotalHours) }} +
+
+ 已分配工时 + {{ formatHours(allocatedTotalHours) }} +
+
+ 未分配工时 + {{ formatHours(remainingTotalHours) }} +
+
+ 涉及人数 + {{ staffCount }} +
+
+ + + + + + + + + + + + + + + + + + +