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 | 116 ++++++++++++++++++++++----------------------------------- 1 files changed, 45 insertions(+), 71 deletions(-) diff --git a/src/views/project/fund/expertFeeFundApply/index.vue b/src/views/project/fund/expertFeeFundApply/index.vue index 6a54eb9..e6fad70 100644 --- a/src/views/project/fund/expertFeeFundApply/index.vue +++ b/src/views/project/fund/expertFeeFundApply/index.vue @@ -1357,11 +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; - - console.log('1'); + // let totalPreTaxAmount = 0.0; + // let totalAfterTaxAmount = 0.0; + // let totalAmount = 0.0; //淇濆瓨鍓嶆牎楠屾暟鎹� for (let k = 0; k < this.fundDetails.length; k++) { @@ -1395,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( @@ -1410,13 +1420,12 @@ (item) => tempDetail.applytype == item.value ); if (applytypeIndex > -1) { - console.log("tempDetail", tempDetail); tempDetail.applytypename = this.rowfeeItemTypes[applytypeIndex].label; tempDetail.subjecttype = this.rowfeeItemTypes[applytypeIndex].subjecttype; tempDetail.subjecttypename = this.rowfeeItemTypes[applytypeIndex].subjecttypename; } this.fundDetails[k] = tempDetail; - + /* //璁$畻涓◣ //if (isNaN(parseFloat(tempDetail.taxedamount))) //鑾峰彇鍙傛暟 @@ -1434,8 +1443,6 @@ this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); this.totalAmount += parseFloat(tempDetail.amount); - console.log('绗簩姝�'); - this.brforaFn() } }); } @@ -1453,79 +1460,46 @@ this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); this.totalAmount += parseFloat(tempDetail.amount); console.log("1", this.amount); - console.log('绗簩姝�'); - this.brforaFn() } }); } + */ } - } - console.log('2'); - }); - }, + //璐圭敤鍚堣 + // this.form.pretaxcost = parseFloat(this.totalPreTaxAmount).toFixed(2); + // this.form.taxedcost = parseFloat(this.totalAfterTaxAmount).toFixed(2); + // this.form.amountrequested = this.totalAmount.toFixed(2); - // 绗簩姝� - brforaFn() { - console.log('3'); - this.loading = true; + //淇濆瓨鏁版嵁 + this.loading = true; + this.form.serviceFunddetails = 0; + this.fundDetails.map((item) => { + this.form.serviceFunddetails += item.amount; + }); + this.form.serviceFunddetails = this.fundDetails; - //鎹愮尞鑰� - this.form.donorname = this.curCase.name; + if (this.form.id != null) { + //鎹愮尞鑰� + this.form.donorname = this.curCase.name; + } + else { + this.form.recordstatus = -1; + } - //闄勪欢澶勭悊 - let list = this.fileList; - if (list.length > 0) { - this.form.annexfiles = list.map(item => item.url).join(","); - } - //璐圭敤鍚堣 - 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); - - for (let m = 0; m < this.fundDetails.length; m++) { - let tempData = this.fundDetails[m]; - if (tempData.id > 0) { - updateFunddetail(tempData).then((res) => { }); + batchUploadFund(this.form).then((response) => { + if (response.code === 200) { + this.$modal.msgSuccess("涓撳鍔冲姟璐逛繚瀛樻垚鍔燂紒"); + this.selectDonotor(this.curCase); } else { - tempData.fundid = this.formData.id; - addFunddetail(tempData).then((res) => { }); + this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐ワ細" + response.msg); } - } + }); - this.$modal.msgSuccess("淇敼鎴愬姛"); + //鍏抽棴绐楀彛 this.loading = false; - }); - } 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; - } + this.dialogOpen = false; + } + }); }, //鑾峰彇涓撳鍒楄〃 -- Gitblit v1.9.3