廖井涛
2025-10-30 9ec9c7db6b27aaf9bd72e8851e809e6e232d4350
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import {add} from '@/utils/decimal'
export default function footSum(list, field) {
    let count = 0
    list.forEach(item => {
        if(field.indexOf('.')>-1){
            let  array = field.split('.')
 
            count = add((item[array[0]][array[1]] || 0), count)
        }else {
            count =add((item[field]  || 0), count)
        }
    })
    return count
}