门店账户多账号
This commit is contained in:
@@ -310,6 +310,16 @@ export default function StoreCreatePage() {
|
||||
setFieldErrors({ phone: phoneMsg });
|
||||
return;
|
||||
}
|
||||
if (phoneCheck.needConfirm) {
|
||||
const ok = window.confirm(
|
||||
phoneCheck.message ??
|
||||
`该手机号已是门店主账号(已绑 ${phoneCheck.existingStoreCount ?? 0} 家店),确认后将追加绑定新店。是否继续?`,
|
||||
);
|
||||
if (!ok) {
|
||||
setFieldErrors({ phone: '已取消绑定已有主账号,请更换手机号或确认后继续' });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
reportFormError(e instanceof Error ? e.message : '手机号校验失败');
|
||||
@@ -381,6 +391,8 @@ export default function StoreCreatePage() {
|
||||
|
||||
setFieldErrors({});
|
||||
|
||||
let confirmBindExisting = false;
|
||||
|
||||
try {
|
||||
|
||||
const phoneCheck = await checkStorePhoneAvailable(form.phone.trim());
|
||||
@@ -397,6 +409,18 @@ export default function StoreCreatePage() {
|
||||
|
||||
}
|
||||
|
||||
if (phoneCheck.needConfirm) {
|
||||
const ok = window.confirm(
|
||||
phoneCheck.message ??
|
||||
`该手机号已是门店主账号(已绑 ${phoneCheck.existingStoreCount ?? 0} 家店),确认后将追加绑定新店。是否继续?`,
|
||||
);
|
||||
if (!ok) {
|
||||
setFieldErrors({ phone: '已取消绑定已有主账号,请更换手机号或确认后继续' });
|
||||
return;
|
||||
}
|
||||
confirmBindExisting = true;
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
reportFormError(e instanceof Error ? e.message : '手机号校验失败');
|
||||
return;
|
||||
@@ -440,6 +464,8 @@ export default function StoreCreatePage() {
|
||||
|
||||
bankBranch: form.bankBranch.trim(),
|
||||
|
||||
...(confirmBindExisting ? { confirmBindExisting: true } : {}),
|
||||
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user