mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 18:53:44 +09:00
first
This commit is contained in:
30
src/service/UserApi.ts
Normal file
30
src/service/UserApi.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import axios from 'axios'
|
||||
|
||||
/**
|
||||
* 사용자관리 > 직원검색
|
||||
* @property {string} name - 이름
|
||||
* @returns
|
||||
* @param name
|
||||
*/
|
||||
export async function getUserList(params = {}) {
|
||||
try {
|
||||
const result = await axios.get('/api/user',params)
|
||||
console.log("result",result.data)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 사용자관리 > 현재 사용자 정보 조회
|
||||
* @returns
|
||||
*/
|
||||
export async function getNowUserList(name: string) {
|
||||
try {
|
||||
const result = await axios.get(`/api/user/info`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
0
src/service/admin.js
Normal file
0
src/service/admin.js
Normal file
15
src/service/code.ts
Normal file
15
src/service/code.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import axios from 'axios'
|
||||
/**
|
||||
* 코드
|
||||
* @param {object} params
|
||||
* @property {string} params.id - 그룹 아이디
|
||||
* @returns
|
||||
*/
|
||||
export async function getDetailCode(params) {
|
||||
try {
|
||||
const result = await axios.get(`/api/code/${params}`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
0
src/service/contract.ts
Normal file
0
src/service/contract.ts
Normal file
16
src/service/integratedApprovalApi.ts
Normal file
16
src/service/integratedApprovalApi.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import axios from 'axios'
|
||||
|
||||
/**
|
||||
* 가격조사 상세조회
|
||||
* @param {object} params
|
||||
* @property {string} params.prcsNo - 가격조사번호
|
||||
* @returns
|
||||
*/
|
||||
export async function getIntegratedApproval(params) {
|
||||
try {
|
||||
const result = await axios.get(`/api/itg/appr,${params}`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
75
src/service/integratedPayment.ts
Normal file
75
src/service/integratedPayment.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
import axios from 'axios'
|
||||
|
||||
/**
|
||||
* 통합결재목록(부서) 조회
|
||||
* @param {object} params
|
||||
* @property {string} params.page - 페이지번호
|
||||
* @property {string} params.row - 행 개수
|
||||
* @property {string} params.title - 제목
|
||||
* @returns
|
||||
*/
|
||||
export async function getIntegratedApproval(params = {}) {
|
||||
try {
|
||||
const result = await axios.get(`/api/itg/appr/req`, {
|
||||
params,
|
||||
headers: { sabun: params.sabun },
|
||||
})
|
||||
console.log(result)
|
||||
if (result.status === 200) {
|
||||
return result.data
|
||||
} else if (result.status >= 500) {
|
||||
throw new Error('서버 오류가 발생했습니다.')
|
||||
} else if (result.status >= 400) {
|
||||
throw new Error('잘못된 요청입니다.')
|
||||
} else {
|
||||
throw new Error(`예상치 못한 상태코드: ${result.status}`)
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.response) {
|
||||
if (e.response.status >= 500) {
|
||||
throw new Error('서버 오류가 발생했습니다.')
|
||||
} else if (e.response.status >= 400) {
|
||||
throw new Error('잘못된 요청입니다.')
|
||||
} else if (e.response._data && e.response._data.message) {
|
||||
throw new Error(e.response._data.message)
|
||||
}
|
||||
}
|
||||
throw new Error(e.message || '알 수 없는 오류')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 통합결재목록(부서) 조회
|
||||
* @param {object} params
|
||||
* @property {string} params.apprNo - 결재번호
|
||||
* @property {string} params.apprOrd - 결재순서
|
||||
* @property {string} params.sabun - 사번
|
||||
* @property {string} params.apprStatCd - 결재상태코드
|
||||
* @property {string} params.reason - 사유 (반려일시 상태코드 0400)
|
||||
* @returns
|
||||
*/
|
||||
export async function updateIntegratedApproval(params = {}) {
|
||||
try {
|
||||
const result = await axios.put(`/api/appr`, params, {
|
||||
headers: { sabun: params.sabun },
|
||||
})
|
||||
if (result.status === 200) {
|
||||
return result.data
|
||||
} else if (result.status >= 500) {
|
||||
throw new Error('서버 오류가 발생했습니다.')
|
||||
} else {
|
||||
throw new Error(`예상치 못한 상태코드: ${result.status}`)
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
239
src/service/priceApi.ts
Normal file
239
src/service/priceApi.ts
Normal file
@@ -0,0 +1,239 @@
|
||||
import axios from 'axios'
|
||||
|
||||
/**
|
||||
* 가격조사 수정
|
||||
* @param {object} params
|
||||
* @property {string} params.cateNm - 분야
|
||||
* @property {string} params.cateNm - 결제상태
|
||||
* @property {string} params.regNm - 담당자
|
||||
* @property {string} params.regSdat - 등록기간
|
||||
* @returns
|
||||
*/
|
||||
export async function updatePrice(params = {}) {
|
||||
try {
|
||||
const result = await axios.put(`/api/prcs`,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.cateNm - 분야
|
||||
* @property {string} params.cateNm - 결제상태
|
||||
* @property {string} params.regNm - 담당자
|
||||
* @property {string} params.regSdat - 등록기간
|
||||
* @returns
|
||||
*/
|
||||
export async function savePrice(params = {}) {
|
||||
try {
|
||||
const result = await axios.post(`/api/prcs`,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.prcsNo - 가격조사번호
|
||||
* @returns
|
||||
*/
|
||||
export async function getDetailPrcs(params) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/${params}`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사서 다운로드 Todo
|
||||
* @param {object} params
|
||||
* @property {string} params.prcsNo - 가격조사번호
|
||||
* @property {string} params.fileOrd - 파일순서
|
||||
* @returns
|
||||
*/
|
||||
export async function getPrcsFileDown(params) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/${params}`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사서 첨부파일 삭제 Todo
|
||||
* @param {object} params
|
||||
* @property {string} params.prcsNo - 가격조사번호
|
||||
* @property {string} params.fileOrd - 파일순서
|
||||
* @returns
|
||||
*/
|
||||
export async function deletePrcsFile(params) {
|
||||
try {
|
||||
const result = await axios.delete(`/api/prcs/${params}`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사_결제관리 조회(페이징)
|
||||
* @param {object} params
|
||||
* @property {string} params.cateCd - 분야코드
|
||||
* @property {string} params.regNm - 담당자
|
||||
* @property {string} params.regSdt - 등록시작일
|
||||
* @property {string} params.regEdt - 등록종료일
|
||||
* @property {string} params.page - 페이지
|
||||
* @property {string} params.row - 아이템갯수
|
||||
* @returns
|
||||
*/
|
||||
export async function getPriceApproList(params = {}) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/approval/page`,params)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사_계약관리 조회(페이징)
|
||||
* @param {object} params
|
||||
* @property {string} params.cateCd - 분야코드
|
||||
* @property {string} params.regNm - 담당자
|
||||
* @property {string} params.regSdt - 등록시작일
|
||||
* @property {string} params.regEdt - 등록종료일
|
||||
* @property {string} params.page - 페이지
|
||||
* @property {string} params.row - 아이템갯수
|
||||
* @returns
|
||||
*/
|
||||
export async function getPriceContrList(params = {}) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/contract/page`,params)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사_견적관리 조회(페이징)
|
||||
* @param {object} params
|
||||
* @property {string} params.prcsNo - 가격조사번호
|
||||
* @returns
|
||||
*/
|
||||
export async function getPriceExtList(params = {}) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/external/count`,params)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사_견적관리 조회(페이징)
|
||||
* @param {object} params
|
||||
* @property {string} params.cateCd - 분야코드
|
||||
* @property {string} params.regNm - 담당자
|
||||
* @property {string} params.title - 제목
|
||||
* @property {string} params.regSdt - 등록시작일
|
||||
* @property {string} params.regEdt - 등록종료일
|
||||
* @property {string} params.page - 페이지
|
||||
* @property {string} params.row - 아이템갯수
|
||||
* @returns
|
||||
*/
|
||||
export async function getPriceExtCountList(params = {}) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/external/page`,params)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 가격조사 조회(페이징)
|
||||
* @param {object} params
|
||||
* @property {string} params.cateCd - 분야코드
|
||||
* @property {string} params.regNm - 담당자
|
||||
* @property {string} params.title - 제목
|
||||
* @property {string} params.regSdt - 등록시작일
|
||||
* @property {string} params.regEdt - 등록종료일
|
||||
* @property {string} params.page - 페이지
|
||||
* @property {string} params.row - 아이템갯수
|
||||
* @returns
|
||||
*/
|
||||
export async function getPriceList(params = {}) {
|
||||
try {
|
||||
const result = await axios.get(`/api/prcs/page`,params)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격조사 회수 처리
|
||||
* @param {object} params
|
||||
* @property {string} params.prcsNo - 가격조사번호
|
||||
* @returns
|
||||
*/
|
||||
export async function updatePrcsNo(param) {
|
||||
try {
|
||||
const result = await axios.put(`/api/prcs/ret/${param}`)
|
||||
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.prcsNo - 가격조사 번호
|
||||
|
||||
* @returns
|
||||
*/
|
||||
export async function putSurveyPrcsNo(params = {}) {
|
||||
try {
|
||||
const result = await axios.put(`/api/prcs/survey${params}`)
|
||||
return result.data
|
||||
} catch (e) {
|
||||
throw new Error(e)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user