From 0e10e10157b90002b99996914eaf1e5574924ddf Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期一, 12 十月 2026 11:15:50 +0800
Subject: [PATCH] 修改了报销校验

---
 src/views/project/fund/applyDetail0/index.vue |   56 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/src/views/project/fund/applyDetail0/index.vue b/src/views/project/fund/applyDetail0/index.vue
index 3299f69..b061aed 100644
--- a/src/views/project/fund/applyDetail0/index.vue
+++ b/src/views/project/fund/applyDetail0/index.vue
@@ -11,8 +11,8 @@
                 clearable
                 style="width: 100%"
                 v-model="form.createTime"
-                type="date"
-                value-format="yyyy-MM-dd HH:mm:ss"
+                type="date" format="yyyy-MM-dd"
+                value-format="yyyy-MM-dd"
                 placeholder="鐢宠鏃ユ湡"
               >
               </el-date-picker>
@@ -1227,6 +1227,7 @@
 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";
 
 export default {
   //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -2103,11 +2104,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 || "鎿嶄綔澶辫触");
         }
       });
     },
@@ -2126,7 +2123,7 @@
         this.standardlevel = res.data.standardlevel;
         if (
           this.userprofile.userName == "admin" ||
-          this.userprofile.userName == "001" ||
+          this.userprofile.userName == "053" ||
           this.userprofile.userName == "047"
         ) {
           this.ismanager = true;
@@ -2876,32 +2873,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 +2904,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();
     },
 
@@ -3279,13 +3272,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 +3287,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