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

View File

@@ -167,10 +167,13 @@
<!-- 选择列占位 --> <!-- 选择列占位 -->
<Space <TextView
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" /> android:gravity="center"
android:text="选择"
android:textColor="@color/text_normal"
android:textSize="13sp" />
<!-- 运单号 --> <!-- 运单号 -->
<TextView <TextView