권한변경
This commit is contained in:
@@ -18,7 +18,9 @@ import NiceCalendar from '@/shared/ui/calendar/nice-calendar';
|
||||
import { notiBar, snackBar } from '@/shared/lib';
|
||||
import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types';
|
||||
import { useKeyboardAware } from '@/shared/lib/hooks/use-keyboard-aware';
|
||||
import { checkGrant } from '@/shared/lib/check-grant';
|
||||
|
||||
const menuId = 34;
|
||||
export const BillingChargePage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
@@ -52,46 +54,52 @@ export const BillingChargePage = () => {
|
||||
};
|
||||
|
||||
const onClickToBillingCharge = () => {
|
||||
if (!billKey) {
|
||||
showAlert('빌키는 필수 입력 항목입니다.');
|
||||
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);
|
||||
if(checkGrant(menuId, 'W')){
|
||||
if (!billKey) {
|
||||
showAlert('빌키는 필수 입력 항목입니다.');
|
||||
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) => {
|
||||
|
||||
Reference in New Issue
Block a user