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.OrderBean;
import com.wd.workoffice.bean.WarehoustBean;
import com.wd.workoffice.util.WorkUtils;

import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

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

public class WorkInStockDetailAdapter extends BaseQuickAdapter<WarehoustBean.RecordsBean, BaseViewHolder> {

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


    @Override
    protected void convert(BaseViewHolder helper, WarehoustBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getName());
        helper.setText(R.id.tv_code, item.getCode());
        helper.setText(R.id.tv_dep, item.getDeptName());
        WarehoustBean.RecordsBean.OfTypeBean ofType = item.getOfType();
        if (ofType != null) {
            helper.setText(R.id.tv_clazz, ofType.getName());
            helper.setText(R.id.tv_diff, WorkUtils.getStockType(ofType.getType()));
        }

        helper.setText(R.id.tv_client, item.getCustomerName());
        helper.setText(R.id.tv_status, TextUtils.equals(item.getStatus(), "1") ? "已启用" : "未启用");
        helper.setText(R.id.tv_time, item.getCreatedTime());
    }
}

