feat: 删除申报/理货申报增加申报状态校验

四个页面删除申报仅允许申报状态为01的记录;
出港理货申报仅允许状态为空的记录;
并修复理货分单申报状态误绑定 arrivalStatus 的问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 13:46:32 +08:00
parent f53a15abb5
commit faf7698829
5 changed files with 37 additions and 1 deletions

View File

@@ -202,6 +202,14 @@ class IntExpArriveViewModel : BasePageViewModel() {
return return
} }
// 校验申报状态:只有申报状态为 01 的记录才能删除申报
if (selectedMaWbList.any { it.declareStatus != "01" } ||
selectedHaWbList.any { it.arrivalStatus != "01" }
) {
showToast("只能删除申报状态为01的运单")
return
}
// 从接口获取删除原因列表 // 从接口获取删除原因列表
launchLoadingCollect({ NetApply.api.getDelReasonList() }) { launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
onSuccess = { result -> onSuccess = { result ->

View File

@@ -228,6 +228,12 @@ class IntExpLoadViewModel : BasePageViewModel() {
return return
} }
// 校验申报状态:只有装载申报状态为 01 的记录才能删除申报
if (selectedItems.any { it.loadStatus != "01" }) {
showToast("只能删除申报状态为01的运单")
return
}
// 从接口获取删除原因列表 // 从接口获取删除原因列表
launchLoadingCollect({ NetApply.api.getDelReasonList() }) { launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
onSuccess = { result -> onSuccess = { result ->

View File

@@ -202,6 +202,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
return return
} }
// 校验申报状态:只有未申报(状态为空)的记录才能理货申报
if (selectedMaWbList.any { !it.declareStatus.isNullOrEmpty() } ||
selectedHaWbList.any { !it.tallyStatus.isNullOrEmpty() }
) {
showToast("只有未申报的运单才能理货申报")
return
}
// 构建请求参数(区分主单和分单) // 构建请求参数(区分主单和分单)
val params = mutableMapOf<String, Any?>() val params = mutableMapOf<String, Any?>()
if (selectedMaWbList.isNotEmpty()) { if (selectedMaWbList.isNotEmpty()) {
@@ -249,6 +257,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
return return
} }
// 校验申报状态:只有申报状态为 01 的记录才能删除申报
if (selectedMaWbList.any { it.declareStatus != "01" } ||
selectedHaWbList.any { it.tallyStatus != "01" }
) {
showToast("只能删除申报状态为01的运单")
return
}
// 从接口获取删除原因列表 // 从接口获取删除原因列表
launchLoadingCollect({ NetApply.api.getDelReasonList() }) { launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
onSuccess = { result -> onSuccess = { result ->

View File

@@ -73,7 +73,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:text="@{bean.arrivalStatus ?? ``}" android:text="@{bean.tallyStatus ?? ``}"
android:textColor="@color/text_normal" android:textColor="@color/text_normal"
android:textSize="14sp" /> android:textSize="14sp" />

View File

@@ -175,6 +175,12 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
fun deleteDeclarationClick() { fun deleteDeclarationClick() {
val (maWbList, haWbList) = getSelectedItems("请选择要删除申报的舱单") ?: return val (maWbList, haWbList) = getSelectedItems("请选择要删除申报的舱单") ?: return
// 校验申报状态:只有申报状态为 01 的舱单才能删除申报
if (maWbList.any { it.mftStatus != "01" } || haWbList.any { it.mftStatus != "01" }) {
showToast("只能删除申报状态为01的舱单")
return
}
// 从接口获取删除原因列表 // 从接口获取删除原因列表
launchLoadingCollect({ NetApply.api.getDelReasonList() }) { launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
onSuccess = { result -> onSuccess = { result ->