feat: 国际出港 出港计重 分托

This commit is contained in:
2025-12-08 15:48:32 +08:00
parent 9149d1ad35
commit 37ffc539c9
4 changed files with 61 additions and 7 deletions

View File

@@ -686,6 +686,13 @@ interface Api {
@POST("IntExpCheckIn/completeCheckIn") @POST("IntExpCheckIn/completeCheckIn")
suspend fun completeCheckIn(@Body data: RequestBody): BaseResultBean<Boolean> suspend fun completeCheckIn(@Body data: RequestBody): BaseResultBean<Boolean>
/**
* 国际出港待计重-开始计重-分托计重
* 接口路径: /IntExpCheckIn/splitCheckIn
*/
@POST("IntExpCheckIn/splitCheckIn")
suspend fun splitCheckIn(@Body data: RequestBody): BaseResultBean<Long>
/** /**
* 国际出港计重明细-根据运单号查询所有计重记录 * 国际出港计重明细-根据运单号查询所有计重记录
* 接口路径: /IntExpCheckIn/listRecordByWh * 接口路径: /IntExpCheckIn/listRecordByWh

View File

@@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_container" android:id="@+id/ll_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="42dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="4dp"
android:focusableInTouchMode="false" android:focusableInTouchMode="false"
android:focusable="false" android:focusable="false"
android:clickable="false" android:clickable="false"

View File

@@ -230,11 +230,57 @@ class GjcWeighingStartViewModel : BaseViewModel() {
} }
/** /**
* 分计重按钮点击 * 分计重按钮点击
*/ */
fun sortingWeighingClick() { fun sortingWeighingClick() {
showToast("分拣计重功能开发中") val bean = maWbBean.value ?: return
// TODO: 实现分拣计重功能
// 1. 验证必填字段
if (bean.no.verifyNullOrEmpty("请输入运单号")) return
if (bean.fno.verifyNullOrEmpty("请输入航班号")) return
if (channel.value.verifyNullOrEmpty("请选择通道号")) return
// 2. 收集当前表单数据,更新到 bean
bean.apply {
// 更新运抵数据(如果用户已编辑)
arrivePc = this@GjcWeighingStartViewModel.arrivePc.value?.toLongOrNull() ?: arrivePc
arriveWeight = this@GjcWeighingStartViewModel.arriveWeight.value?.toDoubleOrNull() ?: arriveWeight
arriveVolume = this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume
}
// 3. 构建请求数据GjcMaWb转RequestBody
val params = bean.toRequestBody(removeEmptyOrNull = true)
// 4. 调用接口
launchLoadingCollect({
NetApply.api.splitCheckIn(params)
}) {
onSuccess = { result ->
if (result.verifySuccess()) {
showToast("分托计重成功")
// 发送刷新事件
viewModelScope.launch {
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
}
// 刷新实时计重数据第5行的只读字段
loadRealTimeRecord()
// 清空表单字段,等待下一次计重
arrivePc.value = ""
arriveWeight.value = ""
arriveVolume.value = ""
maWbBean.value = maWbBean.value?.apply {
carId = null
remark = null
}
carWeight.value = "0"
} else {
showToast(result.msg.noNull("分托计重失败"))
}
}
}
} }
/** /**
@@ -246,6 +292,7 @@ class GjcWeighingStartViewModel : BaseViewModel() {
// 验证必填字段 // 验证必填字段
if (bean.no.verifyNullOrEmpty("请输入运单号")) return if (bean.no.verifyNullOrEmpty("请输入运单号")) return
if (bean.fno.verifyNullOrEmpty("请输入航班号")) return if (bean.fno.verifyNullOrEmpty("请输入航班号")) return
if (channel.value.verifyNullOrEmpty("请选择通道号")) return
// 从编辑字段获取数值 // 从编辑字段获取数值
val pc = realTimePc.value?.toLongOrNull() ?: bean.pc val pc = realTimePc.value?.toLongOrNull() ?: bean.pc

View File

@@ -36,7 +36,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_white_radius_8" android:background="@drawable/bg_white_radius_8"
android:orientation="vertical" android:orientation="vertical"
android:padding="15dp"> android:padding="8dp">
<!-- 第一部分前2行表单左侧2列+ 地磅称重(右侧) --> <!-- 第一部分前2行表单左侧2列+ 地磅称重(右侧) -->
<LinearLayout <LinearLayout
@@ -62,7 +62,7 @@
title='@{"运单号"}' title='@{"运单号"}'
titleLength="@{5}" titleLength="@{5}"
type="@{DataLayoutType.INPUT}" type="@{DataLayoutType.INPUT}"
value='@={viewModel.maWbBean.no}' value='@={viewModel.maWbBean.wbNo}'
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />