Merge branch 'refs/heads/main' into featrue/0526-update

This commit is contained in:
Yesol Choi
2025-05-29 14:01:20 +09:00
8 changed files with 330 additions and 118 deletions

View File

@@ -18,13 +18,13 @@ const links = ref<NavbarItem[]>([
label: '계약관리', label: '계약관리',
icon: '', icon: '',
}, },
{ // {
id: 'document', // id: 'document',
type: 'link', // type: 'link',
to: '/app/documentManagement', // to: '/app/documentManagement',
label: '전표관리', // label: '전표관리',
icon: '', // icon: '',
}, // },
{ {
id: 'payment', id: 'payment',
type: 'link', type: 'link',

View File

@@ -354,6 +354,10 @@ function onInput(event) {
} }
.button.v-button {
padding: 0px 0px;
}
.bottom-button { .bottom-button {
text-align: center; text-align: center;
button { button {
@@ -362,6 +366,7 @@ function onInput(event) {
font-weight: bold; font-weight: bold;
border-color: var(--primary); border-color: var(--primary);
color: white; color: white;
padding: 0.5rem 1rem !important;
} }
} }
button:nth-child(2) { button:nth-child(2) {
@@ -375,9 +380,6 @@ button:nth-child(3) {
margin: 0px 0px; margin: 0px 0px;
} }
.button.v-button {
padding: 0px 0px;
}
.disabled-button { .disabled-button {
//opacity: 0.5; //opacity: 0.5;

View File

@@ -49,7 +49,7 @@ const params = reactive({
{ key: 'contAmt', label: '계약금액', format: formatCurrency }, { key: 'contAmt', label: '계약금액', format: formatCurrency },
{ key: 'contNo', label: '계약번호' }, { key: 'contNo', label: '계약번호' },
{ key: 'signDt', label: '계약체결일' }, { key: 'signDt', label: '계약체결일' },
{ key: 'charge', label: '대금청구' }, { key: 'charge', label: '대금청구', cellClass: 'is-justify-content-center' },
{ key: 'contStat', label: '계약상태' }, { key: 'contStat', label: '계약상태' },
], ],
}) })
@@ -182,7 +182,7 @@ function getContractDetail(){
</div> </div>
</div> </div>
<div class="datatable-wrapper"> <div class="datatable-wrapper">
<ComVFlexTable <VFlexTableCustomize
:data="data.contractData" :data="data.contractData"
:columns="params.flexColumn" :columns="params.flexColumn"
:separators="true" :separators="true"
@@ -190,7 +190,30 @@ function getContractDetail(){
:rounded="true" :rounded="true"
:compact="true" :compact="true"
@rowClick="getContractDetail" @rowClick="getContractDetail"
/> >
<!-- sendYn 컬럼 커스텀 렌더링 -->
<template #body-cell-charge="{ row }">
<div>
<VButton
v-if="row.contStat==='계약종료'"
color="info"
size="small"
to="/app/DocumentManagement"
@click.stop
>
대금청구
</VButton>
<span v-else></span>
</div>
</template>
<!-- 나머지 컬럼만 슬롯 사용 -->
<template #body-cell="{ column, index, value }">
<div>
<span v-if="column.key=='num'">{{index + 1}}</span>
<span v-else>{{ value }}</span>
</div>
</template>
</VFlexTableCustomize>
</div> </div>
</div> </div>
<VButtons class="is-right"> <VButtons class="is-right">

View File

@@ -1,17 +1,25 @@
<script setup lang="ts"> <script setup lang="ts">
import axios from 'axios' import axios from 'axios'
import { getContractDetail, updateContract, saveContract } from "/src/service/contractApi.ts"; import {getContractDetail, saveContract} from "/src/service/contractApi.ts";
import type {iPbAtt} from "/@src/utils/types.ts";
import {useRouter} from "vue-router";
const registerFormOpen = ref(false)
const loading = ref(false)
const isSelectOpen = ref(false)
const notyf = useNotyf()
const router = useRouter()
const selectedCode = ref()
const priceSearchCheckBoxStatus = ref(false)
const isLoading = ref(false)
onBeforeMount(async ()=>{ onBeforeMount(async ()=>{
console.log(history.state.key)
const result = await getContractDetail(history.state.key) const result = await getContractDetail(history.state.key)
getDetailList(result) getDetailList(result)
}) })
const registerFormOpen = ref(false)
const loading = ref(false)
const notyf = useNotyf()
const router = useRouter()
const params = reactive({ const params = reactive({
cateCd: '', cateCd: '',
contNo: '', contNo: '',
@@ -29,8 +37,11 @@ const params = reactive({
row: 10, row: 10,
flexColumn: [], flexColumn: [],
modalColumn: [], modalColumn: [],
contAtts: [], //첨부파일 데이터
}) })
const completedPriceDataParams = reactive({ const completedPriceDataParams = reactive({
prcsNo:'', prcsNo:'',
cateCd:'', cateCd:'',
@@ -39,8 +50,8 @@ const completedPriceDataParams = reactive({
compNm:'', compNm:'',
title:'', title:'',
content:'', content:'',
regSdat:'', contSdat:'',
regEdat:'', contEdat:'',
regSabun:'', regSabun:'',
regNm:'', regNm:'',
regDt:'', regDt:'',
@@ -50,6 +61,7 @@ const completedPriceDataParams = reactive({
svyDt:'', svyDt:'',
reason:'', reason:'',
estimates: [], estimates: [],
excYn: false,
page: 1, page: 1,
row: 5, row: 5,
}) })
@@ -63,15 +75,16 @@ params.modalColumn = [
{ key: 'regNm', label: '선택' }, { key: 'regNm', label: '선택' },
] ]
const selectedCode = ref() params.contAtts = [
const priceSearchCheckBoxStatus = ref(false) { prcsNo : '', bizNo : '' ,fileOrd : 0 ,logiFnm : '' ,physFnm : '',size : 0 ,data : '' ,path : '' },
]
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
@@ -87,21 +100,6 @@ watch(registerFormOpen, async (isOpen) => {
} }
}) })
function getDetailList(arg){
console.log("arg",arg)
completedPriceDataParams.prcsNo = arg.prcsNo
selectedCode.value = arg.cateCd
completedPriceDataParams.bizNo = arg.bizNo
completedPriceDataParams.compNm = arg.compNm
completedPriceDataParams.title = arg.title
completedPriceDataParams.regSdat = arg.contSdat // 계약기간
completedPriceDataParams.regEdat = arg.contEdat
completedPriceDataParams.contAmt = arg.contAmt
// completedPriceDataParams.svyDt = arg.signDt 계약체결일 todo
completedPriceDataParams.reason = arg.reason
}
function formatMonthDate(dateStr) { function formatMonthDate(dateStr) {
if (!dateStr) return '' if (!dateStr) return ''
const date = new Date(dateStr) const date = new Date(dateStr)
@@ -121,8 +119,8 @@ function getDateDiff(start, end) {
} }
const contractPeriod = computed(() => { const contractPeriod = computed(() => {
const start = completedPriceDataParams.regSdat const start = completedPriceDataParams.contSdat
const end = completedPriceDataParams.regEdat const end = completedPriceDataParams.contEdat
const startStr = formatMonthDate(start) const startStr = formatMonthDate(start)
const endStr = formatMonthDate(end) const endStr = formatMonthDate(end)
const diff = getDateDiff(start, end) const diff = getDateDiff(start, end)
@@ -150,8 +148,8 @@ function handlePriceRowClick(row) {
completedPriceDataParams.cateNm = row.cateNm || '' completedPriceDataParams.cateNm = row.cateNm || ''
completedPriceDataParams.title = row.title || '' completedPriceDataParams.title = row.title || ''
completedPriceDataParams.content = row.content || '' completedPriceDataParams.content = row.content || ''
completedPriceDataParams.regSdat = row.regSdat || '' completedPriceDataParams.contSdat = row.regSdat || ''
completedPriceDataParams.regEdat = row.regEdat || '' completedPriceDataParams.contEdat = row.regEdat || ''
completedPriceDataParams.regSabun = row.regSabun || '' completedPriceDataParams.regSabun = row.regSabun || ''
completedPriceDataParams.regNm = row.regNm || '' completedPriceDataParams.regNm = row.regNm || ''
completedPriceDataParams.regDt = row.regDt || '' completedPriceDataParams.regDt = row.regDt || ''
@@ -176,9 +174,9 @@ function handlePriceRowClick(row) {
} }
registerFormOpen.value = false registerFormOpen.value = false
priceSearchCheckBoxStatus.value = !!row 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)
@@ -187,50 +185,42 @@ const fileInputs = ref([
{ file: null, description: '소액수의계약서' }, { file: null, description: '소액수의계약서' },
{ file: null, description: '수의계약 체결 제한 여부 확인서' }, { file: null, description: '수의계약 체결 제한 여부 확인서' },
{ file: null, description: '퇴직자 재직여부 확인서' }, { file: null, description: '퇴직자 재직여부 확인서' },
{ file: null, description: '인지세 납부확인서' },
{ file: null, description: '정부권장정책 이행 구매 검토서' }, { file: null, description: '정부권장정책 이행 구매 검토서' },
{ file: null, description: '기타' } { file: null, description: '기타' },
{ file: null, description: '인지세 납부확인서' },
]) ])
function handleFileChange(e, idx) {
const files = e.target.files
if (files && files.length > 0) {
fileInputs.value[idx].file = files[0]
} else {
fileInputs.value[idx].file = null
}
}
const saveContOne = async () => { const saveContOne = async () => {
let res = null let res = null
try{ try{
loading.value = true loading.value = true
// if (!validation()) {
// return; const amt = Number(String(completedPriceDataParams.contAmt).replace(/[^0-9]/g, ''))
// } if (amt >= 10000000) {
const injiFile = pbAtts.value[6]
if (!injiFile || !injiFile.logiFnm) {
notyf.error('계약금액이 1,000만원 이상일 경우 인지세 납부확인서 첨부가 필수입니다.')
loading.value = false
return
}
}
const paramsCont ={ const paramsCont ={
prcsNo: completedPriceDataParams.prcsNo, prcsNo: completedPriceDataParams.prcsNo,
bizNo: completedPriceDataParams.bizNo, bizNo: completedPriceDataParams.bizNo,
cateCd: priceSearchCheckBoxStatus.value ? selectedCode.value : completedPriceDataParams.cateCd,
compNm: completedPriceDataParams.compNm, compNm: completedPriceDataParams.compNm,
title: completedPriceDataParams.title, title: completedPriceDataParams.title,
regSdat: formatMonthDate(completedPriceDataParams.regSdat), contSdat: formatMonthDate(completedPriceDataParams.contSdat),
regEdat: formatMonthDate(completedPriceDataParams.regEdat), contEdat: formatMonthDate(completedPriceDataParams.contEdat),
contAmt: completedPriceDataParams.contAmt, contAmt: completedPriceDataParams.contAmt,
signDt: formatMonthDate(completedPriceDataParams.svyDt), signDt: formatMonthDate(completedPriceDataParams.contSdat),
reason: completedPriceDataParams.reason, reason: completedPriceDataParams.reason,
exeYn: true, // 가격조사 예외여부 확인필요 excYn: priceSearchCheckBoxStatus.value, // 가격조사 예외여부 확인필요
// cateCd: completedPriceDataParams.cateCd, contAtts: params.contAtts,
// cateNm: completedPriceDataParams.cateNm,
// content: completedPriceDataParams.content,
// regSabun: completedPriceDataParams.regSabun,
// regNm: completedPriceDataParams.regNm,
// regDt: formatMonthDate(completedPriceDataParams.regDt),
// stCd: completedPriceDataParams.stCd,
// stNm: completedPriceDataParams.stNm,
} }
console.log(pbAtts)
res = await updateContract(paramsCont) res = await saveContract(paramsCont)
if(res.request.status == '200'){ if(res.request.status == '200'){
notyf.primary('등록 되었습니다.') notyf.primary('등록 되었습니다.')
@@ -243,9 +233,77 @@ const saveContOne = async () => {
} }
} }
const moveList = () => { const pbAtts = ref<iPbAtt[]>(params.contAtts)
router.push('/app/contractManagement')
const onFileChange = (e, idx) => {
const file = e.target.files[0]
if (!file) return
const reader = new FileReader()
reader.onload = () => {
const result = reader.result
const pbAtt = {
prcsNo: completedPriceDataParams.prcsNo,
logiFnm: file.name,
size: file.size,
data: result.split(',')[1],
}
// 인덱스별로 파일 저장
pbAtts.value[idx] = pbAtt
console.log(pbAtts)
console.log(pbAtts.value[idx].logiFnm)
}
reader.readAsDataURL(file)
} }
function resetForm() {
completedPriceDataParams.prcsNo = ''
completedPriceDataParams.bizNo = ''
completedPriceDataParams.compNm = ''
completedPriceDataParams.title = ''
completedPriceDataParams.contSdat = ''
completedPriceDataParams.contEdat = ''
completedPriceDataParams.contAmt = ''
completedPriceDataParams.reason = ''
selectedCode.value = ''
pbAtts.value = []
// 기타 입력값도 여기에 추가
}
watch(
() => priceSearchCheckBoxStatus.value,
() => {resetForm()}
)
function routerMove() {
router.push({path: '/app/contractManagement'})
}
const showReasonError = computed(() =>
priceSearchCheckBoxStatus.value &&
(!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>
@@ -271,6 +329,7 @@ const moveList = () => {
<VCodeSelect <VCodeSelect
v-model="selectedCode" v-model="selectedCode"
cd_grp="5" cd_grp="5"
:disabled="!priceSearchCheckBoxStatus"
/></VField> /></VField>
</span> </span>
</td> </td>
@@ -306,7 +365,7 @@ const moveList = () => {
<VField class="is-flex"> <VField class="is-flex">
<VControl raw subcontrol> <VControl raw subcontrol>
<VCheckbox <VCheckbox
label="가격조사여부" label="예외사유"
color="info" color="info"
v-model="priceSearchCheckBoxStatus" v-model="priceSearchCheckBoxStatus"
/> />
@@ -321,6 +380,7 @@ const moveList = () => {
v-model="completedPriceDataParams.reason" v-model="completedPriceDataParams.reason"
class="input custom-text-filter" class="input custom-text-filter"
placeholder="가격조사 안했을 시 예외 사유 입력(필수)" placeholder="가격조사 안했을 시 예외 사유 입력(필수)"
:class="{ 'danger-placeholder': showReasonError }"
> >
</VControl> </VControl>
</VField> </VField>
@@ -336,6 +396,7 @@ const moveList = () => {
v-model="completedPriceDataParams.title" v-model="completedPriceDataParams.title"
class="input custom-text-filter" class="input custom-text-filter"
placeholder="계약명" placeholder="계약명"
:disabled="!priceSearchCheckBoxStatus"
> >
</VControl> </VControl>
</VField> </VField>
@@ -346,11 +407,21 @@ const moveList = () => {
<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"
@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>
@@ -361,6 +432,7 @@ const moveList = () => {
v-model="completedPriceDataParams.compNm" v-model="completedPriceDataParams.compNm"
class="input custom-text-filter" class="input custom-text-filter"
placeholder="업체명" placeholder="업체명"
:disabled="!priceSearchCheckBoxStatus"
> >
</VControl> </VControl>
</VField> </VField>
@@ -392,9 +464,10 @@ const moveList = () => {
<VField> <VField>
<VControl> <VControl>
<input <input
:value="formatMonthDate(completedPriceDataParams.regSdat)" :value="formatMonthDate(completedPriceDataParams.contSdat)"
class="input custom-text-filter" class="input custom-text-filter"
placeholder="계약체결일" placeholder="계약체결일"
:disabled="!priceSearchCheckBoxStatus"
> >
</VControl> </VControl>
</VField> </VField>
@@ -405,22 +478,6 @@ const moveList = () => {
> >
</VButton> </VButton>
<VModal
actions="center"
title="계약금액"
>
<template #content>
<VPlaceholderSection
title="Go Premium"
subtitle="Unlock more features and business tools by going premium"
/>
</template>
<template #action>
<VButton color="primary" raised>
등록
</VButton>
</template>
</VModal>
</td> </td>
<td colspan="2"> <td colspan="2">
<VField> <VField>
@@ -429,6 +486,7 @@ const moveList = () => {
v-model="completedPriceDataParams.contAmt" v-model="completedPriceDataParams.contAmt"
class="input custom-text-filter" class="input custom-text-filter"
placeholder="금액" placeholder="금액"
:disabled="!priceSearchCheckBoxStatus"
> >
</VControl> </VControl>
</VField> </VField>
@@ -454,7 +512,7 @@ const moveList = () => {
<div> <div>
<div> <div>
<VDatePicker <VDatePicker
v-model="completedPriceDataParams.regSdat" v-model="completedPriceDataParams.contSdat"
color="green" color="green"
trim-weeks trim-weeks
> >
@@ -479,7 +537,7 @@ const moveList = () => {
<div class=""> <div class="">
<div> <div>
<VDatePicker <VDatePicker
v-model="completedPriceDataParams.regEdat" v-model="completedPriceDataParams.contEdat"
color="green" color="green"
trim-weeks trim-weeks
> >
@@ -513,6 +571,12 @@ const moveList = () => {
</td> </td>
<td colspan="5"> <td colspan="5">
<!-- 첨부파일 입력영역: 등록 버튼 클릭 토글 --> <!-- 첨부파일 입력영역: 등록 버튼 클릭 토글 -->
</td>
</tr>
<tr>
<td></td>
<td colspan="7">
<div v-if="showFileInputs" class="file-upload-list" style="margin-top:10px;"> <div v-if="showFileInputs" class="file-upload-list" style="margin-top:10px;">
<div <div
v-for="(input, idx) in fileInputs" v-for="(input, idx) in fileInputs"
@@ -524,11 +588,13 @@ const moveList = () => {
<input <input
type="file" type="file"
class="file-input" class="file-input"
@change="e => handleFileChange(e, idx)" @change="(e) => onFileChange(e, idx)"
/> />
<span class="file-cta">파일선택</span> <span class="file-cta">파일선택</span>
</label> </label>
<span style="flex:1; margin-right: 10px;">{{ input.file ? input.file.name : '첨부된 파일 없음' }}</span> <span style="flex:1; margin-right: 10px;">
{{ pbAtts[idx] == null ? '' : pbAtts[idx].logiFnm }}
</span>
<span style="flex:2; color: #666;">{{ input.description }}</span> <span style="flex:2; color: #666;">{{ input.description }}</span>
</div> </div>
</div> </div>
@@ -536,10 +602,10 @@ const moveList = () => {
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="bottom-button"> </div>
<VButton @click="saveContOne"> </VButton> <div class="bottom-button">
<VButton @click="moveList"> </VButton> <VButton @click="saveContOne"> </VButton>
</div> <VButton @click="routerMove"> </VButton>
</div> </div>
</div> </div>
</div> </div>
@@ -549,6 +615,7 @@ const moveList = () => {
.table tbody td { .table tbody td {
color: var(--smoke-white); color: var(--smoke-white);
} }
.datatable-table { .datatable-table {
td{ td{
font-family: var(--font),serif; font-family: var(--font),serif;
@@ -573,6 +640,21 @@ const moveList = () => {
tr:nth-child(5) > td:nth-child(4) { tr:nth-child(5) > td:nth-child(4) {
color: black; color: black;
} }
tr:nth-child(7) > td {
padding: 0 12px;
}
}
/* 일반 상태 */
.input::placeholder {
color: #b0b0b0;
}
/* 에러 상태 (빨간색) */
.danger-placeholder::placeholder {
color: #ff3860; /* Bulma 기준 빨간색 */
opacity: 1; /* 크롬 등에서 흐려지는 것 방지 */
} }
.bottom-button { .bottom-button {

View File

@@ -59,9 +59,9 @@ const params = reactive({
], ],
priceData:[], priceData:[],
prcsBizsColumn: [ //견적사 입력 prcsBizsColumn: [ //견적사 입력
{ key: 'email', label: '이메일', editable: true }, { key: 'email', label: '이메일', editable: true},
{ key: 'bizNo', label: '사업자번호', editable: true}, { key: 'bizNo', label: '사업자번호', editable: true, cellClass: 'is-justify-content-center'},
{ key: 'totAmt', label: '금액', editable: true}, { key: 'totAmt', label: '금액', editable: true, cellClass: 'is-justify-content-right'},
{ key: 'sendYn', label: '전송여부', editable: true, cellClass: 'is-justify-content-center'}, { key: 'sendYn', label: '전송여부', editable: true, cellClass: 'is-justify-content-center'},
{ key: 'retransmitYn', label: '재전송여부', editable: true, cellClass: 'is-justify-content-center'}, { key: 'retransmitYn', label: '재전송여부', editable: true, cellClass: 'is-justify-content-center'},
], ],
@@ -283,7 +283,7 @@ const onPrcsFileDownload = async (prcsNo: string, fileOrd: number, logiFnm: stri
disabled disabled
> >
</div> </div>
<div style="transform: translateY(15px)">~</div> <div style="transform: translateY(9px)">~</div>
<div class="column is-4"> <div class="column is-4">
<input <input
:readonly=true :readonly=true
@@ -352,20 +352,14 @@ const onPrcsFileDownload = async (prcsNo: string, fileOrd: number, logiFnm: stri
<!-- sendYn 컬럼 커스텀 렌더링 --> <!-- sendYn 컬럼 커스텀 렌더링 -->
<template #body-cell-sendYn="{ row }"> <template #body-cell-sendYn="{ row }">
<div> <div>
<VButton <span v-if="!row.sendYn" style="color: red;">실패</span>
v-if="!row.sendYn"
color="validation"
size="small"
>
미전송
</VButton>
<span v-else>전송완료</span> <span v-else>전송완료</span>
</div> </div>
</template> </template>
<template #body-cell-retransmitYn="{ row }"> <template #body-cell-retransmitYn="{ row }">
<div> <div>
<VButton <VButton
v-if="!row.sendYn" v-if="!row.sendYn && params.stCd == '0200'"
color="info" color="info"
size="small" size="small"
> >

View File

@@ -263,6 +263,15 @@ watch(currentPage, (newParams) => {
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.datatable-toolbar {
padding: 1rem 1.5rem;
margin: 0 0 2rem 0;
}
.flex-table .flex-table-header {
min-height: 3rem;
}
.v-buttons-right-align { .v-buttons-right-align {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;

View File

@@ -116,7 +116,7 @@ export async function getContractList(params = {}) {
* @param {object} params * @param {object} params
* @returns * @returns
*/ */
export async function getPriceList() { export async function getContractPriceList() {
try { try {
const result = await axios.get(`/api/cont/prcs`) const result = await axios.get(`/api/cont/prcs`)
return result.data return result.data
@@ -139,10 +139,10 @@ export async function getPriceList() {
* @param {object} contNo * @param {object} contNo
* @returns * @returns
*/ */
export async function getPrice(contNo) { export async function updateContractReturn(contNo) {
try { try {
const result = await axios.put(`/api/cont/ret/${contNo}`) const result = await axios.put(`/api/cont/ret/${contNo}`)
return result.data return result
} catch (e) { } catch (e) {
const serverError = e.response?.data; const serverError = e.response?.data;

102
src/service/signDocApi.ts Normal file
View File

@@ -0,0 +1,102 @@
import axios from 'axios'
/**
* (임시) 전자결재 저장(테스트용) 결재중 상태 저장
* @param {object} params
* @property {string} params.contNo - 계약번호
* @returns
*/
export async function signStart(params = {}) {
console.log(params)
try {
const result = await axios.post(`/api/sign/start/`,params)
return result
} catch (e) {
const serverError = e.response?.data;
const message = typeof serverError?.body === 'string'
? serverError.body
: 'Unknown error occurred';
const error = new Error(message); // ✅ 반드시 string만 넣기! 아니면 객체가 문자열로 나옴
error.code = serverError?.code;
error.errTime = serverError?.errTime;
throw error;
}
}
/**
* 전자결재 반려 상태변경
* @param {object} params
* @property {string} params.contNo - 계약번호
* @returns
*/
export async function signReturn(params = {}) {
console.log(params)
try {
const result = await axios.post(`/api/sign/return/`,params)
return result
} catch (e) {
const serverError = e.response?.data;
const message = typeof serverError?.body === 'string'
? serverError.body
: 'Unknown error occurred';
const error = new Error(message); // ✅ 반드시 string만 넣기! 아니면 객체가 문자열로 나옴
error.code = serverError?.code;
error.errTime = serverError?.errTime;
throw error;
}
}
/**
* 전자결재 회수 상태 변경
* @param {object} params
* @property {string} params.contNo - 계약번호
* @returns
*/
export async function signStart(params = {}) {
console.log(params)
try {
const result = await axios.post(`/api/sign/recovery/`,params)
return result
} catch (e) {
const serverError = e.response?.data;
const message = typeof serverError?.body === 'string'
? serverError.body
: 'Unknown error occurred';
const error = new Error(message); // ✅ 반드시 string만 넣기! 아니면 객체가 문자열로 나옴
error.code = serverError?.code;
error.errTime = serverError?.errTime;
throw error;
}
}
/**
* 전자결재 결재완료 상태 변경
* @param {object} params
* @property {string} params.contNo - 계약번호
* @returns
*/
export async function signStart(params = {}) {
console.log(params)
try {
const result = await axios.post(`/api/sign/confirm/`,params)
return result
} catch (e) {
const serverError = e.response?.data;
const message = typeof serverError?.body === 'string'
? serverError.body
: 'Unknown error occurred';
const error = new Error(message); // ✅ 반드시 string만 넣기! 아니면 객체가 문자열로 나옴
error.code = serverError?.code;
error.errTime = serverError?.errTime;
throw error;
}
}