package com.example.chemical.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.chemical.R
import com.rc.core.log.RcLog
import com.rc.httpcore.bean.HxpStockWaitListBean


//查询-详情
class InquiryItemAdapter :
    BaseQuickAdapter<HxpStockWaitListBean, BaseViewHolder>(R.layout.item_inquiry) {

    override fun convert(holder: BaseViewHolder, item: HxpStockWaitListBean) {
        holder.setText(R.id.chemicalName, "${item.chemicalName}")
        RcLog.info("===${holder.adapterPosition}====${item.casNum}")
        if (item.casNum != null) {
            holder.setText(R.id.casNum, "${item.casNum}")
        }
        holder.setText(R.id.chemicalCategoryName, "${item.chemicalCategoryName}")
        holder.setText(R.id.chemicalLevelName, "${item.chemicalLevelName}")
        RcLog.info("===${holder.adapterPosition}====${item.chemicalPurity}")
        if (item.chemicalPurity != null) {
            holder.setText(R.id.chemicalPurity, "${item.chemicalPurity}")
        }
        holder.setText(R.id.surplus, "${item.surplus}${item.specUnit}")
        holder.setText(R.id.chemicalNumber, "${item.chemicalNumber}")
    }
}