فهرست منبع

fix: 审核端财务、成本调查表、成本审核修改

shiyanyu 3 هفته پیش
والد
کامیت
e42e09ddf8

+ 121 - 1
src/views/costAudit/auditInfo/auditManage/costAudit.vue

@@ -13,7 +13,7 @@
               <div
                 style="display: flex; justify-self: start; align-items: center"
               >
-                <div style="width: 120px">监审类别123:</div>
+                <div style="width: 120px">监审类别:</div>
                 <el-cascader
                   v-model="auditForm.catalogId"
                   :options="catalogListOptions"
@@ -411,6 +411,126 @@
       },
     },
     methods: {
+      handleTemplateTypeChange() {
+        if (this.auditForm && this.auditForm.templateType === '1') {
+          this.auditForm.historyTemplate = ''
+          this.loadSurveyFormOptions()
+        } else if (this.auditForm && this.auditForm.templateType === '2') {
+          this.auditForm.dataTable = ''
+          this.loadHistoryTemplateOptions()
+        }
+      },
+      async loadSurveyFormOptions() {
+        try {
+          const res = await getActiveCostVerifyFormListByType()
+          const list = Array.isArray(res?.value) ? res.value : []
+          // 规范为 surveyTemplateId / surveyTemplateName 结构供下拉使用
+          this.surveyFormList = list.map((it) => ({
+            surveyTemplateId:
+              it.surveyTemplateId || it.templateId || it.id || '',
+            surveyTemplateName:
+              it.surveyTemplateName ||
+              it.templatename ||
+              it.name ||
+              it.title ||
+              '',
+            ...it,
+          }))
+        } catch (e) {
+          console.error('获取成本调查表模板(固定表启用)失败:', e)
+          this.surveyFormList = []
+        }
+      },
+      async loadHistoryTemplateOptions() {
+        try {
+          const res = await getActiveCostVerifyFormList()
+          const list = Array.isArray(res?.value) ? res.value : []
+          // 规范为 surveyTemplateId / surveyTemplateName 结构供下拉使用
+          this.auditFormList = list.map((it) => ({
+            surveyTemplateId:
+              it.surveyTemplateId || it.templateId || it.id || '',
+            surveyTemplateName:
+              it.surveyTemplateName ||
+              it.templatename ||
+              it.name ||
+              it.title ||
+              '',
+            ...it,
+          }))
+        } catch (e) {
+          console.error('获取启用的成本核定表模板失败:', e)
+          this.auditFormList = []
+        }
+      },
+      handleGenerateTemplate() {
+        this.$confirm(
+          '生成后不能修改根据调查表生成还是根据历史核定模板生成,确定生成模板吗?',
+          '提示',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          }
+        ).then(() => {
+          this.$refs['auditForm'].validate((valid) => {
+            if (!valid) {
+              this.$message.error('请填写表单数据')
+              return
+            }
+            if (this.auditForm.templateType === '1') {
+              if (!this.auditForm.dataTable) {
+                this.$message.error('请选择成本调查表模板')
+                return
+              }
+              this.generateFromSurveyTemplate()
+            } else if (this.auditForm.templateType === '2') {
+              if (!this.auditForm.historyTemplate) {
+                this.$message.error('请选择历史核定模板')
+                return
+              }
+              this.generateFromHistoryTemplate()
+            } else {
+              this.$message.error('请选择模板来源方式')
+            }
+          })
+        })
+      },
+      async generateFromSurveyTemplate() {
+        try {
+          const resp = await generateCostVerifyForm({
+            catalogId: this.auditForm.catalogId,
+            templatename: this.auditForm.surveyTemplateName,
+            templateId: this.auditForm.dataTable,
+            taskId: (this.selectedProject && this.selectedProject.taskId) || '',
+          })
+          this.auditForm.surveyTemplateId = resp?.value?.surveyTemplateId || ''
+          if (typeof this.loadTemplateDataForEdit === 'function') {
+            await this.loadTemplateDataForEdit(this.auditForm.surveyTemplateId)
+          } else if (typeof this.loadTemplateData === 'function') {
+            await this.loadTemplateData()
+          }
+        } catch (error) {
+          console.error('生成模板失败:', error)
+        }
+      },
+      async generateFromHistoryTemplate() {
+        try {
+          const resp = await generateCostVerifyFormData({
+            catalogId: this.auditForm.catalogId,
+            templatename: this.auditForm.surveyTemplateName,
+            templateId: this.auditForm.historyTemplate,
+            taskId: (this.selectedProject && this.selectedProject.taskId) || '',
+          })
+          this.auditForm.surveyTemplateId = resp?.value?.surveyTemplateId || ''
+          if (typeof this.loadTemplateDataForEdit === 'function') {
+            await this.loadTemplateDataForEdit(this.auditForm.surveyTemplateId)
+          } else if (typeof this.loadTemplateData === 'function') {
+            await this.loadTemplateData()
+          }
+        } catch (error) {
+          console.error('生成模板失败:', error)
+        }
+      },
       // 单元格输入联动:当账面值或审核调整值变化时,自动计算核定值
       handleCellInput(row, item) {
         if (!row) return

+ 109 - 21
src/views/costAudit/auditInfo/auditManage/costSurvey.vue

@@ -20,25 +20,33 @@
       @refresh="noop"
     />
 
-    <!-- 固定表填报弹窗(只读) -->
+    <!-- 固定表弹窗(查看) -->
     <fixed-table-dialog
-      :visible.sync="fixedTableDialogVisible"
-      :survey-data="{ ...currentSurveyRow, fixedHeaders }"
-      :table-items="tableItems"
-      :audit-periods="auditPeriods"
+      :visible.sync="fixedDialogVisible"
+      :survey-data="surveyDetailData"
+      :fixed-fields="fixedFields || ''"
+      :fixed-fieldids="fixedFieldids || ''"
       :is-view-mode="true"
-      :audited-unit-id="auditedUnitId"
-      :upload-id="
-        currentSurveyRow && currentSurveyRow.id ? currentSurveyRow.id : uploadId
+      :request-type="1"
+      :audited-unit-id="
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
       "
+      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
       :survey-template-id="
-        currentSurveyRow && currentSurveyRow.surveyTemplateId
-          ? currentSurveyRow.surveyTemplateId
-          : surveyTemplateId
+        (currentTemplateRow &&
+          (currentTemplateRow.templateId ||
+            currentTemplateRow.surveyTemplateId)) ||
+        ''
       "
-      :catalog-id="catalogId"
-      @save="noop"
-      @refresh="noop"
+      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
+      :table-items="tableItems"
+      :audit-periods="
+        projectAuditPeriods && projectAuditPeriods.length
+          ? projectAuditPeriods
+          : auditPeriods
+      "
+      :project-audit-periods="projectAuditPeriods"
+      :project-audit-period="projectAuditPeriod"
     />
 
     <!-- 动态表填报弹窗(只读) -->
@@ -245,6 +253,7 @@
     reviewCastTaskInfo,
   } from '@/api/audit/survey'
   import { getListBySurveyTemplateIdAndVersion } from '@/api/costSurveyTemplateHeaders'
