From 5743e533414c608a12f9323f17a7c86721c7f54c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 06 十一月 2026 00:13:43 +0800
Subject: [PATCH] organfee

---
 src/views/project/fund/applyDetail0/index.vue |  199 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 122 insertions(+), 77 deletions(-)

diff --git a/src/views/project/fund/applyDetail0/index.vue b/src/views/project/fund/applyDetail0/index.vue
index 9671250..f770dec 100644
--- a/src/views/project/fund/applyDetail0/index.vue
+++ b/src/views/project/fund/applyDetail0/index.vue
@@ -11,7 +11,7 @@
                 clearable
                 style="width: 100%"
                 v-model="form.createTime"
-                type="date"
+                type="date" format="yyyy-MM-dd"
                 value-format="yyyy-MM-dd HH:mm:ss"
                 placeholder="鐢宠鏃ユ湡"
               >
@@ -1034,8 +1034,21 @@
       :close-on-click-modal="false"
       :title="pdftitle"
       :visible.sync="pdfVisible"
+      :fullscreen="pdfFullscreen"
       width="60%"
+      custom-class="pdf-resize-dialog"
+      @closed="pdfFullscreen = false"
     >
+      <template slot="title">
+        <span>{{ pdftitle }}</span>
+        <el-button
+          class="pdf-fullscreen-btn"
+          size="mini"
+          :icon="pdfFullscreen ? 'el-icon-close' : 'el-icon-full-screen'"
+          @click="pdfFullscreen = !pdfFullscreen"
+          >{{ pdfFullscreen ? "杩樺師" : "鍏ㄥ睆" }}</el-button
+        >
+      </template>
       <div class="pdfimg">
         <div class="box-pdf">
           <div>
@@ -1125,16 +1138,7 @@
           </div> -->
         </div>
 
-        <div v-if="this.previewpdf" class="pdfimgmin">
-          <!-- <img :src="pdfimg" /> -->
-          <el-image
-            style="width: 95%; height: 90%"
-            :src="pdfimg"
-            :preview-src-list="pdfimgsrcList"
-          >
-          </el-image>
-        </div>
-        <div v-else class="pdfimgmins">{{ hintitle }}</div>
+        <attachment-preview-pane :file="embeddedFile" style="flex: 1; min-width: 0;" />
       </div>
     </el-dialog>
     <el-dialog title="鎻愮ず" :visible.sync="Savereminder" width="30%">
@@ -1227,6 +1231,8 @@
 import Li_area_select from "@/components/Address";
 import OrgSelecter from "@/views/project/components/orgselect";
 import { getToken } from "@/utils/auth";
+import { moneySum, moneyAdd, moneySub, moneyMul, moneyRound } from "@/utils/money";
+import { checkFileName, checkDetails } from "@/utils/fileNameCheck";
 
 export default {
   //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -1550,15 +1556,8 @@
     },
     // 鑾峰彇璇锋眰澶�
     Getnetworkheader() {
-      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鍙婂叾鍓嶉儴瀛楃
-      }
+      // 浠ュ綋鍓嶉〉闈� origin 涓哄噯锛屽吋瀹� 80/8032/9091 鍙婂悗缁鍙h皟鏁�
+      this.Networkheader = window.location.origin;
     },
     /** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */
     getroute() {
@@ -1844,6 +1843,11 @@
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm: debounce(function() {
+      // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+      if (!this.checkDetailFileNames()) {
+        return;
+      }
+
       if (!this.randomnumber) {
         this.randomnumber = this.generateRandomString(9);
         this.form.randomnumber = this.randomnumber;
@@ -2103,11 +2107,7 @@
           this.$store.dispatch("tagsView/delView", this.$route);
           this.$router.go(-1);
         } else {
-          if (res.msg) {
-            this.$modal.msgError("鎿嶄綔澶辫");
-          } else {
-            this.$modal.msgError(res.msg);
-          }
+          this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
         }
       });
     },
@@ -2526,6 +2526,11 @@
     },
     // 鎺ュ彈鎻愰啋绔嬪埢淇濆瓨
     Savenow() {
+      // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+      if (!this.checkDetailFileNames()) {
+        return;
+      }
+
       if (!this.randomnumber) {
         this.randomnumber = this.generateRandomString(9);
         this.form.randomnumber = this.randomnumber;
@@ -2876,32 +2881,28 @@
       }
     },
 
