Jelajahi Sumber

Merge branch 'master' of http://1.71.9.215:3000/feiyi/cbjsxt-front-master

shiyanyu 1 Minggu lalu
induk
melakukan
8872749e2f

+ 1 - 1
public/config.js

@@ -31,7 +31,7 @@ window.getModuleRootUrl = function (module) {
   if (!combine) {
     modulePort = defaultModulePortMap[module]
   }
-  return "http://5jrgep.ipx.wanziwk.cn";
+  return "http://1.71.9.215:9506";
   //return host + ':' + modulePort
   // return host + modulePort
 }

+ 9 - 0
src/api/properties.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+const portal = window.context.portal
+
+//获取系统属性值
+export function getSysPropertiesAlias(code) {
+  const url = `${portal}/sys/sysProperties/v1/getDecryptByAlias?alias=` + code
+  return request.get(url)
+}

+ 171 - 2
src/components/task/mounTaskComponents/auditNoticeTab.vue

@@ -603,6 +603,7 @@
           ],
         },
         dataUploadUrl: [],
+        resCostDocumentTemplateFiles: [],
       }
     },
     computed: {
@@ -851,19 +852,187 @@
         this.document.documentWhId = ''
         this.getDocumentData()
       },
+      formatDaValue(res) {
+        this.costDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        this.resCostDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        let unit = this.allUnits.find(
+          (item) => item.unitId === this.document.enterpriseId
+        )
+        let documenName = this.getDocumentType({
+          documentId: this.document.documentId,
+        })
+        this.costDocumentTemplateFiles.forEach((item) => {
+          if (item.pinyin.includes('BeiJianShenDanWei')) {
+            item.dataValue = unit.unitName
+          }
+          if (item.pinyin.includes('ShouSongDaRen')) {
+            item.dataValue = unit.contactName
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
+            item.dataValue = unit.address
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
+            item.dataValue = unit.contactMobile
+          }
+          if (item.originalText.includes('需要提供材料') && item.dataValue) {
+            this.dataUploadUrl = item.dataValue
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (
+            item.pinyin.includes('ShiJian') &&
+            (item.dataValue == null || item.dataValue == '')
+          ) {
+            // 获取当前时间,格式为YYYY年MM月DD日
+            item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+          } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('RiQi') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (documenName.includes('成本监审通知书')) {
+            if (item.pinyin.includes('DanWeiMingCheng')) {
+              item.dataValue = unit.unitName
+            }
+            if (item.pinyin.includes('FaRenDaiBiao')) {
+              item.dataValue = unit?.corporateRepresentative || ''
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianRiQi'
+              ) &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('ChuangJianRiQi')) {
+              // 获取当前时间或使用有效日期
+              item.dataValue =
+                item.dataValue && !item.dataValue.includes('年')
+                  ? moment(item.dataValue).format('YYYY年MM月DD日')
+                  : moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本监审提取资料登记表')) {
+            if (
+              item.pinyin.includes('DengJiBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本审核初步意见表')) {
+            if (
+              item.pinyin.includes('YiJianBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('政府定价成本监审结论报告')) {
+            if (
+              item.pinyin.includes('BaoGaoRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JieLunBaoGaoChuangJianRiQi')) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JianShenRenWuFaBuShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'JianShenRenWuFaBuShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuShengChengShiJian'
+              )
+            ) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) =>
+                  item2.pinyin === 'ChengBenJianShenTongZhiShuShengChengShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (item.pinyin.includes('ChengBenZiLiaoShangBaoShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'ChengBenZiLiaoShangBaoShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+          }
+          if (documenName.includes('成本审核初步意见告知书')) {
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianShiJian'
+              ) &&
+              item.dataValue
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = !item.dataValue.includes('年')
+                ? moment(item.dataValue).format('YYYY年MM月DD日')
+                : item.dataValue
+            }
+          }
+          // 回显文号
+          // 获取选中的文号信息
+          const selectedDocument = this.selectDocumentWhSelection[0]
+          if (selectedDocument) {
+            if (
+              item.pinyin.includes('WenHao') ||
+              item.pinyin.includes('WenJianHao')
+            ) {
+              item.dataValue = selectedDocument.whNo
+            }
+            if (item.pinyin.includes('SongDaWenShuMingCheng')) {
+              item.dataValue = selectedDocument.whName
+            }
+          }
+        })
+      },
       getDocumentData() {
         if (this.document.id === null || this.document.id === '') {
           queryByDocumentIdandWhereValue({
             documentId: this.document.documentId,
             whereValue: this.project.projectId,
+            unitId: this.document.enterpriseId,
+            // projectId: this.project.projectId,
           }).then((res) => {
-            this.costDocumentTemplateFiles = res.value || []
+            this.formatDaValue(res)
           })
         } else {
           getCostProjectDocumentFile({
+            // documentId: this.document.documentId,
+            // whereValue: this.project.projectId,
             id: this.document.id,
           }).then((res) => {
-            this.costDocumentTemplateFiles = res.value || []
+            this.formatDaValue(res)
           })
         }
       },

+ 86 - 9
src/views/costAudit/auditInfo/archivesManage/archiveList.vue

@@ -142,14 +142,14 @@
               <el-button
                 type="text"
                 size="small"
-                @click="handleDownload(scope.row)"
+                @click="handleArchivePreview(scope.row)"
               >
                 档案详情
               </el-button>
               <el-button
                 type="text"
                 size="small"
-                @click="handleDelete(scope.row)"
+                @click="handleDownload(scope.row)"
               >
                 下载
               </el-button>
@@ -171,12 +171,30 @@
     </div>
     <!-- 任务详情弹窗 -->
     <taskDetail ref="taskDetail" />
+
+    <!-- 档案详情预览弹窗 -->
+    <el-dialog
+      :visible.sync="previewDialogVisible"
+      width="65%"
+      title="档案详情预览"
+      :close-on-click-modal="false"
+    >
+      <div class="preview-container">
+        <iframe
+          v-if="previewUrl"
+          :src="previewUrl"
+          frameborder="0"
+          class="preview-iframe"
+        ></iframe>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
   import taskDetail from '@/components/task/taskDetail.vue'
   import { getArchiveList } from '@/api/audit/archive'
+  import { getSysPropertiesAlias } from '@/api/properties'
   import { regionMixin } from '@/mixins/useDict'
   export default {
     name: 'ArchiveList',
@@ -200,10 +218,16 @@
           total: 0,
         },
         activeTab: 'list',
+        // 系统属性值
+        sysKkUrl: '',
+        // 预览对话框
+        previewDialogVisible: false,
+        previewUrl: '',
       }
     },
     created() {
       this.fetchData()
+      this.getSysKkUrl()
     },
     methods: {
       // 获取数据
@@ -271,20 +295,63 @@
         this.fetchData()
       },
       handleDetail(row) {
-        // 可以在这里处理详情点击
-        console.log('详情:', row)
+        // 打开任务详情弹窗
+        this.$refs.taskDetail.open(row, 'chengben')
+      },
+      // 获取系统属性值 sys.kk.url
+      async getSysKkUrl() {
+        try {
+          const response = await getSysPropertiesAlias('sys_kk_url')
+          alert(response.value)
+          if (response && response.value) {
+            this.sysKkUrl = response.value
+          }
+        } catch (error) {
+          console.error('获取系统属性值失败:', error)
+        }
       },
       handleView(row) {
         // 打开任务详情弹窗
         this.$refs.taskDetail.open(row, 'chengben')
       },
       handleDownload(row) {
-        // 回归档操作
-        this.$message.info('回归档功能待实现')
-      },
-      handleDelete(row) {
         // 下载操作
-        this.$message.info('下载功能待实现')
+        if (!row.archiveUrl) {
+          this.$message.error('文件下载地址不存在')
+          return
+        }
+        try {
+          // 创建a标签进行下载
+          const link = document.createElement('a')
+          link.style.display = 'none'
+          link.href = row.archiveUrl
+          // 从URL中提取文件名或使用默认文件名
+          const fileName =
+            row.archiveUrl.split('/').pop() || `archive_${new Date().getTime()}`
+          link.download = fileName
+          document.body.appendChild(link)
+          link.click()
+          // 移除a标签
+          document.body.removeChild(link)
+          this.$message.success('文件下载成功')
+        } catch (error) {
+          console.error('下载失败:', error)
+          this.$message.error('文件下载失败')
+        }
+      },
+      // 档案详情预览
+      handleArchivePreview(row) {
+        if (!row.archiveUrl) {
+          this.$message.error('文件预览地址不存在')
+          return
+        }
+        alert(this.sysKkUrl)
+        // 拼接预览URL
+        this.previewUrl =
+          this.sysKkUrl +
+          `onlinePreview?url=${encodeURIComponent(row.archiveUrl)}`
+        // 打开预览弹窗
+        this.previewDialogVisible = true
       },
       backToList() {
         this.activeTab = 'list'
@@ -326,4 +393,14 @@
       text-decoration: underline;
     }
   }
