当前位置:网站首页>el-table加合计
el-table加合计
2022-07-30 01:42:00 【梦之归途】
<el-table :data="tableListData" :header-cell-style="{
'background-color': '#F3F3F3',
height: '40px',
padding: 0,
}" :summary-method="getSummaries" show-summary>
<el-table-column :show-overflow-tooltip="true" :label="item.rebate_name" class-name="custom-cell" align="center" v-for="(item,index) in tabData" :key="index">
<el-table-column :show-overflow-tooltip="true" class-name="custom-cell" :prop="'estimate_amount_'+item.id" label="暂估" min-width="110">
<template slot-scope="scope">
<el-input v-if="scope.row.status" size="mini" placeholder="暂估" v-model="scope.row['estimate_amount_'+item.id]" clearable></el-input>
<span v-else>{
{scope.row['estimate_amount_'+item.id]}}</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" class-name="custom-cell" :prop="'actual_amount_'+item.id" label="实际" min-width="110">
<template slot-scope="scope">
<el-input v-if="scope.row.status" size="mini" placeholder="实际" v-model="scope.row['actual_amount_'+item.id]" clearable></el-input>
<span v-else>{
{scope.row['actual_amount_'+item.id]}}</span>
</template>
</el-table-column>
</el-table-column>
</el-table>
// 合计
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "合计";
return;
}
let arr = Object.keys(this.totalObj);
// console.log(arr)
// console.log(column)
//column.property 是跟el-table-column中prop的值一样的
if (arr.length) {
arr.forEach((item) => {
switch (column.property) {
case item:
sums[index] = this.totalObj[item];
break;
default:
break;
}
});
}
});
return sums;
},
.el-table__footer-wrapper tbody td.custom-cell {
border-right: 1px solid #DBDFE5 !important;
}边栏推荐
猜你喜欢

气路旋转连接器怎么用

CMake Tutorial Tour (1)_Basic starting point

泰克Tektronix示波器软件TDS520|TDS1001|TDS1002上位机软件NS-Scope

Running a Fabric Application

SwiftUI SQLite Database Storage Tutorial Collection (2022 Edition)

自学HarmonyOS应用开发(47)- 自定义switch组件

Huawei's "genius boy" Zhihui Jun has made a new work, creating a "customized" smart keyboard from scratch

Elephant Swap:借助ePLATO提供加密市场的套利空间

API 接口批量测试

What majors become more popular the older they get?
随机推荐
LABVIEW详细介绍:LABVIEW是什么软件?都可以干什么?
API interface batch test
新型海上风电机组及压缩空气储能系统的建模与控制(Matlab代码实现)
About offline use of SAP Fiori apps
初级测试人员如何快速成长
Teach you how to achieve a flowing gradient border
go grpc 自定义拦截器
How Navicat Connects to MySQL
小白必看|不用编程的labview,ATECLOUD完全满足你的需求
Recommendation systems: feature engineering, common features
CMake Tutorial 巡礼(1)_基础的起点
聊聊性能测试环境搭建
nacos的共享配置和扩展配置
Elephant Swap:借助ePLATO提供加密市场的套利空间
Detailed introduction to the usage of Nacos configuration center
fluttter学习之ButtonStyle 、MaterialStateProperty
js中原型链的理解,原型链解决的是什么问题?
什么专业越老越吃香?
利用ESP32构造一个ZIGBEE的网络发送转接
Recommendation system: collection of user "behavioral data" [use Kafka and Cassandra to process data] [if it overlaps with business data, it also needs to be collected independently]