mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-19 21:05:06 +09:00
func : 계약관리 등록폼 저장기능추가진행중
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
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 loading = ref(false)
|
||||
const notyf = useNotyf()
|
||||
const params = reactive({
|
||||
cateCd: '',
|
||||
contNo: '',
|
||||
@@ -36,7 +39,7 @@ const completedPriceDataParams = reactive({
|
||||
regSabun:'',
|
||||
regNm:'',
|
||||
regDt:'',
|
||||
amt:'',
|
||||
contAmt:'',
|
||||
stCd:'',
|
||||
stNm:'',
|
||||
svyDt:'',
|
||||
@@ -79,7 +82,7 @@ watch(registerFormOpen, async (isOpen) => {
|
||||
}
|
||||
})
|
||||
|
||||
function formatDate(dateStr) {
|
||||
function formatMonthDate(dateStr) {
|
||||
if (!dateStr) return ''
|
||||
const date = new Date(dateStr)
|
||||
return date.toLocaleDateString('ko-KR', {
|
||||
@@ -100,8 +103,8 @@ function getDateDiff(start, end) {
|
||||
const contractPeriod = computed(() => {
|
||||
const start = completedPriceDataParams.regSdat
|
||||
const end = completedPriceDataParams.regEdat
|
||||
const startStr = formatDate(start)
|
||||
const endStr = formatDate(end)
|
||||
const startStr = formatMonthDate(start)
|
||||
const endStr = formatMonthDate(end)
|
||||
const diff = getDateDiff(start, end)
|
||||
if (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])
|
||||
completedPriceDataParams.bizNo = minEstimate.bizNo || ''
|
||||
completedPriceDataParams.compNm = minEstimate.compNm || ''
|
||||
completedPriceDataParams.amt = minEstimate.amt || ''
|
||||
completedPriceDataParams.contAmt = minEstimate.amt || ''
|
||||
} else {
|
||||
completedPriceDataParams.bizNo = ''
|
||||
completedPriceDataParams.compNm = ''
|
||||
completedPriceDataParams.amt = ''
|
||||
completedPriceDataParams.contAmt = ''
|
||||
notyf.error("견적서가 없습니다.")
|
||||
}
|
||||
|
||||
registerFormOpen.value = false
|
||||
priceSearchCheckBoxStatus.value = !!row
|
||||
console.log(row)
|
||||
console.log(completedPriceDataParams.amt)
|
||||
console.log(completedPriceDataParams.contAmt)
|
||||
}
|
||||
|
||||
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>
|
||||
@@ -327,7 +370,7 @@ function handleFileChange(e, idx) {
|
||||
<VField>
|
||||
<VControl>
|
||||
<input
|
||||
:value="formatDate(completedPriceDataParams.regSdat)"
|
||||
:value="formatMonthDate(completedPriceDataParams.regSdat)"
|
||||
class="input custom-text-filter"
|
||||
placeholder="계약체결일"
|
||||
>
|
||||
@@ -361,7 +404,7 @@ function handleFileChange(e, idx) {
|
||||
<VField>
|
||||
<VControl>
|
||||
<input
|
||||
v-model="completedPriceDataParams.amt"
|
||||
v-model="completedPriceDataParams.contAmt"
|
||||
class="input custom-text-filter"
|
||||
placeholder="금액"
|
||||
>
|
||||
@@ -472,7 +515,7 @@ function handleFileChange(e, idx) {
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="bottom-button">
|
||||
<VButton>저 장</VButton>
|
||||
<VButton @click="saveContOne">저 장</VButton>
|
||||
<VButton>취 소</VButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,7 @@ export async function getContractList(params = {}) {
|
||||
* @returns
|
||||
*/
|
||||
export async function saveContract(params = {}) {
|
||||
console.log(params)
|
||||
try {
|
||||
const result = await axios.post(`/api/cont`,params)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user