feat: 国际出港-出港装载 opt
This commit is contained in:
@@ -33,7 +33,6 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
val flightDate = MutableLiveData<String>(DateUtils.getCurrentTime().formatDate()) // 航班日期
|
||||
val flightNo = MutableLiveData("") // 航班号
|
||||
val waybillNo = MutableLiveData("") // 运单号
|
||||
val houseWaybillNo = MutableLiveData("") // 分单号
|
||||
|
||||
// ========== 统计信息 ==========
|
||||
val totalCount = MutableLiveData("0") // 合计票数
|
||||
@@ -84,13 +83,6 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.WAYBILL)
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码分单号
|
||||
*/
|
||||
fun scanHouseWaybill() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CODE)
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态重置 (批量操作)
|
||||
*/
|
||||
@@ -198,7 +190,6 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
fdate = flightDate.value?.ifEmpty { null },
|
||||
fno = flightNo.value?.ifEmpty { null },
|
||||
no = waybillNo.value?.ifEmpty { null },
|
||||
hno = houseWaybillNo.value?.ifEmpty { null },
|
||||
pageNum = pageModel.page,
|
||||
pageSize = pageModel.limit
|
||||
)
|
||||
@@ -210,8 +201,7 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
val totalParams = GjcCheckInPage(
|
||||
fdate = flightDate.value?.ifEmpty { null },
|
||||
fno = flightNo.value?.ifEmpty { null },
|
||||
no = waybillNo.value?.ifEmpty { null },
|
||||
hno = houseWaybillNo.value?.ifEmpty { null }
|
||||
no = waybillNo.value?.ifEmpty { null }
|
||||
).toRequestBody()
|
||||
|
||||
// 获取列表 (带Loading)
|
||||
|
||||
@@ -42,6 +42,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
||||
// ========== 全选状态 ==========
|
||||
val isAllChecked = MutableLiveData(false)
|
||||
|
||||
// ========== 全局展开状态 ==========
|
||||
/**
|
||||
* 全局展开状态
|
||||
* - true: 全部展开
|
||||
* - false: 全部收起
|
||||
*/
|
||||
val isAllExpanded = MutableLiveData(false)
|
||||
|
||||
init {
|
||||
// 监听全选状态,自动更新所有列表项
|
||||
isAllChecked.observeForever { checked ->
|
||||
@@ -76,6 +84,28 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换全局展开/收起状态
|
||||
*/
|
||||
fun toggleAllExpand() {
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjcMaWb> ?: return
|
||||
|
||||
// 切换全局状态
|
||||
val shouldExpand = !isAllExpanded.value!!
|
||||
isAllExpanded.value = shouldExpand
|
||||
|
||||
// 更新所有列表项的 showMore 状态
|
||||
list.forEach { bean ->
|
||||
// 只有当有子列表时才设置展开状态
|
||||
if (!bean.haWbList.isNullOrEmpty()) {
|
||||
bean.showMore.set(shouldExpand)
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新列表UI
|
||||
pageModel.rv?.commonAdapter()?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码运单号
|
||||
*/
|
||||
@@ -213,7 +243,11 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
||||
|
||||
// 获取列表 (带Loading)
|
||||
launchLoadingCollect({ NetApply.api.getIntExpTallyList(listParams) }) {
|
||||
onSuccess = { pageModel.handleListBean(it) }
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
// 数据加载完成后,重置全局展开状态为收起
|
||||
isAllExpanded.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取统计信息 (后台请求,不阻塞列表)
|
||||
|
||||
Reference in New Issue
Block a user