feat: fix bugs

This commit is contained in:
2026-01-26 16:22:27 +08:00
parent 5e1e9e58a2
commit 8e2f584f3a
13 changed files with 32 additions and 23 deletions

View File

@@ -198,7 +198,7 @@ class GjcAssembleWeightEditViewModel : BaseViewModel() {
NetApply.api.updateIntExpAssemble(records.toRequestBody())
}) {
onSuccess = { result ->
if (result.data == true) {
if (result.verifySuccess()) {
showToast("保存成功")
// 发送刷新事件通知列表页
viewModelScope.launch {

View File

@@ -312,7 +312,8 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
bean.uld = uldNo.value ?: ""
bean.fno = flightNo.value ?: ""
bean.fdate = flightDate.value ?: ""
bean.passageway = channel.value ?: ""
bean.passageway = passagewayList.value?.firstOrNull{ it.value == channel.value }?.key ?: ""
bean.passagewayId = channel.value ?: ""
// 验证必填字段
if (bean.carId.verifyNullOrEmpty("请输入架子车号")) return
@@ -329,6 +330,7 @@ class GjcBoxWeighingAddViewModel : BaseViewModel() {
val baseParams = mutableMapOf(
"carId" to bean.carId,
"passageway" to bean.passageway,
"passagewayId" to bean.passagewayId,
"uld" to bean.uld,
"dgrCode" to bean.dgrCode,
"boardType" to bean.boardType,

View File

@@ -13,7 +13,7 @@ import com.lukouguoji.module_base.ktx.launchLoadingCollect
import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel
import dev.utils.common.DateUtils
import com.lukouguoji.module_base.ktx.formatDate
import com.lukouguoji.module_base.ktx.formatDate
/**
* 国际出港板箱过磅 ViewModel
@@ -33,7 +33,8 @@ class GjcBoxWeighingViewModel : BasePageViewModel() {
// 统计数据
val totalCount = MutableLiveData("0") // 合计票数
val totalPc = MutableLiveData("0") // 总件数
val totalPc = MutableLiveData("0")
val cargoWeight = MutableLiveData("0")// 总件数
val totalWeight = MutableLiveData("0") // 总重量
///////////////////////////////////////////////////////////////////////////
@@ -116,6 +117,7 @@ class GjcBoxWeighingViewModel : BasePageViewModel() {
val data = result.data
totalCount.value = (data?.wbNumber ?: 0).toString()
totalPc.value = (data?.totalPc ?: 0).toString()
cargoWeight.value = (data?.cargoWeight ?: 0).toString()
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
}
}

View File

@@ -374,7 +374,8 @@ class GjcWeighingStartViewModel : BaseViewModel() {
arriveVolume =
this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume
// 添加通道号
passageWay = this@GjcWeighingStartViewModel.channel.value
passageWay = this@GjcWeighingStartViewModel.channelList.value?.firstOrNull{ it.value == channel.value }?.key ?: ""
passageWayId = this@GjcWeighingStartViewModel.channel.value
remark = pageRemark.value
}
@@ -472,7 +473,8 @@ class GjcWeighingStartViewModel : BaseViewModel() {
"carId" to bean.carId,
"remark" to pageRemark.value,
"checkIn" to "1", // 收运状态设置为已收运
"passageWay" to channel.value // 通道号参数
"passageWayId" to channel.value, // 通道号参数
"passageWay" to (channelList.value?.firstOrNull{ it.value == channel.value }?.key ?: "")
).toRequestBody(removeEmptyOrNull = true)
launchLoadingCollect({