package com.lukouguoji.gjj.holder

import android.view.View
import com.lukouguoji.gjj.databinding.ItemIntImpTallySubBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjImportTally

/**
 * 国际进港理货报告 分单子列表 ViewHolder
 */
class IntImpTallySubViewHolder(view: View) :
    BaseViewHolder<GjjImportTally, ItemIntImpTallySubBinding>(view) {

    override fun onBind(item: Any?, position: Int) {
        val bean = getItemBean(item) ?: return
        binding.bean = bean
        binding.position = position
        binding.executePendingBindings()

        // 单选框点击切换选择状态（独立选择，不联动主单）
        binding.ivCheckbox.setOnClickListener {
            bean.checked.set(!bean.checked.get())
            binding.executePendingBindings()
        }
    }
}
