From 151122a373835c93ef1418c7db0985c0660acf7e Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 28 八月 2023 18:08:58 +0800
Subject: [PATCH] 11

---
 src/views/project/travelexpenseapply/travelexpensedetail/index.vue |   51 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index c9090c5..8f943b0 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -960,10 +960,13 @@
         <div v-if="this.previewpdf" class="pdfimgmin">
           <!-- <img :src="pdfimg" /> -->
           <el-image
-            style="width: 100px; height: 100px"
+            style="width: 95%; height: 90%"
             :src="pdfimg"
             :preview-src-list="pdfimgsrcList"
           >
+            <!-- <div slot="error" class="image-slot">
+              <i class="el-icon-picture-outline"></i>
+            </div> -->
           </el-image>
         </div>
         <div v-else class="pdfimgmins">{{ hintitle }}</div>
@@ -1071,6 +1074,8 @@
       loading: true,
       // 瀵煎嚭閬僵灞�
       exportLoading: false,
+      // 缃戠粶璇锋眰澶�
+      Networkheader: null,
 
       // 褰撳墠鍗曟嵁ID
       curId: 0,
@@ -1165,6 +1170,8 @@
   },
 
   created() {
+    this.Getnetworkheader();
+
     //鑾峰彇璁板綍鍒楄〃
     // this.getList();
 
@@ -1222,7 +1229,20 @@
 
   methods: {
     handleUploadError() {},
-
+    // 鑾峰彇璇锋眰澶�
+    Getnetworkheader() {
+      console.log(window.location.href);
+      let string = window.location.href;
+      if (string.includes("9091")) {
+        const index = string.indexOf("9091");
+        this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
+        console.log(this.Networkheader);
+      } else {
+        const index = string.indexOf("8032");
+        this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
+        console.log(this.Networkheader);
+      }
+    },
     remove(file, fileList) {
       const rbDetails = [...this.rbDetails];
       this.fileListto.splice(this.fileListto.indexOf(file), 1);
@@ -1236,13 +1256,19 @@
     //鏂囦欢涓婁紶鎴愬姛鍥炶皟
     uploadSccess(response, file, fileList) {
       this.rbDetails;
-
       //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
       if (response.code == 200) {
         this.form.filename = file.raw.name;
 
         this.$modal.msgSuccess(response.msg);
-        this.fileListto.push({ name: file.name, url: response.url });
+        this.fileListto.push({
+          name: file.name,
+          url: response.fileName
+        });
+        // this.fileListto.push({
+        //   name: file.name,
+        //   url: response.url
+        // });
         this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
       } else {
         console.log(response.msg);
@@ -1252,8 +1278,14 @@
     Filepopup(index, rows, row) {
       this.atpresent = index;
       this.pdfVisible = true;
+      console.log(this.rbDetails[index]);
       if (this.rbDetails[index].annexfilesList) {
         this.fileListto = this.rbDetails[index].annexfilesList;
+        console.log(this.fileListto);
+        this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url;
+        console.log(this.pdfimg);
+        this.pdfimgsrcList = [];
+        this.pdfimgsrcList.push(this.pdfimg);
       } else {
         this.fileListto = [];
         this.pdfimg = "";
@@ -1273,11 +1305,12 @@
       } else if (name[1] == "jpg" || "png") {
         this.previewpdf = true;
         if (item.url) {
-          this.pdfimg = item.url;
-          this.pdfimgsrcList=[]
-          this.pdfimgsrcList.push(item.url);
+          this.pdfimg = this.Networkheader + "/prod-api" + item.url;
+          this.pdfimgsrcList = [];
+          this.pdfimgsrcList.push(this.pdfimg);
+          console.log(this.pdfimg);
         } else {
-          this.pdfimg = item.response.url;
+          this.pdfimg = this.Networkheader + "/prod-api" + item.response.url;
         }
       } else {
         this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
@@ -1578,6 +1611,7 @@
       this.loading = true;
       listReimbursement(this.queryParams).then(response => {
         this.reimbursementList = response.rows;
+        console.log(this.reimbursementList);
         this.total = response.total;
         this.loading = false;
       });
@@ -1717,6 +1751,7 @@
         //鑾峰彇鎶ラ攢鏄庣粏淇℃伅
         getReimbursementdetaillist(curId).then(res => {
           this.rbDetails = res.data;
+          console.log(this.rbDetails);
           if (this.rbDetails.length == 0) {
             this.addDetailRow(0);
           }

--
Gitblit v1.9.3