erp-el-element/commontable/tablepagination.vue

84 lines
1.7 KiB
Vue

<template>
<div class="calculation">
<div>
<span style="font-weight: bold; padding: 0 10px">本页信息:</span>
<span style="padding: 0 10px">总定价:{{ total_cost }}</span>
</div>
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="page.page"
:page-sizes="page.pagesizes"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
:page-size.sync="page.list_row"
></el-pagination>
</div>
</div>
</template>
<script>
import { add } from "./../utils/Decimal";
export default {
name:"erpTablePagination",
props: {
currentPage4: {
type: Number,
},
page: {
type: Object,
default: () => {
return {};
},
},
tableData: {
default: () => {
return [];
},
},
},
components: {},
data() {
return {};
},
computed: {
// 机器总成本
total_cost: function () {
let priceNumber = 0;
this.tableData.map((res, index) => {
priceNumber = add(priceNumber, res.total_cost);
});
return priceNumber.toFixed(2);
},
},
methods: {
//选择每页条数
handleSizeChange() {
this.$emit("handleSizeChange");
},
//点击页码
handleCurrentChange() {
this.$emit("gettbdata");
},
},
};
</script>
<style scoped lang='scss'>
.calculation {
height: 50px;
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
::v-deep .el-pagination .el-input__suffix {
right: -18px;
}
}
</style>