Compare commits

...

2 Commits

View File

@@ -424,10 +424,11 @@ function renderFinance() {
${card(`<h2 class="mb-4 text-lg font-bold">收入、毛利、成本/费用、净利月度曲线</h2><div style="position:relative;height:300px"><canvas id="financeChart2"></canvas></div>`, "p-5")}
${card(formHtml([
{ label: "日期", input: `<input name="month" type="date" required>` },
{ label: "类", input: `<select name="category"><option></option><option>/</option><option></option></select>` },
{ label: "类", input: `<select name="category"><option>签单</option><option></option><option></option><option></option><option></option></select>` },
{ label: "金额/万", input: `<input name="amount" type="number" step="0.01" required>` },
{ label: "费用说明", input: `<input name="notes" placeholder="摘要说明">` },
], { handler: "createFinance", text: "新增明细" }), "p-4")}
${renderTable(["日期", "类", "金额", "备注"], rows)}
${card(`<div class="flex items-center justify-between cursor-pointer" onclick="document.querySelector('#finance-table').classList.toggle('hidden'); this.querySelector('i').classList.toggle('rotate-90')"><h3 class="font-bold text-slate-700">明细列表 <span class="text-slate-400 font-normal">(${state.data.finance.length})</span></h3><i data-lucide="chevron-down" class="transition-transform rotate-90"></i></div><div id="finance-table" class="hidden mt-3">${renderTable(["日期", "类", "金额", "备注"], rows)}</div>`, "p-4")}
</div>`;
renderChartOn("financeChart2", state.data.financeMonthly);
}