+  import { getProjectInformationInfo } from '@/api/auditTaskProcessing'
 
   export default {
     name: 'CostSurveyViewOnly',
@@ -259,6 +268,8 @@
       uploadId: { type: String, default: '' },
       surveyTemplateId: { type: String, default: '' },
       catalogId: { type: String, default: '' },
+      // 立项信息ID(用于获取监审期间)
+      projectId: { type: [String, Number], default: '' },
       currentNode: {
         type: String,
         default: '',
@@ -272,12 +283,18 @@
       return {
         surveyFormDialogVisible: false,
         fixedTableDialogVisible: false,
+        fixedDialogVisible: false,
         dynamicTableDialogVisible: false,
         currentSurveyRow: null,
+        currentTemplateRow: null,
         formFields: [],
         surveyDetailData: {},
         tableItems: [],
         auditPeriods: [],
+        projectAuditPeriods: [],
+        projectAuditPeriod: '',
+        fixedFields: '',
+        fixedFieldids: '',
         dynamicTableData: [],
         dynamicDialogKey: 0,
         dynamicTableLoading: false,
@@ -304,6 +321,7 @@
       // 查看(只读)
       async handleOnlineFillClick(row) {
         this.currentSurveyRow = row
+        this.currentTemplateRow = row
         this.surveyDetailData = {}
         if (row.tableType === '单记录') {
           if (row.id && this.auditedUnitId) {
@@ -837,6 +855,8 @@
             }
             const res = await getSingleRecordSurveyList(params)
             if (res && res.code === 200 && res.value) {
+              this.fixedFields = res.value.fixedFields || ''
+              this.fixedFieldids = res.value.fixedFieldids || ''
               const { itemlist } = res.value || {}
               if (Array.isArray(itemlist) && itemlist.length > 0) {
                 this.tableItems = itemlist.map((item) => ({
@@ -874,13 +894,27 @@
             this.auditPeriods = this.parseAuditPeriod(
               this.currentSurveyRow.auditPeriod
             )
-          } else {
-            const currentYear = new Date().getFullYear()
-            this.auditPeriods = [
-              String(currentYear - 2),
-              String(currentYear - 1),
-              String(currentYear),
-            ]
+          }
+          // else {
+          //   const currentYear = new Date().getFullYear()
+          // this.auditPeriods = [
+          //   String(currentYear - 2),
+          //   String(currentYear - 1),
+          //   String(currentYear),
+          // ]
+          // }
+
+          // 2.1) 获取立项信息监审期间作为优先回显(FixedTableDialog 内部会优先使用 projectAuditPeriods)
+          await this.fetchProjectAuditPeriods()
+          // 若立项未配置或接口未返回有效年份,则用已解析的 auditPeriods 覆盖传入,避免子组件回退到“最近三年”导致出现不期望年份
+          if (
+            (!this.projectAuditPeriods ||
+              this.projectAuditPeriods.length === 0) &&
+            Array.isArray(this.auditPeriods) &&
+            this.auditPeriods.length > 0
+          ) {
+            this.projectAuditPeriods = this.auditPeriods.slice()
+            this.projectAuditPeriod = this.auditPeriods.join(',')
           }
 
           // 3) 额外拉取表头/规则信息,并透传给弹窗
@@ -898,8 +932,22 @@
             this.fixedHeaders = null
           }
 
+          // 3.1) 将最终年份写入 surveyData,避免子组件走默认最近三年
+          const finalYears =
+            (this.projectAuditPeriods && this.projectAuditPeriods.length
+              ? this.projectAuditPeriods
+              : this.auditPeriods) || []
+          if (Array.isArray(finalYears) && finalYears.length > 0) {
+            const apStr = finalYears.join(',')
+            this.surveyDetailData = {
+              ...(this.surveyDetailData || {}),
+              auditPeriod: apStr,
+            }
+          }
+
           // 4) 打开固定表弹窗
           this.fixedTableDialogVisible = true
+          this.fixedDialogVisible = true
           return
         }
         // 兜底:没有条件则使用当前行自带配置或空
@@ -908,6 +956,46 @@
           this.getMockTableItems()
         this.fixedHeaders = null
         this.fixedTableDialogVisible = true
+        this.fixedDialogVisible = true
+      },
+      // 获取立项信息监审期间,供固定表年份优先回显
+      async fetchProjectAuditPeriods() {
+        try {
+          this.projectAuditPeriods = []
+          this.projectAuditPeriod = ''
+          const pid = this.projectId
+          if (!pid) return
+          const res = await getProjectInformationInfo(pid)
+          const val = res && res.value
+          if (!val) return
+
+          // 支持两种来源:字符串 auditPeriod 或 数组 auditPeriodArray
+          let years = []
+          if (typeof val.auditPeriod === 'string' && val.auditPeriod.trim()) {
+            years = this.parseAuditPeriod(val.auditPeriod)
+          } else if (Array.isArray(val.auditPeriod)) {
+            years = val.auditPeriod.map((y) => String(y))
+          } else if (Array.isArray(val.auditPeriodArray)) {
+            years = val.auditPeriodArray
+              .map((it) => it && (it.value || it))
+              .map((y) => String(y))
+          }
+
+          // 规范化:去空白、保留顺序去重、仅保留四位年份
+          const seen = new Set()
+          years = years
+            .map((y) => String(y || '').trim())
+            .filter(
+              (y) => /^(19|20)\d{2}$/.test(y) && !seen.has(y) && seen.add(y)
+            )
+
+          this.projectAuditPeriods = years
+          this.projectAuditPeriod = years.join(',')
+          console.log(this.projectAuditPeriods, 'this.projectAuditPeriods')
+          console.log(this.projectAuditPeriod, 'this.projectAuditPeriod')
+        } catch (e) {
+          // 忽略失败,保留已有解析结果
+        }
       },
       resetDynamicDialogState() {
         this.dynamicDialogKey += 1

+ 1 - 0
src/views/costAudit/auditInfo/auditManage/details.vue

@@ -42,6 +42,7 @@
             :upload-id="''"
             :survey-template-id="''"
             :catalog-id="catalogId"
+            :project-id="selectedProject && selectedProject.projectId"
             @handle-page-change="handleCostSurveyPageChange"
             @handle-size-change="handleCostSurveySizeChange"
             @refresh="handleCostSurveyRefresh"

+ 236 - 18
src/views/costAudit/auditInfo/auditManage/submitData.vue

@@ -143,59 +143,88 @@
         <el-button type="primary" @click="handleAuditSubmit">提交</el-button>
       </div>
     </el-dialog>
-    <!-- 单记录弹窗 -->
     <survey-form-dialog
       :visible.sync="singleDialogVisible"
-      :survey-data="{}"
+      :survey-data="{ ...(currentTemplateRow || {}), ...surveyDetailData }"
       :is-view-mode="true"
+      :request-type="2"
       :audited-unit-id="
-        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
+        auditedUnitId ||
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
+        ''
+      "
+      :upload-id="
+        (currentTemplateRow &&
+          (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
+        ''
       "
-      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
       :survey-template-id="
         (currentTemplateRow &&
           (currentTemplateRow.templateId ||
             currentTemplateRow.surveyTemplateId)) ||
         ''
       "
-      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
-      :request-type="2"
+      :catalog-id="
+        catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
+      "
     />
 
-    <!-- 固定表弹窗(查看模式) -->
     <fixed-table-dialog
       :visible.sync="fixedDialogVisible"
       :is-view-mode="true"
+      :request-type="2"
       :audited-unit-id="
-        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
+        auditedUnitId ||
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
+        ''
+      "
+      :upload-id="
+        (currentTemplateRow &&
+          (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
+        ''
       "
-      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
       :survey-template-id="
         (currentTemplateRow &&
           (currentTemplateRow.templateId ||
             currentTemplateRow.surveyTemplateId)) ||
         ''
       "
-      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
-      :request-type="2"
+      :catalog-id="
+        catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
+      "
+      :project-audit-periods="projectAuditPeriods"
+      :project-audit-period="projectAuditPeriod"
+      :audit-periods="auditPeriods"
+      :fixed-fields="fixedFields || ''"
+      :fixed-fieldids="fixedFieldids || ''"
+      :table-items="tableItems"
     />
 
-    <!-- 动态表弹窗(查看模式) -->
     <dynamic-table-dialog
       :visible.sync="dynamicDialogVisible"
       :is-view-mode="true"
+      :request-type="2"
       :audited-unit-id="
-        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
+        auditedUnitId ||
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) ||
+        ''
+      "
+      :upload-id="
+        (currentTemplateRow &&
+          (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
+        ''
       "
-      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
       :survey-template-id="
         (currentTemplateRow &&
           (currentTemplateRow.templateId ||
             currentTemplateRow.surveyTemplateId)) ||
         ''
       "
-      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
-      :request-type="2"
+      :catalog-id="
+        catalogId || (currentTemplateRow && currentTemplateRow.catalogId) || ''
+      "
+      :table-data="dynamicTableData"
+      :table-items="tableItems"
     />
   </div>
 </template>
@@ -226,6 +255,10 @@
   import SurveyFormDialog from '@/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue'
   import FixedTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue'
   import DynamicTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue'
+  import { getSingleRecordSurveyList } from '@/api/audit/survey'
+  import { getDynamicTableData } from '@/api/audit/survey'
+  import { getProjectInformationInfo } from '@/api/auditTaskProcessing'
+  import { getSurveyDetail } from '@/api/audit/survey'
 
   export default {
     name: 'AuditReview',
@@ -251,6 +284,24 @@
         type: Array,
         default: () => [],
       },
+      auditedUnitId: {
+        type: [String, Number],
+        default: '',
+      },
+      catalogId: {
+        type: [String, Number],
+        default: '',
+      },
+      // 任务ID,用于在缺少 uploadId 时回退查询详情
+      taskId: {
+        type: [String, Number],
+        default: '',
+      },
+      // 立项信息ID(用于获取监审期间)
+      projectId: {
+        type: [String, Number],
+        default: '',
+      },
     },
     data() {
       return {
@@ -280,6 +331,17 @@
         singleDialogVisible: false,
         fixedDialogVisible: false,
         dynamicDialogVisible: false,
+        // 固定表/动态表所需的配置与数据(用于弹窗透传)
+        fixedFields: '',
+        fixedFieldids: '',
+        tableItems: [],
+        dynamicTableData: [],
+        // 立项信息监审期间
+        projectAuditPeriods: [],
+        projectAuditPeriod: '',
+        auditPeriods: [],
+        // 详情回显数据(供单记录弹窗 survey-data 绑定使用)
+        surveyDetailData: {},
         // 资料审核表单数据
         auditForm: {
           auditedStatus: '通过', // 默认审核通过
@@ -464,21 +526,177 @@
         }
       },
       // 查看预置模板,按模板类型打开不同弹窗
-      handleViewTemplate(row) {
+      async handleViewTemplate(row) {
         this.currentTemplateRow = row || null
         const t = String(
           (row && (row.templateType || row.templatetype)) || ''
         ).trim()
         if (t === '1') {
+          // 单记录:清理并预取详情(type=2),与 costSurvey 实现保持一致的回显逻辑
+          this.surveyDetailData = {}
+          await this.loadSingleRecordDetail()
           this.singleDialogVisible = true
         } else if (t === '2') {
-          this.fixedDialogVisible = true
+          // 与 components 版本一致:先拉取固定表表头与项配置
+          const surveyTemplateId =
+            (row && (row.surveyTemplateId || row.templateId)) || ''
+          Promise.all([
+            this.initFixedTableData(surveyTemplateId),
+            this.fetchProjectAuditPeriods(),
+          ]).then(() => {
+            this.fixedDialogVisible = true
+          })
         } else if (t === '3') {
+          await this.initDynamicTableData()
           this.dynamicDialogVisible = true
         } else {
           this.$message.warning('未知的模板类型,无法打开预置模板')
         }
       },
+      // 预取动态表数据(type=2),与 costSurvey 一致的参数拼装,但本页使用 type=2
+      async initDynamicTableData() {
+        this.dynamicTableData = []
+        const row = this.currentTemplateRow || {}
+        const uploadId = row.uploadId || row.id || ''
+        const auditedUnitId = row.auditedUnitId || this.auditedUnitId || ''
+        const catalogId = row.catalogId || this.catalogId || ''
+        const surveyTemplateId = row.templateId || row.surveyTemplateId || ''
+        if (!uploadId) return
+        try {
+          const params = {
+            uploadId,
+            ...(auditedUnitId ? { auditedUnitId } : {}),
+            catalogId,
+            surveyTemplateId,
+            type: 2,
+          }
+          const res = await getDynamicTableData(params)
+          if (res && res.code === 200) {
+            const records =
+              (res.value && (res.value.records || res.value)) || []
+            this.dynamicTableData = Array.isArray(records) ? records : []
+          }
+        } catch (e) {
+          this.dynamicTableData = []
+        }
+      },
+      // 获取立项信息监审期间,供固定表年份优先回显
+      async fetchProjectAuditPeriods() {
+        try {
+          this.projectAuditPeriods = []
+          this.projectAuditPeriod = ''
+          const pid = this.projectId
+          if (!pid) return
+          const res = await getProjectInformationInfo(pid)
+          const periodStr =
+            (res &&
+              res.value &&
+              (res.value.auditPeriod || res.value.auditperiod)) ||
+            ''
+          if (typeof periodStr === 'string' && periodStr.trim()) {
+            const arr = periodStr
+              .split(',')
+              .map((y) => String(y).trim())
+              .filter((y) => /^(19|20)\d{2}$/.test(y))
+            this.projectAuditPeriods = arr
+            this.projectAuditPeriod = arr.join(',')
+          }
+        } catch (e) {
+          console.error('获取立项信息监审期间失败', e)
+          this.projectAuditPeriods = []
+          this.projectAuditPeriod = ''
+        }
+      },
+      // 预取单记录详情(type=2),将数组结果映射为 { rowid: rvalue } 的对象,供弹窗回显
+      async loadSingleRecordDetail() {
+        this.surveyDetailData = {}
+        const row = this.currentTemplateRow || {}
+        const uploadId = row.uploadId || row.id || ''
+        const auditedUnitId = row.auditedUnitId || this.auditedUnitId || ''
+        const hasUpload = Boolean(uploadId)
+        const hasTask = Boolean(this.taskId)
+        if (!hasUpload && !hasTask) return
+        try {
+          const params = hasUpload
+            ? { uploadId, type: 2, ...(auditedUnitId ? { auditedUnitId } : {}) }
+            : { taskId: this.taskId, type: 2 }
+          const res = await getSurveyDetail(params)
+          if (res && res.code === 200 && res.value) {
+            const detail = {}
+            const val = res.value
+            if (Array.isArray(val)) {
+              val.forEach((item) => {
+                if (!item || typeof item !== 'object') return
+                const key =
+                  item.rowid !== undefined
+                    ? item.rowid
+                    : item.rowId !== undefined
+                    ? item.rowId
+                    : item.id !== undefined
+                    ? item.id
+                    : undefined
+                const value =
+                  item.rvalue !== undefined
+                    ? item.rvalue
+                    : item.rValue !== undefined
+                    ? item.rValue
+                    : item.value !== undefined
+                    ? item.value
+                    : item.val !== undefined
+                    ? item.val
+                    : ''
+                if (key !== undefined) detail[key] = value
+              })
+            } else if (val && typeof val === 'object') {
+              Object.assign(detail, val)
+            }
+            this.surveyDetailData = detail
+          }
+        } catch (e) {
+          this.surveyDetailData = {}
+        }
+      },
+      // 获取固定表配置(表头与项),与 components/task/components/submitData.vue 保持一致
+      async initFixedTableData(surveyTemplateId) {
+        try {
+          this.fixedFields = ''
+          this.fixedFieldids = ''
+          this.tableItems = []
+          if (!surveyTemplateId) return
+          const params = { surveyTemplateId, type: 2 }
+          const res = await getSingleRecordSurveyList(params)
+          if (res && res.code === 200 && res.value) {
+            this.fixedFields = res.value.fixedFields || ''
+            this.fixedFieldids = res.value.fixedFieldids || ''
+            const { itemlist } = res.value || {}
+            if (Array.isArray(itemlist) && itemlist.length > 0) {
+              this.tableItems = itemlist.map((item) => ({
+                id: item.id || item.itemId || '',
+                rowid: item.rowid || item.id || item.itemId || '',
+                seq: item.序号,
+                itemName: item.项目 || item.itemName || '',
+                unit: item.unit || '',
+                isCategory: item.isCategory || false,
+                categorySeq: item.categorySeq || '',
+                categoryId: item.categoryId || '',
+                parentid:
+                  item.parentid !== undefined
+                    ? item.parentid
+                    : item.parentId !== undefined
+                    ? item.parentId
+                    : '-1',
+                validateRules: item.validateRules || {},
+                linkageRules: item.linkageRules || {},
+                children: item.children || [],
+                ...item,
+              }))
+            }
+          }
+        } catch (e) {
+          console.error('获取固定表配置失败:', e)
+          this.tableItems = []
+        }
+      },
       // 查看报表
       handleViewReport(row) {
         this.$message.info(`查看报表:${row.name}`)