feat: reset status dialog
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user