Explorar el Código

fix(pms): 优化计划工作部门名称展示

- 支持项目、队伍及公司名称兜底显示
- 将项目名称列调整为部门名称
- 同步更新部门名称合并及汇总逻辑
- 移除接口数据调试日志
Zimo hace 1 semana
padre
commit
8e244e931f
Se han modificado 2 ficheros con 7 adiciones y 11 borrados
  1. 2 0
      src/api/pms/iotprojecttaskplan/index.ts
  2. 5 11
      src/views/pms/plan-work/index.vue

+ 2 - 0
src/api/pms/iotprojecttaskplan/index.ts

@@ -18,6 +18,8 @@ export interface IotProjectTaskPlanSummaryItem {
 export interface IotProjectTaskPlanSummaryVO {
   business: string
   projectDeptName: string
+  teamName: string
+  companyName: string
   items: IotProjectTaskPlanSummaryItem[]
   cumulativeGasInjection?: number | string | null
   cumulativeFootage?: number | string | null

+ 5 - 11
src/views/pms/plan-work/index.vue

@@ -33,7 +33,7 @@ interface MonthColumn {
 }
 
 interface SummaryTableRow {
-  projectDeptName: string
+  name: string
   business: string
   unit: string
   monthValues: Record<string, number | null>
@@ -117,7 +117,7 @@ const buildTableData = (list: IotProjectTaskPlanSummaryVO[]) => {
       })
 
       return {
-        projectDeptName: project.projectDeptName || '-',
+        name: project.projectDeptName ?? project.teamName ?? project.companyName ?? '-',
         business,
         unit: metric?.unit || '-',
         monthValues,
@@ -146,7 +146,7 @@ const getColumnSummaries = ({ columns, data }: SummaryMethodProps) => {
   return columns.map((column) => {
     const property = column.property
 
-    if (property === 'projectDeptName') return '合计'
+    if (property === 'name') return '合计'
     if (property === 'total') return sumValues(data.map((row) => row.total))
 
     if (property?.startsWith('month-')) {
@@ -165,7 +165,7 @@ const tableSpanMethod = ({
   row: SummaryTableRow
   column: { property?: string }
 }) => {
-  if (column.property !== 'projectDeptName') return [1, 1]
+  if (column.property !== 'name') return [1, 1]
   return row.projectRowSpan ? [row.projectRowSpan, 1] : [0, 0]
 }
 
@@ -173,7 +173,6 @@ const loadSummaryStatistics = useDebounceFn(async () => {
   loading.value = true
   try {
     const data = await IotProjectTaskPlanApi.getSummaryStatistics(query.value)
-    console.log('计划工作汇总统计接口数据:', data)
     buildTableData(Array.isArray(data?.list) ? data.list : [])
   } finally {
     loading.value = false
@@ -250,12 +249,7 @@ watch(
               empty-text="暂无数据"
               show-summary
               show-border>
-              <ZmTableColumn
-                prop="projectDeptName"
-                label="项目名称"
-                :min-width="180"
-                fixed="left"
-                show-overflow-tooltip />
+              <ZmTableColumn prop="name" label="部门名称" fixed="left" show-overflow-tooltip />
               <ZmTableColumn prop="business" label="项目业务" fixed="left" />
               <ZmTableColumn
                 v-for="month in monthColumns"