fix : 삭제 기능 정리

This commit is contained in:
Yesol Choi
2025-05-26 13:32:08 +09:00
parent 0f4272ed48
commit 7a5c491554
2 changed files with 20 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { savePrice } from '/src/service/priceApi'
import { Person } from '/@src/utils/types'
import {formatBizNum} from "/@src/utils/common/comfunc.ts";
import {formatBizNum,formatDate} from "/@src/utils/common/comfunc.ts";
const notyf = useNotyf()
const showTable = ref(false)
@@ -14,6 +14,7 @@ const cateSelectRef = ref()
const titleRef = ref()
const contentRef = ref()
const prcsBizsRef = ref()
const router = useRouter()
const generalParams = reactive({
title: "",
@@ -56,7 +57,7 @@ const params = reactive({
{ key: 'qty', label: '수량', editable: true },
{ key: '', label: '단가(VAT별도)', editable: false },
{ key: '', label: '금액(VAT별도)', editable: false },
{ key: '', label: '삭제', editable: false },
{ key: 'delete', label: '삭제', editable: false },
],
dtlSpecs: [], //상세 규격 입력 데이터
})
@@ -120,7 +121,7 @@ const savePriceOne = async () => {
res = await savePrice(paramsPrice)
if(res.request.status == '200'){
notyf.primary('수정 되었습니다.')
notyf.primary('등록 되었습니다.')
router.push({path: '/app/priceManagement'})
}
}catch(e){
@@ -171,16 +172,17 @@ const onDetailDelete = (index: number) => {
}
}
function formatDate(dateStr) {
if (!dateStr) return ''
const date = new Date(dateStr)
return date.toLocaleDateString('ko-KR', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}).replace(/\./g, '-').replace(/\s/g, '').replace(/-$/,'')
const onPayDelete = (index: number) => {
console.log("params.felxColumn.length",params.felxColumn.length)
console.log("params.felxColumn.length",apprLine.value.length)
if(apprLine.value.length-1 !== params.felxColumn.length
|| (params.felxColumn.length == 6 && apprLine.value.length-1 == params.felxColumn.length))
{
apprLine.value.splice(index, 1)
}
}
const fileInput = ref<HTMLInputElement | null>(null)
const fileName = ref('')
@@ -345,6 +347,7 @@ function onInput(row, column){
:columns="params.dtlSpecsColumn"
:separators="true"
:clickable="true"
:compact="true"
>
<template #body-cell="{ row, column, index, value }">
<!-- : 특정 컬럼이면 input, 아니면 그냥 출력 -->
@@ -355,7 +358,7 @@ function onInput(row, column){
class="editable-input"
/>
<span v-else-if="column.key=='num'">{{index+1}}</span>
<span v-else class="lnil lnil-close"
<span v-else-if="column.key=='delete'" class="lnil lnil-close"
@click="onDetailDelete(index)">{{ value }}</span>
</div>
</template>
@@ -440,7 +443,6 @@ function onInput(row, column){
style="display: none"
@change="onFileChange"
/>
<span v-if="fileName" class="file-name">{{ fileName }}</span>
</VField>
</td>
@@ -486,8 +488,9 @@ function onInput(row, column){
v-model="row.attendCd"/>
</VField>
</span>
<span v-else
@click="onDetailDelete(index)">{{value}}</span>
<span v-else-if="column.key=='actions'" class="lnil lnil-close"
@click="onPayDelete(index)"/>
<span v-else>{{value}}</span>
</div>
</template>
</ComVFlexTable>

View File

@@ -67,14 +67,13 @@ const params = reactive({
{ key: 'qty', label: '수량', editable: true },
{ key: '', label: '단가(VAT별도)', editable: false },
{ key: '', label: '금액(VAT별도)', editable: false },
{ key: '', label: '삭제', editable: false },
{ key: 'delete', label: '삭제', editable: false },
],
dtlSpecs: [], //상세 규격 입력 데이터
btnChangeFlag: false
})
function getDetailList(arg){
console.log("arg",arg)
params.prcsNo = arg.prcsNo
params.stCd = arg.stCd
params.cateSelect = arg.cateCd
@@ -366,7 +365,7 @@ function onInput(row, column){
class="editable-input"
/>
<span v-else-if="column.key=='num'">{{index+1}}</span>
<span v-else class="lnil lnil-close"
<span v-else-if="column.key=='delete'" class="lnil lnil-close"
@click="onDetailDelete(index)">{{ value }}</span>
</div>
</template>