feat: 国际出港 出港计重 分托
This commit is contained in:
@@ -686,6 +686,13 @@ interface Api {
|
||||
@POST("IntExpCheckIn/completeCheckIn")
|
||||
suspend fun completeCheckIn(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||
|
||||
/**
|
||||
* 国际出港待计重-开始计重-分托计重
|
||||
* 接口路径: /IntExpCheckIn/splitCheckIn
|
||||
*/
|
||||
@POST("IntExpCheckIn/splitCheckIn")
|
||||
suspend fun splitCheckIn(@Body data: RequestBody): BaseResultBean<Long>
|
||||
|
||||
/**
|
||||
* 国际出港计重明细-根据运单号查询所有计重记录
|
||||
* 接口路径: /IntExpCheckIn/listRecordByWh
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="42dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_margin="4dp"
|
||||
android:focusableInTouchMode="false"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
|
||||
@@ -230,11 +230,57 @@ class GjcWeighingStartViewModel : BaseViewModel() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 分拣计重按钮点击
|
||||
* 分托计重按钮点击
|
||||
*/
|
||||
fun sortingWeighingClick() {
|
||||
showToast("分拣计重功能开发中")
|
||||
// TODO: 实现分拣计重功能
|
||||
val bean = maWbBean.value ?: return
|
||||
|
||||
// 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.fno.verifyNullOrEmpty("请输入航班号")) return
|
||||
if (channel.value.verifyNullOrEmpty("请选择通道号")) return
|
||||
|
||||
// 从编辑字段获取数值
|
||||
val pc = realTimePc.value?.toLongOrNull() ?: bean.pc
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_white_radius_8"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
android:padding="8dp">
|
||||
|
||||
<!-- 第一部分:前2行表单(左侧2列)+ 地磅称重(右侧) -->
|
||||
<LinearLayout
|
||||
@@ -62,7 +62,7 @@
|
||||
title='@{"运单号"}'
|
||||
titleLength="@{5}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.maWbBean.no}'
|
||||
value='@={viewModel.maWbBean.wbNo}'
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
Reference in New Issue
Block a user