From d600cbe4f16890992066a035192535801f2b4225 Mon Sep 17 00:00:00 2001 From: YANG JIANKUAN Date: Tue, 16 Dec 2025 09:06:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20opt=20=E5=87=BA=E6=B8=AF=E8=AE=A1?= =?UTF-8?q?=E9=87=8D=20=E5=AE=8C=E6=88=90=E8=AE=A1=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewModel/GjcWeighingStartViewModel.kt | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcWeighingStartViewModel.kt b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcWeighingStartViewModel.kt index 7447085..9811fc7 100644 --- a/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcWeighingStartViewModel.kt +++ b/module_gjc/src/main/java/com/lukouguoji/gjc/viewModel/GjcWeighingStartViewModel.kt @@ -190,7 +190,10 @@ class GjcWeighingStartViewModel : BaseViewModel() { * 航班日期点击 */ fun flightDateClick(view: View) { - Common.onYearMonthDay(view.context.getActivity(), maWbBean.value?.fdate?.formatDate()) { year, month, day -> + Common.onYearMonthDay( + view.context.getActivity(), + maWbBean.value?.fdate?.formatDate() + ) { year, month, day -> val calendar = Calendar.getInstance() calendar.set(year, month - 1, day) val date = calendar.time @@ -260,8 +263,10 @@ class GjcWeighingStartViewModel : BaseViewModel() { bean.apply { // 更新运抵数据(如果用户已编辑) arrivePc = this@GjcWeighingStartViewModel.arrivePc.value?.toLongOrNull() ?: arrivePc - arriveWeight = this@GjcWeighingStartViewModel.arriveWeight.value?.toDoubleOrNull() ?: arriveWeight - arriveVolume = this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume + arriveWeight = + this@GjcWeighingStartViewModel.arriveWeight.value?.toDoubleOrNull() ?: arriveWeight + arriveVolume = + this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume // 添加通道号 passageWay = this@GjcWeighingStartViewModel.channel.value } @@ -313,9 +318,6 @@ class GjcWeighingStartViewModel : BaseViewModel() { if (channel.value.verifyNullOrEmpty("请选择通道号")) return // 从编辑字段获取数值 - val pc = realTimePc.value?.toLongOrNull() ?: bean.pc - val weight = realTimeWeight.value?.toDoubleOrNull() ?: bean.weight - val volume = realTimeVolume.value?.toDoubleOrNull() ?: bean.volume val arrivePcVal = arrivePc.value?.toLongOrNull() ?: bean.arrivePc val arriveWeightVal = arriveWeight.value?.toDoubleOrNull() ?: bean.arriveWeight val arriveVolumeVal = arriveVolume.value?.toDoubleOrNull() ?: bean.arriveVolume @@ -337,9 +339,9 @@ class GjcWeighingStartViewModel : BaseViewModel() { "dest" to bean.dest, "dest1" to bean.dest1, "dest2" to bean.dest2, - "pc" to pc, - "weight" to weight, - "volume" to volume, + "pc" to bean.pc, + "weight" to bean.weight, + "volume" to bean.volume, "arrivePc" to arrivePcVal, "arriveWeight" to arriveWeightVal, "arriveVolume" to arriveVolumeVal, @@ -385,9 +387,11 @@ class GjcWeighingStartViewModel : BaseViewModel() { Constant.RequestCode.WAYBILL -> { maWbBean.value = maWbBean.value?.apply { no = content } } + Constant.RequestCode.FLIGHT_NO -> { maWbBean.value = maWbBean.value?.apply { fno = content } } + Constant.RequestCode.CAR -> { maWbBean.value = maWbBean.value?.apply { carId = content } // 查询托盘车自重