shiyanyu 11 часов назад
Родитель
Сommit
b305bbe5ef

+ 1 - 0
src/components/task/taskComponents/auditNoticeTab.vue

@@ -375,6 +375,7 @@
     addCostProjectDocument,
     updateCostProjectDocument,
     deleteCostProjectDocument,
+    downDocument,
   } from '@/api/taskCustomizedRelease.js'
   import { dictMixin, regionMixin } from '@/mixins/useDict'
   import { uploadFile } from '@/api/file'

+ 21 - 8
src/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue

@@ -578,16 +578,21 @@
 
         let base = labels.concat(extras)
 
-        // 基于元数据控制显示:固定表头只保留“非期间字段”(isAuditPeriod=true 的字段一律不显示,即使 showVisible=1 也不例外)
+        // 基于元数据控制显示:
+        // 1) 期间字段一律从固定表头剔除,避免与“${year}${fieldName}”动态列重复
+        // 2) showVisible === '0' 的字段:固定表头不显示
         let filtered = base.filter((label) => {
           const m = this.getFieldMeta(label)
           if (!m) return true
-          // 期间字段一律从固定表头剔除,避免与“${year}${fieldName}”动态列重复
+
+          // 期间字段一律剔除
           if (this.isAuditPeriodMeta(m)) return false
 
-          // 非期间字段:showVisible=1 强制显示
+          // showVisible === '0':不显示
           const sv = m.showVisible
-          if (sv != null && String(sv).trim() === '1') return true
+          if (sv != null && String(sv).trim() === '0') return false
+
+          // 非期间字段:showVisible=1 强制显示(其余情况默认显示)
           return true
         })
 
@@ -655,15 +660,23 @@
         return cols
       },
 
-      // ====== fixedFields 渲染辅助(基于 columnsMeta)======
+      // 统一表头 key 规范化:去除所有空白字符(解决后端 fieldName 带大量空格导致无法匹配的问题)
+      normalizeHeaderKey(val) {
+        return String(val == null ? '' : val)
+          .replace(/\s+/g, '')
+          .trim()
+      },
+
+      // ====== fixedFields 渲染辅助(基于 columnsMeta / surveyData.fixedHeaders)======
       getFieldMeta(label) {
         const metas = this.metaList()
-        const key = String(label || '').trim()
+        const key = this.normalizeHeaderKey(label)
         if (!key) return null
+
         return (
-          metas.find((m) => String(m?.label || '').trim() === key) ||
+          metas.find((m) => this.normalizeHeaderKey(m?.label) === key) ||
           metas.find(
-            (m) => String(m?.fieldName || m?.name || '').trim() === key
+            (m) => this.normalizeHeaderKey(m?.fieldName || m?.name) === key
           ) ||
           null
         )