def __init__(self, uid): self.doc = DoctorDAO.get(uid) self.tk = Tk() self.tk.title("医院挂号就诊系统-医生界面") self.userNameText = Label(self.tk, text=f"欢迎你, {self.doc.name}") self.userNameText.grid(row=0, column=0, columnspan=2, padx=5) self.actionsFrame = LabelFrame(self.tk, text="操作") self.refresButton = Button(self.actionsFrame, text=" 刷新 ", padx=20, command=self.refresHandler) self.refresButton.grid(row=0, column=0, padx=5) self.historyButton = Button(self.actionsFrame, text="查看历史", padx=20, command=self.historyHandler) self.historyButton.grid(row=0, column=1, padx=5) self.actionsFrame.grid(row=1, column=0) self.createPendingFrame() self.createDetailedFrame() self.tk.mainloop()
def __init__(self, uid): self.doc = DoctorDAO.get(uid) self.tk = Tk() self.tk.title("医院挂号就诊系统-历史查询") self.createPendingFrame() self.tk.mainloop()
def patientResultToString(result): doctor = DoctorDAO.get(result.did) dept = DepartmentDAO.get(doctor.deptID) if result.rtype == "pro": printType = "专家" else: printType = "普通" time = result.rtime.strftime("%Y/%m/%d %H:%M:%S") return f"{result.rid:8} | {time:19} | {printType:2} | {dept.deptName:<10}"
def createInfoFrame(self): self.infoFrame = Frame(self.detailedFrame) reg = RegistrationtDAO.get(self.selectedRID()) doc = DoctorDAO.get(reg.did) dept = DepartmentDAO.get(doc.deptID) Label(self.infoFrame, text="挂号编号", width=13, anchor="e").grid(row=0, column=0) Label(self.infoFrame, text=reg.rid, width=30, anchor="w").grid(row=0, column=1) Label(self.infoFrame, text="挂号时间", width=13, anchor="e").grid(row=1, column=0) Label(self.infoFrame, text=reg.rtime.strftime("%Y/%m/%d %H:%M:%S"), width=30, anchor="w").grid(row=1, column=1) Label(self.infoFrame, text="挂号类型", width=13, anchor="e").grid(row=2, column=0) Label(self.infoFrame, text=rtypePrint(reg.rtype), width=30, anchor="w").grid(row=2, column=1) Label(self.infoFrame, text="科室名称", width=13, anchor="e").grid(row=3, column=0) Label(self.infoFrame, text=dept.deptName, width=30, anchor="w").grid(row=3, column=1) Label(self.infoFrame, text="科室地点", width=13, anchor="e").grid(row=4, column=0) Label(self.infoFrame, text=dept.location, width=30, anchor="w").grid(row=4, column=1) Label(self.infoFrame, text="科室电话", width=13, anchor="e").grid(row=5, column=0) Label(self.infoFrame, text=dept.phone, width=30, anchor="w").grid(row=5, column=1) Label(self.infoFrame, text="医生名称", width=13, anchor="e").grid(row=6, column=0) Label(self.infoFrame, text=doc.name, width=30, anchor="w").grid(row=6, column=1) self.infoFrame.grid(row=1, columnspan=2)
def refresHandler(self): self.doc = DoctorDAO.get(self.doc.uid) self.updatePendingFrame() self.updateDetailedFrame()