feat: 国际进港电报解析接口对接及仓库/提取记录页面
- 电报解析:航班级联查询(自动填充目的站、始发站下拉) - 电报解析:修复接口返回格式(PageInfo 非 BaseResultBean) - 电报解析:报文类型必选校验 - 新增进港仓库、提取记录页面及菜单入口 - 修复 Spinner 空列表时 hint 不显示的问题 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.lukouguoji.gjj.holder
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.gjj.activity.IntImpPickUpRecordDetailsActivity
|
||||
import com.lukouguoji.gjj.databinding.ItemIntImpPickUpRecordBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.IntImpPickUpRecordBean
|
||||
|
||||
/**
|
||||
* 国际进港-提取记录 ViewHolder
|
||||
*/
|
||||
class IntImpPickUpRecordViewHolder(view: View) :
|
||||
BaseViewHolder<IntImpPickUpRecordBean, ItemIntImpPickUpRecordBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item) ?: return
|
||||
binding.bean = bean
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 图标点击切换选择状态
|
||||
binding.ivIcon.setOnClickListener {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
binding.executePendingBindings()
|
||||
}
|
||||
|
||||
// 列表项点击进入提取详情
|
||||
itemView.setOnClickListener {
|
||||
IntImpPickUpRecordDetailsActivity.start(itemView.context, bean.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.lukouguoji.gjj.holder
|
||||
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lukouguoji.gjj.databinding.ItemIntImpStorageUseSubBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||
import com.lukouguoji.module_base.bean.GjcStorageUse
|
||||
|
||||
/**
|
||||
* 国际进港-仓库 库位明细行 ViewHolder
|
||||
*/
|
||||
class IntImpStorageUseSubViewHolder(view: View) :
|
||||
BaseViewHolder<GjcStorageUse, ItemIntImpStorageUseSubBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item) ?: return
|
||||
binding.bean = bean
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 单选框点击切换选择状态(反向联动主列表)
|
||||
binding.ivCheckbox.setOnClickListener {
|
||||
// 切换子列表项的选择状态
|
||||
val newCheckedState = !bean.checked.get()
|
||||
bean.checked.set(newCheckedState)
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 反向联动主列表项(仅在勾选时联动)
|
||||
updateParentCheckState(newCheckedState)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新父列表项的选择状态
|
||||
*/
|
||||
private fun updateParentCheckState(newCheckedState: Boolean) {
|
||||
val recyclerView = itemView.parent as? RecyclerView ?: return
|
||||
val parentBean = recyclerView.tag as? GjcMaWb ?: return
|
||||
|
||||
if (newCheckedState) {
|
||||
parentBean.checked.set(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.lukouguoji.gjj.holder
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.gjj.R
|
||||
import com.lukouguoji.gjj.databinding.ItemIntImpStorageUseBinding
|
||||
import com.lukouguoji.module_base.adapter.setCommonAdapter
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
|
||||
/**
|
||||
* 国际进港-仓库 ViewHolder
|
||||
*/
|
||||
class IntImpStorageUseViewHolder(view: View) :
|
||||
BaseViewHolder<GjcMaWb, ItemIntImpStorageUseBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item) ?: return
|
||||
binding.bean = bean
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 图标点击切换选择状态(联动子列表)
|
||||
binding.ivIcon.setOnClickListener {
|
||||
val newCheckedState = !bean.checked.get()
|
||||
bean.checked.set(newCheckedState)
|
||||
|
||||
// 联动勾选/取消所有子列表项
|
||||
bean.storageUseList?.forEach { storageUse ->
|
||||
storageUse.checked.set(newCheckedState)
|
||||
}
|
||||
|
||||
binding.executePendingBindings()
|
||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
// 展开按钮点击事件
|
||||
binding.ivShow.setOnClickListener {
|
||||
bean.showMore.set(!bean.showMore.get())
|
||||
}
|
||||
|
||||
// 初始化库位明细子列表 RecyclerView
|
||||
setCommonAdapter(
|
||||
binding.rvSub,
|
||||
IntImpStorageUseSubViewHolder::class.java,
|
||||
R.layout.item_int_imp_storage_use_sub
|
||||
)
|
||||
|
||||
// 刷新库位明细数据(传递父Bean引用)
|
||||
val storageUseList = bean.storageUseList ?: emptyList()
|
||||
binding.rvSub.tag = bean
|
||||
binding.rvSub.refresh(storageUseList)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user