mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 01:22:33 +09:00
fix : 3단결제 체크 "최소 결재자는 본인 외 2명이상 필수"
마지막이 결재자 인지 "결재선의 마지막은 결재자이어야 함"
결재자 있는지 "결재자는 필수입니다."
관련 validation 처리 완료
This commit is contained in:
@@ -94,11 +94,40 @@ const cancel = () => {
|
|||||||
router.push('/app/contractManagement')
|
router.push('/app/contractManagement')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validation = () => {
|
||||||
|
notyf.dismissAll()
|
||||||
|
const resultGu = apprLine.value.filter((item,index)=> index != 0 && !item.lineclsf)
|
||||||
|
|
||||||
|
if(resultGu.length > 0){
|
||||||
|
console.log("resultGu",resultGu)
|
||||||
|
notyf.error("결재선 구분값을 입력해주세요")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if(apprLine.value.length < 2){
|
||||||
|
notyf.error("결재선은 본인 외 2명이상 필수입니다.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const result = apprLine.value.filter((item)=> item.lineclsf === 'A' )
|
||||||
|
|
||||||
|
if(result.length > 1){
|
||||||
|
notyf.error("결재는 한 명입니다.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const resultLastItem = apprLine.value[apprLine.value.length-1].lineclsf
|
||||||
|
if(resultLastItem != 'A'){
|
||||||
|
notyf.error("결재선의 마지막은 결재자이어야 함")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const createChit = async () => {
|
const createChit = async () => {
|
||||||
let res = null
|
let res = null
|
||||||
try{
|
try{
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
if (validation()) {
|
||||||
const createParams = {
|
const createParams = {
|
||||||
contNo: params.contNo, //"CONT-0000000005",
|
contNo: params.contNo, //"CONT-0000000005",
|
||||||
bldat: '20250602',//params.regSdt.replace("-",""), // "20250501",
|
bldat: '20250602',//params.regSdt.replace("-",""), // "20250501",
|
||||||
@@ -122,7 +151,8 @@ const createChit = async () => {
|
|||||||
txBillSeq: '202503231', //params.txBillSeq,//!!!!!!어떤 값인지 모름 202503231
|
txBillSeq: '202503231', //params.txBillSeq,//!!!!!!어떤 값인지 모름 202503231
|
||||||
slipAtts: pbAtts.value.map(req => ({
|
slipAtts: pbAtts.value.map(req => ({
|
||||||
logiFnm: req.logiFnm,
|
logiFnm: req.logiFnm,
|
||||||
data: req.data})),//첨부파일 데이터,
|
data: req.data
|
||||||
|
})),//첨부파일 데이터,
|
||||||
zwf0011t: {
|
zwf0011t: {
|
||||||
wkftx: "결재 테스트11", //!!!!!!어떤 값인지 모름
|
wkftx: "결재 테스트11", //!!!!!!어떤 값인지 모름
|
||||||
apprs: [{
|
apprs: [{
|
||||||
@@ -156,9 +186,10 @@ const createChit = async () => {
|
|||||||
notyf.dismissAll()
|
notyf.dismissAll()
|
||||||
res = await saveTempSlip(createParams)
|
res = await saveTempSlip(createParams)
|
||||||
if (res.request.status == '200') {
|
if (res.request.status == '200') {
|
||||||
notyf.primary('등록 되었습니다.')
|
notyf.primary('전표가 등록 되었습니다.')
|
||||||
router.push({path: '/app/priceManagement'})
|
router.push({path: '/app/priceManagement'})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}catch(e){
|
}catch(e){
|
||||||
notyf.error(e.message)
|
notyf.error(e.message)
|
||||||
}finally {
|
}finally {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const getDetailList = (item) => {
|
|||||||
params.slipAtts = item.slipAtts//첨부파일
|
params.slipAtts = item.slipAtts//첨부파일
|
||||||
console.log("params.slipAtts",params.slipAtts)
|
console.log("params.slipAtts",params.slipAtts)
|
||||||
apprLine.value = item.zwf0011t.apprs[0].value
|
apprLine.value = item.zwf0011t.apprs[0].value
|
||||||
console.log("apprsList.value",apprLine.value)
|
console.log("apprsList.value 여기 결재선 들어옴",apprLine.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
function onInput(event) {
|
function onInput(event) {
|
||||||
@@ -115,6 +115,33 @@ const router = useRouter()
|
|||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
router.push('/app/contractManagement')
|
router.push('/app/contractManagement')
|
||||||
}
|
}
|
||||||
|
const validation = () => {
|
||||||
|
notyf.dismissAll()
|
||||||
|
const resultGu = apprLine.value.filter((item,index)=> index != 0 && !item.lineclsf)
|
||||||
|
|
||||||
|
if(resultGu.length > 0){
|
||||||
|
console.log("resultGu",resultGu)
|
||||||
|
notyf.error("결재선 구분값을 입력해주세요")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if(apprLine.value.length < 2){
|
||||||
|
notyf.error("결재선은 본인 외 2명이상 필수입니다.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const result = apprLine.value.filter((item)=> item.lineclsf === 'A' )
|
||||||
|
|
||||||
|
if(result.length > 1){
|
||||||
|
notyf.error("결재는 한 명입니다.")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const resultLastItem = apprLine.value[apprLine.value.length-1].lineclsf
|
||||||
|
if(resultLastItem != 'A'){
|
||||||
|
notyf.error("결재선의 마지막은 결재자이어야 함")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
@@ -122,6 +149,7 @@ const updateChit = async () => {
|
|||||||
let res = null
|
let res = null
|
||||||
try{
|
try{
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
if (validation()){
|
||||||
const createParams = {
|
const createParams = {
|
||||||
contNo : params.contNo, //"CONT-0000000005",
|
contNo : params.contNo, //"CONT-0000000005",
|
||||||
zwf0011t : {
|
zwf0011t : {
|
||||||
@@ -140,9 +168,10 @@ const updateChit = async () => {
|
|||||||
notyf.dismissAll()
|
notyf.dismissAll()
|
||||||
res = await updateTempSlip(createParams)
|
res = await updateTempSlip(createParams)
|
||||||
if(res.request.status == '200'){
|
if(res.request.status == '200'){
|
||||||
notyf.primary('등록 되었습니다.')
|
notyf.primary('결재선이 수정 되었습니다.')
|
||||||
router.push({path: '/app/priceManagement'})
|
router.push({path: '/app/priceManagement'})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}catch(e){
|
}catch(e){
|
||||||
notyf.error(e.message)
|
notyf.error(e.message)
|
||||||
}finally {
|
}finally {
|
||||||
@@ -216,7 +245,6 @@ const isDuplicate = (person: Person) =>{
|
|||||||
watch(
|
watch(
|
||||||
selectUser,
|
selectUser,
|
||||||
(newPersons) => {
|
(newPersons) => {
|
||||||
console.log("newPersons",newPersons)
|
|
||||||
if (Array.isArray(newPersons) && newPersons.length > 0) {
|
if (Array.isArray(newPersons) && newPersons.length > 0) {
|
||||||
const filtered = newPersons.filter((p) => !isDuplicate(p))
|
const filtered = newPersons.filter((p) => !isDuplicate(p))
|
||||||
apprLine.value = [...apprLine.value, ...filtered]
|
apprLine.value = [...apprLine.value, ...filtered]
|
||||||
@@ -230,7 +258,7 @@ const onDocDelete = (index: number) => {
|
|||||||
|
|
||||||
if(apprLine.value.length-1 !== params.flexColumn.length
|
if(apprLine.value.length-1 !== params.flexColumn.length
|
||||||
|| (params.flexColumn.length == 8 && apprLine.value.length-1 == params.flexColumn.length))
|
|| (params.flexColumn.length == 8 && apprLine.value.length-1 == params.flexColumn.length))
|
||||||
{
|
{console.log("삭제 index 접근함")
|
||||||
apprLine.value.splice(index, 1)
|
apprLine.value.splice(index, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user