diff --git a/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt index ccb0add..af2d51a 100644 --- a/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt +++ b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjcUldUseBean.kt @@ -65,6 +65,19 @@ class GjcUldUseBean : Serializable { var loadArea: String = "" // 组装区 var pc: Long = 0 // 组装件数 + var allowLoad: String = "" // 允许装机(0:不允许;1:允许) + + // 是否允许装机 + val isAllowLoad: Boolean + get() = allowLoad == "1" + + // 装机状态文本 + val allowLoadText: String + get() = when (allowLoad) { + "1" -> "允许装机" + "0" -> "不允许装机" + else -> "" + } var fillWeightFlag: String = "" // 回填状态:0-未回填,1-部分回填,2-已回填 // 回填状态文本 diff --git a/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt b/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt index 74fca48..5b2c620 100644 --- a/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt +++ b/module_base/src/main/java/com/lukouguoji/module_base/http/net/Api.kt @@ -738,6 +738,14 @@ interface Api { @POST("IntExpOutHandover/waitingTrans") suspend fun waitingTrans(@Body data: RequestBody): BaseResultBean + /** + * 国际出港出库交接-允许装机 + * 接口路径: /IntExpOutHandover/allow + * @param data 请求参数:选中的ULD列表(GjcUldUseBean 数组) + */ + @POST("IntExpOutHandover/allow") + suspend fun allowLoading(@Body data: RequestBody): BaseResultBean + /** * 国际出港-出港装载 分页查询 * 接口路径: /IntExpLoad/pageQuery diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/IntExpOutHandoverViewModel.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/IntExpOutHandoverViewModel.kt index c62d51f..f1ead8c 100644 --- a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/IntExpOutHandoverViewModel.kt +++ b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/IntExpOutHandoverViewModel.kt @@ -106,6 +106,36 @@ class IntExpOutHandoverViewModel : BasePageViewModel() { } } + /** + * 允许装机(多选,批量操作) + */ + fun allowLoadClick() { + val list = pageModel.rv?.commonAdapter()?.items as? List ?: return + val selectedItems = list.filter { it.isSelected } + + if (selectedItems.isEmpty()) { + showToast("请选择要允许装机的ULD") + return + } + + if (selectedItems.all { it.isAllowLoad }) { + showToast("所选ULD均已允许装机") + return + } + + val requestData = selectedItems.toRequestBody() + + launchLoadingCollect({ NetApply.api.allowLoading(requestData) }) { + onSuccess = { + showToast("允许装机成功") + viewModelScope.launch { + FlowBus.with(ConstantEvent.EVENT_REFRESH).emit("refresh") + } + refresh() + } + } + } + /** * 待配运按钮点击 */ diff --git a/module_gjc/src/main/res/layout/activity_int_exp_out_handover.xml b/module_gjc/src/main/res/layout/activity_int_exp_out_handover.xml index a78b0ba..7103831 100644 --- a/module_gjc/src/main/res/layout/activity_int_exp_out_handover.xml +++ b/module_gjc/src/main/res/layout/activity_int_exp_out_handover.xml @@ -173,6 +173,12 @@ + + + @@ -77,7 +77,7 @@ @@ -100,7 +100,7 @@ @@ -123,7 +123,7 @@ @@ -146,7 +146,7 @@ @@ -165,6 +165,30 @@ + + + + + + + + + @@ -179,7 +203,7 @@ @@ -202,7 +226,7 @@ @@ -225,7 +249,7 @@ @@ -249,7 +273,7 @@ @@ -272,7 +296,7 @@ @@ -291,6 +315,12 @@ + + +