量具管理系统
发布时间:2025-12-10 11:33:56
浏览次数:16
量具管理系统-首页
传统量具管理问题:量具编号重复,编码没有按要求,频繁领用登记麻烦,,忘记校验,使用过期量具,手写标签不易辨认。
本人使用Python编制量具管理系统解决以上问题:
主要使用模块:tkinter
首先编制首页三大功能:量具生成(编号自动生成,打印二维码标签),量具查询(过期清单,量具更新,报告查询),量具分析(数量分析
from tkinter import *import osfrom datetime import datetimeimport createclassimport analysisclassimport queryclassclass base:def __init__(self, master,user):self.root = masterself.user=userwidth = 800height =600screenwidth = self.root .winfo_screenwidth()screenheight = self.root .winfo_screenheight()alignstr = '%dx%d+%d+%d' % (width, height, (screenwidth-width)/2, (screenheight-height)/2)self.root.geometry(alignstr)self.root.title("量具管理"+self.user)self.root.iconbitmap(".\\pic\\smart.ico")self.root.wm_attributes("-topmost", 1)self.photo0 = PhotoImage(file=os.getcwd()+".\\pic\\we1.png")self.photo_create = PhotoImage(file=os.getcwd()+".\\pic\\create.png")self.photor_search= PhotoImage(file=os.getcwd()+".\\pic\\search.png")self.photo_analysis=PhotoImage(file=os.getcwd()+".\\pic\\analysis.png")self.create_ui()def create_ui(self):self.one = Label(self.root, text="© Powered by Will Wu "+"2020-"+str(datetime.now().year), width=30, height=2, font=("Arial", 10))self.one.pack(side=BOTTOM)self.fx=LabelFrame(self.root)self.fx.place(relx=0.1,rely=0.88,relwidth=0.2,relheight=0.12) self.theLabel = Label(self.fx,image=self.photo0,fg="white")self.theLabel.pack()self.button_create=Button(self.root,image=self.photo_create,command=self.create_mi) self.button_create.place(relx=0.05,rely=0.01)self.button_search=Button(self.root,image=self.photor_search,command=self.search_mi)self.button_search.place(relx=0.35,rely=0.01)self.button_analysis=Button(self.root,image=self.photo_analysis,command=self.analysis_mi)self.button_analysis.place(relx=0.65,rely=0.01)def create_mi(self):#self.root.destroy()self.root.withdraw()#root1=Tk()root1=Toplevel()createclass.create(root1,self.user,"量具生成_") def search_mi(self):self.root.withdraw()root1=Toplevel()queryclass.query(root1,self.user,"量具查询_") def analysis_mi(self):self.root.withdraw()#root1=Tk()root1=Toplevel()analysisclass.analysis(root1,self.user,"量具分析_") if __name__ == '__main__':root = Tk()base(root,"usertest")root.mainloop()