feat: 国际进港舱单新增开始理货按钮
- 底部「货物发放」改名为「理货完成」,「分拣理货」改名为「装机单」 - 新增蓝色「开始理货」按钮,选中唯一一条运单后弹出修改库位对话框, 提交 /IntImpManifest/modifyStorage - 弹窗默认回填该运单已有的理货库位:舱单列表接口不返回 locationTally, 改为先按 fid + wbNo 查一次装机单记录取出库位再回填 - GjjManifest 补充 locationTallyId 字段 - 装机单列表项运单号、品名列 completeSpace 调整为 5 以对齐 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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 = "" // 交接图片数量
|
||||
|
||||
@@ -481,6 +481,77 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
||||
.navigation()
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始理货(弹出修改库位对话框,提交理货库位)
|
||||
*/
|
||||
fun startTallyClick() {
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: 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<GjjManifest>,
|
||||
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()
|
||||
}
|
||||
|
||||
/**
|
||||
* 货物发放
|
||||
*/
|
||||
|
||||
@@ -274,9 +274,15 @@
|
||||
style="@style/tv_bottom_btn"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:onClick="@{()-> viewModel.sortingTallyClick()}"
|
||||
android:text="分拣理货" />
|
||||
android:text="装机单" />
|
||||
|
||||
<!-- 货物发放按钮 (红色) -->
|
||||
<TextView
|
||||
style="@style/tv_bottom_btn"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:onClick="@{()-> viewModel.startTallyClick()}"
|
||||
android:text="开始理货" />
|
||||
|
||||
<!-- 理货完成按钮 (红色) -->
|
||||
<TextView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="40dp"
|
||||
@@ -284,7 +290,7 @@
|
||||
android:background="@drawable/bg_red_btn_bottom"
|
||||
android:gravity="center"
|
||||
android:onClick="@{()-> viewModel.cargoReleaseClick()}"
|
||||
android:text="货物发放"
|
||||
android:text="理货完成"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
completeSpace="@{5}"
|
||||
android:text="运单号:"
|
||||
android:textSize="15sp" />
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
completeSpace="@{4}"
|
||||
completeSpace="@{5}"
|
||||
android:text="品名(中):"
|
||||
android:textSize="15sp" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user