Forráskód Böngészése

fix:修改成本审核Bug
fix:文书管理数据没显示问题

cb_luzhixia 1 hónapja
szülő
commit
b7823b72bf

+ 1 - 3
src/api/costFormManage.js

@@ -77,9 +77,7 @@ export function getCostFormVersionsByTemplateId(params) {
   return request({
     url: `${url}/costVerifyTemplateItems/v1/listByTemplateId`,
     method: 'get',
-    params: {
-      surveyTemplateId: params.surveyTemplateId,
-    },
+    params,
   })
 }
 

+ 25 - 0
src/api/costVerifyManage.js

@@ -56,3 +56,28 @@ export function listByVerifyTemplateId(params) {
     params,
   })
 }
+
+export function exportExcel(params) {
+  return request({
+    url: `${url}/fdTemplateExport/v1/exportExcel`,
+    method: 'get',
+    params,
+  })
+}
+
+export function importExcel(data, params) {
+  return request({
+    url: `${url}/api/fdTemplateExport/v1/importExcel`,
+    method: 'post',
+    data,
+    params,
+  })
+}
+// /costVerifyTemplate/v1/getDetail
+export function getVerifyTemplateDetail(params) {
+  return request({
+    url: `${url}/costVerifyTemplate/v1/getDetail`,
+    method: 'get',
+    params,
+  })
+}

+ 151 - 44
src/components/task/components/costAudit.vue

@@ -7,19 +7,39 @@
         :rules="rules"
         :disabled="disabled"
       >
-        <el-form-item label="核定模板名称:" prop="surveyTemplateName">
-          <el-input
-            v-model="auditForm.surveyTemplateName"
-            style="width: 350px"
-            clearable
-            placeholder="请输入核定模板名称"
-          ></el-input>
-        </el-form-item>
+        <el-row>
+          <el-col :span="6">
+            <el-form-item label="" prop="catalogId">
+              <div
+                style="display: flex; justify-self: start; align-items: center"
+              >
+                <div style="width: 120px">监审类别:</div>
+                <el-cascader
+                  v-model="auditForm.catalogId"
+                  :options="catalogListOptions"
+                  v-bind="props"
+                  style="width: 200px"
+                  clearable
+                ></el-cascader>
+              </div>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="核定模板名称:" prop="surveyTemplateName">
+              <el-input
+                v-model="auditForm.surveyTemplateName"
+                style="width: 200px"
+                clearable
+                placeholder="请输入核定模板名称"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-row :gutter="20">
-          <el-col :span="12">
+          <el-col :span="6">
             <el-form-item label="" prop="templateType">
               <div
-                style="display: flex; align-items: center; margin-bottom: 10px"
+                style="display: flex; justify-self: start; align-items: center"
               >
                 <el-radio
                   v-model="auditForm.templateType"
@@ -31,7 +51,6 @@
                 <el-select
                   v-model="auditForm.dataTable"
                   placeholder="请选择"
-                  style="width: 300px"
                   :disabled="auditForm.templateType !== '1'"
                 >
                   <el-option
@@ -44,12 +63,10 @@
               </div>
             </el-form-item>
           </el-col>
-        </el-row>
-        <el-row :gutter="20">
-          <el-col :span="12">
+          <el-col :span="6">
             <el-form-item label="" prop="">
               <div
-                style="display: flex; align-items: center; margin-bottom: 10px"
+                style="display: flex; justify-self: start; align-items: center"
               >
                 <el-radio
                   v-model="auditForm.templateType"
@@ -61,7 +78,6 @@
                 <el-select
                   v-model="auditForm.historyTemplate"
                   placeholder="请选择"
-                  style="width: 300px"
                   :disabled="auditForm.templateType !== '2'"
                 >
                   <el-option
@@ -112,14 +128,12 @@
   } from '@/api/costFormManage'
   import {
     getlistBySurveyTemplateId,
-    batchDeleteCostVerifyForm,
-    getlistBySurveyTemplateIdcurrentversion,
-    batchSave,
-    enable,
-    getListFixedEnabled,
-    listByVerifyTemplateId,
+    getVerifyTemplateDetail,
+    importExcel,
+    exportExcel,
   } from '@/api/costVerifyManage'
   import { getDetail } from '@/api/auditInitiation'