-    //璁$畻鎬婚噾棰�
+    //璁$畻鎬婚噾棰濓紙閲戦涓�寰嬭蛋绮剧‘杩愮畻锛�
     sumTotalFee(row) {
-      let allSum = 0;
+      const detailsArr = [];
       if (this.form.applytype != null) {
         for (let i = 0; i < this.rbDetails.length; i++) {
+          const detail = this.rbDetails[i];
           let totalFee = 0;
-          let taxFee = 0;
           if (this.form.applytype == 1 || this.form.applytype == 2) {
-            //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣
-            if (!isNaN(parseFloat(this.rbDetails[i].amount))) {
-              totalFee += parseFloat(this.rbDetails[i].amount);
-              taxFee += parseFloat(this.rbDetails[i].amount);
+            //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣锛氱◣鍓� - 鎵g◣
+            if (!isNaN(parseFloat(detail.amount))) {
+              totalFee = moneyAdd(totalFee, detail.amount);
             }
-            if (!isNaN(parseFloat(this.rbDetails[i].taxamount))) {
-              totalFee -= parseFloat(this.rbDetails[i].taxamount);
-              taxFee -= parseFloat(this.rbDetails[i].taxamount);
+            if (!isNaN(parseFloat(detail.taxamount))) {
+              totalFee = moneySub(totalFee, detail.taxamount);
             }
           } else if (this.form.applytype == 3 || this.form.applytype == 4) {
             //鍗曚环*鏁伴噺=绋庡墠閲戦
             if (
-              !isNaN(parseFloat(this.rbDetails[i].price)) &&
-              !isNaN(parseFloat(this.rbDetails[i].quantity))
+              !isNaN(parseFloat(detail.price)) &&
+              !isNaN(parseFloat(detail.quantity))
             ) {
-              totalFee +=
-                parseFloat(this.rbDetails[i].price) *
-                parseFloat(this.rbDetails[i].quantity);
+              totalFee = moneyMul(detail.price, detail.quantity);
               this.rbDetails[i].amount = totalFee;
             }
           }
@@ -2911,10 +2912,10 @@
           //   this.rbDetails[i].taxedamount = taxFee.toFixed(2);
           // }
 
-          allSum += totalFee;
+          detailsArr.push(totalFee);
         }
       }
-      // this.form.amountrequested = allSum.toFixed(2);
+      // this.form.amountrequested = moneyRound(moneySum(detailsArr)).toFixed(2);
       // this.$forceUpdate();
     },
 
@@ -3005,7 +3006,43 @@
     //     console.log(response.msg);
     //   }
     // },
+    /**
+     * 2026-10-15锛氫笂浼犳椂鏍¢獙闄勪欢鏂囦欢鍚嶏紙涓氬姟瑕佹眰锛氫笉鍚堟牸绔嬪嵆鎻愮ず涓斾笉鍔犲叆鍒楄〃锛夈��
+     * 瑙勫垯涓庡悗绔� AttachmentNameValidator 鍚屽彛寰勶細涓嶅己鍒跺惈涓枃 / 鍘绘帀鎵╁睍鍚嶅悗涓诲共 鈮�20 瀛� /
+     * 涓嶅惈绌烘牸鍙� / \ : * ? " < > | # % 绛夌壒娈婂瓧绗︺��
+     */
+    checkUploadFileName(file) {
+      const raw = file && file.raw ? file.raw.name : file && file.name;
+      const r = checkFileName(raw);
+      if (!r.ok) {
+        this.$modal.msgError(r.msg);
+        return false;
+      }
+      return true;
+    },
+
+    /**
+     * 2026-10-15锛氫繚瀛樺墠鏍¢獙鏁村崟鏄庣粏闄勪欢鏂囦欢鍚嶏紙鍚悓涓�琛屽唴閲嶅悕锛夈��
+     * 鍙e緞锛堜笟鍔$‘璁わ級锛氬彧鏍¢獙"鏈鍙樻洿"鐨勯檮浠垛�斺�旇�佸崟鎹噷宸插瓨鍦ㄧ殑涓嶅悎瑙勯檮浠跺悕涓嶈兘鎶婁繚瀛樺崱姝�
+     * 锛堝惁鍒欒�佸崟鎹敼涓�涓噾棰濋兘瀛樹笉杩涘幓锛夈�傚悗绔寜 id 璇绘棫璁板綍鏀捐鍘嗗彶闄勪欢锛涘墠绔嬁涓嶅埌"鍝簺鏄巻鍙�"
+     * 鐨勬潈濞佷俊鎭紝鍥犳**浠呮柊澧炲崟鎹�**鍋氫繚瀛樺墠鎷︽埅锛岀紪杈戣�佸崟鎹椂鏂板鐨勪笉鍚堣闄勪欢鐢卞悗绔簩娆℃牎楠屾嫤涓嬨��
+     */
+    checkDetailFileNames() {
+      if (this.form && this.form.id) {
+        return true;
+      }
+      const c = checkDetails(this.rbDetails);
+      if (!c.ok) {
+        this.$modal.msgError(c.msg);
+        return false;
+      }
+      return true;
+    },
+
     uploadSccess(response, file, fileList) {
+      if (!this.checkUploadFileName(file)) {
+        return;
+      }
       this.rbDetails;
 
       //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
@@ -3016,9 +3053,15 @@
         this.fileListto.push({ name: file.name, url: response.fileName });
         // this.fileListto.push({ name: file.name, url: response.url });
         this.pdfimgsrcList.push(
-          this.Networkheader + "/prod-api" + response.fileName
+          this.Networkheader + process.env.VUE_APP_BASE_API + response.fileName
         );
-        this.pdfimg = this.Networkheader + "/prod-api" + response.fileName;
+        this.pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + response.fileName;
+        const localUrl = URL.createObjectURL(file.raw);
+        this.embeddedFile = {
+          name: file.name,
+          url: localUrl,
+          type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
+        };
 
         this.rbDetails[this.atpresent].annexfilesList = this.fileListto;
       } else {
@@ -3033,11 +3076,11 @@
       if (this.rbDetails[index].annexfilesList) {
         this.previewpdf = true;
         this.fileListto = this.rbDetails[index].annexfilesList;
-        this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url;
+        this.pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + this.fileListto[0].url;
         // this.pdfimg = this.fileListto[0].url;
         this.pdfimgsrcList = [];
         this.fileListto.forEach(item => {
-          this.pdfimgsrcList.push(this.Networkheader + "/prod-api" + item.url);
+          this.pdfimgsrcList.push(this.Networkheader + process.env.VUE_APP_BASE_API + item.url);
         });
         console.log(this.pdfimgsrcList);
         console.log(this.pdfimg);
@@ -3048,34 +3091,31 @@
       }
     },
 
-    // 鐐瑰嚮宸蹭笂浼犳枃浠�
+    // 鐐瑰嚮宸蹭笂浼犳枃浠讹細鍦ㄩ檮浠跺脊绐楀彸渚у唴宓岄瑙�
     downFile(item) {
-      console.log(item);
-      this.pdftitle = item.name;
-      let name = item.name.split(".");
-      if (name[1] == "pdf") {
-        this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-        this.previewpdf = false;
-        this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-      } else if (name[1] == "jpg" || "png") {
-        this.previewpdf = true;
-        if (item.url) {
-          this.pdfimg = this.Networkheader + "/prod-api" + item.url;
-
-          // if (!this.pdfimgsrcList.includes(this.pdfimg)) {
-          //   this.pdfimgsrcList.push(this.pdfimg);
-          //   console.log("鍔犲叆");
-          // }
-          console.log(this.pdfimg);
-          console.log(this.pdfimgsrcList, "imglist");
-        } else {
-          this.pdfimg = this.Networkheader + "/prod-api" + item.url;
-        }
-      } else {
-        this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-        this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-        this.previewpdf = false;
+      if (this.operationType == "detail") {
+        const list = (this.fileListto || []).map(f => ({
+          name: f.name,
+          url: f.url
+        }));
+        const index = list.findIndex(f => f.url === item.url);
+        this.$previewFile(list, index > -1 ? index : 0);
+        return;
       }
+      const ext = String(item.name || "").toLowerCase().split(".").pop();
+      const isImage = ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(ext);
+      if (ext !== "pdf" && !isImage) {
+        this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
+        this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
+        return;
+      }
+      this.embeddedFile = {
+        name: item.name,
+        url: item.url,
+        type: ext === "pdf" ? "pdf" : "image"
+      };
+      this.pdftitle = item.name;
+      this.pdfVisible = true;
     },
     getIndexInArray(arr, obj) {
       return arr.indexOf(obj);
@@ -3086,7 +3126,7 @@
       console.log(row);
       const indexlist = this.getIndexInArray(
         this.pdfimgsrcList,
-        this.Networkheader + "/prod-api" + row.url
+        this.Networkheader + process.env.VUE_APP_BASE_API + row.url
       );
       console.log(indexlist);
       this.pdfimgsrcList.splice(indexlist, 1);
@@ -3279,13 +3319,13 @@
 
   //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
   mounted() {
-    window.addEventListener("beforeunload", e => this.beforeunloadHandler(e));
+    // 瀛樹綇鍚屼竴涓紩鐢紝鍚﹀垯 removeEventListener 浼犳柊绠ご鍑芥暟鏃犳硶鐪熸绉婚櫎锛屼細娉勬紡鐩戝惉鍣�
+    this._beforeUnloadHandler = e => this.beforeunloadHandler(e);
+    window.addEventListener("beforeunload", this._beforeUnloadHandler);
     this.getUserList();
     this.getUserProfile();
     let apifunddetailForm = this.funddetailForm;
     let apiform = this.form;
-    console.log(apiform);
-    console.log(apifunddetailForm);
 
     // this.getFeeUnitList();
   },
@@ -3294,7 +3334,12 @@
   beforeMount() {}, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠
   beforeUpdate() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠
   updated() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
-  beforeDestroy() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
+  beforeDestroy() {
+    if (this._beforeUnloadHandler) {
+      window.removeEventListener("beforeunload", this._beforeUnloadHandler);
+      this._beforeUnloadHandler = null;
+    }
+  }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
   destroyed() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
   activated() {} //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
 };

--
Gitblit v1.9.3