mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 01:22:33 +09:00
fix : 견적사입력 사업자번호 format 설정
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { savePrice } from '/src/service/priceApi'
|
import { savePrice } from '/src/service/priceApi'
|
||||||
import { Person } from '/@src/utils/types'
|
import { Person } from '/@src/utils/types'
|
||||||
|
import {formatBizNum} from "/@src/utils/common/comfunc.ts";
|
||||||
|
|
||||||
const notyf = useNotyf()
|
const notyf = useNotyf()
|
||||||
const showTable = ref(false)
|
const showTable = ref(false)
|
||||||
@@ -204,6 +205,13 @@ function onFileChange(event: Event) {
|
|||||||
// 예: emit('file-selected', target.files[0])
|
// 예: emit('file-selected', target.files[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onInput(row, column){
|
||||||
|
if (column.key === 'bizNo') {
|
||||||
|
const raw =row[column.key].replace(/\D/g, '')
|
||||||
|
row[column.key] = formatBizNum(raw) // 실시간 포맷 적용
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -298,6 +306,7 @@ function onFileChange(event: Event) {
|
|||||||
v-model="row[column.key]"
|
v-model="row[column.key]"
|
||||||
class="editable-input"
|
class="editable-input"
|
||||||
ref="prcsBizsRef"
|
ref="prcsBizsRef"
|
||||||
|
@blur="onInput(row, column)"
|
||||||
/>
|
/>
|
||||||
<span v-else-if="column.key=='num'">{{index + 1}}</span>
|
<span v-else-if="column.key=='num'">{{index + 1}}</span>
|
||||||
<!-- readonly 출력 -->
|
<!-- readonly 출력 -->
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {getDetailPrcs, updatePrice} from '/src/service/priceApi'
|
import {getDetailPrcs, updatePrice} from '/src/service/priceApi'
|
||||||
import { type Person } from '/@src/utils/types'
|
import { type Person } from '/@src/utils/types'
|
||||||
|
import {formatBizNum, formatDate} from "/@src/utils/common/comfunc.ts";
|
||||||
|
|
||||||
const notyf = useNotyf()
|
const notyf = useNotyf()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
@@ -47,7 +48,14 @@ const params = reactive({
|
|||||||
prcsBizsColumn: [ //견적사 입력
|
prcsBizsColumn: [ //견적사 입력
|
||||||
{ key: 'num', label: '구분', width: '10%' },
|
{ key: 'num', label: '구분', width: '10%' },
|
||||||
{ key: 'email', label: '이메일', editable: true, width: '50px' },
|
{ key: 'email', label: '이메일', editable: true, width: '50px' },
|
||||||
{ key: 'bizNo', label: '사업자번호', editable: true, width: '50px'},
|
{ key: 'bizNo', label: '사업자번호', editable: true,
|
||||||
|
format: (value: string) => {
|
||||||
|
// '1234567890' -> '123-45-67890'
|
||||||
|
console.log("value",value)
|
||||||
|
if (!value) return ''
|
||||||
|
return formatBizNum(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
{ key: 'actions', label: '동작', width: '100px'}
|
{ key: 'actions', label: '동작', width: '100px'}
|
||||||
],
|
],
|
||||||
prcsBizs: [], //견적사 입력 데이터
|
prcsBizs: [], //견적사 입력 데이터
|
||||||
@@ -62,14 +70,11 @@ const params = reactive({
|
|||||||
{ key: '', label: '삭제', editable: false },
|
{ key: '', label: '삭제', editable: false },
|
||||||
],
|
],
|
||||||
dtlSpecs: [], //상세 규격 입력 데이터
|
dtlSpecs: [], //상세 규격 입력 데이터
|
||||||
detailData :[
|
|
||||||
{ cateNm: '홍길동', age: 30, email: 'hong@example.com' },
|
|
||||||
{ name: '김철수', age: 28, email: 'kim@example.com' },
|
|
||||||
],
|
|
||||||
btnChangeFlag: false
|
btnChangeFlag: false
|
||||||
})
|
})
|
||||||
|
|
||||||
function getDetailList(arg){
|
function getDetailList(arg){
|
||||||
|
console.log("arg",arg)
|
||||||
params.prcsNo = arg.prcsNo
|
params.prcsNo = arg.prcsNo
|
||||||
params.stCd = arg.stCd
|
params.stCd = arg.stCd
|
||||||
params.cateSelect = arg.cateCd
|
params.cateSelect = arg.cateCd
|
||||||
@@ -91,6 +96,7 @@ function getDetailList(arg){
|
|||||||
apprNo: req.apprNo,
|
apprNo: req.apprNo,
|
||||||
apprOrd: req.apprOrd,
|
apprOrd: req.apprOrd,
|
||||||
apprStat: req.apprStat,
|
apprStat: req.apprStat,
|
||||||
|
apprDt: req.apprDt,
|
||||||
attendCd: req.attendCd
|
attendCd: req.attendCd
|
||||||
})) //비고 데이터 없음, 승인일자 없음 todo
|
})) //비고 데이터 없음, 승인일자 없음 todo
|
||||||
}
|
}
|
||||||
@@ -136,6 +142,7 @@ const updatePriceOne = async () => {
|
|||||||
prcsAtts: params.prcsAtts, //첨부파일 데이터
|
prcsAtts: params.prcsAtts, //첨부파일 데이터
|
||||||
apprReqs: apprLine.value.map(({ deptNm, ...rest }) => rest), //결재선 데이터
|
apprReqs: apprLine.value.map(({ deptNm, ...rest }) => rest), //결재선 데이터
|
||||||
}
|
}
|
||||||
|
console.log("paramsPrice",paramsPrice)
|
||||||
res = await updatePrice(paramsPrice)
|
res = await updatePrice(paramsPrice)
|
||||||
notyf.dismissAll()
|
notyf.dismissAll()
|
||||||
if(res.request.status == '200'){
|
if(res.request.status == '200'){
|
||||||
@@ -187,14 +194,11 @@ const onDetailDelete = (index: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDate(dateStr) {
|
function onInput(row, column){
|
||||||
if (!dateStr) return ''
|
if (column.key === 'bizNo') {
|
||||||
const date = new Date(dateStr)
|
const raw =row[column.key].replace(/\D/g, '')
|
||||||
return date.toLocaleDateString('ko-KR', {
|
row[column.key] = formatBizNum(raw) // 실시간 포맷 적용
|
||||||
year: 'numeric',
|
}
|
||||||
month: '2-digit',
|
|
||||||
day: '2-digit',
|
|
||||||
}).replace(/\./g, '-').replace(/\s/g, '').replace(/-$/,'')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -412,6 +416,7 @@ function formatDate(dateStr) {
|
|||||||
v-if="column.editable"
|
v-if="column.editable"
|
||||||
v-model="row[column.key]"
|
v-model="row[column.key]"
|
||||||
class="editable-input"
|
class="editable-input"
|
||||||
|
@blur="onInput(row, column)"
|
||||||
/>
|
/>
|
||||||
<span v-else-if="column.key=='num'">{{index + 1}}</span>
|
<span v-else-if="column.key=='num'">{{index + 1}}</span>
|
||||||
<!-- readonly 출력 -->
|
<!-- readonly 출력 -->
|
||||||
@@ -463,8 +468,10 @@ function formatDate(dateStr) {
|
|||||||
<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
|
<VCodeSelect
|
||||||
|
placeholder="재중"
|
||||||
cd_grp=6
|
cd_grp=6
|
||||||
v-model="row.attendCd"/>
|
v-model="row.attendCd">
|
||||||
|
</VCodeSelect>
|
||||||
</VField>
|
</VField>
|
||||||
</span>
|
</span>
|
||||||
<span v-else
|
<span v-else
|
||||||
|
|||||||
@@ -4,4 +4,17 @@ export function formatDate(date) {
|
|||||||
// 월은 0부터 시작
|
// 월은 0부터 시작
|
||||||
const day = String(date.getDate()).padStart(2, '0')
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
return `${year}-${month}-${day}`
|
return `${year}-${month}-${day}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatBizNum(num){
|
||||||
|
if (!num) return ''
|
||||||
|
|
||||||
|
const raw = num.replace(/\D/g, '') // 숫자만 남김
|
||||||
|
|
||||||
|
// 123 -> 123
|
||||||
|
if (raw.length <= 3) return raw
|
||||||
|
// 12345 -> 123-45
|
||||||
|
if (raw.length <= 5) return raw.replace(/^(\d{3})(\d{0,2})$/, '$1-$2')
|
||||||
|
// 1234567890 -> 123-45-67890
|
||||||
|
return raw.replace(/^(\d{3})(\d{2})(\d{0,5})$/, '$1-$2-$3')
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user