package com.wd.workoffice.ui.activity.mes.report;

import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.bean.mesBean.OrderBadBean;
import com.wd.workoffice.bean.mesBean.ReportProBean;
import com.wd.workoffice.util.MathUtils;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 订单追踪 产品详情
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class MesReportProDetailActivity extends WorkToolBarActivity {

    @BindView(R.id.tv_no)
    TextView tvNo;
    @BindView(R.id.tv_pro_name)
    TextView tvProName;
    @BindView(R.id.tv_pro_code)
    TextView tvProCode;
    @BindView(R.id.tv_spec)
    TextView tvSpec;
    @BindView(R.id.tv_img_code)
    TextView tvImgCode;
    @BindView(R.id.tv_num)
    TextView tvNum;
    @BindView(R.id.tv_price)
    TextView tvPrice;
    @BindView(R.id.tv_lost_price)
    TextView tvLostPrice;
    @BindView(R.id.tv_order_num)
    TextView tvOrderNum;
    @BindView(R.id.tv_rate)
    TextView tvRate;
    @BindView(R.id.tv_finish_num)
    TextView tvFinishNum;
    @BindView(R.id.tv_reason)
    TextView tvReason;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }

    @Override
  protected void initData() {
        ReportProBean.DataBean info = JSON.parseObject(getIntent().getStringExtra("info"), ReportProBean.DataBean.class);
        tvNo.setText(info.getManufactureOrderNumber());
        tvProName.setText(info.getProductName());
        tvProCode.setText(info.getProductCode());
        tvSpec.setText(info.getSpecification());
        tvImgCode.setText(info.getDrawingNumber());
        tvNum.setText(info.getScrapCount()+"");
        tvPrice.setText(MathUtils.converData(info.getUnitPrice(),3));
        tvLostPrice.setText(MathUtils.converData(info.getAmountOfLoss(),3));
        tvOrderNum.setText(info.getOrderCount()+"");
        tvRate.setText(MathUtils.converData(info.getScrapRate(),3));
        tvFinishNum.setText(info.getOcerCount()+"");
        tvReason.setText(info.getScrapReason());
    }

    @Override
    protected void initEvent() {
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_mes_report_pro_detail_detail;
    }

}
