添加物品单位功能
This commit is contained in:
@@ -193,13 +193,6 @@ class SelfProcurementViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateAddPurchaseUnitDialog(show: Boolean) {
|
|
||||||
_showAddPurchaseUnitDialog.value = show
|
|
||||||
if (!show) {
|
|
||||||
_goodsAddUnitParam.value = GoodsPurchaseUnitParam()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun updateSelectedItem(purchaseOrder: PurchaseWarehouseParam?) {
|
fun updateSelectedItem(purchaseOrder: PurchaseWarehouseParam?) {
|
||||||
if (purchaseOrder != null) {
|
if (purchaseOrder != null) {
|
||||||
if (purchaseOrder.goodsCount != 0.0) {
|
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?) {
|
fun updateGoodsPurchaseUnit(goodsPurchaseUnitParam: GoodsPurchaseUnitParam?) {
|
||||||
if (goodsPurchaseUnitParam == null) {
|
if (goodsPurchaseUnitParam == null) {
|
||||||
_dropdownTextChange.value = true
|
|
||||||
_goodsAddUnitParam.value = GoodsPurchaseUnitParam()
|
_goodsAddUnitParam.value = GoodsPurchaseUnitParam()
|
||||||
} else {
|
} else {
|
||||||
val hasUnitId = GlobalData.unitTypeList.any { it.id == goodsPurchaseUnitParam.unitId }
|
|
||||||
_dropdownTextChange.value = !hasUnitId
|
|
||||||
_goodsAddUnitParam.value = goodsPurchaseUnitParam
|
_goodsAddUnitParam.value = goodsPurchaseUnitParam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user