package com.example.chemical.ui.adapter

import android.content.Context
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.chemical.R
import com.rc.httpcore.bean.ChemicalWarnInfoBean

//超期未入库，请尽快处理。
class NotReceivedAdapter(private val ct: Context) :
    BaseQuickAdapter<ChemicalWarnInfoBean, BaseViewHolder>(R.layout.item_not_received) {

    override fun convert(holder: BaseViewHolder, item: ChemicalWarnInfoBean) {
        holder.setText(R.id.chemicalName, "${item.chemicalName}")
        holder.setText(R.id.normsNum, "${item.normsNum}")
        holder.setText(R.id.number, "数量：${item.applyNum}")
        holder.setText(R.id.expireTime, "已入库数量：${item.inStockNum}")
        if (item.isStock) {//已入库
            holder.setBackgroundResource(R.id.isStock, R.drawable.bg_ruku_two)
            holder.setText(R.id.isStock,"已入库")
        } else {
            holder.setBackgroundResource(R.id.isStock, R.drawable.bg_ruku)
            holder.setText(R.id.isStock,"超期未入库")
        }

        holder.setText(R.id.belong, "归属人：${item.belongName}")
        holder.setText(R.id.expire, "入库期限：${item.createTime}")
    }
}