package com.sipai.jspatrol.Fault;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.sipai.jspatrol.Bean.Fault;
import com.sipai.jspatrol.R;

public class DoneFaultActivity extends AppCompatActivity {
    private Fault mFault;
    private TextView tv_area,tv_equ,tv_fault_content,tv_date,tv_sub_man,tv_dispose_content,tv_content_added;

    public static void actionStart(Context context, Fault fault){
        Intent intent = new Intent(context, DoneFaultActivity.class);
        intent.putExtra("fault",fault);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_done_fault);
        init();
        initView();
    }

    private void init() {
        if (getIntent().getSerializableExtra("fault")!=null){
            mFault = (Fault) getIntent().getSerializableExtra("fault");
        }
    }

    private void initView() {
        TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
        tv_title.setText("缺陷详情");
        ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
        btn_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        tv_area = findViewById(R.id.moudle_done_fault_tv_area);
        tv_area.setText(mFault.getProcessSection().getName());
        tv_equ = findViewById(R.id.moudle_done_fault_tv_equ_name);
        tv_equ.setText(mFault.getEquipmentCard().getEquipmentname());
        tv_fault_content = findViewById(R.id.moudle_done_fault_tv_fault_content);
        tv_fault_content.setText(mFault.getProblemcontent());
        tv_date = findViewById(R.id.moudle_done_fault_tv_date);
        tv_date.setText(mFault.getInsdt().substring(0,16));
        tv_sub_man = findViewById(R.id.moudle_done_fault_tv_man);
        tv_sub_man.setText(mFault.getInsuser());
        tv_dispose_content = findViewById(R.id.moudle_done_fault_tv_show_dispose_content);
//        tv_dispose_content.setText(mFault.);
    }
}
