From 6ace58ac8d2a1122940600ceffdbe1c679a10cfb Mon Sep 17 00:00:00 2001
From: yxh <17293325@qq.com>
Date: 星期一, 20 四月 2026 09:38:35 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/opo-web
---
src/views/project/travelexpenseapply/travelexpensedetail/index.vue | 64 ++++++++++++++++++++++----------
1 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index 2f36bc2..e1be1f4 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -1256,6 +1256,7 @@
<script>
import pdf from "vue-pdf";
+import Decimal from 'decimal.js';
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listDonatebaseinfo } from "@/api/project/donatebaseinfo";
@@ -1905,13 +1906,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 +1936,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("鏈壘鍒板搴旈」鐩紝鏃犳硶鍒犻櫎");
+ }
}
},
// 鐐瑰嚮涓婄Щ
@@ -2624,16 +2649,16 @@
this.$refs["form"].validate(valid => {
if (valid) {
//绁ㄦ嵁鏂囦欢澶勭悊
- const addnumber = this.rbPayees.reduce(
+ const addnumber = new Decimal(this.rbPayees.reduce(
(amount, item) => amount + Number(item.amount),
0
- );
-
+ ));
+ console.log(this.form.amountrequested,addnumber);
//鏍¢獙璇锋閲戦鍚堣鏄惁绛変簬鎶ラ攢鍗曢噾棰�
if (this.form.amountrequested != addnumber) {
this.$message({
message:
- "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛�",
+ "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛侊紒",
type: "warning"
});
return;
@@ -2835,7 +2860,6 @@
(amount, item) => amount + Number(item.amount),
0
);
- console.log(addnumber, "addnumber");
this.$refs["form"].validate(valid => {
if (valid) {
//绁ㄦ嵁鏂囦欢澶勭悊
@@ -2843,7 +2867,7 @@
if (this.form.amountrequested != addnumber) {
this.$message({
message:
- "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛�",
+ "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛侊紒锛�",
type: "warning"
});
return;
--
Gitblit v1.9.3