This commit is contained in:
DDD1542
2026-04-06 17:12:30 +09:00
parent 3d95eb8caa
commit b30066e7e3

View File

@@ -2078,15 +2078,18 @@ export default function CustomerManagementPage() {
type="checkbox"
checked={modalContactForm.is_main === "Y" || modalContactForm.is_main === true}
onChange={async (e) => {
if (e.target.checked) {
const checked = e.target.checked;
if (checked) {
const existingMain = modalContacts.find((x) => (x.is_main === "Y" || x.is_main === true) && (x._localId || x.id) !== modalContactEditId);
if (existingMain) {
const ok = await confirm(`현재 메인 담당자는 "${existingMain.contact_name}"입니다. 변경하시겠습니까?`);
if (!ok) return;
setModalContacts((prev) => prev.map((item) => ({ ...item, is_main: "N" })));
}
setModalContactForm((p) => ({ ...p, is_main: "Y" }));
} else {
setModalContactForm((p) => ({ ...p, is_main: "N" }));
}
setModalContactForm((p) => ({ ...p, is_main: e.target.checked ? "Y" : "N" }));
}}
className="rounded"
/>
@@ -2302,15 +2305,18 @@ export default function CustomerManagementPage() {
type="checkbox"
checked={modalDeliveryForm.is_default === "Y" || modalDeliveryForm.is_default === true}
onChange={async (e) => {
if (e.target.checked) {
const checked = e.target.checked;
if (checked) {
const existingMain = modalDeliveries.find((x) => (x.is_default === "Y" || x.is_default === true) && (x._localId || x.id) !== modalDeliveryEditId);
if (existingMain) {
const ok = await confirm(`현재 메인 납품처는 "${existingMain.destination_name}"입니다. 변경하시겠습니까?`);
if (!ok) return;
setModalDeliveries((prev) => prev.map((item) => ({ ...item, is_default: "N" })));
}
setModalDeliveryForm((p) => ({ ...p, is_default: "Y" }));
} else {
setModalDeliveryForm((p) => ({ ...p, is_default: "N" }));
}
setModalDeliveryForm((p) => ({ ...p, is_default: e.target.checked ? "Y" : "N" }));
}}
className="rounded"
/>