package xn.hxp.ui.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import xn.hxp.R
import com.rc.httpcore.bean.ReturningList
import xn.hxp.weidith.TextTool

//归还化学品列表  item_use_list 多个地方使用
class ReturningChemicalsAdapter :
    BaseQuickAdapter<ReturningList, BaseViewHolder>(R.layout.item_use_list) {

    override fun convert(holder: BaseViewHolder, item: ReturningList) {
        holder.setText(R.id.chemicalName, "${item.chemicalName}")
        val chemicalNameView = holder.getView<TextView>(R.id.chemicalName)
        chemicalNameView.setOnClickListener { TextTool.showPop(context, chemicalNameView) }
        //编码
        holder.setText(R.id.chemicalPurity, "${item.tagCode}")

        holder.setText(R.id.surplus, "${item.specNum}${item.specUnit}/${item.packUnit}")
        holder.setText(R.id.chemicalNumber, "${item.belongName}")
        //领用人
        holder.setText(R.id.cabinetName_doorName, "${item.useName}")

    }
}