- 자금이체_ 이체요청 Request,Response 수정
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
useSetHeaderType,
|
||||
useSetFooterMode,
|
||||
useSetOnBack
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
import { useState } from 'react';
|
||||
@@ -16,17 +16,19 @@ import { useStore } from '@/shared/model/store';
|
||||
export const FundAccountTransferRequestPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
const midOptions = useStore.getState().UserStore.selectOptionsMids;
|
||||
|
||||
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [transferAmount, setTransferAmount] = useState<number>(0);
|
||||
const [receiveBankCode, setReceiveBankCode] = useState<string>('');
|
||||
const [receiveAccountNo, setReceiveAccountNo] = useState<string>('');
|
||||
const [receiveAccountName, setReceiveAccountName] = useState<string>('');
|
||||
const [transferMemo, setTransferMemo] = useState<string>('');
|
||||
const [bankCode, setBankCode] = useState<string>('');
|
||||
const [accountNo, setAccountNo] = useState<string>('');
|
||||
const [accountName, setAccountName] = useState<string>('');
|
||||
const [amount, setAmount] = useState<number>(0);
|
||||
const [moid, setMoid] = useState<string>('');
|
||||
const [depositParameter, setDepositParameter] = useState<string>('');
|
||||
|
||||
const { mutateAsync: extensionFundAccountRequest } = useExtensionFundAccountTransferRequestMutation();
|
||||
|
||||
|
||||
useSetHeaderTitle('자금이체 이체등록');
|
||||
useSetHeaderType(HeaderType.RightClose);
|
||||
useSetFooterMode(false);
|
||||
@@ -37,11 +39,12 @@ export const FundAccountTransferRequestPage = () => {
|
||||
const callExtensionFundAccountTransferRequest = () => {
|
||||
let params: ExtensionFundAccountTransferRequestParams = {
|
||||
mid: mid,
|
||||
transferAmount: transferAmount,
|
||||
receiveBankCode: receiveBankCode,
|
||||
receiveAccountNo: receiveAccountNo,
|
||||
receiveAccountName: receiveAccountName,
|
||||
transferMemo: transferMemo
|
||||
bankCode: bankCode,
|
||||
accountNo: accountNo,
|
||||
accountName: accountName,
|
||||
amount: amount,
|
||||
moid: moid,
|
||||
depositParameter: depositParameter
|
||||
};
|
||||
extensionFundAccountRequest(params).then((rs: ExtensionFundAccountTransferRequestResponse) => {
|
||||
navigate(PATHS.additionalService.payout.list);
|
||||
@@ -50,12 +53,15 @@ export const FundAccountTransferRequestPage = () => {
|
||||
|
||||
const isFormValid = () => {
|
||||
return (
|
||||
receiveAccountNo.trim() !== '' &&
|
||||
receiveAccountName.trim() !== '' &&
|
||||
transferAmount >0
|
||||
mid.trim() !== '' &&
|
||||
//bankCode.trim() !== '' &&
|
||||
accountNo.trim() !== '' &&
|
||||
accountName.trim() !== '' &&
|
||||
amount > 0 &&
|
||||
moid.trim() !== ''
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
@@ -64,62 +70,76 @@ export const FundAccountTransferRequestPage = () => {
|
||||
<div className="ing-list">
|
||||
<div className="billing-form gap-30">
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">가맹점</div>
|
||||
<div className="billing-label">가맹점<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<select>
|
||||
<option>userMid</option>
|
||||
<select value={mid} onChange={(e) => setMid(e.target.value)}>
|
||||
{
|
||||
midOptions.map((value, index) => (
|
||||
<option
|
||||
key={value.value}
|
||||
value={value.value}
|
||||
>{value.name}</option>
|
||||
))
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">은행</div>
|
||||
<div className="billing-label">은행<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<select></select>
|
||||
<select value={bankCode} onChange={(e) => setBankCode(e.target.value)}>
|
||||
<option value="">선택하세요</option>
|
||||
{/* TODO: 은행 목록 옵션 추가 필요 */}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">계좌번호</div>
|
||||
<div className="billing-label">계좌번호<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
value={ receiveAccountNo }
|
||||
onChange={ (e) => setReceiveAccountNo(e.target.value) }
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
value={accountNo}
|
||||
onChange={(e) => setAccountNo(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">예금주명</div>
|
||||
<div className="billing-label">예금주명<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
value={ receiveAccountName }
|
||||
onChange={ (e) => setReceiveAccountName(e.target.value) }
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
value={accountName}
|
||||
onChange={(e) => setAccountName(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">이체금액</div>
|
||||
<div className="billing-label">이체금액<span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
value={ transferAmount }
|
||||
onChange={ (e) => setTransferAmount(parseInt(e.target.value)) }
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
value={amount}
|
||||
onChange={(e) => setAmount(parseInt(e.target.value))}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">주문번호</div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
<div className="billing-label">주문번호<span>*</span></div>
|
||||
<div className="billing-field" style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>
|
||||
<input
|
||||
type="text"
|
||||
value={moid}
|
||||
onChange={(e) => setMoid(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">입금인자</div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
<input
|
||||
type="text"
|
||||
value={depositParameter}
|
||||
onChange={(e) => setDepositParameter(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,10 +149,10 @@ export const FundAccountTransferRequestPage = () => {
|
||||
</div>
|
||||
</main>
|
||||
<div className="apply-row">
|
||||
<button
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={ callExtensionFundAccountTransferRequest }
|
||||
disabled={!isFormValid}
|
||||
onClick={callExtensionFundAccountTransferRequest}
|
||||
disabled={!isFormValid()}
|
||||
>등록</button>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user