7b62c2f8b4
## H5 底部导航修复 (Bug #10) - 精简 App.vue,移除重复 tabbar,仅保留全局样式 - uni-page 设置 height: calc(100% - 50px) + overflow-y: auto - 内容区域精确停在底部导航上方,独立滚动不再叠加 - 恢复 custom-tab-bar 组件 ## 项目进度文档 - PROGRESS.md 更新至 10 个 Bug 修复 - 新增 H5 底部导航修复记录 - 新增历史变更条目
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
from typing import List, Dict, Any
|
|
import csv
|
|
import io
|
|
|
|
|
|
def export_customers_csv(customers: List[Dict[str, Any]]) -> bytes:
|
|
output = io.StringIO()
|
|
writer = csv.writer(output)
|
|
writer.writerow(["Name", "Company", "Country", "Phone", "Email", "Status", "Last Contact"])
|
|
for c in customers:
|
|
writer.writerow([
|
|
c.get("name", ""),
|
|
c.get("company", ""),
|
|
c.get("country", ""),
|
|
c.get("phone", ""),
|
|
c.get("email", ""),
|
|
c.get("status", ""),
|
|
c.get("last_contact_at", ""),
|
|
])
|
|
return output.getvalue().encode("utf-8-sig")
|
|
|
|
|
|
def export_quotations_csv(quotations: List[Dict[str, Any]]) -> bytes:
|
|
output = io.StringIO()
|
|
writer = csv.writer(output)
|
|
writer.writerow(["Title", "Customer", "Currency", "Subtotal", "Total", "Status", "Date"])
|
|
for q in quotations:
|
|
writer.writerow([
|
|
q.get("title", ""),
|
|
q.get("customer_name", ""),
|
|
q.get("currency", "USD"),
|
|
q.get("subtotal", 0),
|
|
q.get("total", 0),
|
|
q.get("status", ""),
|
|
q.get("created_at", ""),
|
|
])
|
|
return output.getvalue().encode("utf-8-sig") |