feat: passageWay for api

This commit is contained in:
2025-12-08 19:15:22 +08:00
parent a3b8746264
commit 6ebedc7366
3 changed files with 9 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ class GjcWeighingRecordDetailsViewModel : BaseViewModel() {
waybillBean.value = it
// 提取运单信息字段
waybillNo.value = "${it.prefix}-${it.no}"
waybillNo.value = it.wbNo
prePc.value = it.pc.toString()
preWeight.value = it.weight.toString()
goodsName.value = it.goodsCn
@@ -136,7 +136,7 @@ class GjcWeighingRecordDetailsViewModel : BaseViewModel() {
// 计算重量误差百分比
val preWeightValue = preWeight.value?.toDoubleOrNull() ?: 0.0
val error = if (preWeightValue > 0) {
val error = if (sumWeight > 0 && preWeightValue > 0) {
((sumWeight - preWeightValue) / preWeightValue * 100)
} else {
0.0

View File

@@ -262,9 +262,11 @@ class GjcWeighingStartViewModel : BaseViewModel() {
arrivePc = this@GjcWeighingStartViewModel.arrivePc.value?.toLongOrNull() ?: arrivePc
arriveWeight = this@GjcWeighingStartViewModel.arriveWeight.value?.toDoubleOrNull() ?: arriveWeight
arriveVolume = this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume
// 添加通道号
passageWay = this@GjcWeighingStartViewModel.channel.value
}
// 3. 构建请求数据GjcMaWb转RequestBody
// 3. 构建请求数据GjcMaWb转RequestBody,包含通道号
val params = bean.toRequestBody(removeEmptyOrNull = true)
// 4. 调用接口
@@ -318,7 +320,7 @@ class GjcWeighingStartViewModel : BaseViewModel() {
val arriveWeightVal = arriveWeight.value?.toDoubleOrNull() ?: bean.arriveWeight
val arriveVolumeVal = arriveVolume.value?.toDoubleOrNull() ?: bean.arriveVolume
// 提交数据到接口
// 提交数据到接口(添加通道号参数)
val params = mapOf(
"maWbId" to bean.maWbId,
"no" to bean.no,
@@ -347,7 +349,8 @@ class GjcWeighingStartViewModel : BaseViewModel() {
"businessType" to bean.businessType,
"carId" to bean.carId,
"remark" to bean.remark,
"checkIn" to "1" // 收运状态设置为已收运
"checkIn" to "1", // 收运状态设置为已收运
"passageWay" to channel.value // 通道号参数
).toRequestBody(removeEmptyOrNull = true)
launchLoadingCollect({