package com.wd.workoffice.ui.activity.bat.work;

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.StockFlowBean;
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 WorkWarehouseStockFlowDetailActivity extends WorkToolBarActivity {
    @BindView(R.id.tv_no)
    TextView tvNo;
    @BindView(R.id.tv_flow_type)
    TextView tvFlowType;
    @BindView(R.id.tv_stock_event)
    TextView tvStockEvent;
    @BindView(R.id.tv_order_event)
    TextView tvOrderEvent;
    @BindView(R.id.tv_order_no)
    TextView tvOrderNo;
    @BindView(R.id.tv_pro_name)
    TextView tvProName;
    @BindView(R.id.tv_from_stock)
    TextView tvFromStock;
    @BindView(R.id.tv_target_stock)
    TextView tvTargetStock;
    @BindView(R.id.tv_move_num)
    TextView tvMoveNum;
    @BindView(R.id.tv_balance)
    TextView tvBalance;
    @BindView(R.id.tv_operating)
    TextView tvOperating;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.tv_remark)
    TextView tvRemark;
    private StockFlowBean.RecordsBean dataBean;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
        dataBean = JSON.parseObject(getIntent().getStringExtra("detail"), StockFlowBean.RecordsBean.class);
        tvNo.setText(dataBean.getLinkSerialNumber());
        tvFlowType.setText(dataBean.getTypeName());
        tvStockEvent.setText(dataBean.getStockEventName());
        tvOrderEvent.setText(dataBean.getOrderEventName());
        tvOrderNo.setText(dataBean.getOrderId());
        tvProName.setText(dataBean.getProductName());
        tvFromStock.setText(dataBean.getOriginStockName());
        tvTargetStock.setText(dataBean.getTargetStockName());
        tvMoveNum.setText(MathUtils.converData(dataBean.getQuantity(), 3));
        tvBalance.setText(MathUtils.converData(dataBean.getAfterOver(), 3));
        tvRemark.setText(dataBean.getOptComment());
        tvOperating.setText(dataBean.getOptUserName());
        tvTime.setText(dataBean.getCreatedTime());
    }

    @Override
    protected void initData() {
    }


    @Override
    protected void initEvent() {
    }

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

}
