Tạo data entry dùng để nhập thông tin về cấp phát PPE (Phương tiện bảo vệ cá nhân), Thông tin input bao gồm: Mã vật tư, Tên Vật tư, Đơn vị, Số lượng, Price, Bộ phận nhận, Ngày nhận, Tồn kho.
Drop files here
or click to upload
import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
# Tạo DataFrame rỗng với các cột dự kiến
columns = ['Mã vật tư', 'Tên Vật tư', 'Đơn vị', 'Số lượng', 'Giá', 'Bộ phận nhận', 'Ngày nhận', 'Tồn kho']
df_template = pd.DataFrame(columns=columns)
st.header('Cấp phát PPE (Phương tiện bảo vệ cá nhân)')
# Sử dụng form để nhập dữ liệu
with st.form('data_entry_form') as form:
st.write('Nhập thông tin về cấp phát PPE')
response = AgGrid(
df_template,
editable=True,
fit_columns_on_grid_load=True,
try_to_convert_back_to_original_types=False,
)
submit_button = st.form_submit_button('Gửi dữ liệu')
if submit_button:
st.write('Dữ liệu đã được gửi:', response['data'])
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?