|
|
|
@ -1,5 +1,5 @@
|
|
|
|
import { useState, useEffect } from 'react';
|
|
|
|
import { useState, useEffect } from 'react';
|
|
|
|
import './App.css';
|
|
|
|
import './Form.css';
|
|
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
function App() {
|
|
|
|
const [payerName, setPayerName] = useState('');
|
|
|
|
const [payerName, setPayerName] = useState('');
|
|
|
|
@ -9,6 +9,7 @@ function App() {
|
|
|
|
const [clientId, setClientId] = useState('');
|
|
|
|
const [clientId, setClientId] = useState('');
|
|
|
|
const [payerBankAccount, setPayerBankAccount] = useState('');
|
|
|
|
const [payerBankAccount, setPayerBankAccount] = useState('');
|
|
|
|
const [amount, setAmount] = useState('0-00');
|
|
|
|
const [amount, setAmount] = useState('0-00');
|
|
|
|
|
|
|
|
const [payerAccounts, setPayerAccounts] = useState([]);
|
|
|
|
|
|
|
|
|
|
|
|
const handleBlur = () => {
|
|
|
|
const handleBlur = () => {
|
|
|
|
console.log(amount);
|
|
|
|
console.log(amount);
|
|
|
|
@ -37,7 +38,6 @@ function App() {
|
|
|
|
action: 'getClientInfo',
|
|
|
|
action: 'getClientInfo',
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const data = await response.json();
|
|
|
|
const data = await response.json();
|
|
|
|
setPayerName(data.fields[3].value);
|
|
|
|
setPayerName(data.fields[3].value);
|
|
|
|
setPayerINN(data.fields[4].value);
|
|
|
|
setPayerINN(data.fields[4].value);
|
|
|
|
@ -45,6 +45,7 @@ function App() {
|
|
|
|
setPayerAddress(data.fields[7].value);
|
|
|
|
setPayerAddress(data.fields[7].value);
|
|
|
|
setClientId(data.fields[1].value);
|
|
|
|
setClientId(data.fields[1].value);
|
|
|
|
setPayerBankAccount(data.fields[12].value);
|
|
|
|
setPayerBankAccount(data.fields[12].value);
|
|
|
|
|
|
|
|
setPayerAccounts(data.accounts);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
fetchUsingAsyncAwaitWithFetchApi();
|
|
|
|
fetchUsingAsyncAwaitWithFetchApi();
|
|
|
|
@ -73,7 +74,13 @@ function App() {
|
|
|
|
onChange={(e) => setPayerBankAccount(e.target.value)}
|
|
|
|
onChange={(e) => setPayerBankAccount(e.target.value)}
|
|
|
|
onBlur={handleBlur}
|
|
|
|
onBlur={handleBlur}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<option id="1">{payerBankAccount}</option>
|
|
|
|
{payerAccounts.map((item, ind) => (
|
|
|
|
|
|
|
|
<option key={`cbAccountNumber_${ind}`}>
|
|
|
|
|
|
|
|
{item.description
|
|
|
|
|
|
|
|
? `${item.cbAccountNumber}|${item.description}`
|
|
|
|
|
|
|
|
: item.cbAccountNumber}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
))}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="child">ИНН:</div>
|
|
|
|
<div className="child">ИНН:</div>
|