|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 "")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|