package com.wd.workoffice.ui.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.mesBean.TaskMaterials;
import com.wd.workoffice.bean.mesBean.TaskPeopleBean;
import com.wd.workoffice.util.MathUtils;

import java.util.List;

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

public class WorkTaskMaterialsAdapter extends BaseQuickAdapter<TaskMaterials.ListBean, BaseViewHolder> {
    boolean canModify;

    public WorkTaskMaterialsAdapter(int layoutResId, List data ,boolean canModify) {
        super(layoutResId, data);
        this.canModify = canModify;
    }


    @Override
    protected void convert(BaseViewHolder helper, TaskMaterials.ListBean item) {
        helper.setText(R.id.tv_no, String.format("物料编码:%s", item.getItemCode()));
        helper.setText(R.id.tv_name, item.getItemName());
        helper.setText(R.id.tv_num, MathUtils.converData(item.getItemQty(),3));
        helper.setText(R.id.tv_stock, item.getLocationName());
        helper.setText(R.id.tv_grant, item.isDirectReq()?"是":"否");
        helper.addOnClickListener(R.id.tv_edit);
        helper.addOnClickListener(R.id.tv_delete);
    }
}

