From 12cd75735750eebcc5b7baf2bf885eea5bf3b1c1 Mon Sep 17 00:00:00 2001 From: Yesol Choi Date: Sun, 8 Jun 2025 07:36:45 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20api=20=EC=98=A4=EB=A5=98=20=EB=B0=9C=EC=83=9D?= =?UTF-8?q?=EC=A4=91,=20=EB=B0=B1=EC=97=94=EB=93=9C=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=20=EC=9A=94=EC=B2=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/app/contractUpdate.vue | 65 ++++++++++++++++++++++---------- src/service/contractApi.ts | 16 ++------ 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/src/pages/app/contractUpdate.vue b/src/pages/app/contractUpdate.vue index 07cf87b..1ac241f 100644 --- a/src/pages/app/contractUpdate.vue +++ b/src/pages/app/contractUpdate.vue @@ -5,6 +5,7 @@ import {delContAttachFile, getContractDetail, saveContract, updateContract} from import type {iPbAtt} from "/@src/utils/types.ts"; import {useRouter} from "vue-router"; import {signStart} from "/@src/service/signDocApi.ts"; +import {deletePrcsFile} from "/@src/service/priceApi.ts"; const registerFormOpen = ref(false) @@ -114,6 +115,10 @@ function getDetailList(arg){ params.contStatCd = arg.contStatCd params.contNo = arg.contNo params.contAtts = arg.contAtts + // params.contAtts = arg.contAtts.map((item: any, index: any) => ({ + // ...item, + // description: fileInputs.value[index]?.description || '', + // }) } function formatMonthDate(dateStr) { @@ -314,13 +319,35 @@ const onFileChange = (e, idx) => { reader.readAsDataURL(file) } -function removeFile(idx) { - pbAtts.value[idx] = null - params.contAtts[idx] = null +// function removeFile(idx, input) { +// console.log("input",input) +// pbAtts.value[idx] = null +// params.contAtts[idx] = null +// } + +const removeFile = async (contNo: string, index: number, fileOrd: number) => { + notyf.dismissAll() + const confirmed = confirm('삭제하시겠습니까?') + if (!contNo) { + if (confirmed){ + pbAtts.value.splice(index, 1) + console.log("index",index) + console.log("fileOrd",fileOrd) + } + } else { + if (confirmed) { + await delContAttachFile(contNo, fileOrd).then((res: string) => { + notyf.success(res) + pbAtts.value.splice(index, 1) + }).catch((err) => { + notyf.error('삭제 중 오류가 발생했습니다.') + console.error(err) + }) + } + } } function downloadFile(file) { - console.log(file) file.path = `https://svcm.hmsn.ink/api/cont/${file.contNo}/${file.fileOrd}` window.open(file.path, '_blank') return @@ -676,29 +703,29 @@ const onChangeSign = async() => {
- {{ pbAtts[idx]?.logiFnm || params.contAtts?.[idx]?.logiFnm || '' }} + {{ pbAtts[f.fileOrd]?.logiFnm || params.contAtts?.[f.fileOrd]?.logiFnm || '' }}
-