细节修改
This commit is contained in:
@@ -591,7 +591,7 @@ def generate_excel(orders, selected_fields, sum_fields, sum_results,
|
||||
reports_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'public', 'reports')
|
||||
os.makedirs(reports_dir, exist_ok=True)
|
||||
|
||||
# 生成文件名 - 格式:序号_配置名称_几月几日消费记录.xlsx
|
||||
# 生成文件名 - 格式:配置名称_几月几日消费记录.xlsx
|
||||
# 从 start_time 提取日期(报表数据对应的是开始时间那天的数据)
|
||||
try:
|
||||
start_dt = datetime.strptime(start_time, '%Y-%m-%d %H:%M:%S')
|
||||
@@ -602,12 +602,7 @@ def generate_excel(orders, selected_fields, sum_fields, sum_results,
|
||||
# 如果有补单,添加标记
|
||||
supplement_suffix = '_有补单' if has_supplement else ''
|
||||
|
||||
# 顺序号前缀(两位数字,不足补零)
|
||||
sort_prefix = ''
|
||||
if sort_order:
|
||||
sort_prefix = f'{sort_order:02d}_'
|
||||
|
||||
filename = f'{sort_prefix}{config_name}_{date_str}消费记录{supplement_suffix}.xlsx'
|
||||
filename = f'{config_name}_{date_str}消费记录{supplement_suffix}.xlsx'
|
||||
file_path = os.path.join(reports_dir, filename)
|
||||
|
||||
# 创建工作簿
|
||||
|
||||
Reference in New Issue
Block a user