fix: 开始组装

This commit is contained in:
2026-02-05 17:23:56 +08:00
parent b84dc9a816
commit d26f164736
3 changed files with 7 additions and 1 deletions

View File

@@ -145,6 +145,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
onSuccess = { result ->
val list = result.data?.mapIndexed { index, dictBean ->
AssemblePositionBean().apply {
positionCode = dictBean.code // 保存位置编码/ID
positionName = dictBean.name
isSelected = (index == 0) // 默认选中第一项
}
@@ -569,6 +570,8 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
return
}
val loadAreaId = selectedPosition.value?.positionCode?.trim() ?: ""
// 2. 构建useInfoULD信息
val useInfo = mapOf(
"uld" to uldNo,
@@ -579,6 +582,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
else -> ""
},
"loadArea" to loadArea,
"loadAreaId" to loadAreaId.ifEmpty { null }, // 组装位置ID
"useId" to if (uldInfo.value?.useId == 0L) null else uldInfo.value?.useId // 添加useId来自getUld接口
)
@@ -644,6 +648,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
"consumeWeight" to materialWeight.toDoubleOrNull(),
"ldId" to operatorValue,
"loadArea" to loadArea,
"loadAreaId" to loadAreaId.ifEmpty { null }, // 组装位置ID
"useInfo" to useInfo,
"wbInfo" to wbInfo,
"userId" to SharedPreferenceUtil.getString(Constant.Share.account)