File size: 3,654 Bytes
0f0ef8d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import streamlit as st
from utils_fpso import campo_fpso

MODAL_LISTA = ["", "AÉREO", "MARÍTIMO", "EXPRESSO"]
RESP_ERRO_LISTA = ["", "Sim", "Não"]
INCLUSAO_EXCLUSAO_LISTA = ["", "INCLUSÃO", "EXCLUSÃO"]


def form_equipamento(registro):
    st.markdown("### 📦 Dados do Equipamento")

    col1, col2, col3 = st.columns(3)

    # =====================
    # COLUNA 1
    # =====================
    with col1:
        fpso1 = campo_fpso("FPSO1", registro.fpso1)
        fpso = campo_fpso("FPSO", registro.fpso)
        data_coleta = st.date_input("Data Coleta", registro.data_coleta)
        especialista = st.text_input("Especialista", registro.especialista or "")
        conferente = st.text_input("Conferente", registro.conferente or "")
        osm = st.text_input("OSM", registro.osm or "")

    # =====================
    # COLUNA 2
    # =====================
    with col2:
        modal = st.selectbox(
            "Modal",
            MODAL_LISTA,
            index=MODAL_LISTA.index(registro.modal) if registro.modal in MODAL_LISTA else 0
        )

        quant_equip = st.number_input(
            "Quantidade Equipamentos",
            min_value=0,
            value=registro.quant_equip or 0
        )

        mrob = st.text_input("MROB", registro.mrob or "")
        linhas_osm = st.number_input("Linhas OSM", value=registro.linhas_osm or 0)
        linhas_mrob = st.number_input("Linhas MROB", value=registro.linhas_mrob or 0)
        linhas_erros = st.number_input("Linhas com Erro", value=registro.linhas_erros or 0)

    # =====================
    # COLUNA 3
    # =====================
    with col3:
        erro_storekeeper = st.selectbox(
            "Erro Storekeeper",
            RESP_ERRO_LISTA,
            index=RESP_ERRO_LISTA.index(registro.erro_storekeeper)
            if registro.erro_storekeeper in RESP_ERRO_LISTA else 0
        )

        erro_operacao = st.selectbox(
            "Erro Operação WH",
            RESP_ERRO_LISTA,
            index=RESP_ERRO_LISTA.index(registro.erro_operacao)
            if registro.erro_operacao in RESP_ERRO_LISTA else 0
        )

        erro_especialista = st.selectbox(
            "Erro Especialista WH",
            RESP_ERRO_LISTA,
            index=RESP_ERRO_LISTA.index(registro.erro_especialista)
            if registro.erro_especialista in RESP_ERRO_LISTA else 0
        )

        erro_outros = st.selectbox(
            "Erro Outros",
            RESP_ERRO_LISTA,
            index=RESP_ERRO_LISTA.index(registro.erro_outros)
            if registro.erro_outros in RESP_ERRO_LISTA else 0
        )

        inclusao_exclusao = st.selectbox(
            "Inclusão / Exclusão",
            INCLUSAO_EXCLUSAO_LISTA,
            index=INCLUSAO_EXCLUSAO_LISTA.index(registro.inclusao_exclusao)
            if registro.inclusao_exclusao in INCLUSAO_EXCLUSAO_LISTA else 0
        )

    # =====================
    # CAMPOS GERAIS
    # =====================
    st.markdown("### 📝 Informações Complementares")

    solicitante = st.text_input("Solicitante", registro.solicitante or "")
    ivo = st.text_input("Motivo Inclusão / Exclusão", registro.ivo or "")
    requisitante = st.text_input("Requisitante", registro.requisitante or "")
    nota_fiscal = st.text_input("Nota Fiscal", registro.nota_fiscal or "")
    impacto = st.text_input("Impacto", registro.impacto or "")
    dimensao = st.text_input("Dimensão", registro.dimensao or "")
    observacoes = st.text_area("Observações", registro.observacoes or "", height=120)

    return locals()