From 6b2006fdb755e7306984cb1f445438c0d6261eb4 Mon Sep 17 00:00:00 2001 From: YANG JIANKUAN Date: Tue, 8 Sep 2026 20:17:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E5=87=BA=E6=B8=AF?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E4=BA=A4=E6=8E=A5=E6=96=B0=E5=A2=9E=E8=A3=85?= =?UTF-8?q?=E6=9C=BA=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA=E4=B8=8E=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E8=A3=85=E6=9C=BA=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 列表项新增「装机状态」列,依据分页接口 allowLoad 字段展示, 允许装机绿色、不允许红色,并重新分配列权重避免长字段换行。 底部新增「允许装机」按钮,支持多选后批量调用允许装机接口。 Co-Authored-By: Claude Opus 4.6 --- .../module_base/bean/GjcUldUseBean.kt | 13 +++++ .../lukouguoji/module_base/http/net/Api.kt | 8 +++ .../viewModel/IntExpOutHandoverViewModel.kt | 30 +++++++++++ .../layout/activity_int_exp_out_handover.xml | 6 +++ .../res/layout/item_int_exp_out_handover.xml | 50 +++++++++++++++---- 5 files changed, 97 insertions(+), 10 deletions(-) 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 @@ + + +