Bladeren bron

fix: 修改bug

shiyanyu 1 maand geleden
bovenliggende
commit
b88eec8657

+ 2 - 2
src/views/EntDeclaration/auditTaskManagement/components/CostSurveyTab.vue

@@ -154,14 +154,14 @@
             >
               在线填报
             </el-button>
-            <el-button
+            <!-- <el-button
               type="text"
               size="small"
               :disabled="isViewMode"
               @click="$emit('handle-modify', scope.row)"
             >
               修改
-            </el-button>
+            </el-button> -->
             <el-button
               type="text"
               size="small"

+ 31 - 1
src/views/EntDeclaration/auditTaskManagement/components/DataRequirementsTab.vue

@@ -114,7 +114,7 @@
                 v-if="scope.row.isUpload === 1 || scope.row.isUpload === '1'"
                 type="text"
                 size="small"
-                @click="$emit('handleFileView', scope.row)"
+                @click="handleFileView(scope.row)"
               >
                 查看
               </el-button>
@@ -226,6 +226,36 @@
     },
 
     methods: {
+      // 预览:与 UploadComponent.vue 的 handlePreview 一致
+      handleFileView(row) {
+        console.log(row, '这一行数据')
+        try {
+          const filePath =
+            row?.filePath ||
+            row?.filepath ||
+            row?.fileUrl ||
+            row?.url ||
+            row?.path ||
+            ''
+          if (!filePath) {
+            this.$message &&
+              this.$message.warning &&
+              this.$message.warning('未找到可预览的文件路径')
+            return
+          }
+          const encodedUrl = encodeURIComponent(
+            Base64.encode((window.context && window.context.form) + filePath)
+          )
+          window.open(`${host}:8012/onlinePreview?url=${encodedUrl}`)
+          // 兼容保留:通知父组件
+          this.$emit('handleFileView', row)
+        } catch (e) {
+          console.error('文件预览失败: ', e)
+          this.$message &&
+            this.$message.error &&
+            this.$message.error('文件预览失败')
+        }
+      },
       // 根据资料类型返回上传accept白名单
       getUploadAccept(row) {
         const fmt = row && row.formatRequired

+ 2 - 1
src/views/EntDeclaration/auditTaskManagement/taskFillIn.vue

@@ -1213,10 +1213,11 @@
         this.tabLoading.costSurvey = true
         const params = {
           taskId: this.taskId || (this.taskInfo && this.taskInfo.taskId) || '',
+          catalogId: this.taskInfo.catalogId,
           pageNum: this.costSurveyPagination.currentPage,
           pageSize: this.costSurveyPagination.pageSize,
         }
-        if (this.auditedUnitId) params.auditedUnitId = this.auditedUnitId
+        // if (this.auditedUnitId) params.auditedUnitId = this.auditedUnitId
         getSurveyList(params)
           .then((res) => {
             console.log('成本调查表列表', res)

+ 16 - 16
src/views/costAudit/projectInfo/auditTaskManage/taskProgressManage/detailTabs.vue

@@ -288,22 +288,22 @@
         this.$emit('detailClose')
       },
       // 标签切换:切到成本调查表时加载列表
-      handleTabClick(tab) {
-        if (
-          (tab && tab.name === 'survey') ||
-          (!tab && this.activeTab === 'survey')
-        ) {
-          this.$nextTick(() => {
-            if (
-              this.$refs &&
-              this.$refs.costSurveyRef &&
-              this.$refs.costSurveyRef.loadList
-            ) {
-              this.$refs.costSurveyRef.loadList()
-            }
-          })
-        }
-      },
+      // handleTabClick(tab) {
+      //   if (
+      //     (tab && tab.name === 'survey') ||
+      //     (!tab && this.activeTab === 'survey')
+      //   ) {
+      //     this.$nextTick(() => {
+      //       if (
+      //         this.$refs &&
+      //         this.$refs.costSurveyRef &&
+      //         this.$refs.costSurveyRef.loadList
+      //       ) {
+      //         this.$refs.costSurveyRef.loadList()
+      //       }
+      //     })
+      //   }
+      // },
     },
   }
 </script>