feat: 删除申报/理货申报增加申报状态校验
四个页面删除申报仅允许申报状态为01的记录; 出港理货申报仅允许状态为空的记录; 并修复理货分单申报状态误绑定 arrivalStatus 的问题 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -202,6 +202,14 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
||||
return
|
||||
}
|
||||
|
||||
// 校验申报状态:只有申报状态为 01 的记录才能删除申报
|
||||
if (selectedMaWbList.any { it.declareStatus != "01" } ||
|
||||
selectedHaWbList.any { it.arrivalStatus != "01" }
|
||||
) {
|
||||
showToast("只能删除申报状态为01的运单")
|
||||
return
|
||||
}
|
||||
|
||||
// 从接口获取删除原因列表
|
||||
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
|
||||
onSuccess = { result ->
|
||||
|
||||
@@ -228,6 +228,12 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
||||
return
|
||||
}
|
||||
|
||||
// 校验申报状态:只有装载申报状态为 01 的记录才能删除申报
|
||||
if (selectedItems.any { it.loadStatus != "01" }) {
|
||||
showToast("只能删除申报状态为01的运单")
|
||||
return
|
||||
}
|
||||
|
||||
// 从接口获取删除原因列表
|
||||
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
|
||||
onSuccess = { result ->
|
||||
|
||||
@@ -202,6 +202,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
||||
return
|
||||
}
|
||||
|
||||
// 校验申报状态:只有未申报(状态为空)的记录才能理货申报
|
||||
if (selectedMaWbList.any { !it.declareStatus.isNullOrEmpty() } ||
|
||||
selectedHaWbList.any { !it.tallyStatus.isNullOrEmpty() }
|
||||
) {
|
||||
showToast("只有未申报的运单才能理货申报")
|
||||
return
|
||||
}
|
||||
|
||||
// 构建请求参数(区分主单和分单)
|
||||
val params = mutableMapOf<String, Any?>()
|
||||
if (selectedMaWbList.isNotEmpty()) {
|
||||
@@ -249,6 +257,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
||||
return
|
||||
}
|
||||
|
||||
// 校验申报状态:只有申报状态为 01 的记录才能删除申报
|
||||
if (selectedMaWbList.any { it.declareStatus != "01" } ||
|
||||
selectedHaWbList.any { it.tallyStatus != "01" }
|
||||
) {
|
||||
showToast("只能删除申报状态为01的运单")
|
||||
return
|
||||
}
|
||||
|
||||
// 从接口获取删除原因列表
|
||||
launchLoadingCollect({ NetApply.api.getDelReasonList() }) {
|
||||
onSuccess = { result ->
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.arrivalStatus ?? ``}"
|
||||
android:text="@{bean.tallyStatus ?? ``}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user