권한변경

This commit is contained in:
focp212@naver.com
2025-11-17 15:58:26 +09:00
parent d7086eeb38
commit 99c4ed7000
5 changed files with 51 additions and 43 deletions

View File

@@ -104,7 +104,7 @@ export const EscrowDetail = ({
const onClickToShowMailResend = () => { const onClickToShowMailResend = () => {
if(checkGrant(menuId, 'X')){ if(checkGrant(menuId, ' W')){
setDownloadBottomSheetOn(true); setDownloadBottomSheetOn(true);
} }
else{ else{

View File

@@ -130,7 +130,7 @@ export const ListWrap = () => {
setSortType(sort); setSortType(sort);
}; };
const onClickToOpenDownloadBottomSheet = () => { const onClickToOpenDownloadBottomSheet = () => {
if (!checkGrant(menuId, 'X')) { if (!checkGrant(menuId, 'D')) {
showAlert(t('common.nopermission')); showAlert(t('common.nopermission'));
return; return;
} }

View File

@@ -35,7 +35,7 @@ export const ReferenceWrap = () => {
const { mutateAsync: vatReturnReferenceRequest } = useVatReturnReferenceRequestMutation(); const { mutateAsync: vatReturnReferenceRequest } = useVatReturnReferenceRequestMutation();
const onClickToResquest = () => { const onClickToResquest = () => {
if(checkGrant(menuId, 'R')){ if(checkGrant(menuId, 'W')){
let params: VatReturnReferenceRequestParams = { let params: VatReturnReferenceRequestParams = {
mid: mid, mid: mid,
startDate: startDate, startDate: startDate,

View File

@@ -29,7 +29,7 @@ export enum QnaRegisterPropsName {
Title = 'Title', Title = 'Title',
Contents = 'Contents', Contents = 'Contents',
}; };
const menuId = 64;
export const QnaRegisterPage = () => { export const QnaRegisterPage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const { t } = useTranslation(); const { t } = useTranslation();
@@ -136,7 +136,7 @@ export const QnaRegisterPage = () => {
}; };
const onClickToRegisterQna = () => { const onClickToRegisterQna = () => {
if (!checkGrant(64, 'W')) { if (!checkGrant(menuId, 'W')) {
showAlert(t('common.nopermission')); showAlert(t('common.nopermission'));
return; return;
} }

View File

@@ -18,7 +18,9 @@ import NiceCalendar from '@/shared/ui/calendar/nice-calendar';
import { notiBar, snackBar } from '@/shared/lib'; import { notiBar, snackBar } from '@/shared/lib';
import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types'; import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types';
import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware'; import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware';
import { checkGrant } from '@/shared/lib/check-grant';
const menuId = 34;
export const BillingChargePage = () => { export const BillingChargePage = () => {
const { navigate } = useNavigate(); const { navigate } = useNavigate();
const { t } = useTranslation(); const { t } = useTranslation();
@@ -52,46 +54,52 @@ export const BillingChargePage = () => {
}; };
const onClickToBillingCharge = () => { const onClickToBillingCharge = () => {
if (!billKey) { if(checkGrant(menuId, 'W')){
showAlert('빌키는 필수 입력 항목입니다.'); if (!billKey) {
return; showAlert('빌키는 필수 입력 항목입니다.');
}
else if (!productName) {
showAlert('상품명은 필수 입력 항목입니다.');
}
else if (!productAmount) {
showAlert('상품금액은 필수 입력 항목입니다.');
}
else if (productAmount <= 0) {
showAlert('상품금액은 0보다 커야 합니다.');
}
else if (!orderNumber) {
showAlert('주문번호는 필수 입력 항목입니다.');
}
else if (!buyerName) {
showAlert('구매자명은 필수 입력 항목입니다.');
}
let params: BillingChargeParams = {
billKey: billKey,
productName: productName,
productAmount: productAmount,
orderNumber: orderNumber,
buyerName: buyerName,
paymentRequestDate: moment(paymentRequestDate).format('YYYYMMDD'),
installmentMonth: installmentMonth
};
billingCharge(params).then((rs: BillingChargeResponse) => {
snackBar('결제 신청을 성공하였습니다.', function () {
navigate(PATHS.transaction.billing.list);
}, 3000);
}).catch((e: any) => {
if (e.response?.data?.error?.message) {
snackBar(e.response?.data?.error?.message);
return; return;
} }
}); else if (!productName) {
showAlert('상품명은 필수 입력 항목입니다.');
}
else if (!productAmount) {
showAlert('상품금액은 필수 입력 항목입니다.');
}
else if (productAmount <= 0) {
showAlert('상품금액은 0보다 커야 합니다.');
}
else if (!orderNumber) {
showAlert('주문번호는 필수 입력 항목입니다.');
}
else if (!buyerName) {
showAlert('구매자명은 필수 입력 항목입니다.');
}
let params: BillingChargeParams = {
billKey: billKey,
productName: productName,
productAmount: productAmount,
orderNumber: orderNumber,
buyerName: buyerName,
paymentRequestDate: moment(paymentRequestDate).format('YYYYMMDD'),
installmentMonth: installmentMonth
};
billingCharge(params).then((rs: BillingChargeResponse) => {
snackBar('결제 신청을 성공하였습니다.', function () {
navigate(PATHS.transaction.billing.list);
}, 3000);
}).catch((e: any) => {
if (e.response?.data?.error?.message) {
snackBar(e.response?.data?.error?.message);
return;
}
});
}
else{
showAlert(t('common.nopermission'));
}
}; };
const onChangeBillKey = (value: string) => { const onChangeBillKey = (value: string) => {