package com.wd.workoffice.ui.adapter;


import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.InStockBean;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;

import java.util.List;

/**
 * Created by flexible on 2018/8/13.
 */

public class WorkInStockAdapter extends BaseQuickAdapter<InStockBean.RecordsBean, BaseViewHolder> {

    public WorkInStockAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, InStockBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getName());
        helper.setText(R.id.tv_code, item.getCode());
        helper.setText(R.id.tv_bottom_name, item.getErpId());
        helper.setText(R.id.tv_num,String.valueOf(item.getStockInstanceCount()));
        helper.setText(R.id.tv_level, "层级:".concat(MathUtils.conver(item.getLevel())+"级库"));
        helper.setText(R.id.tv_diff, "区分:".concat(WorkUtils.getStockType(item.getType())));
        if (TextUtils.equals("0",item.getStatus())){
            helper.setText(R.id.tv_status, "未启用");
        }else{
            helper.setText(R.id.tv_status, "已启用");
        }
    }
}

