修改自采订单删除逻辑
This commit is contained in:
@@ -320,7 +320,7 @@ private fun AdjustedViewItem(purchaseOrder: GoodsInfo, viewModel: ReceiptViewMod
|
||||
Row {
|
||||
Text("采购量:", style = gray96a0aaTextStyle)
|
||||
Text(
|
||||
"${purchaseOrder.receiveCountStr}${purchaseOrder.unitNameStr}",
|
||||
"${purchaseOrder.receiveCountListStr}${purchaseOrder.unitNameStr}",
|
||||
style = black141428TextStyle
|
||||
)
|
||||
}
|
||||
|
||||
@@ -203,8 +203,9 @@ private fun ContentLeftView(
|
||||
.background(
|
||||
color = Color.White.copy(alpha = 0.37f),
|
||||
shape = RoundedCornerShape(10.dp) // 圆角背景
|
||||
), productList = productList, showClose = true, onCloseClick = {
|
||||
viewModel.removePurchaseOrder(it.goodsId)
|
||||
), productList = productList, showClose = true, onCloseClick = { index, it ->
|
||||
|
||||
viewModel.removePurchaseOrderByIndex(index)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
@@ -37,7 +37,7 @@ fun SelfProcurementListItem(
|
||||
checkedItem: PurchaseWarehouseParam? = null,
|
||||
onItemCheckedClick: (PurchaseWarehouseParam) -> Unit = {},
|
||||
showClose: Boolean = false,
|
||||
onCloseClick: (PurchaseWarehouseParam) -> Unit = {},
|
||||
onCloseClick: (Int, PurchaseWarehouseParam) -> Unit,
|
||||
) {
|
||||
Column(
|
||||
modifier = modifier
|
||||
@@ -82,12 +82,13 @@ fun SelfProcurementListItem(
|
||||
// Spacer(modifier = Modifier.height(31.dp))
|
||||
// 左侧列表
|
||||
LazyColumn() {
|
||||
items(
|
||||
items = productList,
|
||||
// 取消key,列表中可以插入同一物品
|
||||
// key = { it.goodsId }
|
||||
) { it ->
|
||||
|
||||
itemsIndexed(items = productList)
|
||||
// items(
|
||||
// items = productList,
|
||||
// // 取消key,列表中可以插入同一物品
|
||||
//// key = { it.goodsId }
|
||||
// )
|
||||
{ index, it ->
|
||||
val checkedBg =
|
||||
if (it.goodsId == checkedItem?.goodsId) Gray_DCDCF0 else Color.Transparent
|
||||
Row(
|
||||
@@ -127,7 +128,7 @@ fun SelfProcurementListItem(
|
||||
modifier = Modifier
|
||||
.size(48.dp)
|
||||
.clickable {
|
||||
onCloseClick(it)
|
||||
onCloseClick(index, it)
|
||||
},
|
||||
painter = painterResource(R.mipmap.ic_delete),
|
||||
contentDescription = "删除"
|
||||
|
||||
Reference in New Issue
Block a user