| | |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | |
| | | weighAllAmount(data) { |
| | | let count = 0 |
| | | data.forEach(row => { |
| | | count += row.weight |
| | | }) |
| | | return count |
| | | }, |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let count = 0 |
| | | |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | return parseFloat((row.baiscQuantity*row.thickness*row.width*row.height*2.5/1000000).toFixed(2)) |
| | | } |
| | | |
| | | //右边表格定义 |
| | | // const $grid = xGrid.value |
| | | // //获取右边表格checkbox选中的数据 |
| | | // const checkedList = $grid.getCheckboxRecords() |
| | | |
| | | // const checkedSum = (checkedList) =>{ |
| | | // let sum = 0 |
| | | // checkedList.forEach((item)=>{ |
| | | // sum += parseFloat(item.weightSum) |
| | | // }) |
| | | // return sum |
| | | // } |
| | | const handleCheckboxChange=({ row}) =>{ |
| | | const $grid = xGrid.value |
| | | //获取右边表格checkbox选中的数据 |
| | | const checkedList = $grid.getCheckboxRecords() |
| | | let sum = 0; |
| | | checkedList.forEach(item => { |
| | | sum += item.baiscQuantity; |
| | | }); |
| | | //console.log('sum:', sum); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | checkbox-config="{ reserve: true, strict: true }" |
| | | @checkbox-change="handleCheckboxChange" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |