feat: opt views

This commit is contained in:
2026-03-20 12:46:52 +08:00
parent b2ea79512c
commit d6f72186a3
8 changed files with 73 additions and 18 deletions

View File

@@ -250,6 +250,19 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
launchLoadingCollect({ NetApply.api.getIntArrAirManifestList(listParams) }) {
onSuccess = { result ->
isAllExpanded.value = false
// 如果接口未返回航班日期/航班号,用筛选条件填充
val fd = flightDate.value ?: ""
val fn = flightNo.value ?: ""
result.list?.forEach { airManifest ->
airManifest.maWb?.let {
if (it.fdate.isEmpty()) it.fdate = fd
if (it.fno.isEmpty()) it.fno = fn
}
airManifest.haWbList?.forEach {
if (it.fdate.isEmpty()) it.fdate = fd
if (it.fno.isEmpty()) it.fno = fn
}
}
pageModel.handleListBean(result.toBaseListBean())
}
}

View File

@@ -182,6 +182,18 @@ class IntImpTallyViewModel : BasePageViewModel() {
return
}
// 校验所选单据状态是否为 01(已申报)
val invalidMaWb = selectedMaWb.firstOrNull { it.status != "01" }
if (invalidMaWb != null) {
showToast("运单 ${invalidMaWb.getWaybillNo()} 理货未申报,不允许删除理货")
return
}
val invalidHaWb = selectedHaWb.firstOrNull { it.status != "01" }
if (invalidHaWb != null) {
showToast("运单 ${invalidHaWb.getWaybillNo()} 理货未申报,不允许删除理货")
return
}
// 从接口获取删除原因列表
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
onSuccess = { result ->