feat: 国际出港 出港仓库 出库
This commit is contained in:
@@ -207,24 +207,37 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库操作
|
||||
* 出库操作(在Activity中调用,会显示二次确认对话框)
|
||||
*/
|
||||
fun outStorage() {
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjcMaWb> ?: return
|
||||
// 由Activity显示二次确认对话框
|
||||
}
|
||||
|
||||
// 收集所有选中的子列表项(库位)
|
||||
val selectedStorageUseList = mutableListOf<com.lukouguoji.module_base.bean.GjcStorageUse>()
|
||||
list.forEach { maWb ->
|
||||
maWb.storageUseList?.filter { it.isSelected }?.let { selectedStorageUseList.addAll(it) }
|
||||
}
|
||||
|
||||
if (selectedStorageUseList.isEmpty()) {
|
||||
/**
|
||||
* 执行出库操作
|
||||
* @param selectedStorageList 选中的子列表项(库位)
|
||||
*/
|
||||
fun performOutStorage(selectedStorageList: List<com.lukouguoji.module_base.bean.GjcStorageUse>) {
|
||||
if (selectedStorageList.isEmpty()) {
|
||||
showToast("请选择要出库的库位")
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: 实现出库接口调用
|
||||
showToast("出库功能待实现")
|
||||
// 将选中的子列表项转换为RequestBody
|
||||
val params = selectedStorageList.toRequestBody()
|
||||
|
||||
launchLoadingCollect({ NetApply.api.outIntExpStorage(params) }) {
|
||||
onSuccess = {
|
||||
showToast("出库成功")
|
||||
viewModelScope.launch {
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||
}
|
||||
refresh() // 刷新列表
|
||||
}
|
||||
onFailed = { _, msg ->
|
||||
showToast(msg.noNull("出库失败"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user