+  import { catalogMixin } from '@/mixins/useDict'
   export default {
     name: 'CostAudit',
     props: {
@@ -161,6 +175,9 @@
           catalogId: '',
         },
         rules: {
+          catalogId: [
+            { required: true, message: '请输选择监审类别', trigger: 'change' },
+          ],
           surveyTemplateName: [
             { required: true, message: '请输入模版名称', trigger: 'blur' },
           ],
@@ -277,22 +294,31 @@
         if (newVal) {
           this.$nextTick(() => {
             // 获取项目的成本审核表数据
-            // 获取项目的详情数据
-            getDetail({ id: newVal.projectId }).then((res) => {
-              if (res.code === 200) {
-                this.project = res.value
-                this.auditForm.catalogId = res.value.catalogId
-              }
-            })
+            this.getDetail()
           })
         }
       },
     },
     created() {
+      if (this.selectedProject && this.selectedProject.projectId) {
+        // 获取项目的详情数据
+        this.getDetail()
+      }
       this.getActiveCostVerifyFormListByType()
       this.getActiveCostVerifyFormList()
     },
     methods: {
+      getDetail() {
+        // 获取项目的详情数据
+        getDetail({ id: this.selectedProject.projectId }).then((res) => {
+          if (res.code === 200) {
+            this.project = res.value
+            this.auditForm.catalogId = res.value.catalogId
+            // this.auditForm.surveyTemplateId = '9368f1cf-77e7-49fe-8502-4a7a2da99668'
+            this.loadTemplateDataForEdit()
+          }
+        })
+      },
       // 获取所有模板类型为固定表的所有启用成本调查表数据
       getActiveCostVerifyFormListByType() {
         getActiveCostVerifyFormListByType().then((res) => {
@@ -391,10 +417,12 @@
         // 并行获取表头和表格数据
         const [tableHeadersRes, tableDataRes] = await Promise.all([
           getlistBySurveyTemplateId({
-            surveyTemplateId,
+            surveyTemplateId: this.auditForm.surveyTemplateId,
+            taskId: this.selectedProject.taskId,
           }),
           getCostFormVersionsByTemplateId({
-            surveyTemplateId,
+            surveyTemplateId: this.auditForm.surveyTemplateId,
+            taskId: this.selectedProject.taskId,
           }),
         ])
         // 处理表头数据
@@ -409,11 +437,22 @@
       parseAndDisplayTableHeaders(res) {
         this.tableHeadersRes = Array.isArray(res.value) ? res.value : []
         if (this.tableHeadersRes.length > 0) {
+          this.auditForm.surveyTemplateId = res.value[0].surveyTemplateId
+          if (!this.auditForm.surveyTemplateId) {
+            getVerifyTemplateDetail({
+              id: this.auditForm.surveyTemplateId,
+            }).then((res) => {
+              this.auditForm.surveyTemplateName = res.value.surveyTemplateName
+              this.auditForm.catalogId = res.value.catalogId
+            })
+          }
+
           // 表头按照orderNum重新排序
           this.tableHeadersRes.sort((a, b) => a.orderNum - b.orderNum)
           this.costAuditcolumn = [] // 清空现有列配置
           this.tableHeadersRes.forEach((item) => {
             let column = {
+              ...item,
               prop: item.fieldEname,
               label: item.fieldName,
               width: '150px',
@@ -425,16 +464,18 @@
             prop: 'unit',
             label: '单位',
             width: '80px',
-            align: 'center',
           })
-          if (this.selectedProject.auditPeriod) {
+          // 检查tableHeadersRes数组是否包含年账面值
+          const hasBookValueColumn = this.checkHasBookValueColumn()
+
+          if (!hasBookValueColumn && this.selectedProject.auditPeriod) {
             // 获取审计期间并按年份排序
             let auditPeriod = this.selectedProject.auditPeriod
               .split(',')
               .map((year) => parseInt(year))
               .sort((a, b) => a - b)
               .map((year) => year.toString())
-
+            let num = this.tableHeadersRes.length
             // 按年份顺序生成三个字段
             auditPeriod.forEach((item) => {
               // 账面价值字段
@@ -443,32 +484,98 @@
                 label: item + '年账面值',
                 width: '120px',
                 align: 'right',
+                fieldName: item + '年账面值',
+                fieldType: 'integer',
+                format: '',
+                fieldTypelen: '255',
+                fieldTypenointlen: '',
+                isAuditPeriod: 'true',
+                isRequired: 'true',
+                showVisible: '1',
+                isDict: 'false',
+                dictid: '',
+                dictValue: '',
+                tabtype: this.tableHeadersRes[0].tabtype,
+                surveyTemplateId: this.tableHeadersRes[0].surveyTemplateId,
+                versionId: this.tableHeadersRes[0].versionId,
+                orderNum: this.getMaxOrderNum() + 1,
               }
-
+              this.costAuditcolumn.push(bookValueColumn)
+              this.tableHeadersRes.push(bookValueColumn)
               // 审核字段
               let auditColumn = {
                 prop: 'year' + item + 'Audit',
                 label: item + '年审核调整值',
                 width: '150px',
                 align: 'center',
+                fieldName: item + '年审核调整值',
+                fieldType: 'integer',
+                format: '',
+                fieldTypelen: '255',
+                fieldTypenointlen: '',
+                isRequired: 'true',
+                isAuditPeriod: 'true',
+                showVisible: '1',
+                isDict: 'false',
+                dictid: '',
+                dictValue: '',
+                tabtype: this.tableHeadersRes[0].tabtype,
+                surveyTemplateId: this.tableHeadersRes[0].surveyTemplateId,
+                versionId: this.tableHeadersRes[0].versionId,
+                orderNum: this.getMaxOrderNum() + num + 1,
               }
-
+              this.costAuditcolumn.push(auditColumn)
+              this.tableHeadersRes.push(auditColumn)
               // 核定值字段
               let approvedValueColumn = {
                 prop: 'year' + item + 'ApprovedValue',
                 label: item + '年核定值',
                 width: '120px',
                 align: 'right',
+                fieldName: item + '年核定值',
+                fieldType: 'integer',
+                format: '',
+                fieldTypelen: '255',
+                fieldTypenointlen: '',
+                isRequired: 'true',
+                isAuditPeriod: 'true',
+                showVisible: '1',
+                isDict: 'false',
+                dictid: '',
+                dictValue: '',
+                tabtype: this.tableHeadersRes[0].tabtype,
+                surveyTemplateId: this.tableHeadersRes[0].surveyTemplateId,
+                versionId: this.tableHeadersRes[0].versionId,
+                orderNum: this.getMaxOrderNum() + num + 1,
               }
-
-              // 依次添加三个字段到列配置
-              this.costAuditcolumn.push(bookValueColumn)
-              this.costAuditcolumn.push(auditColumn)
               this.costAuditcolumn.push(approvedValueColumn)
+              this.tableHeadersRes.push(approvedValueColumn)
             })
           }
         }
       },
+      getMaxOrderNum() {
+        if (!this.tableHeadersRes || this.tableHeadersRes.length === 0) {
+          return 0
+        }
+        const maxOrderNum = Math.max(
+          ...this.tableHeadersRes.map((item) => item.orderNum || 0)
+        )
+        return maxOrderNum
+      },
+      // 检查tableHeadersRes数组是否包含年账面值列
+      checkHasBookValueColumn() {
+        if (!this.tableHeadersRes || this.tableHeadersRes.length === 0) {
+          return false
+        }
+        // 检查是否有列的label或fieldName包含'年账面值'字样
+        return this.tableHeadersRes.some((item) => {
+          return (
+            (item.label && item.label.includes('年账面值')) ||
+            (item.fieldName && item.fieldName.includes('年账面值'))
+          )
+        })
+      },
       parseAndDisplayTableData(res) {
         // 清空现有数据
         this.costAuditData = []
@@ -508,8 +615,8 @@
               }
             })
 
-            // 为审计期间的三个字段添加初始值
             if (this.selectedProject && this.selectedProject.auditPeriod) {
+              // 为审计期间的三个字段添加初始值
               // 获取审计期间并按年份排序
               let auditPeriod = this.selectedProject.auditPeriod
                 .split(',')
@@ -519,9 +626,9 @@
 
               // 为每个年份添加三个字段的初始值
               auditPeriod.forEach((year) => {
-                rowData[`year${year}BookValue`] = '' // 账面
-                rowData[`year${year}Audit`] = '' // 审核调整值
-                rowData[`year${year}ApprovedValue`] = '' // 核定值
+                rowData[`${year}BookValue账面值`] = '' // 账面值
+                rowData[`${year}Audit审核调整值`] = '' // 审核调整值
+                rowData[`${year}ApprovedValue核定值`] = '' // 核定值
               })
             }
 

+ 127 - 61
src/views/costAudit/auditInfo/auditManage/costAudit.vue

@@ -1,7 +1,12 @@
 <template>
   <div class="app-container">
     <div class="audit-controls">
-      <el-form ref="auditForm" :model="auditForm" :rules="rules">
+      <el-form
+        ref="auditForm"
+        :model="auditForm"
+        :rules="rules"
+        :disabled="auditForm.surveyTemplateId !== ''"
+      >
         <el-row>
           <el-col :span="6">
             <el-form-item label="" prop="catalogId">
@@ -87,7 +92,12 @@
           </el-col>
         </el-row>
       </el-form>
-      <el-button type="primary" size="small" @click="handleGenerateTemplate">
+      <el-button
+        v-if="!auditForm.surveyTemplateId"
+        type="primary"
+        size="small"
+        @click="handleGenerateTemplate"
+      >
         生成核定表
       </el-button>
       <el-button type="primary" size="small" @click="handleSaveTemplate">
@@ -162,12 +172,9 @@
   } from '@/api/costFormManage'
   import {
     getlistBySurveyTemplateId,
-    batchDeleteCostVerifyForm,
-    getlistBySurveyTemplateIdcurrentversion,
-    batchSave,
-    enable,
-    getListFixedEnabled,
-    listByVerifyTemplateId,
+    getVerifyTemplateDetail,
+    importExcel,
+    exportExcel,
   } from '@/api/costVerifyManage'
   import { getDetail } from '@/api/auditInitiation'
   import { catalogMixin } from '@/mixins/useDict'
@@ -342,12 +349,7 @@
         if (newVal) {
           this.$nextTick(() => {
             // 获取项目的详情数据
-            getDetail({ id: newVal.projectId }).then((res) => {
-              if (res.code === 200) {
-                this.project = res.value
-                this.auditForm.catalogId = res.value.catalogId
-              }
-            })
+            this.getDetail()
           })
         }
       },
@@ -355,19 +357,24 @@
     created() {
       if (this.selectedProject && this.selectedProject.projectId) {
         // 获取项目的详情数据
+        this.getDetail()
+      }
+      this.getActiveCostVerifyFormListByType()
+      this.getActiveCostVerifyFormList()
+      // this.handleGenerateTemplate1()
+    },
+    methods: {
+      getDetail() {
+        // 获取项目的详情数据
         getDetail({ id: this.selectedProject.projectId }).then((res) => {
           if (res.code === 200) {
             this.project = res.value
             this.auditForm.catalogId = res.value.catalogId
+            // this.auditForm.surveyTemplateId = '9368f1cf-77e7-49fe-8502-4a7a2da99668'
             this.loadTemplateDataForEdit()
           }
         })
-      }
-      this.getActiveCostVerifyFormListByType()
-      this.getActiveCostVerifyFormList()
-      // this.handleGenerateTemplate1()
-    },
-    methods: {
+      },
       // 获取所有模板类型为固定表的所有启用成本调查表数据
       getActiveCostVerifyFormListByType() {
         getActiveCostVerifyFormListByType().then((res) => {
@@ -465,12 +472,12 @@
         // 并行获取表头和表格数据
         const [tableHeadersRes, tableDataRes] = await Promise.all([
           getlistBySurveyTemplateId({
-            surveyTemplateId: this.auditForm.surveyTemplateId,
             taskId: this.selectedProject.taskId,
+            surveyTemplateId: this.auditForm.surveyTemplateId,
           }),
           getCostFormVersionsByTemplateId({
-            surveyTemplateId: this.auditForm.surveyTemplateId,
             taskId: this.selectedProject.taskId,
+            surveyTemplateId: '',
           }),
         ])
         // 处理表头数据
@@ -485,6 +492,16 @@
       parseAndDisplayTableHeaders(res) {
         this.tableHeadersRes = Array.isArray(res.value) ? res.value : []
         if (this.tableHeadersRes.length > 0) {
+          this.auditForm.surveyTemplateId = res.value[0].surveyTemplateId
+          if (!this.auditForm.surveyTemplateId) {
+            getVerifyTemplateDetail({
+              id: this.auditForm.surveyTemplateId,
+            }).then((res) => {
+              this.auditForm.surveyTemplateName = res.value.surveyTemplateName
+              this.auditForm.catalogId = res.value.catalogId
+            })
+          }
+
           // 表头按照orderNum重新排序
           this.tableHeadersRes.sort((a, b) => a.orderNum - b.orderNum)
           this.costAuditcolumn = [] // 清空现有列配置
@@ -503,7 +520,10 @@
             label: '单位',
             width: '80px',
           })
-          if (this.selectedProject.auditPeriod) {
+          // 检查tableHeadersRes数组是否包含年账面值
+          const hasBookValueColumn = this.checkHasBookValueColumn()
+
+          if (!hasBookValueColumn && this.selectedProject.auditPeriod) {
             // 获取审计期间并按年份排序
             let auditPeriod = this.selectedProject.auditPeriod
               .split(',')
@@ -520,10 +540,11 @@
                 width: '120px',
                 align: 'right',
                 fieldName: item + '年账面值',
-                fieldType: 'string',
-                format: '255',
-                fieldTypelen: '',
+                fieldType: 'integer',
+                format: '',
+                fieldTypelen: '255',
                 fieldTypenointlen: '',
+                isAuditPeriod: 'true',
                 isRequired: 'true',
                 showVisible: '1',
                 isDict: 'false',
@@ -532,9 +553,10 @@
                 tabtype: this.tableHeadersRes[0].tabtype,
                 surveyTemplateId: this.tableHeadersRes[0].surveyTemplateId,
                 versionId: this.tableHeadersRes[0].versionId,
-                orderNum: num + 1,
+                orderNum: this.getMaxOrderNum() + 1,
               }
-
+              this.costAuditcolumn.push(bookValueColumn)
+              this.tableHeadersRes.push(bookValueColumn)
               // 审核字段
               let auditColumn = {
                 prop: 'year' + item + 'Audit',
@@ -542,11 +564,12 @@
                 width: '150px',
                 align: 'center',
                 fieldName: item + '年审核调整值',
-                fieldType: 'string',
-                format: '255',
-                fieldTypelen: '',
+                fieldType: 'integer',
+                format: '',
+                fieldTypelen: '255',
                 fieldTypenointlen: '',
                 isRequired: 'true',
+                isAuditPeriod: 'true',
                 showVisible: '1',
                 isDict: 'false',
                 dictid: '',
@@ -554,9 +577,10 @@
                 tabtype: this.tableHeadersRes[0].tabtype,
                 surveyTemplateId: this.tableHeadersRes[0].surveyTemplateId,
                 versionId: this.tableHeadersRes[0].versionId,
-                orderNum: num + 2,
+                orderNum: this.getMaxOrderNum() + num + 1,
               }
-
+              this.costAuditcolumn.push(auditColumn)
+              this.tableHeadersRes.push(auditColumn)
               // 核定值字段
               let approvedValueColumn = {
                 prop: 'year' + item + 'ApprovedValue',
@@ -564,11 +588,12 @@
                 width: '120px',
                 align: 'right',
                 fieldName: item + '年核定值',
-                fieldType: 'string',
-                format: '255',
-                fieldTypelen: '',
+                fieldType: 'integer',
+                format: '',
+                fieldTypelen: '255',
                 fieldTypenointlen: '',
                 isRequired: 'true',
+                isAuditPeriod: 'true',
                 showVisible: '1',
                 isDict: 'false',
                 dictid: '',
@@ -576,20 +601,36 @@
                 tabtype: this.tableHeadersRes[0].tabtype,
                 surveyTemplateId: this.tableHeadersRes[0].surveyTemplateId,
                 versionId: this.tableHeadersRes[0].versionId,
-                orderNum: num + 3,
+                orderNum: this.getMaxOrderNum() + num + 1,
               }
-
-              // 依次添加三个字段到列配置
-              this.costAuditcolumn.push(bookValueColumn)
-              this.costAuditcolumn.push(auditColumn)
               this.costAuditcolumn.push(approvedValueColumn)
-              this.tableHeadersRes.push(bookValueColumn)
-              this.tableHeadersRes.push(auditColumn)
               this.tableHeadersRes.push(approvedValueColumn)
             })
           }
         }
       },
