feat: reset status dialog

This commit is contained in:
2026-03-20 15:09:27 +08:00
parent d6f72186a3
commit 74e9f5a827

View File

@@ -12,6 +12,7 @@ import com.lukouguoji.module_base.bean.GjjDeclareParam
import com.lukouguoji.module_base.bean.GjjImportManifest
import com.lukouguoji.module_base.common.Constant
import com.lukouguoji.module_base.common.ConstantEvent
import com.lukouguoji.gjj.dialog.IntImpTallyResetDialogModel
import com.lukouguoji.module_base.http.net.NetApply
import com.lukouguoji.module_base.impl.FlowBus
import com.lukouguoji.module_base.ktx.commonAdapter
@@ -134,22 +135,25 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
fun resetStatusClick() {
val (maWbList, haWbList) = getSelectedItems("请选择要重置的舱单") ?: return
val param = GjjDeclareParam(
maWbList = maWbList,
haWbList = haWbList,
restStatus = null,
resetReason = "状态重置"
)
val dialog = IntImpTallyResetDialogModel { dialogModel ->
val param = GjjDeclareParam(
maWbList = maWbList,
haWbList = haWbList,
restStatus = dialogModel.resetStatusCode
)
launchLoadingCollect({ NetApply.api.resetIntArrManifestStatus(param.toRequestBody()) }) {
onSuccess = {
showToast("状态重置成功")
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
launchLoadingCollect({ NetApply.api.resetIntArrManifestStatus(param.toRequestBody()) }) {
onSuccess = {
showToast("状态重置成功")
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
refresh()
}
refresh()
}
}
dialog.show()
}
/**