From f312ef866c91362b3a8d5bd70675298e2954d13c Mon Sep 17 00:00:00 2001 From: YANG JIANKUAN Date: Fri, 28 Aug 2026 16:19:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E9=99=85=E8=BF=9B=E6=B8=AF?= =?UTF-8?q?=E8=88=B1=E5=8D=95=E6=96=B0=E5=A2=9E=E5=BC=80=E5=A7=8B=E7=90=86?= =?UTF-8?q?=E8=B4=A7=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 底部「货物发放」改名为「理货完成」,「分拣理货」改名为「装机单」 - 新增蓝色「开始理货」按钮,选中唯一一条运单后弹出修改库位对话框, 提交 /IntImpManifest/modifyStorage - 弹窗默认回填该运单已有的理货库位:舱单列表接口不返回 locationTally, 改为先按 fid + wbNo 查一次装机单记录取出库位再回填 - GjjManifest 补充 locationTallyId 字段 - 装机单列表项运单号、品名列 completeSpace 调整为 5 以对齐 Co-Authored-By: Claude Opus 5 (1M context) --- .../module_base/bean/GjjManifest.kt | 1 + .../gjj/viewModel/IntImpManifestViewModel.kt | 89 +++++++++++++++++-- .../res/layout/activity_int_imp_manifest.xml | 12 ++- .../res/layout/item_int_imp_loading_list.xml | 4 +- 4 files changed, 92 insertions(+), 14 deletions(-) diff --git a/module_base/src/main/java/com/lukouguoji/module_base/bean/GjjManifest.kt b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjjManifest.kt index aa1d9eb..bfbb612 100644 --- a/module_base/src/main/java/com/lukouguoji/module_base/bean/GjjManifest.kt +++ b/module_base/src/main/java/com/lukouguoji/module_base/bean/GjjManifest.kt @@ -60,6 +60,7 @@ data class GjjManifest( var unNumber: String = "", // 危险品编号 var activeId: Long = 0, // 活动ID var locationTally: String = "", // 理货库位号 + var locationTallyId: Long = 0, // 理货库位ID var pic: String = "", // 交接图片缩略图路径 var originalPic: String = "", // 交接图片原图地址 var picNumber: String = "" // 交接图片数量 diff --git a/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpManifestViewModel.kt b/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpManifestViewModel.kt index 43e586d..65ee829 100644 --- a/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpManifestViewModel.kt +++ b/module_gjj/src/main/java/com/lukouguoji/gjj/viewModel/IntImpManifestViewModel.kt @@ -125,15 +125,15 @@ class IntImpManifestViewModel : BasePageViewModel() { // ========== 全选状态 ========== val isAllChecked = MutableLiveData(false) - - fun onItemCheckChanged() { - updateCheckAllStatus() - } - - fun updateCheckAllStatus() { - val list = pageModel.rv?.commonAdapter()?.items as? List ?: return - isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() } - } + + fun onItemCheckChanged() { + updateCheckAllStatus() + } + + fun updateCheckAllStatus() { + val list = pageModel.rv?.commonAdapter()?.items as? List ?: return + isAllChecked.value = list.isNotEmpty() && list.all { it.checked.get() } + } // ========== 展开/收起 ========== val isAllExpanded = MutableLiveData(false) @@ -481,6 +481,77 @@ class IntImpManifestViewModel : BasePageViewModel() { .navigation() } + /** + * 开始理货(弹出修改库位对话框,提交理货库位) + */ + fun startTallyClick() { + val list = pageModel.rv?.commonAdapter()?.items as? List ?: return + val selectedItems = list.filter { it.isSelected } + + if (selectedItems.isEmpty()) { + showToast("请选择要理货的运单") + return + } + if (selectedItems.size > 1) { + showToast("只能选择一个运单") + return + } + + // 舱单列表接口不返回理货库位,需先查装机单记录取出该运单已有的库位再弹窗回填 + val selectedItem = selectedItems.first() + val queryParams = mapOf( + "fid" to fid.ifEmpty { null }, + "fdep" to fdep.ifEmpty { null }, + "wbNo" to selectedItem.wbNo.ifEmpty { null }, + "pageNum" to 1, + "pageSize" to 1 + ).toRequestBody() + + launchLoadingCollect({ NetApply.api.getIntImpLoadingList(queryParams) }) { + onSuccess = { result -> + val tallyRecord = result.list?.firstOrNull() + showModifyStorageDialog( + selectedItems = selectedItems, + currentLocationId = tallyRecord?.locationTallyId?.takeIf { it > 0 }?.toString() ?: "", + currentLocationName = tallyRecord?.locationTally ?: "" + ) + } + // 查询失败不阻断操作,直接弹出空白库位的对话框 + onFailed = { _, _ -> showModifyStorageDialog(selectedItems, "", "") } + } + } + + /** + * 弹出修改库位对话框并提交(currentLocation* 用于回填该运单已有的理货库位) + */ + private fun showModifyStorageDialog( + selectedItems: List, + currentLocationId: String, + currentLocationName: String + ) { + IntImpModifyStorageDialogModel( + currentLocationId = currentLocationId, + currentLocationName = currentLocationName + ) { dialog -> + val params = mapOf( + "location" to dialog.locationName, + "locationId" to dialog.locationId.toLongOrNull(), + "manifestList" to selectedItems + ).toRequestBody() + + launchLoadingCollect({ NetApply.api.modifyIntImpLoadingStorage(params) }) { + onSuccess = { + if (it.verifySuccess()) { + showToast(it.msg.noNull("修改库位成功")) + refresh() + } else { + showToast(it.msg.noNull("修改库位失败")) + } + } + } + }.show() + } + /** * 货物发放 */ diff --git a/module_gjj/src/main/res/layout/activity_int_imp_manifest.xml b/module_gjj/src/main/res/layout/activity_int_imp_manifest.xml index 550b04f..be51231 100644 --- a/module_gjj/src/main/res/layout/activity_int_imp_manifest.xml +++ b/module_gjj/src/main/res/layout/activity_int_imp_manifest.xml @@ -274,9 +274,15 @@ style="@style/tv_bottom_btn" android:layout_marginEnd="15dp" android:onClick="@{()-> viewModel.sortingTallyClick()}" - android:text="分拣理货" /> + android:text="装机单" /> - + + + diff --git a/module_gjj/src/main/res/layout/item_int_imp_loading_list.xml b/module_gjj/src/main/res/layout/item_int_imp_loading_list.xml index 97ccd28..15d1e0a 100644 --- a/module_gjj/src/main/res/layout/item_int_imp_loading_list.xml +++ b/module_gjj/src/main/res/layout/item_int_imp_loading_list.xml @@ -67,7 +67,7 @@ @@ -194,7 +194,7 @@