+      getMaxOrderNum() {
+        if (!this.tableHeadersRes || this.tableHeadersRes.length === 0) {
+          return 0
+        }
+        const maxOrderNum = Math.max(
+          ...this.tableHeadersRes.map((item) => item.orderNum || 0)
+        )
+        return maxOrderNum
+      },
+      // 检查tableHeadersRes数组是否包含年账面值列
+      checkHasBookValueColumn() {
+        if (!this.tableHeadersRes || this.tableHeadersRes.length === 0) {
+          return false
+        }
+        // 检查是否有列的label或fieldName包含'年账面值'字样
+        return this.tableHeadersRes.some((item) => {
+          return (
+            (item.label && item.label.includes('年账面值')) ||
+            (item.fieldName && item.fieldName.includes('年账面值'))
+          )
+        })
+      },
       parseAndDisplayTableData(res) {
         // 清空现有数据
         this.costAuditData = []
@@ -629,8 +670,8 @@
               }
             })
 
-            // 为审计期间的三个字段添加初始值
             if (this.selectedProject && this.selectedProject.auditPeriod) {
+              // 为审计期间的三个字段添加初始值
               // 获取审计期间并按年份排序
               let auditPeriod = this.selectedProject.auditPeriod
                 .split(',')
@@ -640,9 +681,9 @@
 
               // 为每个年份添加三个字段的初始值
               auditPeriod.forEach((year) => {
-                rowData[`year${year}BookValue`] = '' // 账面
-                rowData[`year${year}Audit`] = '' // 审核调整值
-                rowData[`year${year}ApprovedValue`] = '' // 核定值
+                rowData[`${year}BookValue账面值`] = '' // 账面值
+                rowData[`${year}Audit审核调整值`] = '' // 审核调整值
+                rowData[`${year}ApprovedValue核定值`] = '' // 核定值
               })
             }
 
