feat: 生日归属字段贯通全部界面(查看/列表/提醒/导入/导出/模板)
补全 birthdayOwner(1=结算人 2=联系人)在 schema 写入链路之外的所有流转环节: - 查看弹窗 customer-view:新增"生日归属"行 - 商户列表 page:生日单元格追加归属 badge - 生日提醒页 birthday:新增"归属"列(Row 类型 / SQL / 表头 / colSpan 6→7 / 单元格) - 导入 actions.importCustomers:validData 写入 birthdayOwner(结算人或"1"→1,否则→2) - 导出 export/route + query.EXCEL_COLUMNS:新增"生日归属"列与对应行值 - 导入模板 template/route:表头与示例行同步插入"生日归属"/"联系人" - 表单 customer-form:CustomerValues 类型补 birthdayOwner(消除 v.birthdayOwner 的 TS 报错,编辑页正确回填) 前置条件:MySQL customers 表需新增 birthday_owner 列(见 PR 说明),否则写入与生日页 SQL 会报 Unknown column。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ const schema = z.object({
|
||||
deposit: z.string().trim().optional().default(""),
|
||||
buy: z.string().trim().optional().default(""),
|
||||
birthdayType: z.coerce.number().int().min(1).max(2).default(1),
|
||||
birthdayOwner: z.coerce.number().int().min(1).max(2).default(2),
|
||||
birthday: z.string().trim().optional().default(""),
|
||||
remark: z.string().trim().optional().default(""),
|
||||
});
|
||||
@@ -63,6 +64,7 @@ function pickForm(formData: FormData) {
|
||||
deposit: formData.get("deposit") ?? "",
|
||||
buy: formData.get("buy") ?? "",
|
||||
birthdayType: formData.get("birthdayType") ?? 1,
|
||||
birthdayOwner: formData.get("birthdayOwner") ?? 2,
|
||||
birthday: formData.get("birthday") ?? "",
|
||||
remark: formData.get("remark") ?? "",
|
||||
};
|
||||
@@ -127,6 +129,7 @@ const HEADER_MAP: Record<string, string> = {
|
||||
押金: "deposit",
|
||||
买断: "buy",
|
||||
生日类型: "birthdayType",
|
||||
生日归属: "birthdayOwner",
|
||||
生日: "birthday",
|
||||
业务员: "salesman",
|
||||
报单日期: "reportDate",
|
||||
@@ -179,6 +182,7 @@ export async function importCustomers(formData: FormData): Promise<ImportResult>
|
||||
salesman: rec.salesman || null,
|
||||
remark: rec.remark || null,
|
||||
birthdayType: rec.birthdayType === "阴历" || rec.birthdayType === "2" ? 2 : 1,
|
||||
birthdayOwner: rec.birthdayOwner === "结算人" || rec.birthdayOwner === "1" ? 1 : 2,
|
||||
birthday: parseDate(rec.birthday),
|
||||
reportDate,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user