feat: 国际出港 装货交接 待配运
This commit is contained in:
@@ -223,7 +223,7 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
||||
val filterParams = mapOf(
|
||||
"fdate" to flightDate.value?.ifEmpty { null },
|
||||
"fno" to flightNo.value?.ifEmpty { null },
|
||||
"likeNo" to waybillNo.value?.ifEmpty { null },
|
||||
"wbNo" to waybillNo.value?.ifEmpty { null },
|
||||
"hno" to hno.value?.ifEmpty { null }
|
||||
)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.dialog.IntExpOutWaitingTransDialogModel
|
||||
import com.lukouguoji.gjc.holder.IntExpOutHandoverViewHolder
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.bean.GjcUldUseBean
|
||||
@@ -18,7 +19,7 @@ import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import dev.utils.common.DateUtils
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
/**
|
||||
@@ -105,6 +106,59 @@ class IntExpOutHandoverViewModel : BasePageViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 待配运按钮点击
|
||||
*/
|
||||
fun waitingTransClick() {
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjcUldUseBean> ?: return
|
||||
val selectedItems = list.filter { it.isSelected }
|
||||
|
||||
if (selectedItems.isEmpty()) {
|
||||
showToast("请选择要待配运的ULD")
|
||||
return
|
||||
}
|
||||
|
||||
// 显示待配运弹框
|
||||
showWaitingTransDialog(selectedItems)
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示待配运弹框
|
||||
*/
|
||||
private fun showWaitingTransDialog(selectedItems: List<GjcUldUseBean>) {
|
||||
val dialog = IntExpOutWaitingTransDialogModel { model ->
|
||||
// 弹框确定回调
|
||||
performWaitingTrans(selectedItems, model.locationId, model.locationName)
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行待配运操作
|
||||
*/
|
||||
private fun performWaitingTrans(
|
||||
selectedItems: List<GjcUldUseBean>,
|
||||
locationId: String,
|
||||
locationName: String
|
||||
) {
|
||||
// 构建请求参数
|
||||
val params = mapOf(
|
||||
"location" to locationName,
|
||||
"locationId" to locationId.toLongOrNull(),
|
||||
"uldUseList" to selectedItems
|
||||
).toRequestBody()
|
||||
|
||||
launchLoadingCollect({ NetApply.api.waitingTrans(params) }) {
|
||||
onSuccess = {
|
||||
showToast("待配运操作成功")
|
||||
viewModelScope.launch {
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||
}
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据 (重写BasePageViewModel)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user