@@ -655,6 +696,14 @@
         }
       },
       handleSaveTemplate(type) {
+        // 显示加载状态
+        this.$loading({
+          lock: true,
+          text: '保存数据中...',
+          spinner: 'el-icon-loading',
+          background: 'rgba(0, 0, 0, 0.7)',
+        })
+        // 加上遮罩层
         let headersList = this.tableHeadersRes
         let splitData = this.splitFixedTableDataForSave(this.costAuditData)
 
@@ -665,11 +714,15 @@
         }
         batchSaveOrUpdate(data)
           .then((data) => {
+            // 关闭加载状态
+            this.$loading().close()
             if (type != 'delete') {
               this.$message.success('保存成功')
             }
           })
           .catch((err) => {
+            // 关闭加载状态
+            this.$loading().close()
             console.log(err)
           })
         // this.$message({ type: 'success', message: '保存成功' })
@@ -701,7 +754,7 @@
             const newItem = {
               id: row.itemId || null,
               rkey: correspondingHeader.fieldName,
-              rvalue: row[correspondingHeader.fieldName],
+              rvalue: row[correspondingHeader.fieldEname],
               surveyTemplateId:
                 row.surveyTemplateId || correspondingHeader.surveyTemplateId,
               versionId: row.versionId || correspondingHeader.versionId,
@@ -796,7 +849,6 @@
 
       //
       handleImportData() {
-        return
         let loading = null
         // 第一步:创建文件选择器
         const input = document.createElement('input')
@@ -834,17 +886,27 @@
             const formData = new FormData()
             formData.append('file', file)
 
-            // 先调用上传API
-            // const uploadRes = await uploadFile('/api/file/v1/upload', formData)
+            // 其他参数作为query参数传递
+            const queryParams = {
+              materialId: '', // 根据API文档,此参数为必填,但当前没有值,保留空字符串
+              surveyTemplateId:
+                this.auditForm.surveyTemplateId ||
+                '62d10551-1576-49b0-9130-622b513f431e',
+              taskId: this.selectedProject.taskId,
+              periodRecordId: '', // 非必填参数
+            }
+
+            // 先调用上传API,将参数作为query传递
+            const uploadRes = await importExcel(formData, queryParams)
 
             // 第四步:检查上传结果
-            // if (!uploadRes || !uploadRes.value) {
-            //   // this.$message.error('文件上传失败!');
-            //   return
-            // }
+            if (!uploadRes || !uploadRes.value) {
+              this.$message.error('导入失败!')
+              return
+            }
 
             // 第五步:文件上传成功后,再更新数据
-            const fileInfo = uploadRes.value
+            // const fileInfo = uploadRes.value
             // 创建更新数据对象
             // const updateData = {
             //   id: row.id,
@@ -855,7 +917,7 @@
             // await updateScan(updateData)
 
             // 第七步:更新成功,显示提示并刷新
-            // this.$message.success('文件上传成功并更新数据!')
+            this.$message.success('导入成功')
             // this.$emit('refresh', this.project.projectId) // 通知父组件刷新
           } catch (error) {
             // 错误处理
@@ -869,8 +931,9 @@
         input.click()
       },
       handleExportTemplate() {
-        return
-
+        if (this.costAuditData.length === 0) {
+          return
+        }
         // this.$message({ type: 'info', message: '导出数据' })
         // 显示加载状态
         this.$loading({
@@ -881,8 +944,11 @@
         })
 
         // 从API中获取文件URL
-        downDocument({
-          id: row.id,
+        exportExcel({
+          surveyTemplateId:
+            this.costAuditData[0].surveyTemplateId ||
+            '62d10551-1576-49b0-9130-622b513f431e',
+          versionId: this.costAuditData[0].versionId || '',
         })
           .then((res) => {
             // 关闭加载状态

+ 3 - 1
src/views/costAudit/baseInfo/auditDocNoManage/index.vue

@@ -456,7 +456,9 @@
             label: '适用区域',
             showOverflowTooltip: true,
             align: 'center',
-            formatter: (row) => this.regionNameMap[row.areaCode] || '-',
+            formatter: (row) => {
+              return this.regionNameMap[row.areaCode] || '-'
+            },
           },
           {
             prop: 'generateType',

+ 1 - 1
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -3208,7 +3208,7 @@
               row.status = '0'
               putSurveyTemplatePublishVersion(row).then((res) => {
                 if (res.code === 200) {
-                  this.$message.success(`用成功`)
+                  this.$message.success(`用成功`)
                   this.handleSearch()
                 }
               })

+ 29 - 11
src/views/costAudit/baseInfo/costVerifyManage/index.vue

@@ -759,7 +759,7 @@
                     <el-tag v-else type="info" size="small">无</el-tag>
                   </template>
                 </el-table-column>
-                <el-table-column label="序号" width="150" align="center">
+                <el-table-column label="序号" width="80" align="center">
                   <template slot-scope="scope">
                     <div
                       class="row-indent-container"
@@ -787,6 +787,7 @@
                     .fixedTableHeaders"
                   :key="index"
                   :label="item.rkey"
+                  width="120"
                   align="center"
                 >
                   <template slot-scope="scope">
@@ -2495,16 +2496,22 @@
        * @param {Object} responseData - listByCurrentTemplateId接口返回的数据
        */
       parseAndDisplayFixedTableData(responseData) {
-        if (responseData.value.fixedFields) {
-          this.contentEditForm.fixedTable.fixedTablesTitle =
-            this.stringToObjects(responseData.value.fixedFields || '')
-        } else {
-          let fixedFields = this.contentEditForm.fixedTable.tableHeaders
-            .map((item) => item.fieldName)
-            .join(',')
-          this.contentEditForm.fixedTable.fixedTablesTitle =
-            this.stringToObjects(fixedFields || '')
-        }
+        // if (responseData.value.fixedFields) {
+        //   this.contentEditForm.fixedTable.fixedTablesTitle =
+        //     this.stringToObjects(responseData.value.fixedFields || '')
+        // } else {
+        //   let fixedFields = this.contentEditForm.fixedTable.tableHeaders
+        //     .map((item) => item.fieldName)
+        //     .join(',')
+        //   this.contentEditForm.fixedTable.fixedTablesTitle =
+        //     this.stringToObjects(fixedFields || '')
+        // }
+        let fixedFields = this.contentEditForm.fixedTable.tableHeaders
+          .map((item) => item.fieldName)
+          .join(',')
+        this.contentEditForm.fixedTable.fixedTablesTitle = this.stringToObjects(
+          fixedFields || ''
+        )
         const fixedTitles = this.contentEditForm.fixedTable.fixedTablesTitle
         this.contentEditForm.fixedTable.fixedTableHeaders = fixedTitles.filter(
           (title) => title.rkey !== '序号'
@@ -2766,6 +2773,13 @@
         // 校验表单
         this.$refs['contentEditForm'].validate((valid) => {
           if (valid) {
+            // 显示加载状态
+            this.$loading({
+              lock: true,
+              text: '保存数据中...',
+              spinner: 'el-icon-loading',
+              background: 'rgba(0, 0, 0, 0.7)',
+            })
             if (this.dialogTitle == '修改成本核定模板') {
               let data = {
                 ...this.contentEditForm,
@@ -2790,11 +2804,15 @@
             }
             batchSaveOrUpdate(data)
               .then((data) => {
+                // 关闭加载状态
+                this.$loading().close()
                 this.dialogVisible = false
                 this.$message.success('保存成功')
                 this.handleSearch()
               })
               .catch((err) => {
+                // 关闭加载状态
+                this.$loading().close()
                 console.log(err)
               })
           } else {

+ 47 - 0
src/views/costAudit/baseInfo/financeSheetManage/infoMaintain.vue

@@ -1840,6 +1840,53 @@
         this.pagination.currentPage = 1
         this.handleSearch()
       },
+      // 启动/停用状态
+      handleStatus(row) {
+        const action = row.status === 0 ? '停用' : '启用'
+        if (row.status === '0') {
+          this.$confirm(`确认要停用该数据吗?`, '操作确认', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+            .then(() => {
+              row.status = '-1'
+              putSurveyFdTemplatePublishVersion(row).then((res) => {
+                if (res.code === 200) {
+                  this.$message.success(`停用成功`)
+                  this.handleSearch()
+                }
+              })
+            })
+            .catch(() => {
+              this.$message({
+                type: 'info',
+                message: '已取消操作',
+              })
+            })
+        } else if (row.status === '-1') {
+          this.$confirm(`确认要启用该数据吗?`, '操作确认', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+            .then(() => {
+              row.status = '0'
+              putSurveyFdTemplatePublishVersion(row).then((res) => {
+                if (res.code === 200) {
+                  this.$message.success(`启用成功`)
+                  this.handleSearch()
+                }
+              })
+            })
+            .catch(() => {
+              this.$message({
+                type: 'info',
+                message: '已取消操作',
+              })
+            })
+        }
+      },
 
       handleRowClick(row, column, event) {
         if (column && column.property !== 'checked') {

+ 6 - 2
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/auditNoticeTab.vue

@@ -609,8 +609,12 @@
           pageSize: this.selectDocumentWhPagination.pageSize,
           whType: this.document.documentId,
         }).then((res) => {
-          this.selectDocumentWhData = res.value.records || []
-          this.selectDocumentWhPagination.total = res.value.total || 0
+          this.selectDocumentWhData = res.rows || []
+          this.selectDocumentWhPagination.total = res.total || 0
+          // 获取区域名称,填充regionNameMap
+          if (this.selectDocumentWhData.length > 0) {
+            this.fetchRegionNames(this.selectDocumentWhData, 'areaCode')
+          }
         })
       },
       selectDocumentWhPaginationChange({ currentPage, pageSize }) {