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.DeviceBuyBean;
import com.wd.workoffice.bean.RepairBean;
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 DeviceBuyAdapter extends BaseQuickAdapter<DeviceBuyBean.RecordsBean, BaseViewHolder> {

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


    @Override
    protected void convert(BaseViewHolder helper, DeviceBuyBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getReceiveDeptName());
        helper.setText(R.id.tv_order_people, item.getLaunchUserName());
        helper.setText(R.id.tv_company, item.getLaunchDeptName());
        helper.setText(R.id.tv_code, item.getId());
        helper.setText(R.id.tv_order_time, item.getCreatedTime());
        helper.setText(R.id.tv_status, WorkUtils.getDeviceStatus(item.getStatus()));
        helper.setText(R.id.tv_all_price, MathUtils.converData(item.getLaunchOrderAmount(),3));
    }
}

