From c870390bfc28b314f30240352895c5d6c466c148 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 20 九月 2026 13:46:23 +0800
Subject: [PATCH] AI修复
---
src/views/project/fund/applyDetail/index.vue | 150 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 119 insertions(+), 31 deletions(-)
diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index df6f172..8f7e001 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -69,6 +69,14 @@
<el-input :disabled="true" v-model="form.donorname" placeholder="璇疯緭鍏ユ崘鐚�呭鍚�" />
</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-col :span="10">
<el-form-item label="鐢宠璇存槑" prop="remark">
<el-input v-model="form.remark" placeholder="鐢宠璇存槑" />
@@ -727,7 +735,8 @@
getdownloadBX,
addorupdateFund,
ManualCalculation,
- getdetailsByItemId
+ getdetailsByItemId,
+ listbypower
} from "@/api/project/fund";
import {
@@ -777,6 +786,7 @@
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import { getToken } from "@/utils/auth";
+import { moneySum, moneyMul, moneySub, moneyRound } from "@/utils/money";
import CustomImageViewer from "@/components/CustomImageViewer"; // 鏍规嵁浣犵殑璺緞璋冩暣
export default {
@@ -800,11 +810,12 @@
//"sys_finsubject",
//"sys_financeitemtype",
//"sys_expensetype",
+ 'sys_DonationStatus',
"sys_recordstatus",
"sys_professionaltitle"
],
- data() {
+ data() {
// 鑷畾涔夎韩浠借瘉鍙锋牎楠屽櫒
const validateIdCard = (rule, value, callback) => {
// 1. 濡傛灉涓虹┖锛屼氦缁� required 瑙勫垯鍘诲鐞嗭紝杩欓噷鐩存帴鏀捐
@@ -1020,6 +1031,8 @@
flowconclusion: null,
fundid: null
},
+ // 杩炵画瀹℃壒锛氬緟瀹℃壒鍗曟嵁鍒楄〃
+ pendingList: [],
// 鏌ヨ鍙傛暟
queryParams: {
@@ -1268,9 +1281,12 @@
this.businessType == "2" ||
this.businessType == "3"
) {
+ console.log(this.curCase,'this.curCase');
+
this.form.infoid = this.curCase.id;
this.form.donorname = this.curCase.name;
this.form.donorno = this.curCase.donorno;
+ this.form.invoicecount = this.curCase.recordstate;
}
//鍒濆鍖栨槑缁�
@@ -1373,6 +1389,14 @@
handleCheck() {
this.isopen = 0;
this.reset();
+ // 閲嶇疆瀹℃壒淇℃伅锛岄伩鍏嶄笂涓�鍗曠殑瀹℃壒缁撴灉甯﹀叆涓嬩竴鍗�
+ this.checkObj = {
+ flowlevelone: null,
+ flowconclusion: null,
+ fundid: null
+ };
+ // 杩炵画瀹℃壒锛氬姞杞藉綋鍓嶄笟鍔$被鍨嬩笅鐨勫緟瀹℃壒鍒楄〃
+ this.getPendingList();
getFund(this.curId).then(response => {
this.form = response.data;
@@ -1584,7 +1608,7 @@
let tempDetail = this.rbDetails[j];
if (
isNaN(parseFloat(tempDetail.amount)) ||
- parseFloat(tempDetail.amount) == 0
+ moneyRound(tempDetail.amount) == 0
) {
this.$modal.msgWarning(
"鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
@@ -1599,7 +1623,7 @@
let tempDetail = this.rbDetails[j];
if (
isNaN(parseFloat(tempDetail.amount)) ||
- parseFloat(tempDetail.amount) == 0
+ moneyRound(tempDetail.amount) == 0
) {
this.$modal.msgWarning(
"鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
@@ -1610,7 +1634,7 @@
}
if (
isNaN(parseFloat(tempDetail.taxamount)) ||
- parseFloat(tempDetail.taxamount) == 0
+ moneyRound(tempDetail.taxamount) == 0
) {
tempDetail.taxedamount = parseFloat(tempDetail.amount);
} else {
@@ -1748,6 +1772,66 @@
this.Savenow();
console.log("淇濆瓨骞跺鎵�");
+ },
+
+ // 杩炵画瀹℃壒锛氳幏鍙栧綋鍓嶄笟鍔$被鍨嬩笅鐨勫緟瀹℃壒鍒楄〃
+ getPendingList() {
+ return listbypower({
+ pageNum: 1,
+ pageSize: 1000,
+ CHECKFLAG: 1,
+ APPLYTYPE: this.businessType
+ })
+ .then(res => {
+ this.pendingList = res.rows || [];
+ })
+ .catch(() => {
+ this.pendingList = [];
+ });
+ },
+
+ // 杩炵画瀹℃壒锛氬鎵瑰畬鎴愬悗璇㈤棶鏄惁缁х画瀹℃壒涓嬩竴鍗�
+ continueOrExit() {
+ // 閲嶆柊鎷夊彇寰呭鎵瑰垪琛紙褰撳墠鍗曟嵁宸插鎵瑰畬鎴愯绉诲嚭鍒楄〃锛�
+ this.getPendingList().then(() => {
+ const list = this.pendingList || [];
+ const next = list[0] || null;
+ if (next) {
+ this.$confirm("瀹℃壒宸插畬鎴愶紝鏄惁缁х画瀹℃壒涓嬩竴寮犲緟瀹℃壒鍗曟嵁锛�", "鎻愮ず", {
+ confirmButtonText: "缁х画瀹℃壒",
+ cancelButtonText: "杩斿洖鍒楄〃",
+ type: "info"
+ })
+ .then(() => {
+ // 鍦ㄥ綋鍓嶉〉闈㈢洿鎺ュ姞杞戒笅涓�寮犲緟瀹℃壒鍗曟嵁
+ this.curId = next.id;
+ this.handleCheck();
+ // 鍚屾鏇存柊鍦板潃鏍忥紝閬垮厤鍒锋柊鍚庡洖鍒颁笂涓�鍗�
+ this.$router
+ .replace({
+ path: this.$route.path,
+ query: {
+ id: next.id,
+ businessType: this.businessType,
+ operationType: "check"
+ }
+ })
+ .catch(() => {});
+ })
+ .catch(() => {
+ this.exitToPage();
+ });
+ } else {
+ this.$modal.msgSuccess("宸叉棤寰呭鎵瑰崟鎹紝杩斿洖鍒楄〃");
+ this.exitToPage();
+ }
+ });
+ },
+
+ // 杩斿洖鍒楄〃椤�
+ exitToPage() {
+ this.$store.dispatch("tagsView/delView", this.$route);
+ this.$router.go(-1);
},
// 鍙栨秷鎸夐挳
@@ -2022,14 +2106,13 @@
//璁$畻涓◣锛歵ype(A:宸茬煡绋庡墠閲戦锛岃绠楃◣鍚庨噾棰濓紱B锛氬凡鐭ョ◣鍚庨噾棰濓紝璁$畻绋庡墠閲戦)
calculateTax(row, type) {
- let targetValue = 0;
for (let i = 0; i < this.rbDetails.length; i++) {
if (!this.rbDetails[i].amount) {
this.rbDetails[i].amount = 0;
}
- targetValue += parseFloat(this.rbDetails[i].amount); // 鍋囪姣忎釜瀵硅薄涓殑鐗瑰畾鍊煎瓨鍌ㄥ湪'specificValue'灞炴�т笅
}
- this.form.pretaxcost = targetValue;
+ // 鍚堣閲戦蹇呴』绮剧‘绱姞锛屽惁鍒欎細鍐欏叆 form.pretaxcost 骞惰惤搴�
+ this.form.pretaxcost = moneySum(this.rbDetails, "amount");
},
//瀵煎叆鎵�鏈夐」鐩�
@@ -2191,7 +2274,7 @@
let tempDetail = this.rbDetails[j];
if (
isNaN(parseFloat(tempDetail.amount)) ||
- parseFloat(tempDetail.amount) == 0
+ moneyRound(tempDetail.amount) == 0
) {
this.$modal.msgWarning(
"鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
@@ -2206,7 +2289,7 @@
let tempDetail = this.rbDetails[j];
if (
isNaN(parseFloat(tempDetail.amount)) ||
- parseFloat(tempDetail.amount) == 0
+ moneyRound(tempDetail.amount) == 0
) {
this.$modal.msgWarning(
"鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
@@ -2217,7 +2300,7 @@
}
if (
isNaN(parseFloat(tempDetail.taxamount)) ||
- parseFloat(tempDetail.taxamount) == 0
+ moneyRound(tempDetail.taxamount) == 0
) {
tempDetail.taxedamount = parseFloat(tempDetail.amount);
} else {
@@ -2258,8 +2341,8 @@
//鍏抽棴绐楀彛
this.$modal.closeLoading();
this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
- this.$store.dispatch("tagsView/delView", this.$route);
- this.$router.go(-1);
+ // 杩炵画瀹℃壒锛氳闂槸鍚︾户缁鎵逛笅涓�鍗�
+ this.continueOrExit();
} else {
this.$modal.closeLoading();
@@ -2498,33 +2581,32 @@
});
//鍏ㄩ儴鍒犻櫎鍚庢坊鍔犱竴鏉℃柊琛�
},
- //璁$畻鎬婚噾棰�
+ //璁$畻鎬婚噾棰濓紙閲戦涓�寰嬭蛋绮剧‘杩愮畻锛岀姝� parseFloat 绱姞锛�
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 = moneySub(totalFee, -parseFloat(detail.amount));
+ taxFee = moneySub(taxFee, -parseFloat(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);
+ taxFee = moneySub(taxFee, 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);
- this.rbDetails[i].amount = totalFee;
+ totalFee = moneyMul(detail.price, detail.quantity);
+ detail.amount = totalFee;
}
}
@@ -2533,9 +2615,10 @@
// this.rbDetails[i].taxedamount = taxFee.toFixed(2);
// }
- allSum += totalFee;
+ detailsArr.push(totalFee);
}
}
+ const allSum = moneyRound(moneySum(detailsArr));
// this.form.amountrequested = allSum.toFixed(2);
// this.$forceUpdate();
},
@@ -3238,7 +3321,9 @@
//鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
mounted() {
- window.addEventListener("beforeunload", e => this.beforeunloadHandler(e));
+ // 瀛樹綇鍚屼竴涓紩鐢紝鍚﹀垯 removeEventListener 浼犳柊绠ご鍑芥暟鏃犳硶鐪熸绉婚櫎锛屼細娉勬紡鐩戝惉鍣�
+ this._beforeUnloadHandler = e => this.beforeunloadHandler(e);
+ window.addEventListener("beforeunload", this._beforeUnloadHandler);
this.getUserList();
let apiaccountselectform = this.accountselectform;
let apiform = this.form;
@@ -3254,7 +3339,10 @@
updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
destroyed() {
- window.removeEventListener("beforeunload", e => this.beforeunloadFn(e));
+ if (this._beforeUnloadHandler) {
+ window.removeEventListener("beforeunload", this._beforeUnloadHandler);
+ this._beforeUnloadHandler = null;
+ }
}, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
activated() { } //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
};
--
Gitblit v1.9.3