Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
79 |
-
(current_status == '待财务审批' and approver_role
|
80 |
-
(current_status == '待总经理审批' and approver_role
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
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:
|