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,') },