feat(customers): 联系人/结算人各自独立手机号
- customers 表新增 contacts_phone / balance_user_phone 两列(sql/add-contact-phones.sql) - 新增表单拆出"联系人信息/结算人信息"分区,手机号必填并校验 11 位;编辑选填 - 列表联系人/结算人列改为姓名+手机号两行展示,沿用业务员脱敏规则 - 查看弹窗同步分区并在服务端预脱敏,旧公共 phone 不再下发客户端 - 生日提醒页按生日归属展示对应人姓名+手机号,空值回退旧 phone - 导入模板/导出增加两个新列,保留"联系电话"表头兼容旧导入文件 - 旧 phone 列保留历史数据,界面不再录入/展示 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,8 +11,9 @@ import type { ActionState } from "./actions";
|
||||
type CustomerValues = {
|
||||
customerName?: string | null;
|
||||
contacts?: string | null;
|
||||
contactsPhone?: string | null;
|
||||
balanceUser?: string | null;
|
||||
phone?: string | null;
|
||||
balanceUserPhone?: string | null;
|
||||
detail?: string | null;
|
||||
deposit?: string | null;
|
||||
buy?: string | null;
|
||||
@@ -107,18 +108,7 @@ export function CustomerForm({
|
||||
pattern={requireAll ? "\\S+" : undefined}
|
||||
title={requireAll ? "商户名称不能包含空格" : undefined}
|
||||
/>
|
||||
<Field label="联系人" name="contacts" defaultValue={v.contacts} required />
|
||||
<Field label="结算人" name="balanceUser" defaultValue={v.balanceUser} required />
|
||||
<Field label="业务员" name="salesman" defaultValue={v.salesman} required />
|
||||
<Field
|
||||
label="联系电话"
|
||||
name="phone"
|
||||
defaultValue={v.phone}
|
||||
required={requireAll}
|
||||
pattern={requireAll ? "1\\d{10}" : undefined}
|
||||
inputMode={requireAll ? "numeric" : undefined}
|
||||
title={requireAll ? "请输入 11 位手机号" : undefined}
|
||||
/>
|
||||
<Field
|
||||
label="报单日期"
|
||||
name="reportDate"
|
||||
@@ -129,6 +119,36 @@ export function CustomerForm({
|
||||
</div>
|
||||
</FormSection>
|
||||
|
||||
<FormSection title="联系人信息">
|
||||
<div className="grid grid-cols-1 gap-x-5 gap-y-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Field label="姓名" name="contacts" defaultValue={v.contacts} required />
|
||||
<Field
|
||||
label="手机号"
|
||||
name="contactsPhone"
|
||||
defaultValue={v.contactsPhone}
|
||||
required={requireAll}
|
||||
pattern={requireAll ? "1\\d{10}" : undefined}
|
||||
inputMode={requireAll ? "numeric" : undefined}
|
||||
title={requireAll ? "请输入 11 位手机号" : undefined}
|
||||
/>
|
||||
</div>
|
||||
</FormSection>
|
||||
|
||||
<FormSection title="结算人信息">
|
||||
<div className="grid grid-cols-1 gap-x-5 gap-y-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Field label="姓名" name="balanceUser" defaultValue={v.balanceUser} required />
|
||||
<Field
|
||||
label="手机号"
|
||||
name="balanceUserPhone"
|
||||
defaultValue={v.balanceUserPhone}
|
||||
required={requireAll}
|
||||
pattern={requireAll ? "1\\d{10}" : undefined}
|
||||
inputMode={requireAll ? "numeric" : undefined}
|
||||
title={requireAll ? "请输入 11 位手机号" : undefined}
|
||||
/>
|
||||
</div>
|
||||
</FormSection>
|
||||
|
||||
<FormSection title="生日">
|
||||
<div className="grid grid-cols-1 gap-x-5 gap-y-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<div className="space-y-1.5">
|
||||
|
||||
Reference in New Issue
Block a user