diff --git a/pythonProject/order_data.txt b/pythonProject/order_data.txt index 8b13789..f4d3dd1 100644 --- a/pythonProject/order_data.txt +++ b/pythonProject/order_data.txt @@ -1 +1,4 @@ +1001, 按摩 +8号技师 - 8号技师 + 8号技师 diff --git a/pythonProject/zs1.py b/pythonProject/zs1.py index 4006105..f896557 100644 --- a/pythonProject/zs1.py +++ b/pythonProject/zs1.py @@ -26,6 +26,41 @@ class FootSpaManagementSystem: self.admin_login_button = tk.Button(self.main_frame, text="绠$悊鍛樼櫥褰", command=self.create_admin_login_view) self.admin_login_button.pack() + #娉ㄥ唽鐣岄潰杩斿洖鍒濆鐣岄潰 + def surer1(self): + self.frame_register.pack_forget() + self.main_frame.pack() + + #閫夋嫨璁㈠崟鐣岄潰杩斿洖鐢ㄦ埛鐣岄潰 + def surer2(self): + self.frame_order.pack_forget() + self.user_frame.pack() + + #閫夋嫨鎶甯堢晫闈㈣繑鍥炵敤鎴风晫闈 + def surer3(self): + self.frame_technician.pack_forget() + self.user_frame.pack() + + #鍒犻櫎璁㈠崟鐣岄潰杩斿洖鐢ㄦ埛鐣岄潰 + def surer4(self): + self.delete_frame.pack_forget() + self.user_frame.pack() + + #閰掓按璁㈠崟鐣岄潰杩斿洖鐢ㄦ埛鐣岄潰 + def surer5(self): + self.beverage_frame.pack_forget() + self.user_frame.pack() + + #绠$悊鍛樼櫥褰曠晫闈㈣繑鍥炲垵濮嬬晫闈 + def surer6(self): + self.admin_login_window.pack_forget() + self.main_frame.pack() + + #鐢ㄦ埛鐧诲綍鐣岄潰杩斿洖鍒濆鐣岄潰 + def surer7(self): + self.frame_login.pack_forget() + self.main_frame.pack() + #绠$悊鍛樼櫥褰曞嚱鏁 def admin_login(self): admin_username = "zg" @@ -53,6 +88,8 @@ class FootSpaManagementSystem: self.password_entry.pack() self.login_button = tk.Button(self.admin_login_window, text="鐧诲綍", command=self.admin_login) self.login_button.pack() + self.back_button = tk.Button(self.admin_login_window, text="杩斿洖涓荤晫闈", command=self.surer6) + self.back_button.pack() #鏌ョ湅鐢ㄦ埛鍑芥暟 def show_user_info(self): @@ -130,43 +167,6 @@ class FootSpaManagementSystem: else: messagebox.showerror("鐧诲綍澶辫触", "娌℃湁鐢ㄦ埛鏁版嵁銆") # 鏄剧ず鎵句笉鍒扮敤鎴锋暟鎹殑娑堟伅 - #娉ㄥ唽鐣岄潰杩斿洖鍒濆鐣岄潰 - def surer1(self): - self.frame_register.pack_forget() - self.main_frame.pack() - if hasattr(self, "back_button"): - self.back_button.pack_forget() # 绉婚櫎杩斿洖涓荤晫闈㈢殑鎸夐挳 - self.frame_register.pack_forget() - self.main_frame.pack() - - #閫夋嫨璁㈠崟鐣岄潰杩斿洖鐢ㄦ埛鐣岄潰 - def surer2(self): - self.frame_order.pack_forget() - self.user_frame.pack() - if hasattr(self, "back_button_order"): - self.back_button_order.pack_forget() # 绉婚櫎杩斿洖涓荤晫闈㈢殑鎸夐挳 - self.frame_order.pack_forget() - self.user_frame.pack() - - #閫夋嫨鎶甯堢晫闈㈣繑鍥炵敤鎴风晫闈 - def surer3(self): - self.frame_technician.pack_forget() - self.user_frame.pack() - if hasattr(self, "back_button_order"): - self.back_button_order.pack_forget() # 绉婚櫎杩斿洖涓荤晫闈㈢殑鎸夐挳 - self.frame_technician.pack_forget() - self.user_frame.pack() - - #鍒犻櫎璁㈠崟鐣岄潰杩斿洖鐢ㄦ埛鐣岄潰 - def surer4(self): - self.delete_frame.pack_forget() - self.user_frame.pack() - - #閰掓按璁㈠崟鐣岄潰杩斿洖鐢ㄦ埛鐣岄潰 - def surer5(self): - self.beverage_frame.pack_forget() - self.user_frame.pack() - #娉ㄥ唽鐣岄潰 def switch_to_register(self): self.main_frame.pack_forget() @@ -182,7 +182,7 @@ class FootSpaManagementSystem: self.password_entry.pack() self.register_button = tk.Button(self.frame_register, text="娉ㄥ唽", command=self.register_user) self.register_button.pack() - self.back_button = tk.Button(self.root, text="杩斿洖涓荤晫闈", command=self.surer1) + self.back_button = tk.Button(self.frame_register, text="杩斿洖涓荤晫闈", command=self.surer1) self.back_button.pack() #鐢ㄦ埛鐧诲綍鐣岄潰 @@ -200,6 +200,8 @@ class FootSpaManagementSystem: self.password_entry_login.pack() self.login_button = tk.Button(self.frame_login, text="鐧诲綍", command=self.login_user) self.login_button.pack() + self.back_button = tk.Button(self.frame_login, text="杩斿洖涓荤晫闈", command=self.surer7) + self.back_button.pack() #鐢ㄦ埛鐧诲綍鍚庣殑鐢ㄦ埛鐣岄潰 def show_user_interface(self): @@ -213,6 +215,8 @@ class FootSpaManagementSystem: self.user_frame.pack() self.order_button = tk.Button(self.user_frame, text="閫夋嫨璁㈠崟", command=self.switch_to_order) self.order_button.pack() + self.select_technician = tk.Button(self.user_frame, text="閫夋嫨鎶甯", command=self.show_select_technician_screen) + self.select_technician.pack() self.view_order_button = tk.Button(self.user_frame, text="鏌ョ湅璁㈠崟", command=self.view_order) self.view_order_button.pack() self.delete_order_button = tk.Button(self.user_frame, text="鍒犻櫎璁㈠崟", command=self.delete_order) @@ -288,8 +292,6 @@ class FootSpaManagementSystem: if selected_services: order_number = self.generate_order_number() # 鐢熸垚璁㈠崟鍙 messagebox.showinfo("涓嬪崟鎴愬姛", f"鎮ㄩ夋嫨浜嗭細{', '.join(selected_services)}\n 璁㈠崟鍙凤細{order_number}") - # 鏄剧ず閫夋嫨鎶甯堢殑鐣岄潰 - self.show_select_technician_screen() with open(self.order_data_file, "a") as file: file.write(f"{order_number}, {', '.join(selected_services)}{self.order_info}\n") else: @@ -302,7 +304,7 @@ class FootSpaManagementSystem: # 閫夋嫨鎶甯堢晫闈 def show_select_technician_screen(self): - self.frame_order.pack_forget() # 绉婚櫎閫夋嫨璁㈠崟鐣岄潰 + self.user_frame.pack_forget() # 绉婚櫎鐢ㄦ埛鐣岄潰 # 鍒涘缓閫夋嫨鎶甯堢殑鐣岄潰 self.frame_technician = tk.Frame(self.root) self.frame_technician.pack() @@ -327,16 +329,16 @@ class FootSpaManagementSystem: self.back_button_order = tk.Button(self.frame_technician, text="杩斿洖鐢ㄦ埛鐣岄潰", command=self.surer3) self.back_button_order.pack() + #閫夋嫨鎶甯堝嚱鏁 def confirm_technician(self): - selected_services = [service for service, selected in self.services.items() if selected.get() == 1] + selected_services = [service for service, selected in self.technicians.items() if selected.get() == 1] if selected_services: selected_technicians = [technician for technician, selected in self.technicians.items() if selected.get() == 1] - selected_services_str = ', '.join(selected_services) selected_technicians_str = ', '.join(selected_technicians) messagebox.showinfo("涓嬪崟鎴愬姛", - f"鎮ㄩ夋嫨浜嗭細{selected_services_str}\n鎵閫夋嫨鐨勬妧甯: {selected_technicians_str}") + f"鎮ㄦ墍閫夋嫨鐨勬妧甯: {selected_technicians_str}") with open(self.order_data_file, "a") as file: - file.write(f"{selected_services_str} - {selected_technicians_str}{self.order_info}\n") + file.write(f" {selected_technicians_str}{self.order_info}\n") #閰掓按璁㈠崟鐣岄潰 def switch_to_beverage_order(self): @@ -365,7 +367,6 @@ class FootSpaManagementSystem: def run(self): self.root.mainloop() # 鍚姩涓诲惊鐜 - # 瀹炰緥鍖栬冻娴村簵绠$悊绯荤粺 foot_spa_system = FootSpaManagementSystem() foot_spa_system.run() \ No newline at end of file