|
|
@ -316,12 +316,15 @@ export default { |
|
|
|
|
|
|
|
|
// 处理行展开事件 |
|
|
// 处理行展开事件 |
|
|
handleBoxExpand(row, expandedRows) { |
|
|
handleBoxExpand(row, expandedRows) { |
|
|
// 更新展开行的数组 |
|
|
|
|
|
this.expandedBoxRows = expandedRows.map(expandedRow => this.getBoxRowKey(expandedRow)); |
|
|
|
|
|
|
|
|
|
|
|
if (expandedRows.includes(row)) { |
|
|
|
|
|
// 行被展开,加载明细数据 |
|
|
|
|
|
this.loadPalletDetails(row); |
|
|
|
|
|
|
|
|
// 判断当前操作是展开还是收起 |
|
|
|
|
|
const isExpanding = expandedRows.includes(row); |
|
|
|
|
|
|
|
|
|
|
|
if (isExpanding) { |
|
|
|
|
|
// 如果是展开操作,则展开所有行 |
|
|
|
|
|
this.expandAll(); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果是收起操作,则收起所有行 |
|
|
|
|
|
this.collapseAll(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -375,6 +378,22 @@ export default { |
|
|
return value; |
|
|
return value; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 展开所有行 |
|
|
|
|
|
expandAll() { |
|
|
|
|
|
// 获取所有行的key |
|
|
|
|
|
this.expandedBoxRows = this.dataListBoxes.map(row => this.getBoxRowKey(row)); |
|
|
|
|
|
|
|
|
|
|
|
// 为每个行加载明细数据 |
|
|
|
|
|
this.dataListBoxes.forEach(row => { |
|
|
|
|
|
this.loadPalletDetails(row); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 收起所有行 |
|
|
|
|
|
collapseAll() { |
|
|
|
|
|
this.expandedBoxRows = []; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 刷新数据的公共方法 |
|
|
// 刷新数据的公共方法 |
|
|
refresh() { |
|
|
refresh() { |
|
|
this.loadBoxList(); |
|
|
this.loadBoxList(); |
|
|
|