+
+  .preview-container {
+    width: 100%;
+    height: 600px;
+  }
+
+  .preview-iframe {
+    width: 100%;
+    height: 100%;
+  }
 </style>

+ 1 - 1
src/views/costAudit/auditInfo/archivesManage/pendingArchiveList.vue

@@ -273,7 +273,7 @@
         this.fetchData()
       },
       handleDetail(row) {
-        console.log('详情:', row)
+        this.$refs.taskDetail.open(row, 'chengben')
       },
       backToList() {
         this.activeTab = 'list'

+ 168 - 90
src/views/costAudit/auditInfo/auditManage/auditDocumentsMain.vue

@@ -186,7 +186,7 @@
               <el-input
                 v-model="document.documentNumber"
                 placeholder="请选择通知书文号"
-                style="width: 82%"
+                style="width: 79%"
                 disabled
               ></el-input>
               <!-- disabled -->
@@ -549,6 +549,7 @@
         },
         dataUploadUrl: [],
         isWh: '0',
+        resCostDocumentTemplateFiles: [],
       }
     },
     computed: {
@@ -602,43 +603,6 @@
         deep: true,
         immediate: true,
       },
-      costDocumentTemplateFiles: {
-        handler(newVal, oldVal) {
-          if (newVal.length > 0) {
-            console.log(this.costDocumentTemplateFiles)
-            this.costDocumentTemplateFiles.forEach((item) => {
-              if (
-                item.pinyin.includes('ShiJian') &&
-                (item.dataValue == null || item.dataValue == '')
-              ) {
-                // 获取当前时间,格式为YYYY-MM-DD
-                item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-              } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
-                item.dataValue = item.dataValue.split(' ')[0]
-              }
-              if (
-                item.originalText.includes('需要提供材料') &&
-                item.dataValue
-              ) {
-                this.dataUploadUrl = item.dataValue
-              }
-              if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
-                // 移除所有HTML标签
-                item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
-              }
-              if (
-                (item.pinyin.includes('ShengChengRiQi') ||
-                  item.pinyin.includes('BaoGaoRiQi')) &&
-                (item.dataValue == null || item.dataValue == '')
-              ) {
-                // 获取当前时间,格式为YYYY-MM-DD
-                item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-              }
-            })
-          }
-        },
-        deep: true,
-      },
     },
     mounted() {
       this.getData()
@@ -854,6 +818,170 @@
         this.document.documentNumber = ''
         this.document.documentWhId = ''
       },
+      formatDaValue(res) {
+        this.costDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        this.resCostDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        let unit = this.allUnits.find(
+          (item) => item.unitId === this.document.enterpriseId
+        )
+        let documenName = this.getDocumentType({
+          documentId: this.document.documentId,
+        })
+        this.costDocumentTemplateFiles.forEach((item) => {
+          if (item.pinyin.includes('BeiJianShenDanWei')) {
+            item.dataValue = unit.unitName
+          }
+          if (item.pinyin.includes('ShouSongDaRen')) {
+            item.dataValue = unit.contactName
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
+            item.dataValue = unit.address
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
+            item.dataValue = unit.contactMobile
+          }
+          if (item.originalText.includes('需要提供材料') && item.dataValue) {
+            this.dataUploadUrl = item.dataValue
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (
+            item.pinyin.includes('ShiJian') &&
+            (item.dataValue == null || item.dataValue == '')
+          ) {
+            // 获取当前时间,格式为YYYY年MM月DD日
+            item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+          } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('RiQi') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (documenName.includes('成本监审通知书')) {
+            if (item.pinyin.includes('DanWeiMingCheng')) {
+              item.dataValue = unit.unitName
+            }
+            if (item.pinyin.includes('FaRenDaiBiao')) {
+              item.dataValue = unit?.corporateRepresentative || ''
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianRiQi'
+              ) &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('ChuangJianRiQi')) {
+              // 获取当前时间或使用有效日期
+              item.dataValue =
+                item.dataValue && !item.dataValue.includes('年')
+                  ? moment(item.dataValue).format('YYYY年MM月DD日')
+                  : moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本监审提取资料登记表')) {
+            if (
+              item.pinyin.includes('DengJiBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本审核初步意见表')) {
+            if (
+              item.pinyin.includes('YiJianBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('政府定价成本监审结论报告')) {
+            if (
+              item.pinyin.includes('BaoGaoRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JieLunBaoGaoChuangJianRiQi')) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JianShenRenWuFaBuShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'JianShenRenWuFaBuShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuShengChengShiJian'
+              )
+            ) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) =>
+                  item2.pinyin === 'ChengBenJianShenTongZhiShuShengChengShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (item.pinyin.includes('ChengBenZiLiaoShangBaoShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'ChengBenZiLiaoShangBaoShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+          }
+          if (documenName.includes('成本审核初步意见告知书')) {
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianShiJian'
+              ) &&
+              item.dataValue
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = !item.dataValue.includes('年')
+                ? moment(item.dataValue).format('YYYY年MM月DD日')
+                : item.dataValue
+            }
+          }
+          // 回显文号
+          // 获取选中的文号信息
+          const selectedDocument = this.selectDocumentWhSelection[0]
+          if (selectedDocument) {
+            if (
+              item.pinyin.includes('WenHao') ||
+              item.pinyin.includes('WenJianHao')
+            ) {
+              item.dataValue = selectedDocument.whNo
+            }
+            if (item.pinyin.includes('SongDaWenShuMingCheng')) {
+              item.dataValue = selectedDocument.whName
+            }
+          }
+        })
+      },
       getDocumentData() {
         if (this.document.id === null || this.document.id === '') {
           queryByDocumentIdandWhereValue({
@@ -862,57 +990,7 @@
             unitId: this.document.enterpriseId,
             // projectId: this.project.projectId,
           }).then((res) => {
-            this.costDocumentTemplateFiles = res.value || []
-            let unit = this.allUnits.find(
-              (item) => item.unitId === this.document.enterpriseId
-            )
-            let documenName = this.getDocumentType({
-              documentId: this.document.documentId,
-            })
-            this.costDocumentTemplateFiles.forEach((item) => {
-              if (documenName.includes('成本监审通知书')) {
-                if (item.pinyin.includes('DanWeiMingCheng')) {
-                  item.dataValue = unit.unitName
-                }
-                if (item.pinyin.includes('FaRenDaiBiao')) {
-                  item.dataValue = unit?.corporateRepresentative || ''
-                }
-                if (
-                  item.pinyin.includes(
-                    'ChengBenJianShenTongZhiShuChuangJianRiQi'
-                  )
-                ) {
-                  // 获取当前时间
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (item.pinyin.includes('BeiJianShenDanWei')) {
-                item.dataValue = unit.unitName
-              }
-              if (item.pinyin.includes('ShouSongDaRen')) {
-                item.dataValue = unit.contactName
-              }
-              if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
-                item.dataValue = unit.address
-              }
-              if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
-                item.dataValue = unit.contactMobile
-              }
-              // 回显文号
-              // 获取选中的文号信息
-              const selectedDocument = this.selectDocumentWhSelection[0]
-              if (selectedDocument) {
-                if (
-                  item.pinyin.includes('WenHao') ||
-                  item.pinyin.includes('WenJianHao')
-                ) {
-                  item.dataValue = selectedDocument.whNo
-                }
-                if (item.pinyin.includes('SongDaWenShuMingCheng')) {
-                  item.dataValue = selectedDocument.whName
-                }
-              }
-            })
+            this.formatDaValue(res)
           })
         } else {
           getCostProjectDocumentFile({
@@ -920,7 +998,7 @@
             // whereValue: this.project.projectId,
             id: this.document.id,
           }).then((res) => {
-            this.costDocumentTemplateFiles = res.value || []
+            this.formatDaValue(res)
           })
         }
       },

+ 171 - 2
src/views/costAudit/baseInfo/statistics/components/auditNoticeTab.vue

@@ -603,6 +603,7 @@
           ],
         },
         dataUploadUrl: [],
+        resCostDocumentTemplateFiles: [],
       }
     },
     computed: {
@@ -851,19 +852,187 @@
         this.document.documentWhId = ''
         this.getDocumentData()
       },
+      formatDaValue(res) {
+        this.costDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        this.resCostDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        let unit = this.allUnits.find(
+          (item) => item.unitId === this.document.enterpriseId
+        )
+        let documenName = this.getDocumentType({
+          documentId: this.document.documentId,
+        })
+        this.costDocumentTemplateFiles.forEach((item) => {
+          if (item.pinyin.includes('BeiJianShenDanWei')) {
+            item.dataValue = unit.unitName
+          }
+          if (item.pinyin.includes('ShouSongDaRen')) {
+            item.dataValue = unit.contactName
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
+            item.dataValue = unit.address
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
+            item.dataValue = unit.contactMobile
+          }
+          if (item.originalText.includes('需要提供材料') && item.dataValue) {
+            this.dataUploadUrl = item.dataValue
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (
+            item.pinyin.includes('ShiJian') &&
+            (item.dataValue == null || item.dataValue == '')
+          ) {
+            // 获取当前时间,格式为YYYY年MM月DD日
+            item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+          } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('RiQi') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (documenName.includes('成本监审通知书')) {
+            if (item.pinyin.includes('DanWeiMingCheng')) {
+              item.dataValue = unit.unitName
+            }
+            if (item.pinyin.includes('FaRenDaiBiao')) {
+              item.dataValue = unit?.corporateRepresentative || ''
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianRiQi'
+              ) &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('ChuangJianRiQi')) {
+              // 获取当前时间或使用有效日期
+              item.dataValue =
+                item.dataValue && !item.dataValue.includes('年')
+                  ? moment(item.dataValue).format('YYYY年MM月DD日')
+                  : moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本监审提取资料登记表')) {
+            if (
+              item.pinyin.includes('DengJiBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本审核初步意见表')) {
+            if (
+              item.pinyin.includes('YiJianBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('政府定价成本监审结论报告')) {
+            if (
+              item.pinyin.includes('BaoGaoRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JieLunBaoGaoChuangJianRiQi')) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JianShenRenWuFaBuShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'JianShenRenWuFaBuShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuShengChengShiJian'
+              )
+            ) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) =>
+                  item2.pinyin === 'ChengBenJianShenTongZhiShuShengChengShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (item.pinyin.includes('ChengBenZiLiaoShangBaoShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'ChengBenZiLiaoShangBaoShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+          }
+          if (documenName.includes('成本审核初步意见告知书')) {
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianShiJian'
+              ) &&
+              item.dataValue
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = !item.dataValue.includes('年')
+                ? moment(item.dataValue).format('YYYY年MM月DD日')
+                : item.dataValue
+            }
+          }
+          // 回显文号
+          // 获取选中的文号信息
+          const selectedDocument = this.selectDocumentWhSelection[0]
+          if (selectedDocument) {
+            if (
+              item.pinyin.includes('WenHao') ||
+              item.pinyin.includes('WenJianHao')
+            ) {
+              item.dataValue = selectedDocument.whNo
+            }
+            if (item.pinyin.includes('SongDaWenShuMingCheng')) {
+              item.dataValue = selectedDocument.whName
+            }
+          }
+        })
+      },
       getDocumentData() {
         if (this.document.id === null || this.document.id === '') {
           queryByDocumentIdandWhereValue({
             documentId: this.document.documentId,
             whereValue: this.project.projectId,
+            unitId: this.document.enterpriseId,
+            // projectId: this.project.projectId,
           }).then((res) => {
-            this.costDocumentTemplateFiles = res.value || []
+            this.formatDaValue(res)
           })
         } else {
           getCostProjectDocumentFile({
+            // documentId: this.document.documentId,
+            // whereValue: this.project.projectId,
             id: this.document.id,
           }).then((res) => {
-            this.costDocumentTemplateFiles = res.value || []
+            this.formatDaValue(res)
           })
         }
       },

+ 28 - 76
src/views/costAudit/baseInfo/statistics/historyAnalysis.vue

@@ -94,6 +94,7 @@
           node-key="id"
           :props="treeProps"
           :check-strictly="true"
+          :current-node-key="currentCheckedNode"
           @check="handleCheck"
         ></el-tree>
         <Empty v-else description="暂无数据"></Empty>
@@ -213,6 +214,7 @@
           series: [],
         },
         compositionData: [],
+        currentCheckedNode: null,
       }
     },
     mounted() {
@@ -605,6 +607,14 @@
         return null
       },
 
+      // 判断是否为根节点
+      isRootNode(node) {
+        if (!node) return false
+        const pid = node.parentId
+        return pid === undefined || pid === null || String(pid || '') === '-1'
+      },
+
+      // 查找节点到根的路径
       // 获取树的父级(拥有子节点)id 列表
       getParentIds(tree = []) {
         const ids = []
@@ -712,76 +722,6 @@
         }
       },
 
