from time import sleep
def apply(name,article):
print(f'|{"-"*10}请填写表单{"-"*10}|\n|-申请人:{name}\n|-申请物品:{article}')
process = ['|-申请日期:','|-申请至何时:','|-申请用途或原因:']
data = {'|-申请人:':name,'|-申请物品:':article}
for i in range(len(process)):
data[process[i]] = input(process[i])
return data
def audit(data):
print(f'|{"-"*10}上级审核{"-"*10}|')
for i in data:
print(i,data[i])
while True:
result = input(f'是否通过 {data["|-申请人:"]} 员工的审批(Yes/No):')
if result == 'Y' or result == 'Yes' or result == 'yes':
return True
if result == 'N' or result == 'No' or result == 'no':
return False
print('输入错误,请重新输入!')
def main():
while True:
name = input('申请人:')
article = input('申请物品:')
data = apply(name,article)
result = audit(data)
if result == True:
print(f'申请人:{name}\n申请物品:{article}\n申请结果:成功通过上级领导审批,请在规定时间内归还!')
else:
print(f'申请人:{name}\n申请物品:{article}\n申请结果:抱歉,未通过上级领导审批!')
print('正在重新进入系统',end='')
count = 3
while count:print('.',end='');sleep(1);count -= 1
print()
if __name__ == '__main__':
main()