公式:店员奖金=item1+item3+item5+item7
this.dyjj全局变量
this.tableDat 全局数组
1.求出尾部小计这一行的数据
columns.map((column, columnIndex) => {
var aa = XEUtils.sum(data, column.property)
this.tableDat.push(aa)
if (columnIndex === 0) {
return ‘小计’
}
}
其中小计这一行的值放入数组,
var aa = XEUtils.sum(data, column.property)
this.tableDat.push(aa)
2.第二行需要展示的地方计算
columns.map((column, columnIndex) => {
if (columnIndex === 4) {if (this.tableDat != null) {if (this.tableDat.length > 0) {console.log(this.tableDat[1] +this.tableDat[3] +this.tableDat[5] +this.tableDat[7])//店员奖金=item1+item3+item5+item7this.dyjl =this.tableDat[1] +this.tableDat[3] +this.tableDat[5] +this.tableDat[7]}}return this.dyjl}
}