From f409f83de7f803178715f128f275d77741c3072d Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 08 六月 2026 09:11:49 +0800
Subject: [PATCH] 省人民维护申请表增加案例状态

---
 src/views/project/travelexpenseapply/travelexpensedetail/index.vue |   98 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 73 insertions(+), 25 deletions(-)

diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index 2f36bc2..7f5b2a6 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -30,7 +30,6 @@
               >
                 <el-option
                   v-for="item in personsList"
-                  :key="item.reportNo"
                   :label="item.reportName"
                   :value="item.reportName"
                 >
@@ -65,7 +64,6 @@
               >
                 <el-option
                   v-for="dict in dict.type.sys_travelexpensebelong"
-                  :key="dict.value"
                   :label="dict.label"
                   :value="dict.value"
                 ></el-option>
@@ -81,6 +79,7 @@
               <el-select
                 v-model="form.infoid"
                 @change="selectbaseinfo"
+                @clear="clearDonatorInfo"
                 clearable
                 filterable
                 placeholder="璇烽�夋嫨鎹愮尞鑰�"
@@ -94,6 +93,14 @@
                 </el-option>
               </el-select>
             </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <div style="margin-left: 10px;">
+              <dict-tag
+                :options="dict.type.sys_DonationStatus"
+                :value="form.invoicecount"
+              />
+            </div>
           </el-col>
         </el-row>
         <el-row style="margin-top: 10px">
@@ -145,7 +152,7 @@
             <el-form-item label="鍑哄樊浜�" prop="travelers">
               <el-select v-model="form.travelers" clearable filterable allow-create ref="getReportname"
                 default-first-option placeholder="璇烽�夋嫨" @change="getAccountinfo()">
-                <el-option v-for="item in travelers" :key="item.reportNo" :label="item.reportName"
+                <el-option v-for="item in travelers"  :label="item.reportName"
                   :value="item.reportName">
                 </el-option>
               </el-select>
@@ -329,8 +336,8 @@
                   @focus1="getPersons(scope.row)"
                 >
                   <el-option
-                    v-for="item in personsSel"
-                    :key="item.reportNo"
+                    v-for="(item, index) in personsSel"
+                    :key="`${item.reportNo}_${index}`"
                     :label="item.reportName"
                     :value="item.reportName"
                   >
@@ -779,8 +786,8 @@
                   @change="getAccountinfo2(scope.row, scope.row.persontype)"
                 >
                   <el-option
-                    v-for="item in personsSel"
-                    :key="item.reportNo"
+                    v-for="(item, index) in personsSel"
+                    :key="`${item.reportNo}_${index}`"
                     :label="item.reportName"
                     :value="item.reportName"
                   >
@@ -1312,7 +1319,8 @@
     "sys_recordstatus",
     "sys_travelexpensebelong",
     "sys_traffictype",
-    "sys_area_name"
+    "sys_area_name",
+    "sys_DonationStatus"
   ],
   data() {
     return {
@@ -1905,13 +1913,27 @@
         const index = this.getIndexInArray(this.fileListto, row);
         this.fileListto.splice(index, 1);
         console.log(this.rbDetails[this.atpresent].annexfilesList);
-        indexvalue = this.rbDetails[this.atpresent].annexfilesList.find(
-          (item, index) => {
-            return item.name == row.name;
-          }
-        );
-        console.log(indexvalue, "鍒犻櫎绱㈠紩");
-        this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
+        // indexvalue = this.rbDetails[this.atpresent].annexfilesList.find(
+        //   (item, index) => {
+        //     return item.name == row.name;
+        //   }
+        // );
+        // console.log(indexvalue, "鍒犻櫎绱㈠紩");
+        // this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
+        const targetIndex = this.rbDetails[
+          this.atpresent
+        ].annexfilesList.findIndex(item => {
+          return item.name === row.name; // 寤鸿浣跨敤涓ユ牸鐩哥瓑 ===
+        });
+        console.log(targetIndex, "鍒犻櫎绱㈠紩"); // 鐜板湪鎵撳嵃鐨勬槸绱㈠紩鍙凤紝渚嬪 0, 1, 2...
+
+        if (targetIndex > -1) {
+          // 纭繚鎵惧埌浜嗗厓绱�
+          this.rbDetails[this.atpresent].annexfilesList.splice(targetIndex, 1);
+          console.log("鍒犻櫎鎴愬姛");
+        } else {
+          console.log("鏈壘鍒板搴旈」鐩紝鏃犳硶鍒犻櫎");
+        }
       } else {
         const indexlist = this.getIndexInArray(
           this.invoicepdfimgsrcList,
@@ -1921,13 +1943,23 @@
         const index = this.getIndexInArray(this.invoicefileListto, row);
         this.invoicefileListto.splice(index, 1);
         console.log(this.rbDetails[this.atpresent].invoicefilesList);
-        indexvalue = this.rbDetails[this.atpresent].invoicefilesList.find(
-          (item, index) => {
-            return item.name == row.name;
-          }
-        );
-        console.log(indexvalue, "鍒犻櫎绱㈠紩");
-        this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1);
+        const targetIndex = this.rbDetails[
+          this.atpresent
+        ].invoicefilesList.findIndex(item => {
+          return item.name === row.name; // 寤鸿浣跨敤涓ユ牸鐩哥瓑 ===
+        });
+        console.log(targetIndex, "鍒犻櫎绱㈠紩"); // 鐜板湪鎵撳嵃鐨勬槸绱㈠紩鍙凤紝渚嬪 0, 1, 2...
+
+        if (targetIndex > -1) {
+          // 纭繚鎵惧埌浜嗗厓绱�
+          this.rbDetails[this.atpresent].invoicefilesList.splice(
+            targetIndex,
+            1
+          );
+          console.log("鍒犻櫎鎴愬姛");
+        } else {
+          console.log("鏈壘鍒板搴旈」鐩紝鏃犳硶鍒犻櫎");
+        }
       }
     },
     // 鐐瑰嚮涓婄Щ
@@ -2219,10 +2251,22 @@
         if (item.id == this.form.infoid) {
           this.form.donorno = item.donorno;
           this.form.donorname = item.name;
+
+          // 鏂板锛氬皢鎹愮尞鑰呯殑 recordstate 璧嬪�煎埌 invoicecount
+          if (item.recordstate !== undefined && item.recordstate !== null) {
+            this.form.invoicecount = item.recordstate.toString();
+          } else {
+            this.form.invoicecount = ""; // 濡傛灉 recordstate 涓虹┖锛屾竻绌哄瓧娈�
+          }
         }
       });
     },
-
+    // 娣诲姞娓呴櫎鏂规硶
+    clearDonatorInfo() {
+      this.form.donorno = "";
+      this.form.donorname = "";
+      this.form.invoicecount = ""; // 娓呯┖ invoicecount
+    },
     onpick(e) {
       // console.log(e,this.value1)
     },
@@ -2629,8 +2673,12 @@
             0
           );
 
-          //鏍¢獙璇锋閲戦鍚堣鏄惁绛変簬鎶ラ攢鍗曢噾棰�
-          if (this.form.amountrequested != addnumber) {
+          // 淇濈暀2浣嶅皬鏁板悗杩涜姣旇緝
+          const requestedAmount = Number(this.form.amountrequested);
+          const calculatedAmount = Number(addnumber);
+
+          // 浣跨敤toFixed淇濈暀2浣嶅皬鏁�
+          if (requestedAmount.toFixed(2) !== calculatedAmount.toFixed(2)) {
             this.$message({
               message:
                 "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛�",

--
Gitblit v1.9.3