func : 계약관리 등록폼 기능추가

- 계약상대자 변경기능 추가
This commit is contained in:
Kasi
2025-05-28 09:11:09 +09:00
parent 4336bd1b5d
commit 366ad2fa36

View File

@@ -7,8 +7,13 @@ import {useRouter} from "vue-router";
const registerFormOpen = ref(false) const registerFormOpen = ref(false)
const loading = ref(false) const loading = ref(false)
const isSelectOpen = ref(false)
const notyf = useNotyf() const notyf = useNotyf()
const router = useRouter() const router = useRouter()
const selectedCode = ref()
const priceSearchCheckBoxStatus = ref(false)
const isLoading = ref(false)
const params = reactive({ const params = reactive({
cateCd: '', cateCd: '',
contNo: '', contNo: '',
@@ -68,15 +73,12 @@ params.contAtts = [
{ prcsNo : '', bizNo : '' ,fileOrd : 0 ,logiFnm : '' ,physFnm : '',size : 0 ,data : '' ,path : '' }, { prcsNo : '', bizNo : '' ,fileOrd : 0 ,logiFnm : '' ,physFnm : '',size : 0 ,data : '' ,path : '' },
] ]
const selectedCode = ref()
const priceSearchCheckBoxStatus = ref(false)
const data = reactive({ const data = reactive({
contractData: [], contractData: [],
completedPriceSearchData: [], completedPriceSearchData: [],
}) })
const isLoading = ref(false)
watch(registerFormOpen, async (isOpen) => { watch(registerFormOpen, async (isOpen) => {
if (isOpen) { if (isOpen) {
isLoading.value = true isLoading.value = true
@@ -166,8 +168,9 @@ function handlePriceRowClick(row) {
} }
registerFormOpen.value = false registerFormOpen.value = false
completedPriceDataParams.estimates = row.estimates
console.log(row) console.log(row)
console.log(completedPriceDataParams.contAmt) console.log(completedPriceDataParams.estimates)
} }
const showFileInputs = ref(false) const showFileInputs = ref(false)
@@ -215,7 +218,7 @@ const saveContOne = async () => {
if(res.request.status == '200'){ if(res.request.status == '200'){
notyf.primary('등록 되었습니다.') notyf.primary('등록 되었습니다.')
// router.push({path: '/app/contractManagement'}) router.push({path: '/app/contractManagement'})
} }
}catch(e){ }catch(e){
notyf.error(e.message) notyf.error(e.message)
@@ -241,7 +244,7 @@ const onFileChange = (e, idx) => {
// 인덱스별로 파일 저장 // 인덱스별로 파일 저장
pbAtts.value[idx] = pbAtt pbAtts.value[idx] = pbAtt
console.log(pbAtts) console.log(pbAtts)
console.log(pbAtts.value[0].logiFnm) console.log(pbAtts.value[idx].logiFnm)
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
} }
@@ -273,6 +276,28 @@ const showReasonError = computed(() =>
priceSearchCheckBoxStatus.value && priceSearchCheckBoxStatus.value &&
(!completedPriceDataParams.reason || !completedPriceDataParams.reason.trim()) (!completedPriceDataParams.reason || !completedPriceDataParams.reason.trim())
) )
const estimateBizNoOptions = computed(() =>
completedPriceDataParams.estimates.map(est => ({
value: est.bizNo,
text: est.bizNo
}))
)
function onBizNoChange() {
const selected = completedPriceDataParams.estimates.find(est => est.bizNo === completedPriceDataParams.bizNo)
if (selected) {
completedPriceDataParams.compNm = selected.compNm || ''
completedPriceDataParams.contAmt = selected.amt || 0
completedPriceDataParams.bizNo = selected.bizNo || ''
} else {
completedPriceDataParams.compNm = ''
completedPriceDataParams.contAmt = 0
completedPriceDataParams.bizNo = ''
}
}
</script> </script>
<template> <template>
@@ -376,12 +401,21 @@ const showReasonError = computed(() =>
<td> <td>
<VField> <VField>
<VControl> <VControl>
<input <VSelect
v-model="completedPriceDataParams.bizNo" v-model="completedPriceDataParams.bizNo"
class="input custom-text-filter" class="input custom-text-filter"
placeholder="사업자번호" @change="onBizNoChange"
:disabled="!priceSearchCheckBoxStatus" @focus="isSelectOpen = true"
> >
<option value="" disabled>사업자번호 선택</option>
<option
v-for="option in estimateBizNoOptions"
:key="option.value"
:value="option.value"
>
{{ option.text }}
</option>
</VSelect>
</VControl> </VControl>
</VField> </VField>
</td> </td>