Explorar o código

2024-04-29 修改

修改

1. 地接费用录入详情界面 BUG修复
zhaiy hai 1 ano
pai
achega
a8457fe7f0

+ 11 - 4
app/src/main/java/com/pan_american/android/ui/group_op/ground_convey_payment_insert/GroundConveyPaymentDetailActivity.kt

@@ -432,13 +432,18 @@ class GroundConveyPaymentDetailActivity : BaseActivity<ActivityGroundConveyPayme
 
                                     if (isChecked) {
                                         isChecked = false
-
                                         checkedItemId.remove(id)
 
+                                        showItemList.clear()
+
                                         for ((i, item) in carTouristGuides.withIndex()) {
                                             if (item.sId == id) {
                                                 totalPrice -= carTouristGuides[i].price * carTouristGuides[i].count
                                             }
+
+                                            if (checkedItemId.contains(item.sId)) {
+                                                showItemList.add(item)
+                                            }
                                         }
 
                                         showItemList.removeIf { item ->
@@ -449,12 +454,14 @@ class GroundConveyPaymentDetailActivity : BaseActivity<ActivityGroundConveyPayme
                                         isChecked = true
                                         checkedItemId.add(id)
 
+                                        showItemList.clear()
+
                                         for ((i, item) in carTouristGuides.withIndex()) {
                                             if (item.sId == id) {
                                                 totalPrice += carTouristGuides[i].price * carTouristGuides[i].count
                                             }
 
-                                            if (checkedItemId.contains(id)) {
+                                            if (checkedItemId.contains(item.sId)) {
                                                 showItemList.add(item)
                                             }
                                         }
@@ -720,11 +727,11 @@ class GroundConveyPaymentDetailActivity : BaseActivity<ActivityGroundConveyPayme
         }
 
         override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
-            return oldList[oldItemPosition] == newList[newItemPosition]
+            return oldList[oldItemPosition].id == newList[newItemPosition].id
         }
 
         override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
-            return oldList[oldItemPosition] == newList[newItemPosition]
+            return oldList[oldItemPosition].id == newList[newItemPosition].id
         }
 
     }