fix : 결재선 비고 select box 이슈로 컴포넌트 하나 더 생성

This commit is contained in:
Yesol Choi
2025-05-27 16:41:06 +09:00
parent cebc55c90b
commit 6bb34c0133
2 changed files with 88 additions and 3 deletions

View File

@@ -0,0 +1,83 @@
<script setup lang="ts">
import {useCodes} from '/src/stores/codeStore.ts'
const detailCode = useCodes()
export interface VSelectProps {
raw?: boolean
multiple?: boolean
cd_grp?: string
placeholder?: string
}
defineOptions({
inheritAttrs: false,
})
const modelValue = defineModel<any>({
default: '',
})
const props = defineProps<VSelectProps>()
const attrs = useAttrs()
const { field, id } = useVFieldContext({
create: false,
help: 'VSelect',
})
const internal = computed({
get() {
if (field?.value) {
return field.value.value
}
else {
return modelValue.value
}
},
set(value: any) {
if (field?.value) {
field.value.setValue(value)
}
modelValue.value = value
},
})
const classes = computed(() => {
if (props.raw) return []
return ['select', props.multiple && 'is-multiple']
})
const cdItems = ref<Array<{ cd: string; nm: string }>>([])
watch(() => props.cd_grp, async (newVal) => {
if (newVal) {
await detailCode.setDetailCode(newVal)
cdItems.value = detailCode.getCodeList(newVal)
}
}, { immediate: true })
</script>
<template>
<div :class="classes">
<select
:id="id"
v-bind="attrs"
v-model="internal"
:name="id"
:multiple="props.multiple"
@change="field?.handleChange"
@blur="field?.handleBlur"
>
<option value="null">{{ props.placeholder || '선택하세요' }}</option>
<option
v-for="item in cdItems"
:key="item.cd"
:value="item.cd"
>
<slot name="code" :item="item">
{{ item.nm }}
</slot>
</option>
</select>
</div>
</template>

View File

@@ -2,6 +2,7 @@
import {getDetailPrcs, updatePrice, getPrcsFileDown, deletePrcsFile} from '/src/service/priceApi' import {getDetailPrcs, updatePrice, getPrcsFileDown, deletePrcsFile} from '/src/service/priceApi'
import {type iPbAtt, type Person} from '/@src/utils/types' import {type iPbAtt, type Person} from '/@src/utils/types'
import {formatBizNum, formatDatefromString} from "/@src/utils/common/comfunc.ts"; import {formatBizNum, formatDatefromString} from "/@src/utils/common/comfunc.ts";
import VDefaultCodeSelect from "/@src/components/app-vuero/VDefaultCodeSelect.vue";
const notyf = useNotyf() const notyf = useNotyf()
const loading = ref(false) const loading = ref(false)
const router = useRouter() const router = useRouter()
@@ -39,7 +40,7 @@ const params = reactive({
{ key: 'deptNm', label: '부서' }, { key: 'deptNm', label: '부서' },
{ key: 'sabun', label: '사번' }, { key: 'sabun', label: '사번' },
{ key: 'name', label: '이름' }, { key: 'name', label: '이름' },
{ key: 'attendCd', label: '비고' }, { key: 'attendCd', label: '비고'},
{ key: 'apprStat', label: '결재상태'}, { key: 'apprStat', label: '결재상태'},
{ key: 'apprDt', label: '승인일자'}, { key: 'apprDt', label: '승인일자'},
], ],
@@ -92,6 +93,7 @@ function getDetailList(arg){
apprDt: req.apprDt, apprDt: req.apprDt,
attendCd: req.attendCd attendCd: req.attendCd
})) //비고 데이터 없음, 승인일자 없음 todo })) //비고 데이터 없음, 승인일자 없음 todo
console.log("apprLine.value",apprLine.value)
params.prcsAtts = arg.prcsAtts params.prcsAtts = arg.prcsAtts
} }
@@ -564,14 +566,14 @@ const onPrcsFileDownload = async (prcsNo: string, fileOrd: number, logiFnm: stri
</span> </span>
<span v-else-if="column.key=='attendCd'" class="column"> <span v-else-if="column.key=='attendCd'" class="column">
<VField class="pr-1"> <VField class="pr-1">
<VCodeSelect <VDefaultCodeSelect
placeholder="재중" placeholder="재중"
cd_grp=6 cd_grp=6
v-model="row.attendCd"> v-model="row.attendCd">
<!-- <template #code>--> <!-- <template #code>-->
<!-- <span v-if="!row.attendCd">{{"재중"}}</span>--> <!-- <span v-if="!row.attendCd">{{"재중"}}</span>-->
<!-- </template>--> <!-- </template>-->
</VCodeSelect> </VDefaultCodeSelect>
</VField> </VField>
</span> </span>
<span v-else <span v-else