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/officeExpenseApply/index.vue |   83 +++++++++++++++++++++++++----------------
 1 files changed, 50 insertions(+), 33 deletions(-)

diff --git a/src/views/project/fund/officeExpenseApply/index.vue b/src/views/project/fund/officeExpenseApply/index.vue
index 18c2188..a72772a 100644
--- a/src/views/project/fund/officeExpenseApply/index.vue
+++ b/src/views/project/fund/officeExpenseApply/index.vue
@@ -87,8 +87,11 @@
       <!-- v-hasPermi="['project:medicalfund:export']" -->
       <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
     </el-row>
-    <el-table v-loading="loading" border :data="donateconsolationfundList"
-    :row-class-name="rowClassName"
+    <el-table
+      v-loading="loading"
+      border
+      :data="donateconsolationfundList"
+      :row-class-name="rowClassName"
     >
       <el-table-column
         label="鐢宠鏃ユ湡"
@@ -138,7 +141,7 @@
         </template>
       </el-table-column>
       <el-table-column
-        label="鐢宠鏉愭枡鐘舵��"
+        label="鏉愭枡棰勫鐘舵��"
         width="140"
         align="center"
         prop="checkstatus"
@@ -177,7 +180,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['project:medicalfund:edit']"
             >淇敼</el-button
           >
           <el-button
@@ -191,17 +193,16 @@
             v-if="scope.row.recordstatus == -1 || scope.row.recordstatus == 1"
             size="mini"
             type="text"
-            icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['project:medicalfund:delete']"
-            >鍒犻櫎</el-button
+            ><span class="button-delete"
+              ><i class="el-icon-delete"></i>鍒犻櫎</span
+            ></el-button
           >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-download"
             @click="mixExport(scope.row.id)"
-            v-hasPermi="['project:medicalfund:download']"
             >涓嬭浇</el-button
           >
         </template>
@@ -224,8 +225,8 @@
                 clearable
                 style="width: 100%"
                 v-model="form.applyTime"
-                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>
@@ -682,7 +683,9 @@
                   type="text"
                   size="small"
                 >
-                  鍒犻櫎
+                  <span class="button-delete"
+                    ><i class="el-icon-delete"></i>鍒犻櫎</span
+                  >
                 </el-button>
                 <el-button
                   @click.native.prevent="
@@ -1165,8 +1168,20 @@
         .then(() => {
           //鏌ユ壘鏄惁瀛樺湪鐧昏瀹屾垚璁板綍
           //鍒ゆ柇鏄惁瀛樺湪涓婃姤璁板綍
-          row.recordstatus = 0;var currenttime = new Date();
-          row.applyTime = currenttime.getFullYear() + "-" + (currenttime.getMonth()+1) + "-" + currenttime.getDate() + " " + currenttime.getHours() + ":" + currenttime.getMinutes() + ":" + currenttime.getSeconds();
+          row.recordstatus = 0;
+          var currenttime = new Date();
+          row.applyTime =
+            currenttime.getFullYear() +
+            "-" +
+            (currenttime.getMonth() + 1) +
+            "-" +
+            currenttime.getDate() +
+            " " +
+            currenttime.getHours() +
+            ":" +
+            currenttime.getMinutes() +
+            ":" +
+            currenttime.getSeconds();
           updateFund(row).then(response => {
             if (response.code == 200) {
               this.$message({
@@ -1694,41 +1709,40 @@
         });
     },
 
-    //璁$畻鎬婚噾棰�
+    //璁$畻鎬婚噾棰濓紙閲戦涓�寰嬭蛋绮剧‘杩愮畻锛岀姝� parseFloat 绱姞锛�
     sumTotalFee(row) {
-      let allSum = 0;
+      const detailsArr = [];
       if (this.form.applytype != null) {
         for (let i = 0; i < this.fundDetails.length; i++) {
+          const detail = this.fundDetails[i];
           let totalFee = 0;
           let taxFee = 0;
           if (this.form.applytype == 1 || this.form.applytype == 2) {
-            //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣
-            if (!isNaN(parseFloat(this.fundDetails[i].amount))) {
-              totalFee += parseFloat(this.fundDetails[i].amount);
-              taxFee += parseFloat(this.fundDetails[i].amount);
+            //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣锛氱◣鍓� - 鎵g◣
+            if (!isNaN(parseFloat(detail.amount))) {
+              totalFee = moneyAdd(totalFee, detail.amount);
+              taxFee = moneyAdd(taxFee, detail.amount);
             }
-            if (!isNaN(parseFloat(this.fundDetails[i].taxamount))) {
-              totalFee -= parseFloat(this.fundDetails[i].taxamount);
-              taxFee -= parseFloat(this.fundDetails[i].taxamount);
+            if (!isNaN(parseFloat(detail.taxamount))) {
+              totalFee = moneySub(totalFee, detail.taxamount);
+              taxFee = moneySub(taxFee, detail.taxamount);
             }
           } else if (this.form.applytype == 3) {
             if (
-              !isNaN(parseFloat(this.fundDetails[i].price)) &&
-              !isNaN(parseFloat(this.fundDetails[i].quantity))
+              !isNaN(parseFloat(detail.price)) &&
+              !isNaN(parseFloat(detail.quantity))
             ) {
-              totalFee +=
-                parseFloat(this.fundDetails[i].price) *
-                parseFloat(this.fundDetails[i].quantity);
+              totalFee = moneyMul(detail.price, detail.quantity);
             }
           }
           if (!isNaN(parseFloat(taxFee))) {
-            this.fundDetails[i].taxedamount = taxFee.toFixed(2);
+            this.fundDetails[i].taxedamount = moneyRound(taxFee).toFixed(2);
           }
-          allSum += totalFee;
+          detailsArr.push(totalFee);
         }
       }
       //this.form.amountrequested = allSum.toFixed(2);
-      this.$set(this.form, "amountrequested", allSum.toFixed(2));
+      this.$set(this.form, "amountrequested", moneyRound(moneySum(detailsArr)).toFixed(2));
       //this.$forceUpdate();
     },
 
@@ -1842,7 +1856,7 @@
             console.log(url);
             const link = document.createElement("a");
             link.href = url;
-            const name=fileUrl["downloadName"]
+            const name = fileUrl["downloadName"];
             link.setAttribute("download", name); // 鏇挎崲file.pdf涓哄疄闄呯殑鏂囦欢鍚�
             document.body.appendChild(link);
             link.click();
@@ -1930,7 +1944,7 @@
     },
     rowClassName({ row, column, rowIndex, columnIndex }) {
       //姝ゅ垽鏂负鏈�鍚庝笁琛�
-      if (row.recordstatus == -1 && row.backflowlevel != 0) {
+      if (row.recordstatus == -1 && row.backflowlevel != null) {
         return "error-row";
       }
     }
@@ -1975,7 +1989,10 @@
 </script>
 <style scoped>
 /* @import url(); 寮曞叆鍏叡css绫� */
+.button-delete {
+  color: rgb(236, 69, 69);
+}
 ::v-deep.el-table .error-row {
-  background: #FCEBEB;
+  background: #fcebeb;
 }
 </style>

--
Gitblit v1.9.3