From ab04ec484fb2907cb75608280dcd4d12aa48d073 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期六, 28 六月 2025 14:15:27 +0800
Subject: [PATCH] 详情文件下载

---
 laboratory/src/views/reportLibrary/feasibilityStudy/components/approval/index.vue |   86 +++++++++++++------------------------------
 1 files changed, 26 insertions(+), 60 deletions(-)

diff --git a/laboratory/src/views/reportLibrary/feasibilityStudy/components/approval/index.vue b/laboratory/src/views/reportLibrary/feasibilityStudy/components/approval/index.vue
index 4da308f..e94aed6 100644
--- a/laboratory/src/views/reportLibrary/feasibilityStudy/components/approval/index.vue
+++ b/laboratory/src/views/reportLibrary/feasibilityStudy/components/approval/index.vue
@@ -1,17 +1,7 @@
 <template>
-  <el-dialog
-    :title="dialogTitle"
-    :visible.sync="visible"
-    width="80%"
-    @open="open"
-    po
-    :close-on-click-modal="false"
-    @close="handleClose"
-  >
-    <div
-      class="approval-dialog"
-      :style="{ height: obj.isDetail ? '50vh' : '40vh' }"
-    >
+  <el-dialog :title="dialogTitle" :visible.sync="visible" width="80%" @open="open" po :close-on-click-modal="false"
+    @close="handleClose">
+    <div class="approval-dialog" :style="{ height: obj.isDetail ? '50vh' : '40vh' }">
       <!-- 左侧审批内容 -->
       <div class="approval-content">
         <Card class="approval-content-card">
@@ -31,14 +21,7 @@
               </template>
             </Table>
 
-            <el-form
-              ref="form"
-              :model="form"
-              :rules="rules"
-              inline
-              label-position="top"
-              style="margin-top: 38px"
-            >
+            <el-form ref="form" :model="form" :rules="rules" inline label-position="top" style="margin-top: 38px">
               <div class="header-title" style="width: 100%">
                 <div class="header-title-left">
                   <img src="@/assets/public/headercard.png" />
@@ -46,12 +29,7 @@
                 </div>
               </div>
               <el-form-item prop="reportCode" style="margin-top: 38px">
-                <el-input
-                  disabled
-                  v-model="form.reportCode"
-                  style="width: 100%"
-                  placeholder="请输入报告编号"
-                />
+                <el-input disabled v-model="form.reportCode" style="width: 100%" placeholder="请输入报告编号" />
               </el-form-item>
 
               <div class="header-title" style="width: 100%">
@@ -61,12 +39,7 @@
                 </div>
               </div>
               <el-form-item prop="reportName" style="margin-top: 38px">
-                <el-input
-                  disabled
-                  v-model="form.reportName"
-                  style="width: 100%"
-                  placeholder="请输入报告名称"
-                />
+                <el-input disabled v-model="form.reportName" style="width: 100%" placeholder="请输入报告名称" />
               </el-form-item>
 
               <div class="header-title" style="width: 100%">
@@ -76,12 +49,7 @@
                 </div>
               </div>
               <el-form-item prop="reportText" style="margin-top: 38px">
-                <ai-editor
-                  :readOnly="true"
-                  :value="form.reportText"
-                  style="width: 100%"
-                  placeholder="请输入报告正文"
-                />
+                <ai-editor :readOnly="true" :value="form.reportText" style="width: 100%" placeholder="请输入报告正文" />
               </el-form-item>
               <div class="header-title" style="width: 100%">
                 <div class="header-title-left">
@@ -90,7 +58,7 @@
                 </div>
               </div>
               <el-form-item prop="name" style="margin-top: -18px">
-                <el-upload action="#" :file-list="fileList" disabled>
+                <el-upload action="#" :on-preview="handlePreview" :file-list="fileList" disabled>
                 </el-upload>
               </el-form-item>
             </el-form>
@@ -111,18 +79,10 @@
           <div class="status">
             <div class="status-title">审批结果</div>
             <div class="status-content">
-              <div
-                class="resolve"
-                :class="status == '2' && 'activeStatus'"
-                @click.stop="status = 2"
-              >
+              <div class="resolve" :class="status == '2' && 'activeStatus'" @click.stop="status = 2">
                 通过
               </div>
-              <div
-                class="reject"
-                :class="status == '4' && 'activeStatus'"
-                @click.stop="status = 4"
-              >
+              <div class="reject" :class="status == '4' && 'activeStatus'" @click.stop="status = 4">
                 驳回
               </div>
             </div>
@@ -131,11 +91,7 @@
         <el-col :span="12">
           <div class="remark">
             <div class="remark-title">审批意见</div>
-            <el-input
-              type="textarea"
-              v-model="remark"
-              placeholder="请输入审批意见"
-            />
+            <el-input type="textarea" v-model="remark" placeholder="请输入审批意见" />
           </div>
         </el-col>
       </el-row>
@@ -144,9 +100,7 @@
       <el-button @click="handleClose">{{
         obj.isDetail ? "关闭" : "取 消"
       }}</el-button>
-      <el-button type="primary" @click="handleApprove" v-if="!obj.isDetail"
-        >确认</el-button
-      >
+      <el-button type="primary" @click="handleApprove" v-if="!obj.isDetail">确认</el-button>
     </div>
   </el-dialog>
 </template>
@@ -156,6 +110,7 @@
 import AiEditor from "@/components/AiEditor";
 import { getDetail } from "../../service";
 import { customUploadRequest, getFullUrl } from "@/utils/utils";
+import apiConfig from '@/utils/baseurl';
 
 export default {
   name: "ApprovalDialog",
@@ -174,7 +129,7 @@
     },
     obj: {
       type: Object,
-      default: () => {},
+      default: () => { },
     },
   },
   data() {
@@ -211,6 +166,17 @@
   },
   methods: {
     getFullUrl,
+    handlePreview(file) {
+      console.log('url', file)
+      if (file && file.url) {
+        if (file.url && file.url.startsWith(apiConfig.showImgUrl)) {
+          window.open(file.url, '_blank');
+        } else {
+          let newUrl = apiConfig.showImgUrl + file.url;
+          window.open(newUrl, '_blank');
+        }
+      }
+    },
     open() {
       if (!this.obj.id) {
         this.$message.error("缺少必要参数");
@@ -237,7 +203,7 @@
                   uid: file.id,
                 };
               });
-            this.form.feasibilityReportFiles =data.feasibilityReportFiles;
+            this.form.feasibilityReportFiles = data.feasibilityReportFiles;
           } else {
             this.fileList = [];
             this.form.feasibilityReportFiles = [];

--
Gitblit v1.7.1