diff --git a/resources/views/esign/create.blade.php b/resources/views/esign/create.blade.php index 09c7ac1d..b7dc9db8 100644 --- a/resources/views/esign/create.blade.php +++ b/resources/views/esign/create.blade.php @@ -580,6 +580,40 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i = })); }; + // 개발용: 주소/사업자등록번호/상호 랜덤 입력 + const fillRandomVariables = () => { + const addresses = [ + '서울특별시 강남구 테헤란로 123, 4층', + '서울특별시 서초구 서초대로 456, 7층', + '경기도 성남시 분당구 판교로 789', + '서울특별시 마포구 월드컵북로 54길 12', + '인천광역시 연수구 송도과학로 32', + ]; + const bizNos = [ + '123-45-67890', '234-56-78901', '345-67-89012', + '456-78-90123', '567-89-01234', + ]; + const companies = [ + '(주)테스트컴퍼니', '(주)블루오션', '(주)스마트솔루션', + '(주)넥스트웨이브', '(주)그린테크', + ]; + const pick = arr => arr[Math.floor(Math.random() * arr.length)]; + const labelMap = { + '주소': pick(addresses), + '사업자등록번호': pick(bizNos), + '상호': pick(companies), + }; + setMetadata(prev => { + const updated = { ...prev }; + templateVars.forEach(v => { + if (labelMap[v.label] !== undefined) { + updated[v.key] = labelMap[v.label]; + } + }); + return updated; + }); + }; + const fillRandomCounterpart = async () => { try { const res = await fetch(`/esign/contracts/search-partners?q=`, { @@ -665,6 +699,20 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i = if (hasTemplates) { setStep(2); } else { handleSubmit(); } } else if (step === 2) { applyTitleDefaults(form.title); + // 상대방 이름/전화번호를 계약 변수에 자동 입력 + setMetadata(prev => { + const updated = { ...prev }; + const labelMap = { + '파트너명': form.counterpart_name, + '전화번호': form.counterpart_phone, + }; + templateVars.forEach(v => { + if (labelMap[v.label] !== undefined && labelMap[v.label] && !updated[v.key]?.trim()) { + updated[v.key] = labelMap[v.label]; + } + }); + return updated; + }); setStep(3); } }; @@ -991,7 +1039,16 @@ className="px-5 py-1.5 bg-blue-600 text-white rounded-md hover:bg-blue-700 text- {templateVars.length > 0 && (