2022.8.3 总计、界面按钮调整

master
271556543@qq.com 3 years ago
parent 9709ee01ad
commit df47e516e0

@ -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)"> v-if="scope.row.purchase_status === 1 && ((scope.row.req_status === 3 && scope.row.is_plan === 0)||scope.row.is_plan === 1)">
<Button class="slot-btns-item" type="primary" size="small" @click="buyProcess(scope.row)"></Button> <Button class="slot-btns-item" type="primary" size="small" @click="buyProcess(scope.row)"></Button>
</template> </template>
<template v-if="!(scope.row.req_status != 1 || scope.row.join_status != 1 || scope.row.invite_status != 1 || scope.row.purchase_status != 1 || scope.row.status === 2)">
<Poptip <Poptip transfer placement="bottom">
placement="bottom" <Button type="primary" size="small" ghost>更多</Button>
:transfer="true" <div slot="content">
confirm <template v-if="!(scope.row.req_status != 1 || scope.row.join_status != 1 || scope.row.invite_status != 1 || scope.row.purchase_status != 1 || scope.row.status === 2)">
title="确认要删除吗" <Poptip
@on-ok="()=>deleteContract(scope.row.id)"> placement="bottom"
<i-button :transfer="true"
class="slot-btns-item" confirm
type="error" title="确认要删除吗"
size="small" @on-ok="()=>deleteContract(scope.row.id)">
ghost>删除</i-button> <i-button
</Poptip> class="slot-btns-item"
</template> type="error"
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['detailContract'].isShowDetail = true,$refs['detailContract'].getDetail(scope.row.id)">查看</Button> size="small"
<template v-if="scope.row.status != 2"> ghost>删除</i-button>
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['editor'].isShowEditor = true,$refs['editor'].getDetail(scope.row.id)">编辑</Button> </Poptip>
</template> </template>
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['detailContract'].isShowDetail = true,$refs['detailContract'].getDetail(scope.row.id)">查看</Button>
<template v-if="scope.row.status != 2">
<Button class="slot-btns-item" type="primary" size="small" @click="$refs['editor'].isShowEditor = true,$refs['editor'].getDetail(scope.row.id)">编辑</Button>
</template>
</div>
</Poptip>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -406,7 +412,7 @@ export default {
}, },
{ {
label:"合同预算价(万元)", label:"合同预算价(万元)",
width: 180, width: 200,
prop:"plan_price", prop:"plan_price",
align:'right', align:'right',
formatter:(v1,v2,value)=>{ formatter:(v1,v2,value)=>{
@ -415,7 +421,7 @@ export default {
}, },
{ {
label:'合同签订价(万元)', label:'合同签订价(万元)',
width: 180, width: 200,
prop:'money', prop:'money',
align:'right' align:'right'
}, },
@ -556,6 +562,12 @@ export default {
} }
} }
], ],
//
tableTotal:{
fundLogTotal:0,
moneyTotal:0,
planPriceTotal:0
},
planTable:[ planTable:[
{ {
@ -647,20 +659,26 @@ export default {
sums[index] = '总计' sums[index] = '总计'
return return
} }
const values = data.map(item => Number(item[column.property])); if(column.property === 'fund_log_total'){
if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) { sums[index] = this.tableTotal.fundLogTotal
sums[index] = values.reduce((prev, curr) => { return
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 === '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 return sums
@ -853,8 +871,11 @@ export default {
end_plan_price:this.select.priceMax, end_plan_price:this.select.priceMax,
status:this.select.status status:this.select.status
}) })
this.list = res.data this.list = res.list.data
this.total = res.total 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,')
}, },

Loading…
Cancel
Save