From abf424d10e04bfeac35a5912841af21c710e36e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Thu, 19 Feb 2026 23:13:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=83=88=20=EA=B3=84=EC=95=BD=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20-=20=EA=B3=84=EC=95=BD=EC=A0=9C=EB=AA=A9=20?= =?UTF-8?q?=EB=93=9C=EB=A1=AD=EB=B0=95=EC=8A=A4=20+=20=EB=B2=88=EA=B0=9C?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EB=9E=9C=EB=8D=A4=20=EC=83=81=EB=8C=80?= =?UTF-8?q?=EB=B0=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 계약 제목을 드롭박스로 변경 (영업파트너 계약서/비밀유지 서약서/고객 서비스이용 계약서/직접입력) - 직접입력 선택 시 텍스트 입력 필드 표시 - 번개마크 2개 → 1개로 축소 - 번개마크 클릭 시 영업파트너 목록에서 랜덤으로 상대방 정보 자동 채우기 Co-Authored-By: Claude Opus 4.6 --- resources/views/esign/create.blade.php | 83 ++++++++++++++------------ 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/resources/views/esign/create.blade.php b/resources/views/esign/create.blade.php index 46bd23e8..51ff4677 100644 --- a/resources/views/esign/create.blade.php +++ b/resources/views/esign/create.blade.php @@ -36,6 +36,12 @@ { id: 2, title: '템플릿 & 미리보기' }, { id: 3, title: '확인 & 생성' }, ]; +const TITLE_PRESETS = [ + { value: '영업파트너 계약서', label: '영업파트너 계약서' }, + { value: '비밀유지 서약서', label: '비밀유지 서약서' }, + { value: '고객 서비스이용 계약서', label: '고객 서비스이용 계약서' }, + { value: '__custom__', label: '직접입력' }, +]; // ─── Input ─── const Input = ({ label, name, value, error, onChange, type = 'text', required = false, placeholder = '', style }) => ( @@ -350,11 +356,12 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i = const App = () => { const [step, setStep] = useState(1); const [form, setForm] = useState({ - title: '', description: '', sign_order_type: 'counterpart_first', + title: '영업파트너 계약서', description: '', sign_order_type: 'counterpart_first', expires_at: (() => { const d = new Date(); d.setDate(d.getDate() + 7); return d.getFullYear() + '-' + String(d.getMonth()+1).padStart(2,'0') + '-' + String(d.getDate()).padStart(2,'0') + 'T23:59'; })(), creator_name: '(주) 코드브릿지엑스', creator_email: 'contact@codebridge-x.com', creator_phone: '02-6347-0005', counterpart_name: '', counterpart_email: '', counterpart_phone: '', }); + const [titleType, setTitleType] = useState('영업파트너 계약서'); const [file, setFile] = useState(null); const [registeredStamp, setRegisteredStamp] = useState(null); const [submitting, setSubmitting] = useState(false); @@ -415,33 +422,22 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i = } catch (_) { setTemplateItems([]); } }; - const fillTestData = () => { - const year = new Date().getFullYear(); - setForm(f => ({ - ...f, - title: `${year}년 영업파트너 계약서`, - description: '영업파트너 위촉 및 수수료 지급에 관한 계약', - creator_name: '(주) 코드브릿지엑스', - creator_email: 'contact@codebridge-x.com', - creator_phone: '02-6347-0005', - counterpart_name: '김지훈', - counterpart_email: 'awesomemyword@gmail.com', - counterpart_phone: '010-5123-8210', - })); - }; - - const fillTestDataNda = () => { - setForm(f => ({ - ...f, - title: '비밀유지서약서', - description: '영업파트너 등 비밀유지서약서', - creator_name: '(주) 코드브릿지엑스', - creator_email: 'contact@codebridge-x.com', - creator_phone: '02-6347-0005', - counterpart_name: '김지훈', - counterpart_email: 'awesomemyword@gmail.com', - counterpart_phone: '010-5123-8210', - })); + const fillRandomCounterpart = async () => { + try { + const res = await fetch(`/esign/contracts/search-partners?q=`, { + headers: { 'Accept': 'application/json', 'X-CSRF-TOKEN': csrfToken }, + }); + const json = await res.json(); + if (json.success && json.data.length > 0) { + const partner = json.data[Math.floor(Math.random() * json.data.length)]; + setForm(f => ({ + ...f, + counterpart_name: partner.name || '', + counterpart_email: partner.email || '', + counterpart_phone: partner.phone || '', + })); + } + } catch (_) {} }; // 파트너 선택 시 자동 채우기 @@ -567,7 +563,24 @@ className={`w-full text-left px-3 py-2.5 rounded-lg mb-1 transition-colors ${i =

계약 정보

- +
+ + + {titleType === '__custom__' && ( + handleChange('title', e.target.value)} + placeholder="계약 제목을 직접 입력하세요" + className="w-full border border-gray-300 rounded-md px-2.5 py-1.5 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors mt-1" /> + )} + {errors.title &&

{errors.title}

} +