fix : 결재함에서 전표상세시 협조버튼 결재선 모달 폼 완성

This commit is contained in:
Yesol Choi
2025-06-07 21:17:44 +09:00
parent 4b1962985b
commit 7059cd0d72
3 changed files with 135 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import PriceDetail from "/@src/pages/app/priceDetail.vue";
import {conveterNo, updateApprovalStatus} from "/@src/service/approvalApi.ts"; import {conveterNo, updateApprovalStatus} from "/@src/service/approvalApi.ts";
import {formatDatefromString} from "/@src/utils/common/comfunc.ts"; import {formatDatefromString} from "/@src/utils/common/comfunc.ts";
import DocumentManagementDetail from "/@src/pages/app/documentManagementDetail.vue"; import DocumentManagementDetail from "/@src/pages/app/documentManagementDetail.vue";
import {updateTempSlip} from "/@src/service/slipApi.ts";
const gubunMap = { const gubunMap = {
SAP: '전표생성', SAP: '전표생성',
@@ -18,6 +19,7 @@ onBeforeMount(async () => {
}) })
const isModalOpen = ref(false) const isModalOpen = ref(false)
const subModalOpen = ref(false)
const selectedRow = ref<any>(null) const selectedRow = ref<any>(null)
const prcsNo = ref<string>('') const prcsNo = ref<string>('')
let apprNo = ref<string>('') let apprNo = ref<string>('')
@@ -51,6 +53,12 @@ const params = reactive({
], ],
approvalParams: [], approvalParams: [],
rowData: [], rowData: [],
cooperationData: [],
cooperColumn:[
{ key: 'lineclsf', label: '결재구분' },
{ key: 'bname', label: '사번' },
{ key: 'abscd', label: '사유코드(근태)' },
]
}) })
const searchParamsList = reactive({ const searchParamsList = reactive({
@@ -185,6 +193,46 @@ watch(currentPage, (newParams) => {
currentPage.value = newParams currentPage.value = newParams
searchApproval(currentPage.value) searchApproval(currentPage.value)
}) })
const getCooperation = () => {
console.log("data",data)
params.cooperationData = data
}
const loading = ref(false)
const updateChit = async () => {
let res = null
try{
loading.value = true
// if (validation()){
// const createParams = {
// belnr : params.contNo, //전표번호
// wkfid : //요청번호(협조용)
// wkftx : //결재제목
// apprs : {
// label: "0605145807", 명칭 //!!!!!!!뭔 값인지 모름
// apprs : [{
// label: '결재',
// value: apprLine.value.map((req) => ({
// lineclsf : req.lineclsf, //결재구분
// bname : req.bname, //사번
// abscd : req.abscd //사유코드(근태)
// }))
// }]
// }
// }
notyf.dismissAll()
// res = await updateTempSlip(createParams)
if(res.request.status == '200'){
notyf.primary('결재선이 수정 되었습니다.')
router.push({path: '/app/ApprovalManagement'})
}
// }
}catch(e){
notyf.error(e.message)
}finally {
loading.value = false
}
}
</script> </script>
<template> <template>
@@ -301,13 +349,43 @@ watch(currentPage, (newParams) => {
@close="isModalOpen = false" @close="isModalOpen = false"
> >
<template #content> <template #content>
<PriceDetail v-if="params.rowData.gubun === 'SVCM'" :prcsNo="prcsNo" /> <PriceDetail v-if="params.rowData.gubun === 'SVCM'" :prcsNo="prcsNo" @buttonClick="getCooperation"/>
<document-management-detail v-else-if="params.rowData.gubun === 'SAP'" :apprNo="apprNo" /> <document-management-detail v-else-if="params.rowData.gubun === 'SAP'" :apprNo="apprNo" />
<div v-else>지원하지 않는 구분입니다.</div> <div v-else>지원하지 않는 구분입니다.</div>
</template> </template>
<template #action> <template #action>
<VButton type="submit" color="info" raised @click="updateIntegratedPaymentRejectionFunc">반려</VButton> <VButton type="submit" color="info" raised @click="updateIntegratedPaymentRejectionFunc">반려</VButton>
<VButton type="submit" color="primary" raised @click="updateIntegratedPaymentApprovalFunc">승인</VButton> <VButton type="submit" color="primary" raised @click="updateIntegratedPaymentApprovalFunc">승인</VButton>
<VButton type="submit" color="info" raised v-if="params.rowData.gubun === 'SAP'" @click="subModalOpen= true">협조</VButton>
<VButton type="submit" color="primary" raised v-if="params.rowData.gubun === 'SAP'" @click="updateIntegratedPaymentApprovalFunc">결재</VButton>
</template>
</VModal>
<VModal
:open="subModalOpen"
actions="center"
title="협조 리스트"
size="contract-big"
cancelLabel="닫기"
@close="subModalOpen = false"
>
<template #content>
<VUserSap/>
<ComVFlexTable
:key="params.cooperationData.length"
:data="params.cooperationData"
:columns="params.cooperColumn"
:separators="true"
>
<template #body-cell="{ row, column, index, value }">
<!-- : 특정 컬럼이면 input, 아니면 그냥 출력 -->
<div>
<span>{{ value }}</span>
</div>
</template>
</ComVFlexTable>
</template>
<template #action>
<VButton type="submit" color="info" raised @click="">협조등록</VButton>
</template> </template>
</VModal> </VModal>
<VFlexPagination <VFlexPagination

View File

@@ -17,12 +17,15 @@ onBeforeMount(async ()=>{
}else if(props.apprNo){ }else if(props.apprNo){
const sapApprNo = await sapApprConveterNo(props.apprNo) const sapApprNo = await sapApprConveterNo(props.apprNo)
result = await getSlipDetail(sapApprNo.data.contNo) result = await getSlipDetail(sapApprNo.data.contNo)
emits('buttonClick',result)
} }
getDetailList(result) getDetailList(result)
apprLine.value = result.zwf0011t.apprs apprLine.value = result.zwf0011t.apprs
selectedTab.value = apprLine.value[0].value selectedTab.value = apprLine.value[0].value
}) })
const emits = defineEmits<{
(e: 'buttonClick', data: any): void
}>()
const notyf = useNotyf() const notyf = useNotyf()
const apprLine = ref<VTabsItem[]>([]) const apprLine = ref<VTabsItem[]>([])
const getDetailList = (item) => { const getDetailList = (item) => {

View File

@@ -1,5 +1,53 @@
import axios from 'axios' import axios from 'axios'
/**
* SAP결재상태 변경
* @param {object} params
* @property {string} params
* @returns
*/
export async function changeSapApprStatus(params = {}) {
try {
console.log(params)
const result = await axios.get(`/api/sap/appr`,params)
return result
}
catch (e) {
if (e.response) {
if (e.response.status >= 500) {
throw new Error('서버 오류가 발생했습니다.')
} else if (e.response.status >= 400) {
throw new Error('잘못된 요청입니다.')
}
}
throw new Error(e.message)
}
}
/**
* SAP(협조) 결재 저장
* @param {object} params
* @property {string} params
* @returns
*/
export async function saveSapAppr(params = {}) {
try {
console.log(params)
const result = await axios.post(`/api/sap/appr`,params)
return result
}
catch (e) {
if (e.response) {
if (e.response.status >= 500) {
throw new Error('서버 오류가 발생했습니다.')
} else if (e.response.status >= 400) {
throw new Error('잘못된 요청입니다.')
}
}
throw new Error(e.message)
}
}
/** /**
* SAP결재번호를 계약결재번호로 변경 * SAP결재번호를 계약결재번호로 변경
* @param {object} params * @param {object} params