From ae367e733efa12599c988e2ffe35b1a5ceb1f034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 6 Mar 2026 21:03:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[approvals]=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9D=B8=EA=B0=90=EA=B3=84=20=EB=AF=B8=EB=A6=AC=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0=EB=A5=BC=20=EC=9D=B8=EA=B0=90=EB=B9=84=EA=B5=90=20?= =?UTF-8?q?=ED=98=95=EC=8B=9D=EC=9C=BC=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - edit/show 페이지의 buildSealUsagePreviewHtml을 법인인감|사용인감 비교 레이아웃으로 교체 - 구 테이블 형식(인감종류/비고 필드) 제거 - create 페이지와 동일한 확약문구, 일자 포맷, 회사정보 레이아웃 적용 --- resources/views/approvals/edit.blade.php | 106 ++++++++++------------- resources/views/approvals/show.blade.php | 68 +++++++++------ 2 files changed, 85 insertions(+), 89 deletions(-) diff --git a/resources/views/approvals/edit.blade.php b/resources/views/approvals/edit.blade.php index 48d08b54..6b0cf394 100644 --- a/resources/views/approvals/edit.blade.php +++ b/resources/views/approvals/edit.blade.php @@ -755,19 +755,7 @@ function applyBodyTemplate(formId) { document.getElementById('su-usage-date').value = suContent.usage_date || ''; document.getElementById('su-purpose').value = suContent.purpose || ''; document.getElementById('su-submit-to').value = suContent.submit_to || ''; - document.getElementById('su-remarks').value = suContent.remarks || ''; - - // 인감종류 복원 - const sealTypeSelect = document.getElementById('su-seal-type'); - const sealType = suContent.seal_type || ''; - const predefinedSeals = ['법인인감', '사용인감', '대표이사 인감', '직인']; - if (predefinedSeals.includes(sealType)) { - sealTypeSelect.value = sealType; - } else if (sealType) { - sealTypeSelect.value = '__custom__'; - document.getElementById('su-seal-type-custom-wrap').style.display = ''; - document.getElementById('su-seal-type-custom').value = sealType; - } + document.getElementById('su-attachment-desc').value = suContent.attachment_desc || ''; } } @@ -860,10 +848,9 @@ function applyBodyTemplate(formId) { formContent = { usage_date: document.getElementById('su-usage-date').value, - seal_type: getSealUsageType(), purpose: suPurpose, submit_to: suSubmitTo, - remarks: document.getElementById('su-remarks').value.trim(), + attachment_desc: document.getElementById('su-attachment-desc').value.trim(), company_name: document.getElementById('su-company-name').value, business_num: document.getElementById('su-business-num').value, ceo_name: document.getElementById('su-ceo-name').value, @@ -1113,63 +1100,59 @@ function buildCertPreviewHtml(d) { // 사용인감계 관련 함수 // ========================================================================= -document.getElementById('su-seal-type')?.addEventListener('change', function() { - const customWrap = document.getElementById('su-seal-type-custom-wrap'); - if (this.value === '__custom__') { - customWrap.style.display = ''; - document.getElementById('su-seal-type-custom').focus(); - } else { - customWrap.style.display = 'none'; - } -}); - -function getSealUsageType() { - const sel = document.getElementById('su-seal-type'); - if (sel.value === '__custom__') { - return document.getElementById('su-seal-type-custom').value.trim() || '기타'; - } - return sel.value; -} - function buildSealUsagePreviewHtml(data) { const e = (s) => s ? String(s).replace(/&/g,'&').replace(//g,'>') : '-'; + const dateObj = data.usage_date ? new Date(data.usage_date + 'T00:00:00') : new Date(); + const y = dateObj.getFullYear(); + const m = String(dateObj.getMonth() + 1).padStart(2, ' '); + const d = String(dateObj.getDate()).padStart(2, ' '); + return ` -
-

사 용 인 감 계

+
+

사 용 인 감 계

- + +
- - + + - - + + - - - - - - - - - ${data.remarks ? ` - - - ` : ''}
사용일자${e(data.usage_date)}법인인감사용인감
인감종류${e(data.seal_type)} + (인감 날인) + + (인감 날인) +
용 도${e(data.purpose)}
제출처${e(data.submit_to)}
비 고${e(data.remarks)}
-

- 위와 같이 인감 사용을 신청하오니 허가하여 주시기 바랍니다. -

+ +
+

용도: ${e(data.purpose)}

+

제출처: ${e(data.submit_to)}

+
-
-

상 호: ${e(data.company_name)}

-

사업자등록번호: ${e(data.business_num)}

-

주 소: ${e(data.company_address)}

-

대표이사: ${e(data.ceo_name)}

+ +
+

+ 위 사용인감은 당사에서 사용하는 인감입니다. 당사는 위 인감사용으로 인한 모든 책임을 질 것을 확약하고 사용인감계를 제출합니다. +

+
+ + + ${data.attachment_desc ? `

첨부서류: ${e(data.attachment_desc)}

` : ''} + + +

${y}년 ${m}월 ${d}일

+ + +
+

상 호: ${e(data.company_name)}

+

사업자등록번호: ${e(data.business_num)}

+

주 소: ${e(data.company_address)}

+

대표이사: ${e(data.ceo_name)}

`; } @@ -1177,10 +1160,9 @@ function buildSealUsagePreviewHtml(data) { function openSealUsagePreview() { const data = { usage_date: document.getElementById('su-usage-date').value, - seal_type: getSealUsageType(), purpose: document.getElementById('su-purpose').value, submit_to: document.getElementById('su-submit-to').value, - remarks: document.getElementById('su-remarks').value, + attachment_desc: document.getElementById('su-attachment-desc').value, company_name: document.getElementById('su-company-name').value, business_num: document.getElementById('su-business-num').value, ceo_name: document.getElementById('su-ceo-name').value, diff --git a/resources/views/approvals/show.blade.php b/resources/views/approvals/show.blade.php index 6a54bcdb..b046582c 100644 --- a/resources/views/approvals/show.blade.php +++ b/resources/views/approvals/show.blade.php @@ -801,43 +801,57 @@ function _buildCertHtml(d) { function buildSealUsageShowPreviewHtml(data) { const e = (s) => s ? String(s).replace(/&/g,'&').replace(//g,'>') : '-'; + const dateObj = data.usage_date ? new Date(data.usage_date + 'T00:00:00') : new Date(); + const y = dateObj.getFullYear(); + const m = String(dateObj.getMonth() + 1).padStart(2, ' '); + const d = String(dateObj.getDate()).padStart(2, ' '); + return ` -
-

사 용 인 감 계

+
+

사 용 인 감 계

- + +
- - + + - - + + - - - - - - - - - ${data.remarks ? ` - - - ` : ''}
사용일자${e(data.usage_date)}법인인감사용인감
인감종류${e(data.seal_type)} + (인감 날인) + + (인감 날인) +
용 도${e(data.purpose)}
제출처${e(data.submit_to)}
비 고${e(data.remarks)}
-

- 위와 같이 인감 사용을 신청하오니 허가하여 주시기 바랍니다. -

+ +
+

용도: ${e(data.purpose)}

+

제출처: ${e(data.submit_to)}

+
-
-

상 호: ${e(data.company_name)}

-

사업자등록번호: ${e(data.business_num)}

-

주 소: ${e(data.company_address)}

-

대표이사: ${e(data.ceo_name)}

+ +
+

+ 위 사용인감은 당사에서 사용하는 인감입니다. 당사는 위 인감사용으로 인한 모든 책임을 질 것을 확약하고 사용인감계를 제출합니다. +

+
+ + + ${data.attachment_desc ? `

첨부서류: ${e(data.attachment_desc)}

` : ''} + + +

${y}년 ${m}월 ${d}일

+ + +
+

상 호: ${e(data.company_name)}

+

사업자등록번호: ${e(data.business_num)}

+

주 소: ${e(data.company_address)}

+

대표이사: ${e(data.ceo_name)}

`; }