You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jk14/【人力资源管理系统v2.0】.py

115 lines
3.6 KiB

print("--------------------**欢迎使用【人力资源管理系统】**--------------------")
print( "---------------**请输入员工编号**---------------")
use = input("员工编号:")
user = str(use)
while user != "321":
print("--------------------【人力资源管理系统】--------------------")
user = str(use)
if user == "321":
print("员工编号输入正确,请稍后:")
else:
print("员工编号输入有误,请重新输入:")
use = input("员工编号:")
print("请输入密码:")
key = input("密码:")
keys = str(key)
while keys != "123":
print("--------------------【人力资源管理系统】--------------------")
keys = str(key)
if keys == "123":
print("密码输入正确,请稍后:")
else:
print("密码输入有误,请重新输入:")
key = input("密码:")
print("欢迎您:人资经理小明")
print("""**********************************
欢迎使用人力资源管理系统
请选择功能
1员工信息列表
2: 员工信息查询
3员工信息添加
4员工信息修改
5员工信息删除
0:退出
*********************************""")
staffs = [
{
'ID':'351586',
'name':'小明',
'sexual':'',
'job':'人资经理'
},
{
'ID':'123456',
'name':'小华',
'sexual':'',
'job':'CEO'
},
{
'ID':'654321',
'name':'小丽',
'sexual':'',
'job':'老板'
}
]
while True:
action = input("请输入您要进行的操作:")
print("你选择的功能是:{}".format(action))
if action == "0":
print("欢迎您再次使用!")
break
elif action == "1":
print("请稍后,正在加载员工信息....")
for staff in staffs:
print(staff)
elif action == "2":
print('请输入你要查询员工的员工编号')
ID = input("员工编号:")
for staff in staffs:
if staff['ID'] == ID:
print(staff)
else:
print("员工编号为{}的员工信息不存在".format(ID))
elif action == "3":
print("请输入你要添加员工的员工编号和姓名")
ID = input('员工编号:')
name = input('姓名:')
sexial = input('性别')
job = input('职位')
staff={
'ID': ID,
'name': name,
'sexual':sexual,
'job':job
}
staffs.append(staff)
elif action == "4":
print("请输入你要修改员工的员工编号")
ID = input('员工编号:')
for staff in staffs:
if staff['ID'] == ID:
staff['ID'] =input('请输入修改后的员工编号')
staff['name']=input('请输入修改后的姓名')
staff['sexual']=input('请输入修改后的性别')
staff['job']=input('请输入修改后的职位')
break
else:
print("员工编号为{}的员工信息不存在".format(ID))
elif action == "5":
print("请输入你要删除员工的员工编号")
ID = input('员工编号:')
for staff in staffs:
if staff['ID'] == ID:
staffs.remove(staff)
break
else:
print("员工编号为{}的员工信息不存在".format(ID))
else:
print("输入错误,请重新输入!")