feat(bill): 支持服务端跨字段检索与 --search-fields 参数

This commit is contained in:
gitea committed 2026-09-17 15:59:56 +08:00
1 parent 7e16a6a312
commit bcb77feabb
5 files changed
+159 -8

No files matched your search

+5 -1
View File
@@ -164,6 +164,7 @@ export async function handleBillCommand(
const code = stringOption(parsed.options, ["code", "c"]);
const keyword = stringOption(parsed.options, ["keyword", "k", "q", "query"]);
const searchFields = stringOption(parsed.options, ["search-fields", "searchFields", "search-field", "sf"]);
const stage = stringOption(parsed.options, ["stage"]);
const state = stringOption(parsed.options, ["state", "s"]);
const count = numberOption(parsed.options, ["count", "limit", "n"], 20);
@@ -179,6 +180,7 @@ export async function handleBillCommand(
const result = await searchAndFormatBills(await getClient(), corpId, {
code,
keyword,
searchFields,
stage,
state,
count,
@@ -223,7 +225,9 @@ export async function handleBillCommand(
if (since) filterSummary.push(`近 ${since}`);
if (startDate || endDate) filterSummary.push(`${startDate || "起"} ~ ${endDate || "止"}`);
if (code) filterSummary.push(`单号: ${code}`);
if (keyword) filterSummary.push(`关键字: ${keyword}`);
if (keyword) {
filterSummary.push(searchFields ? `关键字: ${keyword} (字段: ${searchFields})` : `关键字: ${keyword}`);
}
if (stage) filterSummary.push(`阶段: ${stage}`);
if (state) filterSummary.push(`状态: ${state}`);
const filterTag = filterSummary.length > 0 ? ` | 筛选: ${filterSummary.join(", ")}` : "";