修改自采订单删除逻辑
This commit is contained in:
@@ -230,8 +230,19 @@ class SelfProcurementViewModel @Inject constructor(
|
||||
|
||||
// 删除订单
|
||||
fun removePurchaseOrder(orderId: Int) {
|
||||
_purchaseList.update { current ->
|
||||
current.filterNot { it.goodsId == orderId }
|
||||
_purchaseList.update { currentList ->
|
||||
currentList.filterNot { it.goodsId == orderId }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据位置删除物品
|
||||
*/
|
||||
fun removePurchaseOrderByIndex(index: Int) {
|
||||
_purchaseList.update { currentList ->
|
||||
currentList.toMutableList().apply {
|
||||
removeAt(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user