mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 03:12:27 +09:00
func : 계약관리 등록폼 저장기능추가진행중
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import notyf from "/@src/plugins/notyf.ts";
|
import {saveContract} from "/@src/service/contract.ts";
|
||||||
|
import {formatDate} from "/@src/utils/common/comfunc.ts";
|
||||||
|
|
||||||
const registerFormOpen = ref(false)
|
const registerFormOpen = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
const notyf = useNotyf()
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
cateCd: '',
|
cateCd: '',
|
||||||
contNo: '',
|
contNo: '',
|
||||||
@@ -36,7 +39,7 @@ const completedPriceDataParams = reactive({
|
|||||||
regSabun:'',
|
regSabun:'',
|
||||||
regNm:'',
|
regNm:'',
|
||||||
regDt:'',
|
regDt:'',
|
||||||
amt:'',
|
contAmt:'',
|
||||||
stCd:'',
|
stCd:'',
|
||||||
stNm:'',
|
stNm:'',
|
||||||
svyDt:'',
|
svyDt:'',
|
||||||
@@ -79,7 +82,7 @@ watch(registerFormOpen, async (isOpen) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function formatDate(dateStr) {
|
function formatMonthDate(dateStr) {
|
||||||
if (!dateStr) return ''
|
if (!dateStr) return ''
|
||||||
const date = new Date(dateStr)
|
const date = new Date(dateStr)
|
||||||
return date.toLocaleDateString('ko-KR', {
|
return date.toLocaleDateString('ko-KR', {
|
||||||
@@ -100,8 +103,8 @@ function getDateDiff(start, end) {
|
|||||||
const contractPeriod = computed(() => {
|
const contractPeriod = computed(() => {
|
||||||
const start = completedPriceDataParams.regSdat
|
const start = completedPriceDataParams.regSdat
|
||||||
const end = completedPriceDataParams.regEdat
|
const end = completedPriceDataParams.regEdat
|
||||||
const startStr = formatDate(start)
|
const startStr = formatMonthDate(start)
|
||||||
const endStr = formatDate(end)
|
const endStr = formatMonthDate(end)
|
||||||
const diff = getDateDiff(start, end)
|
const diff = getDateDiff(start, end)
|
||||||
if (startStr && endStr && diff) {
|
if (startStr && endStr && diff) {
|
||||||
return `${startStr} ~ ${endStr} (${diff}일)`
|
return `${startStr} ~ ${endStr} (${diff}일)`
|
||||||
@@ -144,18 +147,18 @@ function handlePriceRowClick(row) {
|
|||||||
const minEstimate = row.estimates.reduce((min, curr) => curr.amt < min.amt ? curr : min, row.estimates[0])
|
const minEstimate = row.estimates.reduce((min, curr) => curr.amt < min.amt ? curr : min, row.estimates[0])
|
||||||
completedPriceDataParams.bizNo = minEstimate.bizNo || ''
|
completedPriceDataParams.bizNo = minEstimate.bizNo || ''
|
||||||
completedPriceDataParams.compNm = minEstimate.compNm || ''
|
completedPriceDataParams.compNm = minEstimate.compNm || ''
|
||||||
completedPriceDataParams.amt = minEstimate.amt || ''
|
completedPriceDataParams.contAmt = minEstimate.amt || ''
|
||||||
} else {
|
} else {
|
||||||
completedPriceDataParams.bizNo = ''
|
completedPriceDataParams.bizNo = ''
|
||||||
completedPriceDataParams.compNm = ''
|
completedPriceDataParams.compNm = ''
|
||||||
completedPriceDataParams.amt = ''
|
completedPriceDataParams.contAmt = ''
|
||||||
notyf.error("견적서가 없습니다.")
|
notyf.error("견적서가 없습니다.")
|
||||||
}
|
}
|
||||||
|
|
||||||
registerFormOpen.value = false
|
registerFormOpen.value = false
|
||||||
priceSearchCheckBoxStatus.value = !!row
|
priceSearchCheckBoxStatus.value = !!row
|
||||||
console.log(row)
|
console.log(row)
|
||||||
console.log(completedPriceDataParams.amt)
|
console.log(completedPriceDataParams.contAmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showFileInputs = ref(false)
|
const showFileInputs = ref(false)
|
||||||
@@ -178,7 +181,47 @@ function handleFileChange(e, idx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const saveContOne = async () => {
|
||||||
|
let res = null
|
||||||
|
try{
|
||||||
|
loading.value = true
|
||||||
|
// if (!validation()) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
const paramsCont ={
|
||||||
|
prcsNo: completedPriceDataParams.prcsNo,
|
||||||
|
bizNo: completedPriceDataParams.bizNo,
|
||||||
|
compNm: completedPriceDataParams.compNm,
|
||||||
|
title: completedPriceDataParams.title,
|
||||||
|
regSdat: formatMonthDate(completedPriceDataParams.regSdat),
|
||||||
|
regEdat: formatMonthDate(completedPriceDataParams.regEdat),
|
||||||
|
contAmt: completedPriceDataParams.contAmt,
|
||||||
|
signDt: formatMonthDate(completedPriceDataParams.svyDt),
|
||||||
|
reason: completedPriceDataParams.reason,
|
||||||
|
exeYn: treu, // 가격조사 예외여부 확인필요
|
||||||
|
// cateCd: completedPriceDataParams.cateCd,
|
||||||
|
// cateNm: completedPriceDataParams.cateNm,
|
||||||
|
// content: completedPriceDataParams.content,
|
||||||
|
// regSabun: completedPriceDataParams.regSabun,
|
||||||
|
// regNm: completedPriceDataParams.regNm,
|
||||||
|
// regDt: formatMonthDate(completedPriceDataParams.regDt),
|
||||||
|
// stCd: completedPriceDataParams.stCd,
|
||||||
|
// stNm: completedPriceDataParams.stNm,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
res = await saveContract(paramsCont)
|
||||||
|
|
||||||
|
if(res.request.status == '200'){
|
||||||
|
notyf.primary('등록 되었습니다.')
|
||||||
|
router.push({path: '/app/contractManagement'})
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
notyf.error(e.message)
|
||||||
|
}finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -327,7 +370,7 @@ function handleFileChange(e, idx) {
|
|||||||
<VField>
|
<VField>
|
||||||
<VControl>
|
<VControl>
|
||||||
<input
|
<input
|
||||||
:value="formatDate(completedPriceDataParams.regSdat)"
|
:value="formatMonthDate(completedPriceDataParams.regSdat)"
|
||||||
class="input custom-text-filter"
|
class="input custom-text-filter"
|
||||||
placeholder="계약체결일"
|
placeholder="계약체결일"
|
||||||
>
|
>
|
||||||
@@ -361,7 +404,7 @@ function handleFileChange(e, idx) {
|
|||||||
<VField>
|
<VField>
|
||||||
<VControl>
|
<VControl>
|
||||||
<input
|
<input
|
||||||
v-model="completedPriceDataParams.amt"
|
v-model="completedPriceDataParams.contAmt"
|
||||||
class="input custom-text-filter"
|
class="input custom-text-filter"
|
||||||
placeholder="금액"
|
placeholder="금액"
|
||||||
>
|
>
|
||||||
@@ -472,7 +515,7 @@ function handleFileChange(e, idx) {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="bottom-button">
|
<div class="bottom-button">
|
||||||
<VButton>저 장</VButton>
|
<VButton @click="saveContOne">저 장</VButton>
|
||||||
<VButton>취 소</VButton>
|
<VButton>취 소</VButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export async function getContractList(params = {}) {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export async function saveContract(params = {}) {
|
export async function saveContract(params = {}) {
|
||||||
|
console.log(params)
|
||||||
try {
|
try {
|
||||||
const result = await axios.post(`/api/cont`,params)
|
const result = await axios.post(`/api/cont`,params)
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user