Quellcode durchsuchen

2024-09-23 修改

修改:
1. 部分UI逻辑修改
zhaiy vor 6 Monaten
Ursprung
Commit
ff13b8ab92

+ 2 - 0
app/src/main/java/com/pan_american/android/data/model/personnel_module/materials_operate/adapter/MaterialListAdapter.kt

@@ -78,6 +78,8 @@ class MaterialListAdapter(private val list: ArrayList<MaterialListItem>): Recycl
             } else {
                 deleteButton.visibility = View.GONE
             }
+
+            remark.isEnabled(false)
         }
     }
 

+ 24 - 11
app/src/main/java/com/pan_american/android/ui/personnel_module/materials_operate/MaterialOperateActivity.kt

@@ -103,6 +103,13 @@ class MaterialOperateActivity : BaseActivity<ActivityMaterialOperateBinding>() {
 
                         OASystem.materialBaseData = dataSourceResponse.data.goodsTypeData
 
+                        materialSearchRequest.apply {
+                            pageIndex = 1
+                            pageSize = 10
+                        }
+
+                        materialSearch(1)
+
                         initEvents()
 
                     } else {
@@ -254,7 +261,7 @@ class MaterialOperateActivity : BaseActivity<ActivityMaterialOperateBinding>() {
 
                                 for (item in materialTypeDetail) {
                                     detailTypeText += item.name
-                                    detailTypeText += "\t"
+                                    detailTypeText += "\t\t"
                                 }
 
                                 binding.detailType.text = detailTypeText.trim()
@@ -274,21 +281,27 @@ class MaterialOperateActivity : BaseActivity<ActivityMaterialOperateBinding>() {
 
             binding.commit.setButtonStatus(CommitButton.STATUS_IN_COMMITING)
 
-            if (materialList.size != 0) {
-                materialList.clear()
-                binding.materialList.adapter!!.notifyItemRangeRemoved(0, materialList.size)
-            }
+            materialList.clear()
+            binding.materialList.adapter!!.notifyItemRangeRemoved(0, materialList.size)
 
             materialSearchRequest.apply {
-                pageIndex = this@MaterialOperateActivity.pageIndex
+                pageIndex = 1
                 pageSize = 10
 
-                for (item in materialTypeDetail) {
-                    typeIds += item.name
-                    typeIds += ","
-                }
+                typeIds = ""
+
+                var i = 0
+
+                while (i < materialTypeDetail.size) {
+
+                    typeIds += materialTypeDetail[i].id
 
-                typeIds.substringBeforeLast(",")
+                    i += 1
+
+                    if (i < materialTypeDetail.size) {
+                        typeIds += ","
+                    }
+                }
 
                 goodsName = binding.materialName.text.toString()
             }