修改自采订单删除逻辑

This commit is contained in:
zxj
2025-07-15 17:27:07 +08:00
parent 84a337bae4
commit 5874e4ed9a
5 changed files with 32 additions and 14 deletions
@@ -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)
}
}
}