-      // 过滤数据:选什么就返回什么(父子可同时保留各自曲线)
-      filterCostSurveysListForHistoryAnalysis(
-        costSurveysList = [],
-        selectedItems = []
-      ) {
-        if (!selectedItems || selectedItems.length === 0) {
-          return []
-        }
-        // 兼容 id / uniqueId / rowid
-        const selectedIdSet = new Set(
-          selectedItems
-            .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
-            .filter(Boolean)
-        )
-
-        // 递归过滤节点,父子都可保留
-        const filterNode = (node) => {
-          if (!node) return null
-
-          const isSelected =
-            selectedIdSet.has(node.id) ||
-            selectedIdSet.has(node.uniqueId) ||
-            selectedIdSet.has(node.rowid) ||
-            selectedIdSet.has(node.rowId)
-          let filteredChildren = []
-
-          if (
-            Array.isArray(node.costSurveysVos) &&
-            node.costSurveysVos.length
-          ) {
-            filteredChildren = node.costSurveysVos
-              .map(filterNode)
-              .filter(Boolean)
-          }
-
-          if (isSelected) {
-            // 选中的节点只保留自身(折线仅展示选中的项,不强制带子项)。
-            // 若自身没有年度数据,则用子节点汇总填充,以保证有折线数据。
-            const hasSurvey =
-              Array.isArray(node.surveysVos) && node.surveysVos.length
-            let fallback = { surveysVos: [], costSurveysVos: [] }
-            if (
-              !hasSurvey &&
-              node.costSurveysVos &&
-              node.costSurveysVos.length
-            ) {
-              fallback = this.aggregateNodeData(node)
-            }
-            return {
-              ...node,
-              surveysVos: hasSurvey ? node.surveysVos : fallback.surveysVos,
-              // 折线不展示未选中的子节点
-              costSurveysVos: [],
-            }
-          }
-
-          // 未选中但有选中子节点,则只保留这些子节点
-          if (filteredChildren.length > 0) {
-            return {
-              ...node,
-              costSurveysVos: filteredChildren,
-            }
-          }
-
-          return null
-        }
-
-        return costSurveysList.map(filterNode).filter(Boolean)
-      },
-
       // 根据索引获取颜色
       getColorByIndex(index) {
         const colors = [
@@ -798,9 +738,13 @@
       },
 
       // 处理指标选择变化
-      handleCheck(data, checked) {
-        // 获取所有选中的节点 key
-        const checkedKeys = this.$refs.indicatorTree.getCheckedKeys()
+      handleCheck(data, info) {
+        const rawCheckedKeys =
+          (info && info.checkedKeys) ||
+          this.$refs.indicatorTree.getCheckedKeys() ||
+          []
+        const checkedKeys = this.sanitizeCheckedKeys(data, rawCheckedKeys)
+        this.$refs.indicatorTree.setCheckedKeys(checkedKeys)
         this.selectedIndicators = checkedKeys
         // 根据选中的指标更新图表(这里可以根据选中项过滤数据)
         this.updateChartsBySelectedIndicators()
@@ -845,6 +789,9 @@
           new Set(this.selectedIndicators || [])
         )
 
+        // 折线图与树保持一致,直接使用当前勾选的节点
+        const finalSelectedIdsForTrend = effectiveSelectedIds
+
         if (!effectiveSelectedIds || effectiveSelectedIds.length === 0) {
           // 如果没有选中任何指标,清空图表
           this.trendData = { xAxis: [], series: [] }
@@ -863,7 +810,7 @@
         }
 
         // 组合选中项的完整节点信息
-        const selectedItems = effectiveSelectedIds
+        const selectedItems = finalSelectedIdsForTrend
           .map((id) => this.findItemById(id, this.indicatorData || []))
           .filter(Boolean)
 
@@ -878,6 +825,7 @@
 
         // 处理趋势图数据
         const trendArr = this.transformTrendFromCostList(trendList)
+        console.log('trendArr999', trendArr)
         const { xAxis, series } = this.buildTrendSeries(trendArr, selectedItems)
         this.trendData = { xAxis, series }
         // 保存所有趋势图数据
@@ -887,13 +835,17 @@
         this.trendCurrentPage = 1
 
         // 构成图:使用选中节点及其子项,展示子项占比
+        // 饼图使用树勾选的节点(含根/子),与勾选保持一致
         const compositionList = this.filterCostSurveysListBySelectedIds(
           dataSource.costSurveysList || [],
-          effectiveSelectedIds
+          this.selectedIndicators
         )
         const compositionData = this.transformCompositionFromCostList(
           compositionList,
-          selectedItems
+          // 维持饼图顺序与勾选一致
+          effectiveSelectedIds
+            .map((id) => this.findItemById(id, this.indicatorData || []))
+            .filter(Boolean)
         )
         // 保存所有构成图数据
         this.compositionAllData = compositionData

+ 163 - 37
src/views/costAudit/baseInfo/statistics/index.js

@@ -214,6 +214,145 @@ export const comprehensiveMixin = {
       return { ids, items }
     },
 
+    // 查找节点到根的路径
+    findPathByKey(
+      id,
+      tree = this.indicatorData ||
+        this.leftDataItems ||
+        this.rightDataItems ||
+        []
+    ) {
+      const getKeys = (item) =>
+        [
+          item.id,
+          item.uniqueId,
+          item.rowid,
+          item.rowId,
+          item.number,
+          item.name,
+        ].filter(Boolean)
+
+      const dfs = (items, path = []) => {
+        for (const item of items) {
+          const currentPath = [...path, item]
+          if (getKeys(item).includes(id)) {
+            return currentPath
+          }
+          if (item.children && item.children.length > 0) {
+            const childPath = dfs(item.children, currentPath)
+            if (childPath) return childPath
+          }
+        }
+        return null
+      }
+      return dfs(tree)
+    },
+
+    // 过滤选中项:
+    // - 点击根节点:只保留当前根节点及其已勾选的子节点,其它根与节点取消
+    // - 点击子/孙节点:只保留当前节点及其已勾选的子节点,其它节点取消
+    sanitizeCheckedKeys(
+      data,
+      checkedKeys = [],
+      tree = this.leftDataItems ||
+        this.rightDataItems ||
+        this.indicatorData ||
+        []
+    ) {
+      if (!checkedKeys || checkedKeys.length === 0) return []
+
+      const useTree = Array.isArray(tree) && tree.length > 0 ? tree : []
+      const paths = []
+      checkedKeys.forEach((key) => {
+        const path = this.findPathByKey(key, useTree)
+        if (path && path.length > 0) {
+          paths.push(path)
+        }
+      })
+
+      const sanitized = new Set()
+
+      if (data && String(data.parentId ?? '').trim() === '-1') {
+        // 根节点:只保留当前根及其已勾选的子节点
+        paths
+          .filter((path) => path[0] && path[0].id === data.id)
+          .forEach((path) => {
+            path.forEach((node) => sanitized.add(node.id))
+          })
+        sanitized.add(data.id)
+      } else if (data) {
+        // 子/孙节点:保留当前节点及其已勾选的子节点,并保留已勾选的根节点
+        paths
+          .filter((path) => path[0] && path[0].rowid === data.parentId)
+          .forEach((root) => {
+            root.forEach((node) => {
+              sanitized.add(node.id)
+              node.children.forEach((child) => {
+                if (checkedKeys.includes(child.id)) {
+                  sanitized.add(child.id)
+                }
+              })
+            })
+          })
+      }
+
+      return Array.from(sanitized)
+    },
+
+    // 过滤数据:选什么就返回什么(父子可同时保留各自曲线)
+    filterCostSurveysListForHistoryAnalysis(
+      costSurveysList = [],
+      selectedItems = []
+    ) {
+      if (!selectedItems || selectedItems.length === 0) {
+        return []
+      }
+      const toKey = (v) =>
+        v === undefined || v === null ? null : String(v).trim()
+      // 兼容 id / uniqueId / rowid,统一转成字符串避免类型不一致
+      const selectedIdSet = new Set(
+        selectedItems
+          .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
+          .map(toKey)
+          .filter(Boolean)
+      )
+
+      // 递归过滤节点,父子都可保留
+      const filterNode = (node) => {
+        if (!node) return null
+
+        const keys = [node.id, node.uniqueId, node.rowid, node.rowId].map(toKey)
+        const isSelected = keys.some((k) => selectedIdSet.has(k))
+        let filteredChildren = []
+
+        if (Array.isArray(node.costSurveysVos) && node.costSurveysVos.length) {
+          filteredChildren = node.costSurveysVos.map(filterNode).filter(Boolean)
+        }
+
+        if (isSelected) {
+          // 选中的节点保留自身;不再用子节点汇总填充,避免父子数据重复
+          const baseNode = {
+            ...node,
+            surveysVos: Array.isArray(node.surveysVos) ? node.surveysVos : [],
+            costSurveysVos: filteredChildren, // 若子节点也选中则一并保留
+          }
+          return baseNode
+        }
+
+        // 未选中但有选中子节点,则只保留这些子节点
+        if (filteredChildren.length > 0) {
+          return {
+            ...node,
+            costSurveysVos: filteredChildren,
+          }
+        }
+
+        return null
+      }
+
+      return costSurveysList.map(filterNode).filter(Boolean)
+    },
+
     // 统一请求统计数据
     async requestStatistics(params = {}) {
       // 如果组件已销毁,直接返回 mock 数据
@@ -320,7 +459,10 @@ export const comprehensiveMixin = {
       if (!selectedIds || selectedIds.length === 0) {
         return []
       }
-      const selectedIdSet = new Set(selectedIds)
+      // 统一转成字符串,避免数字/字符串类型不一致导致无法匹配
+      const toKey = (v) =>
+        v === undefined || v === null ? null : String(v).trim()
+      const selectedIdSet = new Set(selectedIds.map(toKey).filter(Boolean))
       const isSelected = (node) => {
         const keys = [
           node?.id,
@@ -329,7 +471,9 @@ export const comprehensiveMixin = {
           node?.rowId,
           node?.number,
           node?.name,
-        ].filter(Boolean)
+        ]
+          .map(toKey)
+          .filter(Boolean)
         return keys.some((k) => selectedIdSet.has(k))
       }
 
@@ -384,7 +528,7 @@ export const comprehensiveMixin = {
               node.uniqueId || node.id || node.rowid || node.rowId || node.name
             trendArr.push({
               indicatorId: indicatorId,
-              indicatorName: node.label || node.name,
+              indicatorName: node.name,
               year: yearKey,
               value:
                 Number(
@@ -421,13 +565,27 @@ export const comprehensiveMixin = {
           Array.isArray(node.costSurveysVos) &&
           node.costSurveysVos.length > 0
         ) {
+          result.push({
+            name: node.name,
+            indicatorId: indicatorId, // 添加唯一标识
+            value:
+              Number(
+                node.value !== undefined && node.value !== null
+                  ? node.value
+                  : node.rvalue
+              ) || 0,
+            surveysVos: node.surveysVos || [],
+          })
           node.costSurveysVos.forEach((sv) => {
             const surveysList = Array.isArray(sv.surveysVos)
               ? sv.surveysVos
               : []
+            // 子节点使用自己的唯一标识
+            const childIndicatorId =
+              sv.uniqueId || sv.id || sv.rowid || sv.rowId || sv.name
             result.push({
               name: sv.name,
-              indicatorId: indicatorId, // 添加唯一标识
+              indicatorId: childIndicatorId, // 添加子节点的唯一标识
               value:
                 surveysList.reduce((sum, item) => {
                   const v =
@@ -462,29 +620,7 @@ export const comprehensiveMixin = {
       })
       const nameIndexMap = {}
 
-      // 按照选中项顺序来排序结果
-      let orderedResult = result
-      if (selectedItemsOrder && selectedItemsOrder.length > 0) {
-        const indicatorIdToItem = {}
-        result.forEach((item) => {
-          indicatorIdToItem[item.indicatorId] = item
-        })
-        // 先添加按顺序的项
-        orderedResult = selectedItemsOrder
-          .map((item) => {
-            const key =
-              item.uniqueId || item.id || item.rowid || item.rowId || item.name
-            return indicatorIdToItem[key]
-          })
-          .filter(Boolean)
-        // 再添加不在选中项顺序中的项(以防有遗漏)
-        result.forEach((item) => {
-          if (!orderedResult.find((r) => r.indicatorId === item.indicatorId)) {
-            orderedResult.push(item)
-          }
-        })
-      }
-
+      let orderedResult = [...result]
       // 为相同名称的项添加序号
       return orderedResult.map((item) => {
         const nameCount = nameCountMap[item.name] || 1
@@ -602,16 +738,6 @@ export const comprehensiveMixin = {
           color: this.getColorByIndex(index), // 按照顺序重新分配颜色,确保每个项都不同
         }
       })
-
-      // 确保至少有一个空系列,以便图表可以正确初始化
-      if (series.length === 0) {
-        series.push({
-          name: '',
-          data: years.map(() => 0),
-          color: '#ccc',
-        })
-      }
-
       return { xAxis: years, series }
     },
     // 初始化图表

+ 163 - 80
src/views/costAudit/baseInfo/statistics/industryAnalysis.vue

@@ -265,11 +265,11 @@
               type: 'category',
               boundaryGap: false,
               data: [],
-              show: false,
+              show: true,
             },
             yAxis: {
               type: 'value',
-              show: false,
+              show: true,
             },
             series: [],
           }
@@ -635,8 +635,17 @@
       },
 
       // 左侧树选中变更
-      handleLeftCheck() {
-        const checkedKeys = this.$refs.leftPanel?.getCheckedKeys?.() || []
+      handleLeftCheck(data, info) {
+        const rawCheckedKeys =
+          (info && info.checkedKeys) ||
+          this.$refs.leftPanel?.getCheckedKeys?.() ||
+          []
+        const checkedKeys = this.sanitizeCheckedKeys(
+          data,
+          rawCheckedKeys,
+          this.leftDataItems || []
+        )
+        this.$refs.leftPanel?.setCheckedKeys?.(checkedKeys)
         this.leftSelectedItems = checkedKeys
           .map((id) => this.findItemById(id, 'left'))
           .filter(Boolean)
@@ -644,8 +653,17 @@
       },
 
       // 右侧树选中变更
-      handleRightCheck() {
-        const checkedKeys = this.$refs.rightPanel?.getCheckedKeys?.() || []
+      handleRightCheck(data, info) {
+        const rawCheckedKeys =
+          (info && info.checkedKeys) ||
+          this.$refs.rightPanel?.getCheckedKeys?.() ||
+          []
+        const checkedKeys = this.sanitizeCheckedKeys(
+          data,
+          rawCheckedKeys,
+          this.rightDataItems || []
+        )
+        this.$refs.rightPanel?.setCheckedKeys?.(checkedKeys)
         this.rightSelectedItems = checkedKeys
           .map((id) => this.findItemById(id, 'right'))
           .filter(Boolean)
@@ -802,15 +820,19 @@
       findItemById(id, type = 'left') {
         const dataItems =
           type === 'left' ? this.leftDataItems : this.rightDataItems
+        const getKeys = (item) =>
+          [
+            item.id,
+            item.uniqueId,
+            item.rowid,
+            item.rowId,
+            item.number,
+            item.name,
+          ].filter(Boolean)
+
         function search(items) {
           for (const item of items) {
-            const keys = [
-              item.id,
-              item.uniqueId,
-              item.rowid,
-              item.rowId,
-            ].filter(Boolean)
-            if (keys.includes(id)) {
+            if (getKeys(item).includes(id)) {
               return item
             }
             if (item.children && item.children.length > 0) {
@@ -825,11 +847,77 @@
         return search(dataItems)
       },
 
+      // 判断是否为根节点
+      isRootNode(node) {
+        if (!node) return false
+        const pid = node.parentId
+        return pid === undefined || pid === null || String(pid || '') === '-1'
+      },
+
+      // 仅用于图表展示的选中项过滤:如果某节点的子节点被选中,则优先展示子节点,父节点不重复展示
+      filterLeafSelections(type = 'left', selectedIds = []) {
+        if (!selectedIds || selectedIds.length === 0) return []
+        const dataItems =
+          type === 'left' ? this.leftDataItems || [] : this.rightDataItems || []
+
+        const getKeys = (item) =>
+          [
+            item.id,
+            item.uniqueId,
+            item.rowid,
+            item.rowId,
+            item.number,
+            item.name,
+          ].filter(Boolean)
+
+        const idSet = new Set(selectedIds)
+
+        const findNode = (id, nodes) => {
+          for (const n of nodes) {
+            if (getKeys(n).some((key) => idSet.has(key))) return n
+            if (n.children && n.children.length) {
+              const found = findNode(id, n.children)
+              if (found) return found
+            }
+          }
+          return null
+        }
+
+        const hasSelectedChild = (node) => {
+          if (!node || !node.children || node.children.length === 0)
+            return false
+          for (const child of node.children) {
+            if (getKeys(child).some((key) => idSet.has(key))) return true
+            if (hasSelectedChild(child)) return true
+          }
+          return false
+        }
+
+        const filtered = selectedIds.filter((id) => {
+          const node = findNode(id, dataItems)
+          return node && !hasSelectedChild(node)
+        })
+
+        return Array.from(new Set(filtered))
+      },
+
       // 根据选中的数据项更新左侧图表
       updateLeftChartsBySelection() {
-        const effectiveSelectedIds = this.leftSelectedItems || []
+        // 以树的实时勾选结果为准,避免旧的选中残留
+        const checkedIds =
+          (this.$refs.leftPanel && this.$refs.leftPanel.getCheckedKeys()) || []
+        const selectedItems = checkedIds
+          .map((id) => this.findItemById(id, 'left'))
+          .filter(Boolean)
+        const selectedIds = selectedItems
+          .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
+          .filter(Boolean)
+        // 折线图与树保持一致,直接使用当前勾选的节点
+        const selectedItemsForCharts = checkedIds
+          .map((id) => this.findItemById(id, 'left'))
+          .filter(Boolean)
 
-        if (!effectiveSelectedIds || effectiveSelectedIds.length === 0) {
+        if (!selectedItemsForCharts || selectedItemsForCharts.length === 0) {
           // 如果没有选中任何指标,清空图表
           this.leftTrendData = { xAxis: [], series: [] }
           this.leftTrendAllSeries = []
@@ -846,23 +934,22 @@
           return
         }
 
-        // 组合选中项的完整节点信息
-        const selectedItems = effectiveSelectedIds
-          .map((item) => this.findItemById(item.id, 'left'))
-          .filter(Boolean)
-
         // 如果没有原始数据源,[]
         const dataSource = this.leftDataSource || []
 
         // 根据选中的指标过滤数据(趋势:父级仅看自身;子级直接看自身)
-        const trendList = this.filterCostSurveysListForIndustryAnalysis(
+        // 折线图逻辑与 historyAnalysis 保持一致
+        const trendList = this.filterCostSurveysListForHistoryAnalysis(
           dataSource.costSurveysList || [],
-          selectedItems
+          selectedItemsForCharts
         )
 
         // 处理趋势图数据
         const trendArr = this.transformTrendFromCostList(trendList)
-        const { xAxis, series } = this.buildTrendSeries(trendArr, selectedItems)
+        const { xAxis, series } = this.buildTrendSeries(
+          trendArr,
+          selectedItemsForCharts
+        )
         this.leftTrendData = { xAxis, series }
         // 保存所有趋势图数据
         this.leftTrendAllSeries = series
@@ -871,9 +958,7 @@
         this.leftTrendCurrentPage = 1
 
         // 构成图:使用选中节点及其子项,展示子项占比
-        const selectedIds = selectedItems
-          .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
-          .filter(Boolean)
+        // 饼图使用树勾选的节点(含根/子),与勾选保持一致
         const compositionList = this.filterCostSurveysListBySelectedIds(
           dataSource.costSurveysList || [],
           selectedIds
@@ -902,9 +987,21 @@
 
       // 根据选中的数据项更新右侧图表
       updateRightChartsBySelection() {
-        const effectiveSelectedIds = this.rightSelectedItems || []
+        // 以树的实时勾选结果为准,避免旧的选中残留
+        const checkedIds =
+          (this.$refs.rightPanel && this.$refs.rightPanel.getCheckedKeys()) ||
+          []
+        const selectedItems = checkedIds
+          .map((id) => this.findItemById(id, 'right'))
+          .filter(Boolean)
+        const selectedIds = selectedItems
+          .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
+          .filter(Boolean)
+        const selectedItemsForCharts = checkedIds
+          .map((id) => this.findItemById(id, 'right'))
+          .filter(Boolean)
 
-        if (!effectiveSelectedIds || effectiveSelectedIds.length === 0) {
+        if (!selectedItemsForCharts || selectedItemsForCharts.length === 0) {
           // 如果没有选中任何指标,清空图表
           this.rightTrendData = { xAxis: [], series: [] }
           this.rightTrendAllSeries = []
@@ -921,23 +1018,22 @@
           return
         }
 
-        // 组合选中项的完整节点信息
-        const selectedItems = effectiveSelectedIds
-          .map((item) => this.findItemById(item.id, 'right'))
-          .filter(Boolean)
-
         // 如果没有原始数据源,[]
         const dataSource = this.rightDataSource || []
 
         // 根据选中的指标过滤数据(趋势:父级仅看自身;子级直接看自身)
-        const trendList = this.filterCostSurveysListForIndustryAnalysis(
+        // 折线图逻辑与 historyAnalysis 保持一致
+        const trendList = this.filterCostSurveysListForHistoryAnalysis(
           dataSource.costSurveysList || [],
-          selectedItems
+          selectedItemsForCharts
         )
 
         // 处理趋势图数据
         const trendArr = this.transformTrendFromCostList(trendList)
-        const { xAxis, series } = this.buildTrendSeries(trendArr, selectedItems)
+        const { xAxis, series } = this.buildTrendSeries(
+          trendArr,
+          selectedItemsForCharts
+        )
         this.rightTrendData = { xAxis, series }
         // 保存所有趋势图数据
         this.rightTrendAllSeries = series
@@ -946,9 +1042,7 @@
         this.rightTrendCurrentPage = 1
 
         // 构成图:使用选中节点及其子项,展示子项占比
-        const selectedIds = selectedItems
-          .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
-          .filter(Boolean)
+        // 饼图使用树勾选的节点(含根/子),与勾选保持一致
         const compositionList = this.filterCostSurveysListBySelectedIds(
           dataSource.costSurveysList || [],
           selectedIds
@@ -975,69 +1069,58 @@
         })
       },
 
-      // 过滤数据:选中父级时只显示父级数据,不包含子级
-      filterCostSurveysListForIndustryAnalysis(
+      // 过滤数据:选什么就返回什么(父子可同时保留各自曲线)
+      filterCostSurveysListForHistoryAnalysis(
         costSurveysList = [],
         selectedItems = []
       ) {
         if (!selectedItems || selectedItems.length === 0) {
           return []
         }
+        const toKey = (v) =>
+          v === undefined || v === null ? null : String(v).trim()
+        // 兼容 id / uniqueId / rowid,统一转成字符串避免类型不一致
         const selectedIdSet = new Set(
           selectedItems
             .flatMap((item) => [item.id, item.uniqueId, item.rowid, item.rowId])
+            .map(toKey)
             .filter(Boolean)
         )
 
-        const selectedItemMap = new Map()
-        selectedItems.forEach((item) => {
-          const key =
-            item.id || item.uniqueId || item.rowid || item.rowId || item.name
-          selectedItemMap.set(key, {
-            hasChildren: item.children && item.children.length > 0,
-          })
-        })
-
+        // 递归过滤节点,父子都可保留
         const filterNode = (node) => {
           if (!node) return null
-          const nodeKey =
-            node.id || node.uniqueId || node.rowid || node.rowId || node.name
-          const isSelected = selectedIdSet.has(nodeKey)
 
-          if (isSelected) {
-            const hasSurvey =
-              Array.isArray(node.surveysVos) && node.surveysVos.length
-            let fallback = { surveysVos: [], costSurveysVos: [] }
-            if (
-              !hasSurvey &&
-              Array.isArray(node.costSurveysVos) &&
-              node.costSurveysVos.length
-            ) {
-              fallback = this.aggregateNodeData(node)
-            }
-            const itemInfo = selectedItemMap.get(nodeKey)
-            // 趋势:只展示选中的节点自身,若父节点但无年度数据则用汇总
-            return {
-              ...node,
-              surveysVos: hasSurvey ? node.surveysVos : fallback.surveysVos,
-              costSurveysVos:
-                itemInfo && itemInfo.hasChildren ? [] : fallback.costSurveysVos,
-            }
-          }
+          const keys = [node.id, node.uniqueId, node.rowid, node.rowId].map(
+            toKey
+          )
+          const isSelected = keys.some((k) => selectedIdSet.has(k))
+          let filteredChildren = []
 
           if (
             Array.isArray(node.costSurveysVos) &&
             node.costSurveysVos.length
           ) {
-            const filteredChildren = node.costSurveysVos
+            filteredChildren = node.costSurveysVos
               .map(filterNode)
               .filter(Boolean)
-            if (filteredChildren.length > 0) {
-              return {
-                ...node,
-                surveysVos: [],
-                costSurveysVos: filteredChildren,
-              }
+          }
+
+          if (isSelected) {
+            // 选中的节点保留自身;不再用子节点汇总填充,避免父子数据重复
+            const baseNode = {
+              ...node,
+              surveysVos: Array.isArray(node.surveysVos) ? node.surveysVos : [],
+              costSurveysVos: filteredChildren, // 若子节点也选中则一并保留
+            }
+            return baseNode
+          }
+
+          // 未选中但有选中子节点,则只保留这些子节点
+          if (filteredChildren.length > 0) {
+            return {
+              ...node,
+              costSurveysVos: filteredChildren,
             }
           }
 

+ 166 - 276
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/auditNoticeTab.vue

@@ -711,6 +711,170 @@
         this.document.documentNumber = ''
         this.document.documentWhId = ''
       },
+      formatDaValue(res) {
+        this.costDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        this.resCostDocumentTemplateFiles =
+          JSON.parse(JSON.stringify(res.value || [])) || []
+        let unit = this.allUnits.find(
+          (item) => item.unitId === this.document.enterpriseId
+        )
+        let documenName = this.getDocumentType({
+          documentId: this.document.documentId,
+        })
+        this.costDocumentTemplateFiles.forEach((item) => {
+          if (item.pinyin.includes('BeiJianShenDanWei')) {
+            item.dataValue = unit.unitName
+          }
+          if (item.pinyin.includes('ShouSongDaRen')) {
+            item.dataValue = unit.contactName
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
+            item.dataValue = unit.address
+          }
+          if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
+            item.dataValue = unit.contactMobile
+          }
+          if (item.originalText.includes('需要提供材料') && item.dataValue) {
+            this.dataUploadUrl = item.dataValue
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (
+            item.pinyin.includes('ShiJian') &&
+            (item.dataValue == null || item.dataValue == '')
+          ) {
+            // 获取当前时间,格式为YYYY年MM月DD日
+            item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+          } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('RiQi') && item.dataValue) {
+            item.dataValue = item.dataValue.includes('年')
+              ? item.dataValue
+              : moment(item.dataValue).format('YYYY年MM月DD日')
+          }
+          if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
+            // 移除所有HTML标签
+            item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
+          }
+          if (documenName.includes('成本监审通知书')) {
+            if (item.pinyin.includes('DanWeiMingCheng')) {
+              item.dataValue = unit.unitName
+            }
+            if (item.pinyin.includes('FaRenDaiBiao')) {
+              item.dataValue = unit?.corporateRepresentative || ''
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianRiQi'
+              ) &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('ChuangJianRiQi')) {
+              // 获取当前时间或使用有效日期
+              item.dataValue =
+                item.dataValue && !item.dataValue.includes('年')
+                  ? moment(item.dataValue).format('YYYY年MM月DD日')
+                  : moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本监审提取资料登记表')) {
+            if (
+              item.pinyin.includes('DengJiBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('成本审核初步意见表')) {
+            if (
+              item.pinyin.includes('YiJianBiaoShengChengRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+          }
+          if (documenName.includes('政府定价成本监审结论报告')) {
+            if (
+              item.pinyin.includes('BaoGaoRiQi') &&
+              (item.dataValue == null || item.dataValue == '')
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JieLunBaoGaoChuangJianRiQi')) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = moment(new Date()).format('YYYY年MM月DD日')
+            }
+            if (item.pinyin.includes('JianShenRenWuFaBuShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'JianShenRenWuFaBuShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuShengChengShiJian'
+              )
+            ) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) =>
+                  item2.pinyin === 'ChengBenJianShenTongZhiShuShengChengShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+            if (item.pinyin.includes('ChengBenZiLiaoShangBaoShiJian')) {
+              let dataValue = this.resCostDocumentTemplateFiles.find(
+                (item2) => item2.pinyin === 'ChengBenZiLiaoShangBaoShiJian'
+              ).dataValue
+              item.dataValue = !dataValue.includes('年')
+                ? moment(dataValue).format('YYYY年MM月DD日')
+                : dataValue
+            }
+          }
+          if (documenName.includes('成本审核初步意见告知书')) {
+            if (
+              item.pinyin.includes(
+                'ChengBenJianShenTongZhiShuChuangJianShiJian'
+              ) &&
+              item.dataValue
+            ) {
+              // 获取当前时间,格式为YYYY年MM月DD日
+              item.dataValue = !item.dataValue.includes('年')
+                ? moment(item.dataValue).format('YYYY年MM月DD日')
+                : item.dataValue
+            }
+          }
+          // 回显文号
+          // 获取选中的文号信息
+          const selectedDocument = this.selectDocumentWhSelection[0]
+          if (selectedDocument) {
+            if (
+              item.pinyin.includes('WenHao') ||
+              item.pinyin.includes('WenJianHao')
+            ) {
+              item.dataValue = selectedDocument.whNo
+            }
+            if (item.pinyin.includes('SongDaWenShuMingCheng')) {
+              item.dataValue = selectedDocument.whName
+            }
+          }
+        })
+      },
       getDocumentData() {
         if (this.document.id === null || this.document.id === '') {
           queryByDocumentIdandWhereValue({
@@ -719,144 +883,7 @@
             unitId: this.document.enterpriseId,
             // projectId: this.project.projectId,
           }).then((res) => {
-            this.costDocumentTemplateFiles =
-              JSON.parse(JSON.stringify(res.value || [])) || []
-            this.resCostDocumentTemplateFiles =
-              JSON.parse(JSON.stringify(res.value || [])) || []
-            let unit = this.allUnits.find(
-              (item) => item.unitId === this.document.enterpriseId
-            )
-            let documenName = this.getDocumentType({
-              documentId: this.document.documentId,
-            })
-            this.costDocumentTemplateFiles.forEach((item) => {
-              if (item.pinyin.includes('BeiJianShenDanWei')) {
-                item.dataValue = unit.unitName
-              }
-              if (item.pinyin.includes('ShouSongDaRen')) {
-                item.dataValue = unit.contactName
-              }
-              if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
-                item.dataValue = unit.address
-              }
-              if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
-                item.dataValue = unit.contactMobile
-              }
-              if (
-                item.originalText.includes('需要提供材料') &&
-                item.dataValue
-              ) {
-                this.dataUploadUrl = item.dataValue
-              }
-              if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
-                // 移除所有HTML标签
-                item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
-              }
-              if (
-                item.pinyin.includes('ShiJian') &&
-                (item.dataValue == null || item.dataValue == '')
-              ) {
-                // 获取当前时间,格式为YYYY-MM-DD
-                item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-              } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
-                item.dataValue = item.dataValue.split(' ')[0]
-              }
-              if (
-                item.originalText.includes('需要提供材料') &&
-                item.dataValue
-              ) {
-                this.dataUploadUrl = item.dataValue
-              }
-              if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
-                // 移除所有HTML标签
-                item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
-              }
-              if (documenName.includes('成本监审通知书')) {
-                if (item.pinyin.includes('DanWeiMingCheng')) {
-                  item.dataValue = unit.unitName
-                }
-                if (item.pinyin.includes('FaRenDaiBiao')) {
-                  item.dataValue = unit?.corporateRepresentative || ''
-                }
-                if (
-                  item.pinyin.includes(
-                    'ChengBenJianShenTongZhiShuChuangJianRiQi'
-                  )
-                ) {
-                  // 获取当前时间
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (documenName.includes('成本监审提取资料登记表')) {
-                if (
-                  item.pinyin.includes('DengJiBiaoShengChengRiQi') &&
-                  (item.dataValue == null || item.dataValue == '')
-                ) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (documenName.includes('成本审核初步意见表')) {
-                if (
-                  item.pinyin.includes('YiJianBiaoShengChengRiQi') &&
-                  (item.dataValue == null || item.dataValue == '')
-                ) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (documenName.includes('政府定价成本监审结论报告')) {
-                if (
-                  item.pinyin.includes('BaoGaoRiQi') &&
-                  (item.dataValue == null || item.dataValue == '')
-                ) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-                if (item.pinyin.includes('JieLunBaoGaoChuangJianRiQi')) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-                if (item.pinyin.includes('JianShenRenWuFaBuShiJian')) {
-                  let dataValue = this.resCostDocumentTemplateFiles.find(
-                    (item2) => item2.pinyin === 'JianShenRenWuFaBuShiJian'
-                  ).dataValue
-                  item.dataValue = (dataValue && dataValue.split(' ')[0]) || ''
-                }
-                if (
-                  item.pinyin.includes(
-                    'ChengBenJianShenTongZhiShuShengChengShiJian'
-                  )
-                ) {
-                  let dataValue = this.resCostDocumentTemplateFiles.find(
-                    (item2) =>
-                      item2.pinyin ===
-                      'ChengBenJianShenTongZhiShuShengChengShiJian'
-                  ).dataValue
-                  item.dataValue = (dataValue && dataValue.split(' ')[0]) || ''
-                }
-                if (item.pinyin.includes('ChengBenZiLiaoShangBaoShiJian')) {
-                  let dataValue = this.resCostDocumentTemplateFiles.find(
-                    (item2) => item2.pinyin === 'ChengBenZiLiaoShangBaoShiJian'
-                  ).dataValue
-                  item.dataValue = (dataValue && dataValue.split(' ')[0]) || ''
-                }
-              }
-              // 回显文号
-              // 获取选中的文号信息
-              const selectedDocument = this.selectDocumentWhSelection[0]
-              if (selectedDocument) {
-                if (
-                  item.pinyin.includes('WenHao') ||
-                  item.pinyin.includes('WenJianHao')
-                ) {
-                  item.dataValue = selectedDocument.whNo
-                }
-                if (item.pinyin.includes('SongDaWenShuMingCheng')) {
-                  item.dataValue = selectedDocument.whName
-                }
-              }
-            })
+            this.formatDaValue(res)
           })
         } else {
           getCostProjectDocumentFile({
@@ -864,144 +891,7 @@
             // whereValue: this.project.projectId,
             id: this.document.id,
           }).then((res) => {
-            this.costDocumentTemplateFiles =
-              JSON.parse(JSON.stringify(res.value || [])) || []
-            this.resCostDocumentTemplateFiles =
-              JSON.parse(JSON.stringify(res.value || [])) || []
-            let unit = this.allUnits.find(
-              (item) => item.unitId === this.document.enterpriseId
-            )
-            let documenName = this.getDocumentType({
-              documentId: this.document.documentId,
-            })
-            this.costDocumentTemplateFiles.forEach((item) => {
-              if (item.pinyin.includes('BeiJianShenDanWei')) {
-                item.dataValue = unit.unitName
-              }
-              if (item.pinyin.includes('ShouSongDaRen')) {
-                item.dataValue = unit.contactName
-              }
-              if (item.pinyin.includes('BeiJianShenDanWeiBanGongDiDian')) {
-                item.dataValue = unit.address
-              }
-              if (item.pinyin.includes('BeiJianShenDanWeiLianXiRenDianHua')) {
-                item.dataValue = unit.contactMobile
-              }
-              if (
-                item.originalText.includes('需要提供材料') &&
-                item.dataValue
-              ) {
-                this.dataUploadUrl = item.dataValue
-              }
-              if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
-                // 移除所有HTML标签
-                item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
-              }
-              if (
-                item.pinyin.includes('ShiJian') &&
-                (item.dataValue == null || item.dataValue == '')
-              ) {
-                // 获取当前时间,格式为YYYY-MM-DD
-                item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-              } else if (item.pinyin.includes('ShiJian') && item.dataValue) {
-                item.dataValue = item.dataValue.split(' ')[0]
-              }
-              if (
-                item.originalText.includes('需要提供材料') &&
-                item.dataValue
-              ) {
-                this.dataUploadUrl = item.dataValue
-              }
-              if (item.pinyin.includes('DiGaoNeiRong') && item.dataValue) {
-                // 移除所有HTML标签
-                item.dataValue = item.dataValue.replace(/<[^>]+>/g, '')
-              }
-              if (documenName.includes('成本监审通知书')) {
-                if (item.pinyin.includes('DanWeiMingCheng')) {
-                  item.dataValue = unit.unitName
-                }
-                if (item.pinyin.includes('FaRenDaiBiao')) {
-                  item.dataValue = unit?.corporateRepresentative || ''
-                }
-                if (
-                  item.pinyin.includes(
-                    'ChengBenJianShenTongZhiShuChuangJianRiQi'
-                  )
-                ) {
-                  // 获取当前时间
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (documenName.includes('成本监审提取资料登记表')) {
-                if (
-                  item.pinyin.includes('DengJiBiaoShengChengRiQi') &&
-                  (item.dataValue == null || item.dataValue == '')
-                ) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (documenName.includes('成本审核初步意见表')) {
-                if (
-                  item.pinyin.includes('YiJianBiaoShengChengRiQi') &&
-                  (item.dataValue == null || item.dataValue == '')
-                ) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-              }
-              if (documenName.includes('政府定价成本监审结论报告')) {
-                if (
-                  item.pinyin.includes('BaoGaoRiQi') &&
-                  (item.dataValue == null || item.dataValue == '')
-                ) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-                if (item.pinyin.includes('JieLunBaoGaoChuangJianRiQi')) {
-                  // 获取当前时间,格式为YYYY-MM-DD
-                  item.dataValue = moment(new Date()).format('YYYY-MM-DD')
-                }
-                if (item.pinyin.includes('JianShenRenWuFaBuShiJian')) {
-                  let dataValue = this.resCostDocumentTemplateFiles.find(
-                    (item2) => item2.pinyin === 'JianShenRenWuFaBuShiJian'
-                  ).dataValue
-                  item.dataValue = (dataValue && dataValue.split(' ')[0]) || ''
-                }
-                if (
-                  item.pinyin.includes(
-                    'ChengBenJianShenTongZhiShuShengChengShiJian'
-                  )
-                ) {
-                  let dataValue = this.resCostDocumentTemplateFiles.find(
-                    (item2) =>
-                      item2.pinyin ===
-                      'ChengBenJianShenTongZhiShuShengChengShiJian'
-                  ).dataValue
-                  item.dataValue = (dataValue && dataValue.split(' ')[0]) || ''
-                }
-                if (item.pinyin.includes('ChengBenZiLiaoShangBaoShiJian')) {
-                  let dataValue = this.resCostDocumentTemplateFiles.find(
-                    (item2) => item2.pinyin === 'ChengBenZiLiaoShangBaoShiJian'
-                  ).dataValue
-                  item.dataValue = (dataValue && dataValue.split(' ')[0]) || ''
-                }
-              }
-              // 回显文号
-              // 获取选中的文号信息
-              const selectedDocument = this.selectDocumentWhSelection[0]
-              if (selectedDocument) {
-                if (
-                  item.pinyin.includes('WenHao') ||
-                  item.pinyin.includes('WenJianHao')
-                ) {
-                  item.dataValue = selectedDocument.whNo
-                }
-                if (item.pinyin.includes('SongDaWenShuMingCheng')) {
-                  item.dataValue = selectedDocument.whName
-                }
-              }
-            })
+            this.formatDaValue(res)
           })
         }
       },