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.StockDetailBean;
import com.wd.workoffice.bean.workEnum.PagePermissionType;
import com.wd.workoffice.util.WorkUtils;

import java.util.List;

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

public class WorkStockDetailAdapter extends BaseQuickAdapter<StockDetailBean.RecordsBean, BaseViewHolder> {

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

    @Override
    protected void convert(BaseViewHolder helper, StockDetailBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getOrderId());
        helper.setText(R.id.tv_order_type, item.getOrderTypeName());
        helper.setText(R.id.tv_num, String.valueOf(item.getQuantity()));
        helper.setText(R.id.tv_in, String.valueOf(item.getApplyInto()));
        helper.setText(R.id.tv_out, String.valueOf(item.getApplyOut()));
        helper.setText(R.id.tv_time, item.getCreatedTime());
        helper.addOnClickListener(R.id.tv_flow);
        if (!WorkUtils.hasPermission(PagePermissionType.STOCK_QUANTITY_DETAIL_FLOW.getPermission())) {
            helper.setGone(R.id.tv_flow, false);
        }

    }
}

