From 1ac73df8d9b32efe0db1ff66755e37323c1b7678 Mon Sep 17 00:00:00 2001 From: zxj <275873859@qq.com> Date: Tue, 5 Aug 2025 16:57:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=A9=E5=93=81=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewmodel/SelfProcurementViewModel.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/sw/inbound/viewmodel/SelfProcurementViewModel.kt b/app/src/main/java/com/sw/inbound/viewmodel/SelfProcurementViewModel.kt index 0576b58..b246eea 100644 --- a/app/src/main/java/com/sw/inbound/viewmodel/SelfProcurementViewModel.kt +++ b/app/src/main/java/com/sw/inbound/viewmodel/SelfProcurementViewModel.kt @@ -193,13 +193,6 @@ class SelfProcurementViewModel @Inject constructor( } } - fun updateAddPurchaseUnitDialog(show: Boolean) { - _showAddPurchaseUnitDialog.value = show - if (!show) { - _goodsAddUnitParam.value = GoodsPurchaseUnitParam() - } - } - fun updateSelectedItem(purchaseOrder: PurchaseWarehouseParam?) { if (purchaseOrder != null) { if (purchaseOrder.goodsCount != 0.0) { @@ -388,13 +381,20 @@ class SelfProcurementViewModel @Inject constructor( } } + fun updateAddPurchaseUnitDialog(show: Boolean) { + _showAddPurchaseUnitDialog.value = show + if (show) { + val hasUnitId = GlobalData.unitTypeList.any { it.id == _selectedItem.value?.kcUnitId } + _dropdownTextChange.value = !hasUnitId + } else { + _goodsAddUnitParam.value = GoodsPurchaseUnitParam() + } + } + fun updateGoodsPurchaseUnit(goodsPurchaseUnitParam: GoodsPurchaseUnitParam?) { if (goodsPurchaseUnitParam == null) { - _dropdownTextChange.value = true _goodsAddUnitParam.value = GoodsPurchaseUnitParam() } else { - val hasUnitId = GlobalData.unitTypeList.any { it.id == goodsPurchaseUnitParam.unitId } - _dropdownTextChange.value = !hasUnitId _goodsAddUnitParam.value = goodsPurchaseUnitParam } }