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/fundcheck/officeExpenseCheck/index.vue | 54 +++++++++++++++++++++++++++---------------------------
1 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/views/project/fundcheck/officeExpenseCheck/index.vue b/src/views/project/fundcheck/officeExpenseCheck/index.vue
index 5f011fc..731bb1e 100644
--- a/src/views/project/fundcheck/officeExpenseCheck/index.vue
+++ b/src/views/project/fundcheck/officeExpenseCheck/index.vue
@@ -148,8 +148,8 @@
<el-col :span="5">
<el-form-item label="鐢宠鏃ユ湡" prop="createTime">
<!-- <el-input v-model="form.donorno" placeholder="璇疯緭鍏ョ敵璇锋棩鏈�" /> -->
- <el-date-picker clearable style="width: 100%" v-model="form.createTime" type="date"
- value-format="yyyy-MM-dd HH:mm:ss" placeholder="鐢宠鏃ユ湡">
+ <el-date-picker clearable style="width: 100%" v-model="form.createTime" type="date" format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd" placeholder="鐢宠鏃ユ湡">
</el-date-picker>
</el-form-item>
</el-col>
@@ -424,7 +424,7 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="dundcheck" v-if="dialogType == 'edit'">纭</el-button>
+ <el-button type="primary" :loading="checkSubmitLoading" :disabled="checkSubmitLoading" @click="dundcheck" v-if="dialogType == 'edit'">纭</el-button>
<el-button @click="cancel">鍙栨秷</el-button>
</div>
</el-dialog>
@@ -499,6 +499,7 @@
import { listDept } from "@/api/system/dept";
import { getToken } from "@/utils/auth";
import { setItem, grtItem, removeItem } from "@/utils/storage.js";
+import { moneySum, moneyAdd, moneySub, moneyMul, moneyRound } from "@/utils/money";
export default {
components: {
@@ -522,6 +523,7 @@
],
data() {
return {
+ checkSubmitLoading: false,
arrr2: [],
arrr3: [],
//璐圭敤绫诲瀷鏁扮粍
@@ -596,11 +598,11 @@
checkmaterials: [
{
value: 1,
- label: "鏉愭枡寰呭鏍�"
+ label: "寰呭鏍�"
},
{
value: 2,
- label: "瀹℃煡閫氳繃绛夊緟閭瘎绾歌川鏉愭枡"
+ label: "瀹℃煡閫氳繃绛夊緟绾歌川鏉愭枡"
},
{
value: 3,
@@ -735,6 +737,7 @@
});
},
dundcheck() {
+ if (this.checkSubmitLoading) return;
// this.$em
this.dialogOpen = false;
let checkfundobj = {
@@ -742,17 +745,15 @@
flowcontent: this.newobj.flowconclusion,
fundid: this.newobj.fundid
};
+ this.checkSubmitLoading = true;
checkfund(checkfundobj).then(res => {
+ this.checkSubmitLoading = false;
if (res.code == 200) {
this.reset();
this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
this.getlistbypower();
} else {
- if (res.msg) {
- this.$modal.msgError("鎿嶄綔澶辫");
- } else {
- this.$modal.msgError(res.msg);
- }
+ this.$modal.msgError(res.msg || "鎿嶄綔澶辫触");
}
});
},
@@ -1448,41 +1449,40 @@
// });
},
- //璁$畻鎬婚噾棰�
+ //璁$畻鎬婚噾棰濓紙閲戦涓�寰嬭蛋绮剧‘杩愮畻锛岀姝� parseFloat 绱姞锛�
sumTotalFee() {
- let allSum = 0;
+ const detailsArr = [];
if (this.form.applytype != null) {
for (let i = 0; i < this.fundDetailArr.length; i++) {
+ const detail = this.fundDetailArr[i];
let totalFee = 0;
let taxFee = 0;
if (this.form.applytype == 1 || this.form.applytype == 2) {
- //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣
- if (!isNaN(parseFloat(this.fundDetailArr[i].amount))) {
- totalFee += parseFloat(this.fundDetailArr[i].amount);
- taxFee += parseFloat(this.fundDetailArr[i].amount);
+ //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣锛氱◣鍓� - 鎵g◣
+ if (!isNaN(parseFloat(detail.amount))) {
+ totalFee = moneyAdd(totalFee, detail.amount);
+ taxFee = moneyAdd(taxFee, detail.amount);
}
- if (!isNaN(parseFloat(this.fundDetailArr[i].taxamount))) {
- totalFee -= parseFloat(this.fundDetailArr[i].taxamount);
- taxFee -= parseFloat(this.fundDetailArr[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.fundDetailArr[i].price)) &&
- !isNaN(parseFloat(this.fundDetailArr[i].quantity))
+ !isNaN(parseFloat(detail.price)) &&
+ !isNaN(parseFloat(detail.quantity))
) {
- totalFee +=
- parseFloat(this.fundDetailArr[i].price) *
- parseFloat(this.fundDetailArr[i].quantity);
+ totalFee = moneyMul(detail.price, detail.quantity);
}
}
if (!isNaN(parseFloat(taxFee))) {
- this.fundDetailArr[i].taxedamount = taxFee.toFixed(2);
+ this.fundDetailArr[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();
},
--
Gitblit v1.9.3