feat: 国际出港 出港仓库 清仓
This commit is contained in:
@@ -71,14 +71,23 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 全选按钮点击 (切换全选状态)
|
||||
* 全选按钮点击 (切换全选状态,单向同步到子列表)
|
||||
*/
|
||||
fun checkAllClick() {
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjcMaWb> ?: return
|
||||
|
||||
// 切换全选状态
|
||||
val shouldCheckAll = !isAllChecked.value!!
|
||||
list.forEach { it.checked.set(shouldCheckAll) }
|
||||
|
||||
// 单向同步:主列表和子列表都设置为相同的选择状态
|
||||
list.forEach { maWb ->
|
||||
maWb.checked.set(shouldCheckAll)
|
||||
// 同步到所有子列表项
|
||||
maWb.haWbList?.forEach { haWb ->
|
||||
haWb.checked.set(shouldCheckAll)
|
||||
}
|
||||
}
|
||||
|
||||
isAllChecked.value = shouldCheckAll
|
||||
|
||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||
|
||||
Reference in New Issue
Block a user