feat(export): 决策261 导出弹框四选一(限勾一)——excel/html/yhy/原格式
- workbench.html:导出弹框(四复选框限勾一+取消/导出;手工无源格式置灰原格式;删旧手工三选弹框) - api_server:_export_session/_export_meta 通用化(fmt=html/yhy/xlsx 通用;手工空 fmt 拒绝) - core/export_html.py 新建:HTML 全量导出(目录树+汇总分析+项目/单位级工料机+清单→定额,审核备注全带,自包含单文件) - core/export_yhy.py 新建:.yhy 专有格式(manifest+sessions+全部数据表 zip;s_settings/s_remarks/s_edit_log 不导;导入另立项) - manual_import:Excel zip 内加「项目级工料机汇总.xlsx」(决策188 dyn_rows 现算同源;改 231「不导工料机」) - 台账/索引:决策 261 及补记 - 注:workbench/api_server/common.js 内含决策 258-260 遗留配套改动(同文件混改不可拆,一并入库;uiConfirm 依赖 common.js 同提) 351P+3S;四格式 API 断言 4/4;IAB 无头全链路实测(隔离实例)
This commit is contained in:
268
CostReview/app/core/export_html.py
Normal file
268
CostReview/app/core/export_html.py
Normal file
@@ -0,0 +1,268 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""HTML 导出(2026-11-03 主人定):导出「界面可以看到的一模一样的数据,包含审核的备注内容」,
|
||||
全部已有数据渲染成一个自包含 .html 单文件(内嵌样式,浏览器直接打开)。
|
||||
|
||||
层级与数据源(与工作台同一套会话库 + 决策 188 现算引擎,显示=导出):
|
||||
· 项目标题 / 目录树概览(s_sections → s_unit_works,树序=单项入库序+编号自然序,231 补记十)
|
||||
· 项目级工料机汇总(dyn_lme.dyn_rows 现算,前 11 列=界面项目级卡同形,决策 147/259)
|
||||
· 项目汇总分析(s_proj_summary 原样树,决策 244)
|
||||
· 单位工程:分部分项表(分部→清单→定额子行,审核备注列 x_remark)+措施项目表
|
||||
+单位级工料机汇总(dyn_lme.dyn_uw_rows 现算 9 列)
|
||||
· 临删行保留并打删除线(界面所见);没算的数值留空(填空三分类)
|
||||
只读会话库,不碰源文件;cos/cos4/xlsx 通道一概不经过这里。"""
|
||||
|
||||
import io
|
||||
import html as _h
|
||||
|
||||
import dyn_lme
|
||||
|
||||
|
||||
def _fmt_money(v):
|
||||
if v is None or v == "":
|
||||
return ""
|
||||
try:
|
||||
return "{:,.2f}".format(float(v))
|
||||
except (TypeError, ValueError):
|
||||
return str(v)
|
||||
|
||||
|
||||
def _fmt_qty(v):
|
||||
if v is None or v == "":
|
||||
return ""
|
||||
try:
|
||||
f = float(v)
|
||||
s = ("%f" % f).rstrip("0").rstrip(".")
|
||||
return s if s else "0"
|
||||
except (TypeError, ValueError):
|
||||
return str(v)
|
||||
|
||||
|
||||
def _e(v):
|
||||
return _h.escape("" if v is None else str(v), quote=True)
|
||||
|
||||
|
||||
def _tree_order(sc, sid):
|
||||
"""单位工程树序(=export_excel_bytes 同款:单项入库序+组内编号自然序)。"""
|
||||
from formats.skeleton import _natkey
|
||||
sec_order = {r["id"]: i for i, r in enumerate(
|
||||
sc.execute("SELECT id FROM s_sections WHERE session_id=? ORDER BY id", (sid,)).fetchall())}
|
||||
uws = sorted(sc.execute("SELECT * FROM s_unit_works WHERE session_id=?", (sid,)).fetchall(),
|
||||
key=lambda r: (sec_order.get(r["section_id"], len(sec_order)),
|
||||
_natkey(r["Number"] or ""), r["id"]))
|
||||
secs = sc.execute("SELECT * FROM s_sections WHERE session_id=? ORDER BY id", (sid,)).fetchall()
|
||||
return secs, uws
|
||||
|
||||
|
||||
def _proj_lme_table(sc, sid):
|
||||
"""项目级工料机汇总表(dyn_rows 前 11 列,与界面卡同形)。"""
|
||||
try:
|
||||
rows = dyn_lme.dyn_rows(sc, sid, None) or []
|
||||
except Exception:
|
||||
rows = []
|
||||
if not rows:
|
||||
return "<p class='empty'>没有数据</p>"
|
||||
out = ["<table class='grid'><thead><tr>",
|
||||
"<th>编码</th><th>名称</th><th>规格型号</th><th>单位</th><th>类别</th>",
|
||||
"<th>消耗量</th><th>除税编制价</th><th>税率(%)</th><th>含税编制价</th><th>备注</th>",
|
||||
"</tr></thead><tbody>"]
|
||||
for r in rows:
|
||||
out.append("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class='n'>%s</td>"
|
||||
"<td class='n'>%s</td><td class='n'>%s</td><td class='n'>%s</td><td>%s</td></tr>"
|
||||
% (_e(r[1]), _e(r[2]), _e(r[3]), _e(r[4]), _e(r[9]),
|
||||
_fmt_qty(r[5]), _fmt_money(r[6]), _fmt_qty(r[7]), _fmt_money(r[8]), _e(r[10])))
|
||||
out.append("</tbody></table>")
|
||||
return "".join(out)
|
||||
|
||||
|
||||
def _uw_lme_table(sc, sid, uw_id):
|
||||
"""单位级工料机汇总表(dyn_uw_rows 前 9 列=界面形状:码/名/规/单/类别/量/除税/税率/含税)。"""
|
||||
try:
|
||||
rows = dyn_lme.dyn_uw_rows(sc, sid, uw_id) or []
|
||||
except Exception:
|
||||
rows = []
|
||||
if not rows:
|
||||
return "<p class='empty'>没有数据</p>"
|
||||
out = ["<table class='grid'><thead><tr>",
|
||||
"<th>编码</th><th>名称</th><th>规格型号</th><th>单位</th><th>类别</th>",
|
||||
"<th>数量</th><th>除税价</th><th>税率(%)</th><th>含税价</th>",
|
||||
"</tr></thead><tbody>"]
|
||||
for r in rows:
|
||||
out.append("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class='n'>%s</td>"
|
||||
"<td class='n'>%s</td><td class='n'>%s</td><td class='n'>%s</td></tr>"
|
||||
% (_e(r[0]), _e(r[1]), _e(r[2]), _e(r[3]), _e(r[4]),
|
||||
_fmt_qty(r[5]), _fmt_money(r[6]), _fmt_qty(r[7]), _fmt_money(r[8])))
|
||||
out.append("</tbody></table>")
|
||||
return "".join(out)
|
||||
|
||||
|
||||
def _proj_summary_table(sc, sid):
|
||||
"""项目汇总分析(s_proj_summary 原样树,决策 244;无表/无数据=空卡)。"""
|
||||
try:
|
||||
rows = sc.execute("""SELECT Kind, Number, Code, Name, Formula, Rate, Total, Remark
|
||||
FROM s_proj_summary WHERE session_id=? ORDER BY id""",
|
||||
(sid,)).fetchall()
|
||||
except Exception:
|
||||
rows = []
|
||||
if not rows:
|
||||
return "<p class='empty'>没有数据</p>"
|
||||
out = ["<table class='grid'><thead><tr><th>序号</th><th>编码</th><th>名称</th>",
|
||||
"<th>计算公式/说明</th><th>费率(%)</th><th>金额</th><th>备注</th>",
|
||||
"</tr></thead><tbody>"]
|
||||
for r in rows:
|
||||
num = r["Number"] or ""
|
||||
out.append("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class='n'>%s</td>"
|
||||
"<td class='n'>%s</td><td>%s</td></tr>"
|
||||
% (_e(num), _e(r["Code"]), _e(r["Name"]), _e(r["Formula"]),
|
||||
_fmt_qty(r["Rate"]), _fmt_money(r["Total"]), _e(r["Remark"])))
|
||||
out.append("</tbody></table>")
|
||||
return "".join(out)
|
||||
|
||||
|
||||
def _bills_tables(sc, uw_id):
|
||||
"""单位工程的 分部分项+措施 两张表(分部树递归照 export_excel_bytes 同款挂接)。"""
|
||||
ds_all = [dict(r) for r in sc.execute(
|
||||
"SELECT * FROM s_divides WHERE uw_id=? ORDER BY x_seq, id", (uw_id,)).fetchall()]
|
||||
bills = [dict(r) for r in sc.execute(
|
||||
"""SELECT * FROM s_bills WHERE uw_id=?
|
||||
ORDER BY CASE WHEN x_seq IS NULL THEN 1 ELSE 0 END, x_seq, id""", (uw_id,)).fetchall()]
|
||||
|
||||
def b_total(b):
|
||||
try:
|
||||
if b.get("Quantity") is not None and b.get("Price") is not None:
|
||||
return round(float(b["Quantity"]) * float(b["Price"]), 2)
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
return b.get("Total")
|
||||
|
||||
def norm_rows_html(bill_id):
|
||||
out = []
|
||||
for n in sc.execute("""SELECT Number, Name, Unit, Quantity, Price, Total, x_tdel
|
||||
FROM s_norms WHERE bill_id=? ORDER BY id""", (bill_id,)).fetchall():
|
||||
out.append("<tr%s><td class='ind'>└ %s</td><td>%s</td><td></td><td>%s</td>"
|
||||
"<td class='n'>%s</td><td class='n'>%s</td><td class='n'>%s</td><td></td></tr>"
|
||||
% ((" class='tdel'" if n["x_tdel"] else ""),
|
||||
_e(n["Number"]), _e(n["Name"]), _e(n["Unit"]),
|
||||
_fmt_qty(n["Quantity"]), _fmt_money(n["Price"]), _fmt_money(n["Total"])))
|
||||
return "".join(out)
|
||||
|
||||
def bill_html(b):
|
||||
return ("<tr%s><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class='n'>%s</td>"
|
||||
"<td class='n'>%s</td><td class='n'>%s</td><td>%s</td></tr>%s"
|
||||
% ((" class='tdel'" if b.get("x_tdel") else ""),
|
||||
_e(b.get("Number")), _e(b.get("Name")), _e(b.get("Attr")), _e(b.get("Unit")),
|
||||
_fmt_qty(b.get("Quantity")), _fmt_money(b.get("Price")),
|
||||
_fmt_money(b_total(b)), _e(b.get("x_remark")), norm_rows_html(b["id"])))
|
||||
|
||||
def table(head_html, rows_html):
|
||||
if not rows_html:
|
||||
return "<p class='empty'>没有数据</p>"
|
||||
return "<table class='grid'><thead><tr>%s</tr></thead><tbody>%s</tbody></table>" % (
|
||||
head_html, rows_html)
|
||||
|
||||
head = ("<th>编码</th><th>名称</th><th>项目特征</th><th>单位</th><th>工程数量</th>"
|
||||
"<th>单价</th><th>合价</th><th>审核备注</th>")
|
||||
|
||||
# 分部分项:分部树递归(子分部/清单挂上级名下,同 231 补记十树口径)
|
||||
ds = [d for d in ds_all if d.get("Kind") != "prelim"]
|
||||
ids = {d["id"] for d in ds}
|
||||
kids, roots = {}, []
|
||||
for d in ds:
|
||||
p = d.get("parent_id")
|
||||
(kids.setdefault(p, []).append(d)) if p in ids else roots.append(d)
|
||||
by_div = {}
|
||||
for b in bills:
|
||||
if b.get("Kind") == "prelim":
|
||||
continue
|
||||
by_div.setdefault(b.get("div_id"), []).append(b)
|
||||
|
||||
def walk(d, out):
|
||||
out.append("<tr class='div'><td></td><td colspan='7'>▣ %s</td></tr>" % _e(d.get("Name")))
|
||||
for b in by_div.get(d["id"], []):
|
||||
out.append(bill_html(b))
|
||||
for sub in kids.get(d["id"], []):
|
||||
walk(sub, out)
|
||||
|
||||
fb_rows = []
|
||||
for d in roots:
|
||||
walk(d, fb_rows)
|
||||
for b in by_div.get(None, []): # 无分部挂靠的清单:落首个一级分部名下兜底(同 Excel 通道)
|
||||
if roots:
|
||||
fb_rows.insert(0, bill_html(b))
|
||||
else:
|
||||
fb_rows.append(bill_html(b))
|
||||
# 措施项目:清单平铺(带上级分部名列省略,界面措施区同数据)
|
||||
prelim_rows = [bill_html(b) for b in bills if b.get("Kind") == "prelim"]
|
||||
return (table(head, "".join(fb_rows)), table(head, "".join(prelim_rows)))
|
||||
|
||||
|
||||
_CSS = """
|
||||
body{font-family:"Microsoft YaHei",Arial,sans-serif;margin:24px;color:#243b53;background:#f7f9fc}
|
||||
h1{font-size:22px;border-bottom:2px solid #1f66d1;padding-bottom:8px}
|
||||
h2{font-size:18px;margin:28px 0 10px;color:#1f66d1}
|
||||
h3{font-size:15px;margin:20px 0 8px;background:#eaf1fb;padding:6px 10px;border-left:4px solid #1f66d1}
|
||||
h4{font-size:13px;margin:14px 0 6px;color:#5b6b80}
|
||||
table.grid{border-collapse:collapse;width:100%;font-size:12px;background:#fff}
|
||||
table.grid th,table.grid td{border:1px solid #c9d6e8;padding:4px 7px;text-align:left;vertical-align:top}
|
||||
table.grid th{background:#eaf1fb;color:#243b53;white-space:nowrap}
|
||||
td.n,th.n{text-align:right;white-space:nowrap}
|
||||
tr.div td{background:#f2f6fc;font-weight:600}
|
||||
tr.tdel td{text-decoration:line-through;color:#98a6b8;background:#fafbfc}
|
||||
td.ind{padding-left:22px;color:#5b6b80}
|
||||
p.empty{color:#98a6b8;font-size:12px;margin:6px 0}
|
||||
.meta{color:#8a97a8;font-size:12px;margin:4px 0 18px}
|
||||
.toc li{margin:2px 0;font-size:13px}
|
||||
"""
|
||||
|
||||
|
||||
def export(sc, sid):
|
||||
"""HTML 导出入口:返回 (字节, 文件名, 错误)。"""
|
||||
srow = sc.execute("SELECT * FROM sessions WHERE id=?", (sid,)).fetchone()
|
||||
if not srow:
|
||||
return None, None, "会话不存在"
|
||||
proj = (srow["Name"] if "Name" in srow.keys() else srow["name"]) or "工程"
|
||||
secs, uws = _tree_order(sc, sid)
|
||||
if not uws:
|
||||
return None, None, "本工程还没有单位工程,无数据可导出"
|
||||
secs_by_id = {r["id"]: r for r in secs}
|
||||
|
||||
out = ["<!DOCTYPE html><html lang='zh-CN'><head><meta charset='utf-8'>",
|
||||
"<title>%s-审核版</title><style>%s</style></head><body>" % (_e(proj), _CSS)]
|
||||
out.append("<h1>%s <span style='font-size:13px;color:#8a97a8'>(审核版 HTML 导出)</span></h1>" % _e(proj))
|
||||
|
||||
# 目录树概览
|
||||
out.append("<h2>目录树</h2><ul class='toc'>")
|
||||
cur_sec = None
|
||||
for i, u in enumerate(uws):
|
||||
s = secs_by_id.get(u["section_id"])
|
||||
if s is not None and s["id"] != cur_sec:
|
||||
cur_sec = s["id"]
|
||||
out.append("<li><b>%s %s</b></li><ul>" % (_e(s["Number"]), _e(s["Name"])))
|
||||
out.append("<li>%s %s <span class='meta'>合价 %s</span></li>"
|
||||
% (_e(u["Number"]), _e(u["Name"]), _fmt_money(u["Total"])))
|
||||
nxt = uws[i + 1] if i + 1 < len(uws) else None
|
||||
if s is not None and (nxt is None or nxt["section_id"] != cur_sec):
|
||||
out.append("</ul>")
|
||||
out.append("</ul>")
|
||||
|
||||
# 项目级:汇总分析 + 工料机汇总(界面原数据卡同数据)
|
||||
out.append("<h2>项目汇总分析</h2>")
|
||||
out.append(_proj_summary_table(sc, sid))
|
||||
out.append("<h2>项目级工料机汇总</h2>")
|
||||
out.append(_proj_lme_table(sc, sid))
|
||||
|
||||
# 单位工程明细
|
||||
for u in uws:
|
||||
out.append("<h3>%s %s <span style='font-weight:400'>合价 %s</span></h3>"
|
||||
% (_e(u["Number"]), _e(u["Name"]), _fmt_money(u["Total"])))
|
||||
fb, prelim = _bills_tables(sc, u["id"])
|
||||
out.append("<h4>分部分项</h4>")
|
||||
out.append(fb)
|
||||
out.append("<h4>措施项目</h4>")
|
||||
out.append(prelim)
|
||||
out.append("<h4>单位级工料机汇总</h4>")
|
||||
out.append(_uw_lme_table(sc, sid, u["id"]))
|
||||
|
||||
out.append("<p class='meta'>导出时间:%s 数据与工作台显示同源(含审核备注)</p>" %
|
||||
__import__("datetime").datetime.now().strftime("%Y-%m-%d %H:%M"))
|
||||
out.append("</body></html>")
|
||||
return "".join(out).encode("utf-8"), proj + "-审核版.html", None
|
||||
89
CostReview/app/core/export_yhy.py
Normal file
89
CostReview/app/core/export_yhy.py
Normal file
@@ -0,0 +1,89 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
""".yhy 专有格式导出(2026-11-03 主人定):审核等全部数据打包单文件,不同租户相互交流。
|
||||
|
||||
内容 = 该会话在会话库里的全部数据:
|
||||
· sessions 行(17 列全带,含 x_info/x_feat 等原文)
|
||||
· 全部带 session_id 的 s_* 表(动态枚举 sqlite_master,将来加表自动带上,防漏表)
|
||||
· s_norms / s_norm_res(无 session_id,按 bills→norms 父引用带出)
|
||||
不导:s_settings(软件设置,非会话数据)、s_remarks(按源文件共享的备注源库,备注本体
|
||||
已在 s_bills.x_remark)、s_edit_log(审计日志按内容锚关联,无法按会话切分)。
|
||||
|
||||
格式:zip 包(manifest.json + sessions.json + rows/<表>.json,UTF-8 JSON)。
|
||||
导入(收方建会话)另立项——子表 id 全局自增、跨会话会撞号,方案待主人拍板。"""
|
||||
|
||||
import io
|
||||
import json
|
||||
import zipfile
|
||||
from datetime import datetime
|
||||
|
||||
YHY_MAGIC = "YHY"
|
||||
YHY_VERSION = 1
|
||||
_SKIP_TABLES = ("s_settings", "s_remarks", "s_edit_log")
|
||||
|
||||
|
||||
def _json_default(o):
|
||||
if isinstance(o, (bytes, bytearray)):
|
||||
return o.decode("utf-8", "replace")
|
||||
return str(o)
|
||||
|
||||
|
||||
def _session_tables(sc):
|
||||
"""带 session_id 的 s_* 表(动态枚举,防漏表)。"""
|
||||
tabs = [r[0] for r in sc.execute(
|
||||
"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name").fetchall()]
|
||||
out = []
|
||||
for t in tabs:
|
||||
if not t.startswith("s_") or t in _SKIP_TABLES:
|
||||
continue
|
||||
cols = [c[1] for c in sc.execute("PRAGMA table_info('%s')" % t).fetchall()]
|
||||
if "session_id" in cols:
|
||||
out.append(t)
|
||||
return out
|
||||
|
||||
|
||||
def export(sc, sid):
|
||||
""".yhy 导出入口:返回 (字节, 文件名, 错误)。"""
|
||||
srow = sc.execute("SELECT * FROM sessions WHERE id=?", (sid,)).fetchone()
|
||||
if not srow:
|
||||
return None, None, "会话不存在"
|
||||
proj = (srow["name"] if "name" in srow.keys() else srow["Name"]) or "工程"
|
||||
payload = {}
|
||||
payload["sessions"] = [dict(r) for r in sc.execute(
|
||||
"SELECT * FROM sessions WHERE id=?", (sid,)).fetchall()]
|
||||
for t in _session_tables(sc):
|
||||
payload[t] = [dict(r) for r in sc.execute(
|
||||
"SELECT * FROM %s WHERE session_id=? ORDER BY id" % t, (sid,)).fetchall()]
|
||||
# 子表按父引用带出(s_norms→bills,s_norm_res→norms;无数据=空表也留键,收方可对结构)
|
||||
bids = [b["id"] for b in payload.get("s_bills", [])]
|
||||
if bids:
|
||||
ph = ",".join("?" * len(bids))
|
||||
payload["s_norms"] = [dict(r) for r in sc.execute(
|
||||
"SELECT * FROM s_norms WHERE bill_id IN (%s) ORDER BY id" % ph, bids).fetchall()]
|
||||
else:
|
||||
payload["s_norms"] = []
|
||||
nids = [n["id"] for n in payload["s_norms"]]
|
||||
if nids:
|
||||
ph = ",".join("?" * len(nids))
|
||||
payload["s_norm_res"] = [dict(r) for r in sc.execute(
|
||||
"SELECT * FROM s_norm_res WHERE norm_id IN (%s) ORDER BY id" % ph, nids).fetchall()]
|
||||
else:
|
||||
payload["s_norm_res"] = []
|
||||
|
||||
manifest = {
|
||||
"magic": YHY_MAGIC,
|
||||
"version": YHY_VERSION,
|
||||
"exported_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
||||
"session_name": proj,
|
||||
"tables": {t: len(v) for t, v in sorted(payload.items())},
|
||||
}
|
||||
buf = io.BytesIO()
|
||||
with zipfile.ZipFile(buf, "w", zipfile.ZIP_DEFLATED) as zo:
|
||||
zo.writestr("manifest.json", json.dumps(manifest, ensure_ascii=False, indent=1))
|
||||
zo.writestr("sessions.json", json.dumps(payload["sessions"], ensure_ascii=False,
|
||||
default=_json_default))
|
||||
for t, rows in payload.items():
|
||||
if t == "sessions":
|
||||
continue
|
||||
zo.writestr("rows/%s.json" % t, json.dumps(rows, ensure_ascii=False,
|
||||
default=_json_default))
|
||||
return buf.getvalue(), proj + "-审核版.yhy", None
|
||||
@@ -908,9 +908,35 @@ def export_excel_bytes(sc, sid):
|
||||
k += 1
|
||||
used[nm] = True
|
||||
zo.writestr("%s/%s" % (folder, nm), _unit_workbook(u, divs, bills))
|
||||
# 2026-11-03 主人定:Excel 导出工料机只导「项目级工料机汇总」一份(取代 231「不导
|
||||
# 工料机」);数据=决策 188 dyn_rows 现算,与界面项目级卡同源同值。
|
||||
zo.writestr("%s/项目级工料机汇总.xlsx" % folder, _proj_lme_workbook(sc, sid))
|
||||
return buf.getvalue(), proj + "-审核版.zip", None
|
||||
|
||||
|
||||
def _proj_lme_workbook(sc, sid):
|
||||
"""项目级工料机汇总.xlsx 单件字节:列=界面项目级卡 9 列+备注(dyn_rows 前 11 列)。
|
||||
没有现算数据时只留表头(没数据不造数)。"""
|
||||
import io as _io
|
||||
import dyn_lme
|
||||
wb = Workbook()
|
||||
ws = wb.active
|
||||
ws.title = "项目级工料机汇总"
|
||||
ws.append(["编码", "名称", "规格型号", "单位", "类别",
|
||||
"消耗量", "除税编制价", "税率(%)", "含税编制价", "备注"])
|
||||
for c in ws[1]:
|
||||
c.font = Font(bold=True)
|
||||
try:
|
||||
rows = dyn_lme.dyn_rows(sc, sid, None) or []
|
||||
except Exception:
|
||||
rows = []
|
||||
for r in rows:
|
||||
ws.append([r[1], r[2], r[3], r[4], r[9], r[5], r[6], r[7], r[8], r[10]])
|
||||
buf = _io.BytesIO()
|
||||
wb.save(buf)
|
||||
return buf.getvalue()
|
||||
|
||||
|
||||
def _unit_workbook(u, divs, bills):
|
||||
"""单单位工程 xlsx 字节(决策 231 架子:填写说明+分部分项10列+措施8列,合价/备注)。
|
||||
决策 233:自 export_excel_bytes 抽出——整包 zip 与单单位工程导出(export_unit_xlsx)同一产出。"""
|
||||
|
||||
Reference in New Issue
Block a user