EricGEGE commited on
Commit
e8f1ece
·
verified ·
1 Parent(s): 05dacae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -75,16 +75,15 @@ def approve_order(order_id, approver_role):
75
  for order_index in order_indexes:
76
  current_status = order_records[order_index]['审批状态']
77
 
78
- if (current_status == '待单证审批' and approver_role != '单证') or \
79
- (current_status == '待财务审批' and approver_role != '财务') or \
80
- (current_status == '待总经理审批' and approver_role != '总经理'):
81
- return f'只有{current_status}角色可以批准当前订单'
82
-
83
- next_status = get_next_approval_status(current_status)
84
- headers = list(order_records[0].keys())
85
- orders.update_cell(order_index + 2, headers.index('审批状态') + 1, next_status) # 更新审批状态
86
- orders.update_cell(order_index + 2, headers.index('timestamp') + 1,
87
- datetime.now().strftime('%m/%d/%Y %H:%M')) # 更新时间戳
88
 
89
  return '订单已批准'
90
  except Exception as e:
 
75
  for order_index in order_indexes:
76
  current_status = order_records[order_index]['审批状态']
77
 
78
+ if (current_status == '待单证审批' and approver_role = '单证') or \
79
+ (current_status == '待财务审批' and approver_role = '财务') or \
80
+ (current_status == '待总经理审批' and approver_role = '总经理'):
81
+
82
+ next_status = get_next_approval_status(current_status)
83
+ headers = list(order_records[0].keys())
84
+ orders.update_cell(order_index + 2, headers.index('审批状态') + 1, next_status) # 更新审批状态
85
+ orders.update_cell(order_index + 2, headers.index('timestamp') + 1,
86
+ datetime.now().strftime('%m/%d/%Y %H:%M')) # 更新时间戳
 
87
 
88
  return '订单已批准'
89
  except Exception as e: