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)}

`; }