feat: 国际进港仓库修改库位功能优化
- 修改库位弹窗打开时预填充当前库位 - 已出库分单拦截修改库位操作并提示 - 修复主单列表入库时间字段绑定错误(opDate→inDate) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -110,8 +110,16 @@ class IntImpStorageUseActivity :
|
||||
|
||||
val selectedStorage = selectedStorageUseList[0]
|
||||
|
||||
// 弹出库位选择弹框,选择后再调用接口
|
||||
IntImpModifyStorageDialogModel { dialog ->
|
||||
// 已出库的分单不允许修改库位
|
||||
if (!selectedStorage.outOpId.isNullOrEmpty() || !selectedStorage.outDate.isNullOrEmpty()) {
|
||||
showToast("该分单已出库,不允许修改库位")
|
||||
return
|
||||
}
|
||||
|
||||
// 弹出库位选择弹框,选择后再调用接口,传入当前库位ID以预填充
|
||||
IntImpModifyStorageDialogModel(
|
||||
currentLocationId = selectedStorage.locationId?.toString() ?: ""
|
||||
) { dialog ->
|
||||
val locationName = dialog.locationName
|
||||
val locationId = dialog.locationId
|
||||
viewModel.performModifyStorage(locationName, locationId, selectedStorage)
|
||||
|
||||
@@ -15,6 +15,7 @@ import dev.utils.app.info.KeyValue
|
||||
* 国际进港 - 修改库位对话框
|
||||
*/
|
||||
class IntImpModifyStorageDialogModel(
|
||||
private val currentLocationId: String = "",
|
||||
private val callback: (IntImpModifyStorageDialogModel) -> Unit
|
||||
) : BaseDialogModel<DialogIntImpModifyStorageBinding>(DIALOG_TYPE_CENTER) {
|
||||
|
||||
@@ -54,6 +55,10 @@ class IntImpModifyStorageDialogModel(
|
||||
onSuccess = { result ->
|
||||
val list = result.data?.map { it.toKeyValue() } ?: emptyList()
|
||||
locationList.value = list
|
||||
// 列表加载完成后,预选当前库位
|
||||
if (currentLocationId.isNotEmpty()) {
|
||||
selectedLocationCode.value = currentLocationId
|
||||
}
|
||||
}
|
||||
onFailed = { _, msg ->
|
||||
showToast(msg ?: "加载库位列表失败")
|
||||
|
||||
@@ -266,7 +266,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.opDate}"
|
||||
android:text="@{bean.inDate}"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user