From 1e5acf790c1070e97449c884e283b5bff7914dbc Mon Sep 17 00:00:00 2001 From: KG Date: Thu, 5 Jun 2025 23:52:24 +0900 Subject: [PATCH] =?UTF-8?q?func=20:=20=EA=B8=B0=EC=A1=B4=20=EC=B2=A8?= =?UTF-8?q?=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EB=B0=9B=EA=B8=B0=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=99=84=EC=84=B1=20=20-=20API=20=ED=95=84?= =?UTF-8?q?=EC=9A=94=EB=A1=9C=20=EC=B6=94=ED=9B=84=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20issue=20:=20=EC=88=98=EC=A0=95=ED=8F=BC=EC=9D=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EA=B8=B0=EB=8A=A5=20500=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20=20-=20=EA=B8=88=EC=9D=BC=20=EA=B0=80?= =?UTF-8?q?=EA=B2=A9=EC=A1=B0=EC=82=AC=20=EC=B2=A8=EB=B6=80=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EA=B4=80=EB=A0=A8=20=EC=97=90=EB=9F=AC=EB=82=AC?= =?UTF-8?q?=EB=8D=98=EA=B2=83=EC=B2=98=EB=9F=BC=20=EB=B0=B1=EC=97=94?= =?UTF-8?q?=EB=93=9C=EC=AA=BD=20=EC=9D=98=EC=8B=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/app/contractUpdate.vue | 93 +++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 12 deletions(-) diff --git a/src/pages/app/contractUpdate.vue b/src/pages/app/contractUpdate.vue index 8f10af6..d3927ef 100644 --- a/src/pages/app/contractUpdate.vue +++ b/src/pages/app/contractUpdate.vue @@ -17,7 +17,6 @@ const priceSearchCheckBoxStatus = ref(false) const isLoading = ref(false) onBeforeMount(async ()=>{ - console.log(history.state.key) const result = await getContractDetail(history.state.key) getDetailList(result) }) @@ -42,8 +41,6 @@ const params = reactive({ contAtts: [], //첨부파일 데이터 }) - - const completedPriceDataParams = reactive({ prcsNo:'', cateCd:'', @@ -82,7 +79,6 @@ params.contAtts = [ { prcsNo : '', bizNo : '' ,fileOrd : 0 ,logiFnm : '' ,physFnm : '',size : 0 ,data : '' ,path : '' }, ] - const data = reactive({ contractData: [], completedPriceSearchData: [], @@ -118,6 +114,7 @@ function getDetailList(arg){ completedPriceDataParams.signDt = arg.signDt params.contStatCd = arg.contStatCd params.contNo = arg.contNo + params.contAtts = arg.contAtts } function formatMonthDate(dateStr) { @@ -200,7 +197,7 @@ function handlePriceRowClick(row) { console.log(completedPriceDataParams.estimates) } -const showFileInputs = ref(false) +const showFileInputs = ref(true) const fileInputs = ref([ { file: null, description: '시행 품의문' }, { file: null, description: '소액수의계약서' }, @@ -256,6 +253,13 @@ const saveContOne = async () => { const pbAtts = ref(params.contAtts) +watch( + () => params.contAtts, + (newContAtts) => { + pbAtts.value = newContAtts.map(() => null) + }, + { immediate: true, deep: true } +) const onFileChange = (e, idx) => { const file = e.target.files[0] if (!file) return @@ -276,6 +280,20 @@ const onFileChange = (e, idx) => { reader.readAsDataURL(file) } +function removeFile(idx) { + pbAtts.value[idx] = null // 신규 파일 제거 + params.contAtts[idx] = null // 기존 파일도 제거(화면상 표시 안 됨) +} + +// [추가] 다운로드 버튼: 기존 파일 다운로드 +function downloadFile(file) { + // file.path가 실제 다운로드 가능한 URL이면 바로 열기 + console.log(file) + file.path = `https://svcm.hmsn.ink/api/cont/${file.contNo}/${file.fileOrd}` + window.open(file.path, '_blank') + return +} + function resetForm() { completedPriceDataParams.prcsNo = '' completedPriceDataParams.bizNo = '' @@ -350,6 +368,7 @@ const onChangeSign = async() => { } } +