feat: 开始组装 opt

This commit is contained in:
2026-01-05 12:13:31 +08:00
parent e083165553
commit c3c700c111
2 changed files with 16 additions and 9 deletions

View File

@@ -236,13 +236,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
fun loadWaitingAssembleWaybills() {
val wbNo = searchText.value?.trim() ?: ""
// 验证运单号不能为空
if (wbNo.isEmpty()) {
showToast("请输入运单号")
return
}
// 发起网络请求
// 发起网络请求(空参数时相当于刷新列表)
launchLoadingCollect({ NetApply.api.queryWaitingAssemble(wbNo) }) {
onSuccess = { result ->
// 数据转换: GjcWarehouse -> AssembleWaybillBean
@@ -447,6 +441,16 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
return
}
// 校验组装件数不能大于运单件数
val waybillPieces = waybillInfo.value?.waybillPieces?.trim() ?: ""
val assembleCountInt = assembleCount.toLongOrNull() ?: 0L
val waybillPiecesInt = waybillPieces.toLongOrNull() ?: 0L
if (assembleCountInt > waybillPiecesInt) {
showToast("组装件数不能大于运单件数")
return
}
val assembleWeight = waybillInfo.value?.assembleWeight?.trim() ?: ""
// 组装重量为非必填,不进行验证