From df47e516e0cec3e6a0092c34085753bee4bd9355 Mon Sep 17 00:00:00 2001 From: "271556543@qq.com" <271556543@qq.com> Date: Wed, 3 Aug 2022 14:38:47 +0800 Subject: [PATCH] =?UTF-8?q?2022.8.3=20=E6=80=BB=E8=AE=A1=E3=80=81=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=8C=89=E9=92=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/contractList.vue | 91 ++++++++++++++++++----------- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/src/views/contract/contractList.vue b/src/views/contract/contractList.vue index daf155e..ca5d5e1 100644 --- a/src/views/contract/contractList.vue +++ b/src/views/contract/contractList.vue @@ -113,24 +113,30 @@ v-if="scope.row.purchase_status === 1 && ((scope.row.req_status === 3 && scope.row.is_plan === 0)||scope.row.is_plan === 1)"> - - - + + + +
+ + + +
+
@@ -406,7 +412,7 @@ export default { }, { label:"合同预算价(万元)", - width: 180, + width: 200, prop:"plan_price", align:'right', formatter:(v1,v2,value)=>{ @@ -415,7 +421,7 @@ export default { }, { label:'合同签订价(万元)', - width: 180, + width: 200, prop:'money', align:'right' }, @@ -556,6 +562,12 @@ export default { } } ], + //总计 + tableTotal:{ + fundLogTotal:0, + moneyTotal:0, + planPriceTotal:0 + }, planTable:[ { @@ -647,20 +659,26 @@ export default { sums[index] = '总计' return } - const values = data.map(item => Number(item[column.property])); - if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr); - if (!isNaN(value)) { - return prev + curr; - } else { - return prev; - } - }, 0); - sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') - } else { - sums[index] = ''; + if(column.property === 'fund_log_total'){ + sums[index] = this.tableTotal.fundLogTotal + return } + if(column.property === 'plan_price'){ + sums[index] = this.tableTotal.planPriceTotal + return + } + if(column.property === 'money'){ + sums[index] = this.tableTotal.moneyTotal + return + } + + // const values = data.map(item => Number(item[column.property])); + // if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) { + // + // sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') + // } else { + // sums[index] = ''; + // } }) return sums @@ -853,8 +871,11 @@ export default { end_plan_price:this.select.priceMax, status:this.select.status }) - this.list = res.data - this.total = res.total + this.list = res.list.data + this.total = res.list.total + this.tableTotal.fundLogTotal = res.fund_log_total + this.tableTotal.moneyTotal = Number(res.money_total).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') + this.tableTotal.planPriceTotal = Number(res.plan_price_total).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') },