From a79d67f8a9a9fa02f9d25f987b9611af965c484f Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 22 十月 2026 18:41:01 +0800
Subject: [PATCH] 修改了风格
---
src/views/project/fund/applyDetail0/index.vue | 99 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 72 insertions(+), 27 deletions(-)
diff --git a/src/views/project/fund/applyDetail0/index.vue b/src/views/project/fund/applyDetail0/index.vue
index 9671250..90a2988 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="鐢宠鏃ユ湡"
>
@@ -1227,6 +1227,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寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -1844,6 +1846,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 +2110,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 +2529,11 @@
},
// 鎺ュ彈鎻愰啋绔嬪埢淇濆瓨
Savenow() {
+ // 2026-10-15锛氫繚瀛樺墠闄勪欢鏂囦欢鍚嶈鑼冩牎楠岋紙浠呮柊澧炲崟鎹紱鑰佸崟鎹殑鍘嗗彶闄勪欢鐢卞悗绔寜"鍙牎楠屾湰娆″彉鏇�"鏀捐锛�
+ if (!this.checkDetailFileNames()) {
+ return;
+ }
+
if (!this.randomnumber) {
this.randomnumber = this.generateRandomString(9);
this.form.randomnumber = this.randomnumber;
@@ -2876,32 +2884,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 +2915,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 +3009,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;
//鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
@@ -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