From ca4261a5d05d0359d02e332b88ed149a0656eae1 Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期四, 27 七月 2023 13:47:57 +0800 Subject: [PATCH] 修改了专家费用保存 --- src/views/project/fund/expertFeeFundApply/index.vue | 119 +++++++++++++++++++++++++---------------------------------- 1 files changed, 51 insertions(+), 68 deletions(-) diff --git a/src/views/project/fund/expertFeeFundApply/index.vue b/src/views/project/fund/expertFeeFundApply/index.vue index d2ed7c1..e6fad70 100644 --- a/src/views/project/fund/expertFeeFundApply/index.vue +++ b/src/views/project/fund/expertFeeFundApply/index.vue @@ -1357,9 +1357,9 @@ this.$refs["form"].validate((valid) => { if (valid) { this.formData = this.form; - let totalPreTaxAmount = 0.0; - let totalAfterTaxAmount = 0.0; - let totalAmount = 0.0; + // let totalPreTaxAmount = 0.0; + // let totalAfterTaxAmount = 0.0; + // let totalAmount = 0.0; //淇濆瓨鍓嶆牎楠屾暟鎹� for (let k = 0; k < this.fundDetails.length; k++) { @@ -1393,6 +1393,18 @@ // tempDetail.unitname = tempDetail.unitno; // } + + } + + //闄勪欢澶勭悊 + let list = this.fileList; + if (list.length > 0) { + this.form.annexfiles = list.map(item => item.url).join(","); + } + + //澶勭悊鏄庣粏 + for (let i = 0; i < this.fundDetails.length; i++) { + let tempDetail = this.fundDetails[i]; //鑾峰彇鏈嶅姟椤圭洰鏄庣粏 let tempItemArr = tempDetail.itemArr; let itemIndex = tempItemArr.findIndex( @@ -1408,13 +1420,12 @@ (item) => tempDetail.applytype == item.value ); if (applytypeIndex > -1) { - console.log("tempData1", tempData); tempDetail.applytypename = this.rowfeeItemTypes[applytypeIndex].label; tempDetail.subjecttype = this.rowfeeItemTypes[applytypeIndex].subjecttype; tempDetail.subjecttypename = this.rowfeeItemTypes[applytypeIndex].subjecttypename; } - - this.fundDetails[m] = tempDetail; + this.fundDetails[k] = tempDetail; + /* //璁$畻涓◣ //if (isNaN(parseFloat(tempDetail.taxedamount))) //鑾峰彇鍙傛暟 @@ -1432,8 +1443,6 @@ this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); this.totalAmount += parseFloat(tempDetail.amount); - console.log('绗簩姝�'); - this.brforaFn() } }); } @@ -1451,72 +1460,46 @@ this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); this.totalAmount += parseFloat(tempDetail.amount); console.log("1", this.amount); - console.log('绗簩姝�'); - this.brforaFn() } }); } + */ } + //璐圭敤鍚堣 + // this.form.pretaxcost = parseFloat(this.totalPreTaxAmount).toFixed(2); + // this.form.taxedcost = parseFloat(this.totalAfterTaxAmount).toFixed(2); + // this.form.amountrequested = this.totalAmount.toFixed(2); + + //淇濆瓨鏁版嵁 + this.loading = true; + this.form.serviceFunddetails = 0; + this.fundDetails.map((item) => { + this.form.serviceFunddetails += item.amount; + }); + this.form.serviceFunddetails = this.fundDetails; + + if (this.form.id != null) { + //鎹愮尞鑰� + this.form.donorname = this.curCase.name; + } + else { + this.form.recordstatus = -1; + } + + batchUploadFund(this.form).then((response) => { + if (response.code === 200) { + this.$modal.msgSuccess("涓撳鍔冲姟璐逛繚瀛樻垚鍔燂紒"); + this.selectDonotor(this.curCase); + } else { + this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐ワ細" + response.msg); + } + }); + + //鍏抽棴绐楀彛 + this.loading = false; + this.dialogOpen = false; } }); - }, - - // 绗簩姝� - brforaFn() { - //闄勪欢澶勭悊 - this.loading = true; - let list = this.fileList; - if (list.length > 0) { - this.form.annexbankcard = list.map(item => item.url).join(","); - } - - // - this.form.donorname = this.curCase.name; - this.form.pretaxcost = parseFloat(this.totalPreTaxAmount).toFixed(2); - this.form.taxedcost = parseFloat(this.totalAfterTaxAmount).toFixed(2); - this.form.amountrequested = this.totalAmount.toFixed(2); - if (this.form.id != null) { - this.form.recordstatus = -1; - updateFund(this.form).then((res) => { - this.getfundList(); - this.dialogOpen = false; - this.getList(); - this.selectDonotor(this.curCase); - - // this.$modal.msgSuccess("淇敼鎴愬姛"); - this.loading = false; - for (let m = 0; m < this.fundDetails.length; m++) { - let tempData = this.fundDetails[m]; - if (tempData.id > 0) { - updateFunddetail(tempData).then((res) => { }); - } else { - tempData.fundid = this.formData.id; - addFunddetail(tempData).then((res) => { }); - } - } - }); - } else { - this.form.serviceFunddetails = 0; - this.fundDetails.map((item) => { - this.form.serviceFunddetails += item.amount; - }); - this.form.serviceFunddetails = this.fundDetails; - this.form.recordstatus = -1; - - batchUploadFund(this.form).then((response) => { - if (response.code === 200) { - this.$modal.msgSuccess("鏂板鎴愬姛"); - this.loading = false; - this.selectDonotor(this.curCase); - } else { - this.$modal.msgError("鏂板澶辫触锛�" + response.msg); - this.loading = false; - } - }); - - //鍏抽棴绐楀彛 - this.dialogOpen = false; - } }, //鑾峰彇涓撳鍒楄〃 -- Gitblit v1.9.3