error checking on client forms
This commit is contained in:
parent
9ebe8bc221
commit
486bbf9686
@ -248,13 +248,14 @@ export const uploadAttachmentFile = (file) =>
|
||||
});
|
||||
}
|
||||
|
||||
export const uploadSignedFile = (file, id) =>
|
||||
export const uploadSignedFile = (file, id, digital = false) =>
|
||||
{
|
||||
return new Promise((resolve, reject) =>
|
||||
{
|
||||
let data = new FormData();
|
||||
data.append('file', file);
|
||||
data.append('id', id);
|
||||
data.append('digital', digital);
|
||||
|
||||
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/questionnaire/send`, data,
|
||||
{
|
||||
@ -365,4 +366,9 @@ export const downloadQuestionnaire = ({ filename, download = true }) =>
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const questionnaireSetSign = ({ dispatch, sign }) =>
|
||||
{
|
||||
dispatch({ type: actionTypes.QUESTIONNAIRE_SET_SIGN, data: { sign } });
|
||||
}
|
||||
@ -118,14 +118,14 @@ export default class AddressSuggests extends React.Component
|
||||
render()
|
||||
{
|
||||
const { focused, options } = this.state;
|
||||
const { value, disabled, required, placeholder } = this.props;
|
||||
const { value, disabled, required, placeholder, className } = this.props;
|
||||
|
||||
return (
|
||||
<div className="autocomlete" style={{ position: "relative" }}>
|
||||
<input type="text"
|
||||
autoComplete="off"
|
||||
style={{ width: "100%" }}
|
||||
className={ `react-select__control react-select__control--is-focused ${ focused ? "react-select__control--menu-is-open" : "" }` }
|
||||
className={ `react-select__control react-select__control--is-focused ${ focused ? "react-select__control--menu-is-open" : "" } ${ className && className }` }
|
||||
id="address"
|
||||
name="address"
|
||||
value={ value }
|
||||
|
||||
@ -5,7 +5,7 @@ import moment from "moment";
|
||||
import fileDownload from 'js-file-download';
|
||||
|
||||
import { getCertificates, isPluginCryptoProInstalled, generateSignature } from "../../../utils/digital_signature";
|
||||
import { downloadQuestionnaire } from "../../../actions";
|
||||
import { downloadQuestionnaire, uploadSignedFile } from "../../../actions";
|
||||
export default class DigitalSignaturesList extends React.Component
|
||||
{
|
||||
constructor(props)
|
||||
@ -75,6 +75,8 @@ export default class DigitalSignaturesList extends React.Component
|
||||
|
||||
_sign = () =>
|
||||
{
|
||||
const { company, onSignDigital } = this.props;
|
||||
|
||||
downloadQuestionnaire({ download: false })
|
||||
.then(({ file, filename }) =>
|
||||
{
|
||||
@ -91,13 +93,23 @@ export default class DigitalSignaturesList extends React.Component
|
||||
|
||||
const now = moment().format("DDMMYYYY_HHmmss");
|
||||
generateSignature(file_to_sign, this.state.certificate_selected.certificate)
|
||||
.then(signature => {
|
||||
.then(signature =>
|
||||
{
|
||||
console.log("signature");
|
||||
console.log(signature);
|
||||
|
||||
fileDownload(signature, `${ now }_${ filename }.sig`);
|
||||
fileDownload(file, `${ now }_${ filename }`);
|
||||
alert("Подписание ЭЦП прошло успешно.");
|
||||
uploadSignedFile(signature, company.questionnaire_id)
|
||||
.then(() =>
|
||||
{
|
||||
onSignDigital();
|
||||
})
|
||||
.catch(() =>
|
||||
{
|
||||
});
|
||||
|
||||
//fileDownload(signature, `${ now }_${ filename }.sig`);
|
||||
//fileDownload(file, `${ now }_${ filename }`);
|
||||
//alert("Подписание ЭЦП прошло успешно.");
|
||||
});
|
||||
})
|
||||
.catch((e) =>
|
||||
@ -114,8 +126,11 @@ export default class DigitalSignaturesList extends React.Component
|
||||
'The card cannot be accessed because the wrong PIN was presented. (0x8010006B)': 'Указанный пароль неверный'
|
||||
}
|
||||
|
||||
let errorText = errorsText[e.message] || 'Ошибка подписания файла';
|
||||
alert(errorText);
|
||||
if(e !== undefined)
|
||||
{
|
||||
let errorText = errorsText[e.message] || 'Ошибка подписания файла';
|
||||
alert(errorText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +57,11 @@ class Form_1_Main extends QuestionnaireForm
|
||||
step: 1,
|
||||
status: "empty",
|
||||
loading: false,
|
||||
errors: [],
|
||||
};
|
||||
|
||||
this.ref_form = React.createRef();
|
||||
this.ref_submit = React.createRef();
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
@ -73,8 +77,13 @@ class Form_1_Main extends QuestionnaireForm
|
||||
{
|
||||
}
|
||||
|
||||
_checkDisabled = () =>
|
||||
_handle_onNextPage = (event) =>
|
||||
{
|
||||
console.log("Form_1_Main", "_handle_onNextPage");
|
||||
event.preventDefault();
|
||||
|
||||
const errors = [];
|
||||
|
||||
const { main } = this.state;
|
||||
const { company } = this.props;
|
||||
const check = ["title", "inn", "kpp", "email", "telephone", "financial_loan"];
|
||||
@ -87,11 +96,14 @@ class Form_1_Main extends QuestionnaireForm
|
||||
{
|
||||
if(main[check[i]] === "")
|
||||
{
|
||||
return true;
|
||||
errors.push(`main.${ check[i] }`);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
this.setState({ errors }, () =>
|
||||
{
|
||||
this.ref_submit.current.click();
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onNonProfitChange = () =>
|
||||
@ -135,25 +147,38 @@ class Form_1_Main extends QuestionnaireForm
|
||||
render()
|
||||
{
|
||||
const { company, checking } = this.props;
|
||||
const { loading, main, status } = this.state;
|
||||
const { loading, main, status, errors, } = this.state;
|
||||
const firstLetter = /(?!.*[DFIOQU])[A-VXY]/i;
|
||||
const letter = /(?!.*[DFIOQU])[A-Z]/i;
|
||||
const digit = /[0-9]/;
|
||||
const fin_mask = [firstLetter, digit, letter, " ", digit, letter, digit];
|
||||
|
||||
console.log({ errors });
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_1 ${ checking && "disabled" }`}>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_1 ${ checking && "disabled" }`}>
|
||||
<p className="title">1. Информация о лизингополучателе</p>
|
||||
|
||||
{ errors.length > 0 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, проверьте корректность заполнения данных в форме.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<div className="form_field">
|
||||
<label>Краткое наименование <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("main.title") > -1 ? "error" : "" }
|
||||
id="main.title"
|
||||
name="main.title"
|
||||
value={ this._checkStrValue(main.title) }
|
||||
placeholder="Введите наименование"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { this._removeError("main.title"); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ true }
|
||||
/>
|
||||
@ -163,11 +188,12 @@ class Form_1_Main extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>ИНН <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("main.inn") > -1 ? "error" : "" }
|
||||
id="main.inn"
|
||||
name="main.inn"
|
||||
value={ this._checkStrValue(main.inn) }
|
||||
placeholder="Введите ИНН"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => {this._removeError("main.inn"); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ true }
|
||||
maxLength={ 12 }
|
||||
@ -177,11 +203,12 @@ class Form_1_Main extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>КПП <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("main.kpp") > -1 ? "error" : "" }
|
||||
id="main.kpp"
|
||||
name="main.kpp"
|
||||
value={ this._checkStrValue(main.kpp) }
|
||||
placeholder="Введите КПП"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => {this._removeError("main.kpp"); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ true }
|
||||
/>
|
||||
@ -193,12 +220,13 @@ class Form_1_Main extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Телефон <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("main.telephone") > -1 ? "error" : "" }
|
||||
mask='+7 (999) 999 99 99'
|
||||
id="main.telephone"
|
||||
name="main.telephone"
|
||||
value={ this._checkStrValue(main.telephone) }
|
||||
placeholder="Введите номер"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { if(event.target.value !== "" && !isNaN(parseInt(event.target.value.replace(/[^\d]+/g, ''), 10)) && parseInt(event.target.value.replace(/[^\d]+/g, ''), 10) > 7) { this._removeError("main.telephone"); } this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ checking } >
|
||||
</InputMask>
|
||||
@ -211,7 +239,7 @@ class Form_1_Main extends QuestionnaireForm
|
||||
name="main.websiteurl"
|
||||
value={ this._checkStrValue(main.websiteurl) }
|
||||
placeholder="Введите адрес сайта, если есть"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
disabled={ checking }
|
||||
/>
|
||||
</div>
|
||||
@ -220,11 +248,13 @@ class Form_1_Main extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>E-mail <sup className="required_label">*</sup></label>
|
||||
<input type="email"
|
||||
className={ errors.indexOf("main.email") > -1 ? "error" : "" }
|
||||
id="main.email"
|
||||
name="main.email"
|
||||
value={ this._checkStrValue(main.email) }
|
||||
placeholder="Укажите адрес электронной почты"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { this._removeError("main.email"); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ checking }
|
||||
/>
|
||||
<p>может использоваться для отправки лизингодателем юридически значимых сообщений в соответсвии с условиями договора лизинга, а так же для операций в электронном ПТС/ПСМ</p>
|
||||
@ -233,14 +263,16 @@ class Form_1_Main extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Финансовая нагрузка <sup className="required_label">*</sup></label>
|
||||
<CurrencyInput
|
||||
id="main.financial_loan"
|
||||
name="main.financial_loan"
|
||||
value={ this._checkStrValue(main.financial_loan) !== "" ? this._checkStrValue(main.financial_loan) : null }
|
||||
precision="2"
|
||||
selectAllOnFocus={ true }
|
||||
placeholder="Укажите сумму"
|
||||
onChangeEvent={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
disabled={ checking }
|
||||
className={ errors.indexOf("main.financial_loan") > -1 ? "error" : "" }
|
||||
id="main.financial_loan"
|
||||
name="main.financial_loan"
|
||||
value={ this._checkStrValue(main.financial_loan) !== "" && parseFloat(main.financial_loan) > 0 ? this._checkStrValue(main.financial_loan) : null }
|
||||
precision="0"
|
||||
selectAllOnFocus={ true }
|
||||
placeholder="Укажите сумму"
|
||||
onChangeEvent={ (event) => { this._removeError("main.financial_loan"); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ checking }
|
||||
/>
|
||||
<p>сумма текущих ежемесячных платежей по действующим кредитам/договорам лизинга</p>
|
||||
</div>
|
||||
@ -277,17 +309,18 @@ class Form_1_Main extends QuestionnaireForm
|
||||
|
||||
{ !checking && (
|
||||
<div className="action" style={{ flexDirection: "column" }}>
|
||||
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
|
||||
<button type="submit" className="button button-blue" onClick={ this._handle_onNextPage }>
|
||||
{ loading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
|
||||
) : "Продолжить" }
|
||||
</button>
|
||||
<button ref={ this.ref_submit } type="submit" style={{ display: "none" }}/>
|
||||
{ status !== "empty" && (
|
||||
<>
|
||||
<br/><br/>
|
||||
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
|
||||
</>
|
||||
)}
|
||||
) }
|
||||
</div>
|
||||
) }
|
||||
</form>
|
||||
|
||||
@ -38,7 +38,11 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
fias_id: null,
|
||||
},
|
||||
},
|
||||
errors: [],
|
||||
};
|
||||
|
||||
this.ref_form = React.createRef();
|
||||
this.ref_submit = React.createRef();
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
@ -73,49 +77,65 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
}, 10);
|
||||
}
|
||||
|
||||
_checkDisabled = () =>
|
||||
_handle_onNextPage = () =>
|
||||
{
|
||||
const { contacts } = this.state;
|
||||
|
||||
const errors = [];
|
||||
const check = ["fact_address", "legal_address", "postal_address"];
|
||||
|
||||
if(contacts.address_type === "fact")
|
||||
if(contacts.fact_address.name === "")
|
||||
{
|
||||
if(contacts.fact_address.name === "")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
errors.push(`contacts.fact_address`);
|
||||
}
|
||||
|
||||
if(contacts.address_type === "postal")
|
||||
{
|
||||
if(contacts.postal_address.name === "")
|
||||
{
|
||||
return true;
|
||||
errors.push(`contacts.postal_address`);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
this.setState({ errors }, () =>
|
||||
{
|
||||
this.ref_submit.current.click();
|
||||
});
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { company, checking } = this.props;
|
||||
const { contacts, loading, status, step } = this.state;
|
||||
const { contacts, loading, status, step, errors } = this.state;
|
||||
const { address_type, legal_address, fact_address, postal_address, } = contacts;
|
||||
|
||||
console.log("errors", errors);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_2 ${ checking && "disabled" }`}>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_2 ${ checking && "disabled" }`}>
|
||||
<p className="title">2. Адреса лизингополучателя</p>
|
||||
{ errors.length > 0 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, проверьте корректность заполнения данных в форме.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
|
||||
<div className="form_field">
|
||||
<label>Фактический адрес { address_type === "fact" && <sup className="required_label">*</sup> }</label>
|
||||
<label>Фактический адрес <sup className="required_label">*</sup></label>
|
||||
<AddressSuggests
|
||||
className={ errors.indexOf("contacts.fact_address") > -1 ? "error" : "" }
|
||||
value={ this._checkStrValue(fact_address.name) }
|
||||
fias={ this._checkStrValue(fact_address.fias_id) }
|
||||
onChange={ (data) => this._handle_onTextFieldChange("contacts.fact_address", data) }
|
||||
required={ address_type === "fact" ? true : false }
|
||||
disabled={ checking ? true : address_type === "fact" ? false : true }
|
||||
onChange={ (data) => { this._removeError("contacts.fact_address"); this._handle_onTextFieldChange("contacts.fact_address", data); } }
|
||||
required={ true }
|
||||
disabled={ false }
|
||||
/>
|
||||
<p>для юр.диц - заполняется, если отличается от указанного в ЕГРЮЛ; для ИП - заполняется всегда</p>
|
||||
</div>
|
||||
@ -132,7 +152,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
id="contacts.address_type_legal"
|
||||
name="contacts.address_type"
|
||||
checked={ address_type === "legal" ? true : false }
|
||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } }
|
||||
disabled={ checking }
|
||||
/>
|
||||
<label htmlFor="contacts.address_type_legal" className="unselectable">По юридическому адресу, указанному в ЕГРЮЛ</label>
|
||||
@ -145,7 +165,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
id="contacts.address_type_fact"
|
||||
name="contacts.address_type"
|
||||
checked={ address_type === "fact" ? true : false }
|
||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } }
|
||||
disabled={ checking }
|
||||
/>
|
||||
<label htmlFor="contacts.address_type_fact" className="unselectable">По фактическому адресу, указанному в настоящей анкете</label>
|
||||
@ -163,9 +183,10 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
<label htmlFor="contacts.address_type_postal" className="unselectable" style={{ width: "100%" }}>
|
||||
<span>По следующему адресу { address_type === "postal" && <sup className="required_label">*</sup> }</span>
|
||||
<AddressSuggests
|
||||
className={ errors.indexOf("contacts.postal_address") > -1 ? "error" : "" }
|
||||
value={ this._checkStrValue(postal_address.name) }
|
||||
fias={ this._checkStrValue(postal_address.fias_id) }
|
||||
onChange={ (data) => this._handle_onTextFieldChange("contacts.postal_address", data) }
|
||||
onChange={ (data) => { this._removeError("contacts.postal_address"); this._handle_onTextFieldChange("contacts.postal_address", data); } }
|
||||
required={ true }
|
||||
disabled={ !checking && address_type === "postal" ? false : true }
|
||||
/>
|
||||
@ -176,11 +197,12 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
|
||||
{ !checking && (
|
||||
<div className="action">
|
||||
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
|
||||
<button type="submit" className="button button-blue" onClick={ this._handle_onNextPage }>
|
||||
{ loading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
|
||||
) : "Продолжить" }
|
||||
</button>
|
||||
<button ref={ this.ref_submit } type="submit" style={{ display: "none" }}/>
|
||||
{ status !== "empty" && (
|
||||
<>
|
||||
<br/><br/>
|
||||
|
||||
@ -209,7 +209,9 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
event.preventDefault();
|
||||
|
||||
const errors = [];
|
||||
const { main, head_person, signatory_person, } = this.state;
|
||||
const { main, head_person, signatory_person,
|
||||
delegation_files, head_person_files, signatory_person_files, signatory_corporate_files,
|
||||
} = this.state;
|
||||
|
||||
const head_person_check = [
|
||||
"lastname",
|
||||
@ -312,6 +314,11 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
}
|
||||
}
|
||||
|
||||
if(delegation_files.length === 0) { errors.push(`delegation_files`); }
|
||||
if(head_person_files.length === 0) { errors.push(`head_person_files`); }
|
||||
if(signatory_person_files.length === 0) { errors.push(`signatory_person_files`); }
|
||||
if(signatory_corporate_files.length === 0) { errors.push(`signatory_corporate_files`); }
|
||||
|
||||
this.setState({ errors }, () =>
|
||||
{
|
||||
this.ref_submit.current.click();
|
||||
@ -346,22 +353,14 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
render()
|
||||
{
|
||||
const { checking } = this.props;
|
||||
const {
|
||||
personal_data_consent,
|
||||
const { loading, main, head_person, signatory_person, status, errors,
|
||||
head_person_files,
|
||||
signatory_person_files,
|
||||
signatory_corporate_files,
|
||||
delegation_files,
|
||||
modal_show_personal_data,
|
||||
errors,
|
||||
} = this.state;
|
||||
|
||||
console.log("delegation_files", delegation_files);
|
||||
|
||||
|
||||
const { loading, } = this.state;
|
||||
const { main, head_person, signatory_person, status } = this.state;
|
||||
|
||||
console.log("head_person.evo_assignment_date", head_person.evo_assignment_date);
|
||||
|
||||
let head_person_citizenship = { label: getCitizenshipTitleByCode(head_person.identity_document.citizenship.code), code: head_person.identity_document.citizenship.code };
|
||||
@ -369,8 +368,19 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_3 ${ checking && "disabled" }`} onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }}>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_3 ${ checking && "disabled" }`}>
|
||||
<p className="title">3. Информация о единоличном исполнительном органе, подписанте договора лизинга</p>
|
||||
{ errors.length > 0 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, проверьте корректность заполнения данных в форме.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<div className="form_field">
|
||||
<label>Фамилия <sup className="required_label">*</sup></label>
|
||||
<SuggestsInput
|
||||
@ -424,7 +434,6 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Отчество <small>если имеется</small></label>
|
||||
<SuggestsInput
|
||||
className={ errors.indexOf("head_person.middlename") > -1 ? "error" : "" }
|
||||
type="middlename"
|
||||
id="head_person.middlename"
|
||||
name="head_person.middlename"
|
||||
@ -462,8 +471,8 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
isDisabled={ checking }
|
||||
/>
|
||||
</div>
|
||||
<div className="formgroup">
|
||||
|
||||
<div className="formgroup">
|
||||
<div className="form_field">
|
||||
<label>Серия паспорта <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
@ -492,8 +501,8 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
disabled={ checking }>
|
||||
</InputMask>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="formgroup">
|
||||
<div className="form_field">
|
||||
<label>Дата выдачи <sup className="required_label">*</sup></label>
|
||||
@ -520,6 +529,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="form_field">
|
||||
<label>Кем выдан <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
@ -543,6 +553,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
disabled={ checking }
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="form_field">
|
||||
<label>Гражданство <sup className="required_label">*</sup></label>
|
||||
<Select
|
||||
@ -571,6 +582,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
disabled={ checking }
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="form_field">
|
||||
<label>Должность <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
@ -588,12 +600,13 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Телефон <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("head_person.telephone") > -1 ? "error" : "" }
|
||||
mask='+7 (999) 999 99 99'
|
||||
id={ "head_person.telephone" }
|
||||
name={ "head_person.telephone" }
|
||||
value={ this._checkStrValue(head_person.telephone) }
|
||||
placeholder="Введите номер телефона"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
onChange={ (event) => { if(event.target.value !== "" && !isNaN(parseInt(event.target.value.replace(/[^\d]+/g, ''), 10)) && parseInt(event.target.value.replace(/[^\d]+/g, ''), 10) > 7) { this._removeError("head_person.telephone"); } this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ checking }
|
||||
/>
|
||||
@ -602,6 +615,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Адрес E-mail <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("head_person.email") > -1 ? "error" : "" }
|
||||
id={ "head_person.email" }
|
||||
name={ "head_person.email" }
|
||||
value={ this._checkStrValue(head_person.email) }
|
||||
@ -643,6 +657,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<label>Дата окончания полномочий <sup className="required_label">*</sup></label>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", width: "calc(100% - 198px)" }}>
|
||||
<CalendarDatePicker
|
||||
className={ errors.indexOf("head_person.evo_credentials_dateend") > -1 ? "error" : "" }
|
||||
placeholder="ДД.ММ.ГГГГ"
|
||||
id={ "head_person.evo_credentials_dateend" }
|
||||
value={ this._checkStrValue(head_person.evo_credentials_dateend) !== "" ? this._checkStrValue(head_person.evo_credentials_dateend) : null }
|
||||
@ -655,15 +670,26 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
) }
|
||||
|
||||
{ errors.indexOf("head_person_files") > -1 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, приложите как минимум одно отсканированное изображение или фотографию документа, подтверждающего личность.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<FilesList
|
||||
//group="head_person"
|
||||
name="head_person_files"
|
||||
files={ head_person_files }
|
||||
onAddFile={ this._handle_onAddFile }
|
||||
onAddFile={ (name, files) => { this._removeError("head_person_files"); this._handle_onAddFile(name, files); } }
|
||||
onRemoveFile={ this._handle_onRemoveFile }
|
||||
checking={ checking }
|
||||
title="Прикрепить скан паспорта единоличного исполнительного органа"
|
||||
/>
|
||||
<input type="text" id="head_person_files_error_check" value={ head_person_files.length > 0 ? head_person_files.length : "" } required={ true } style={{ opacity: 0.0, height: "0px", marginTop: "-25px", display: "flex" }}/>
|
||||
|
||||
{ main.inn !== null && main.inn.length < 11 &&
|
||||
(
|
||||
@ -690,6 +716,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field" style={{ flexDirection: "row", flexWrap: "nowrap" }}>
|
||||
<label>ИНН <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("main.individual_executive_inn") > -1 ? "error" : "" }
|
||||
style={{ width: "100%" }}
|
||||
mask='999999999999'
|
||||
//maskPlaceholder={ main.individual_executive_inn !== null && main.individual_executive_inn.replace(/[^\d.-]+/g, '').length < 11 ? "_" : " " }
|
||||
@ -707,6 +734,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field" style={{ flexDirection: "row", flexWrap: "nowrap" }}>
|
||||
<label>КПП <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("main.individual_executive_kpp") > -1 ? "error" : "" }
|
||||
style={{ width: "100%" }}
|
||||
mask='9999999999'
|
||||
alwaysShowMask={ false }
|
||||
@ -725,6 +753,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<p style={{ paddingBottom: "15px" }}><label>Организационно-правовая форма и полное наименование управляющей организации или управляющего <sup className="required_label">*</sup></label></p>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("main.individual_executive_oop") > -1 ? "error" : "" }
|
||||
style={{ width: "100%" }}
|
||||
id="main.individual_executive_oop"
|
||||
name="main.individual_executive_oop"
|
||||
@ -738,8 +767,9 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
|
||||
<div className="formgroup" style={{ width: "100%", }}>
|
||||
<div className="form_field">
|
||||
<label style={{ width: "100%", marginBottom: "12px" }}>Номер договора о передаче полномочий управляющей организации /управляющему</label>
|
||||
<label style={{ width: "100%", marginBottom: "12px" }}>Номер договора о передаче полномочий управляющей организации /управляющему <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("main.individual_executive_docnum") > -1 ? "error" : "" }
|
||||
style={{ width: "100%" }}
|
||||
id="main.individual_executive_docnum"
|
||||
name="main.individual_executive_docnum"
|
||||
@ -751,19 +781,9 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
|
||||
<div className="form_field" style={{ alignItems: "flex-end" }}>
|
||||
<label style={{ width: "100%", alignSelf: "flex-start" }}>Дата договора</label>
|
||||
{/*}
|
||||
<input type="text"
|
||||
style={{ width: "100%", }}
|
||||
id="main.individual_executive_docdate"
|
||||
name="main.individual_executive_docdate"
|
||||
value={ this._checkStrValue(main.individual_executive_docdate) }
|
||||
placeholder="Дата"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
||||
required={ true }
|
||||
/>
|
||||
{*/}
|
||||
<label style={{ width: "100%", alignSelf: "flex-start" }}>Дата договора <sup className="required_label">*</sup></label>
|
||||
<CalendarDatePicker
|
||||
className={ errors.indexOf("main.individual_executive_docdate") > -1 ? "error" : "" }
|
||||
style={{ width: "100%", }}
|
||||
placeholder="ДД.ММ.ГГГГ"
|
||||
id={ "main.individual_executive_docdate" }
|
||||
@ -775,14 +795,25 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ errors.indexOf("delegation_files") > -1 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, приложите как минимум одно отсканированное изображение или фотографию документа, подтверждающего передачу полномочий.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<FilesList
|
||||
//group="individual_executive"
|
||||
name="delegation_files"
|
||||
files={ delegation_files }
|
||||
onAddFile={ this._handle_onAddFile }
|
||||
onAddFile={ (name, files) => { this._removeError("delegation_files"); this._handle_onAddFile(name, files); } }
|
||||
onRemoveFile={ this._handle_onRemoveFile }
|
||||
checking={ checking }
|
||||
/>
|
||||
<input type="text" id="delegation_files_error_check" value={ delegation_files.length > 0 ? delegation_files.length : "" } required={ true } style={{ opacity: 0.0, height: "0px", marginTop: "-25px", display: "flex" }}/>
|
||||
|
||||
</React.Fragment>
|
||||
) }
|
||||
@ -810,6 +841,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Фамилия <sup className="required_label">*</sup></label>
|
||||
<SuggestsInput
|
||||
className={ errors.indexOf("signatory_person.lastname") > -1 ? "error" : "" }
|
||||
type="lastname"
|
||||
id="signatory_person.lastname"
|
||||
name="signatory_person.lastname"
|
||||
@ -824,6 +856,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Имя <sup className="required_label">*</sup></label>
|
||||
<SuggestsInput
|
||||
className={ errors.indexOf("signatory_person.firstname") > -1 ? "error" : "" }
|
||||
type="firstname"
|
||||
id="signatory_person.firstname"
|
||||
name="signatory_person.firstname"
|
||||
@ -871,6 +904,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Серия паспорта <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("signatory_person.identity_document.seria") > -1 ? "error" : "" }
|
||||
mask='9999'
|
||||
id="signatory_person.identity_document.seria"
|
||||
name="signatory_person.identity_document.seria"
|
||||
@ -885,6 +919,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Номер паспорта <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("signatory_person.identity_document.docnumber") > -1 ? "error" : "" }
|
||||
mask='999999'
|
||||
id="signatory_person.identity_document.docnumber"
|
||||
name="signatory_person.identity_document.docnumber"
|
||||
@ -901,6 +936,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Дата выдачи <sup className="required_label">*</sup></label>
|
||||
<CalendarDatePicker
|
||||
className={ errors.indexOf("signatory_person.identity_document.issuedate") > -1 ? "error" : "" }
|
||||
style={{ width: "calc(100% - 198px)" }}
|
||||
placeholder="ДД.ММ.ГГГГ"
|
||||
id={ "signatory_person.identity_document.issuedate" }
|
||||
@ -914,6 +950,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Код подразделения <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("signatory_person.identity_document.code") > -1 ? "error" : "" }
|
||||
mask='999-999'
|
||||
id="signatory_person.identity_document.code"
|
||||
name="signatory_person.identity_document.code"
|
||||
@ -929,6 +966,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Кем выдан <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("signatory_person.identity_document.issueby") > -1 ? "error" : "" }
|
||||
id="signatory_person.identity_document.issueby"
|
||||
name="signatory_person.identity_document.issueby"
|
||||
value={ this._checkStrValue(signatory_person.identity_document.issueby) }
|
||||
@ -942,6 +980,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Место рождения <sup className="required_label">*</sup></label>
|
||||
<AddressSuggests
|
||||
className={ errors.indexOf("signatory_person.identity_document.placebirth") > -1 ? "error" : "" }
|
||||
id={ "signatory_person.identity_document.placebirth" }
|
||||
value={ this._checkStrValue(signatory_person.identity_document.placebirth) }
|
||||
placeholder="Укажите место рождения"
|
||||
@ -972,6 +1011,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Адрес регистрации <sup className="required_label">*</sup></label>
|
||||
<AddressSuggests
|
||||
className={ errors.indexOf("signatory_person.identity_document.registration_address") > -1 ? "error" : "" }
|
||||
value={ this._checkStrValue(signatory_person.identity_document.registration_address.name) }
|
||||
fias={ this._checkStrValue(signatory_person.identity_document.registration_address.fias_id) }
|
||||
onChange={ (data) => this._handle_onTextFieldChange("signatory_person.identity_document.registration_address", data) }
|
||||
@ -994,6 +1034,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Должность <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("signatory_person.jobtitle") > -1 ? "error" : "" }
|
||||
id="signatory_person.jobtitle"
|
||||
name="signatory_person.jobtitle"
|
||||
value={ this._checkStrValue(signatory_person.jobtitle) }
|
||||
@ -1008,6 +1049,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Телефон <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("signatory_person.telephone") > -1 ? "error" : "" }
|
||||
id={ "signatory_person.telephone" }
|
||||
name={ "signatory_person.telephone" }
|
||||
value={ this._checkStrValue(signatory_person.telephone) }
|
||||
@ -1022,6 +1064,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>E-mail <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("signatory_person.email") > -1 ? "error" : "" }
|
||||
id="signatory_person.email"
|
||||
name="signatory_person.email"
|
||||
value={ this._checkStrValue(signatory_person.email) }
|
||||
@ -1033,15 +1076,26 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ errors.indexOf("signatory_person_files") > -1 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, приложите как минимум одно отсканированное изображение или фотографию документа, подтверждающего личность.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<FilesList
|
||||
//group="signatory_person"
|
||||
title="Прикрепить скан паспорта подписанта"
|
||||
name="signatory_person_files"
|
||||
files={ signatory_person_files }
|
||||
onAddFile={ this._handle_onAddFile }
|
||||
onAddFile={ (name, files) => { this._removeError("signatory_person_files"); this._handle_onAddFile(name, files); } }
|
||||
onRemoveFile={ this._handle_onRemoveFile }
|
||||
checking={ checking }
|
||||
/>
|
||||
<input type="text" id="signatory_person_files_error_check" value={ signatory_person_files.length > 0 ? signatory_person_files.length : "" } required={ true } style={{ opacity: 0.0, height: "0px", marginTop: "-25px", display: "flex" }}/>
|
||||
|
||||
<p><b>Реквизиты документа подтверждающие полномочия на подписание договора лизинга</b></p>
|
||||
|
||||
@ -1067,6 +1121,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Наименование документа <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("signatory_person.signer_rule_basis_add") > -1 ? "error" : "" }
|
||||
id="signatory_person.signer_rule_basis_add"
|
||||
name="signatory_person.signer_rule_basis_add"
|
||||
value={ this._checkStrValue(signatory_person.signer_rule_basis_add) }
|
||||
@ -1084,6 +1139,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Номер документа <sup className="required_label">*</sup></label>
|
||||
<input type="text"
|
||||
className={ errors.indexOf("signatory_person.docnumber") > -1 ? "error" : "" }
|
||||
id="signatory_person.docnumber"
|
||||
name="signatory_person.docnumber"
|
||||
value={ this._checkStrValue(signatory_person.docnumber) }
|
||||
@ -1097,6 +1153,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
<div className="form_field">
|
||||
<label>Дата документа <sup className="required_label">*</sup></label>
|
||||
<CalendarDatePicker
|
||||
className={ errors.indexOf("signatory_person.docdate") > -1 ? "error" : "" }
|
||||
style={{ width: "calc(100% - 198px)" }}
|
||||
placeholder="ДД.ММ.ГГГГ"
|
||||
id={ "signatory_person.docdate" }
|
||||
@ -1108,15 +1165,26 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ errors.indexOf("signatory_corporate_files") > -1 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, приложите как минимум одно отсканированное изображение или фотографию документа, подтверждающего право подписи.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<FilesList
|
||||
//group="signatory_person"
|
||||
title="Прикрепить скан документа на право подписи"
|
||||
name="signatory_corporate_files"
|
||||
files={ signatory_corporate_files }
|
||||
onAddFile={ this._handle_onAddFile }
|
||||
onAddFile={ (name, files) => { this._removeError("signatory_corporate_files"); this._handle_onAddFile(name, files); } }
|
||||
onRemoveFile={ this._handle_onRemoveFile }
|
||||
checking={ checking }
|
||||
/>
|
||||
<input type="text" id="signatory_corporate_files_error_check" value={ signatory_corporate_files.length > 0 ? signatory_corporate_files.length : "" } required={ true } style={{ opacity: 0.0, height: "0px", marginTop: "-25px", display: "flex" }}/>
|
||||
</>
|
||||
) }
|
||||
|
||||
@ -1145,6 +1213,7 @@ class Form_3_Signer extends QuestionnaireForm
|
||||
</div>
|
||||
</div>
|
||||
{*/}
|
||||
|
||||
{ !checking && (
|
||||
<div className="action">
|
||||
<button type="button" className="button button-blue" onClick={ this._handle_onNextPage }>
|
||||
|
||||
@ -9,7 +9,7 @@ import { SpinnerCircular } from 'spinners-react';
|
||||
import Select from 'react-select';
|
||||
import { connect } from "react-redux";
|
||||
import { withRouter } from 'next/router';
|
||||
import { get as _get } from 'lodash';
|
||||
import { get as _get, slice } from 'lodash';
|
||||
|
||||
import QuestionnaireForm from "../QuestionnaireForm";
|
||||
import CalendarDatePicker from '../../../CalendarDatePicker';
|
||||
@ -28,6 +28,7 @@ class ShareholderForm extends React.Component
|
||||
_handle_onCheckboxFieldChange = this.props._handle_onCheckboxFieldChange;
|
||||
_handle_onFieldChange = this.props._handle_onFieldChange;
|
||||
_checkStrValue = this.props._checkStrValue;
|
||||
_removeError = this.props._removeError;
|
||||
|
||||
_handle_onCitizenshipChange = (name, value) =>
|
||||
{
|
||||
@ -42,7 +43,7 @@ class ShareholderForm extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { index, shareholder, checking } = this.props;
|
||||
const { index, shareholder, checking, errors } = this.props;
|
||||
|
||||
let citizenship = { label: getCitizenshipTitleByCode(shareholder.identity_document.citizenship.code), code: shareholder.identity_document.citizenship.code };
|
||||
console.log("shareholder", "citizenship", citizenship);
|
||||
@ -283,6 +284,7 @@ class Shareholder extends React.Component
|
||||
_handle_onTextFieldChange = this.props._handle_onTextFieldChange;
|
||||
_handle_onCheckboxFieldChange = this.props._handle_onCheckboxFieldChange;
|
||||
_checkStrValue = this.props._checkStrValue;
|
||||
_removeError = this.props._removeError;
|
||||
|
||||
_checkSignatoryDisabled = (signatory_id) =>
|
||||
{
|
||||
@ -300,7 +302,7 @@ class Shareholder extends React.Component
|
||||
|
||||
render()
|
||||
{
|
||||
const { index, shareholders, removeShareholder, signatories, changeSignatorySelection, clearSignatorySelection, checking } = this.props;
|
||||
const { index, shareholders, removeShareholder, signatories, changeSignatorySelection, clearSignatorySelection, checking, errors, } = this.props;
|
||||
const shareholder = shareholders[index];
|
||||
|
||||
return (
|
||||
@ -335,6 +337,7 @@ class Shareholder extends React.Component
|
||||
</svg>
|
||||
</button>
|
||||
) }
|
||||
|
||||
</div>
|
||||
</div>
|
||||
) }
|
||||
@ -398,13 +401,14 @@ class Shareholder extends React.Component
|
||||
<div className="form_field">
|
||||
<label>Доля в уставном капитале (%) <sup className="required_label">*</sup></label>
|
||||
<InputMask
|
||||
className={ errors.indexOf("founder_part") > -1 ? "error" : "" }
|
||||
mask='999'
|
||||
formatChars={{ '9': '[0-9]', }}
|
||||
id={ `founder_persons[${ index }].founder_part` }
|
||||
name={ `founder_persons[${ index }].founder_part` }
|
||||
value={ this._checkStrValue(shareholder.founder_part) }
|
||||
placeholder="Укажите размер доли"
|
||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value > 100 ? 100 : event.target.value) }
|
||||
onChange={ (event) => { _removeError("founder_part"); this._handle_onTextFieldChange(event.target.name, event.target.value > 100 ? 100 : event.target.value); } }
|
||||
required={ true }
|
||||
disabled={ checking }
|
||||
/>
|
||||
@ -486,7 +490,13 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
},
|
||||
loading: false,
|
||||
status: "empty",
|
||||
errors: [
|
||||
[], [], [], []
|
||||
],
|
||||
};
|
||||
|
||||
this.ref_form = React.createRef();
|
||||
this.ref_submit = React.createRef();
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
@ -570,14 +580,16 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
}, 10);
|
||||
}
|
||||
|
||||
_checkDisabled = () =>
|
||||
_handle_onNextPage = () =>
|
||||
{
|
||||
const { founder_persons } = this.state;
|
||||
const check_all = [
|
||||
"founder_part",
|
||||
const errors = [
|
||||
[], [], [], []
|
||||
];
|
||||
|
||||
const { founder_persons } = this.state;
|
||||
|
||||
const check = [
|
||||
"founder_part",
|
||||
"lastname",
|
||||
"firstname",
|
||||
"telephone",
|
||||
@ -594,36 +606,40 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
|
||||
for(let f in founder_persons)
|
||||
{
|
||||
for(let i in check_all)
|
||||
for(let i in check)
|
||||
{
|
||||
if(_get(founder_persons[f], check_all[i]) === "")
|
||||
if(_get(founder_persons[f], check[i]) === "")
|
||||
{
|
||||
console.log("1. EMPTY", f, check_all[i]);
|
||||
return true;
|
||||
errors[f].push(check[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!founder_persons[f].founder_from_list)
|
||||
{
|
||||
for(let i in check)
|
||||
{
|
||||
if(_get(founder_persons[f], check[i]) === "")
|
||||
{
|
||||
console.log("2. EMPTY", f, check[i]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(founder_persons[f].signatory_id === null)
|
||||
{
|
||||
console.log("3. EMPTY", f, "signatory_id");
|
||||
console.log("founder_persons[f]");
|
||||
console.log(founder_persons[f]);
|
||||
this.setState({ errors }, () =>
|
||||
{
|
||||
this.ref_submit.current.click();
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
_onRemoveError = (index, name) =>
|
||||
{
|
||||
const errors = [ ...this.state.errors ];
|
||||
if(errors.indexOf(name) > -1)
|
||||
{
|
||||
errors[index].splice(errors[index].indexOf(name), 1);
|
||||
}
|
||||
this.setState({ errors });
|
||||
}
|
||||
|
||||
_checkErrorsList = () =>
|
||||
{
|
||||
const { errors } = this.state;
|
||||
|
||||
for(let i in errors)
|
||||
{
|
||||
if(errors[i].length > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -633,10 +649,10 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
render()
|
||||
{
|
||||
const { signatories, checking } = this.props;
|
||||
const { founder_persons, loading, address, status, } = this.state;
|
||||
const { founder_persons, loading, address, status, errors, } = this.state;
|
||||
|
||||
return (
|
||||
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_4 ${ checking && "disabled" }`}>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_4 ${ checking && "disabled" }`}>
|
||||
<p className="title">4. Сведения об участниках (акционерах) и бенефициарных владельцах</p>
|
||||
<p>– физических лицах, владеющих долей в уставном капитале более 25%
|
||||
<small>*бенефициарный владелец (в соответствии с Федеральным законом от 07.08.2001 No115-ФЗ «О противодействии легализации (отмыванию) доходов, полученных преступным путем, и финансированию терроризма») —
|
||||
@ -644,17 +660,29 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
имеет возможность контролировать действия вышеуказанного лизингополучателя. Бенефициарным владельцем лизингополучателя-физического лица считается это лицо, за исключением случаев, если имеются основания
|
||||
полагать, что бенефициарным владельцем является иное физическое лицо. В случае, если бенефициарным владельцем являются несколько человек, сведения предоставляются в отношении каждого.</small>
|
||||
</p>
|
||||
|
||||
{ this._checkErrorsList() &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, проверьте корректность заполнения данных в форме.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
{ founder_persons.map((shareholder, index) => (
|
||||
<Shareholder
|
||||
key={ index }
|
||||
index={ index }
|
||||
shareholders={ founder_persons }
|
||||
address={ address }
|
||||
errors={ errors[index] }
|
||||
_handle_onTextFieldChange={ this._handle_onTextFieldChange }
|
||||
_handle_onCheckboxFieldChange={ this._handle_onCheckboxFieldChange }
|
||||
_handle_onFieldChange={ this._handle_onFieldChange }
|
||||
_checkStrValue={ this._checkStrValue }
|
||||
_removeError={ (name) => this._onRemoveError(index, name) }
|
||||
removeShareholder={ this._handle_onRemoveShareholder }
|
||||
clearSignatorySelection={ this._handle_onClearSignatorySelection }
|
||||
changeSignatorySelection={ this._handle_onChangeSignatorySelection }
|
||||
@ -671,11 +699,12 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
<div></div>
|
||||
) }
|
||||
<div>
|
||||
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
|
||||
<button type="submit" className="button button-blue" onClick={ this._handle_onNextPage }>
|
||||
{ loading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
|
||||
) : "Продолжить" }
|
||||
</button>
|
||||
<button ref={ this.ref_submit } type="submit" style={{ display: "none" }}/>
|
||||
{ status !== "empty" && (
|
||||
<>
|
||||
<br/><br/>
|
||||
|
||||
@ -22,7 +22,11 @@ class Form_5_Regulatory extends QuestionnaireForm
|
||||
main: {},
|
||||
loading: false,
|
||||
status: "empty",
|
||||
errors: [],
|
||||
};
|
||||
|
||||
this.ref_form = React.createRef();
|
||||
this.ref_submit = React.createRef();
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
@ -58,34 +62,52 @@ class Form_5_Regulatory extends QuestionnaireForm
|
||||
}, 10);
|
||||
}
|
||||
|
||||
_checkDisabled = () =>
|
||||
_handle_onNextPage = (event) =>
|
||||
{
|
||||
console.log("Form_1_Main", "_handle_onNextPage");
|
||||
event.preventDefault();
|
||||
|
||||
const errors = [];
|
||||
|
||||
const { main } = this.state;
|
||||
const check = ["high_level", "board_of_directors", "collective_executive", "individual_executive"];
|
||||
const check = ["high_level", "individual_executive"];
|
||||
|
||||
for(let i in check)
|
||||
{
|
||||
if(this.state.main[check[i]] === "")
|
||||
if(main[check[i]] === "" || main[check[i]] === null || main[check[i]] === undefined)
|
||||
{
|
||||
return true;
|
||||
errors.push(`main.${ check[i] }`);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
this.setState({ errors }, () =>
|
||||
{
|
||||
this.ref_submit.current.click();
|
||||
});
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
const { checking } = this.props;
|
||||
const { main, loading, status } = this.state;
|
||||
const { main, loading, status, errors } = this.state;
|
||||
const { high_level, board_of_directors, collective_executive, individual_executive, other_control, } = main;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_5 ${ checking && "disabled" }`}>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_5 ${ checking && "disabled" }`}>
|
||||
<p className="title">5. Сведения об органах управления</p>
|
||||
<p>Заполняется юридическими лицами, индивидуальными предпринимателями не заполняется</p>
|
||||
|
||||
{ errors.length > 0 &&
|
||||
(
|
||||
<div className="questionnaire message error">
|
||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M40.5425 31.1863L25.7969 8.08116C24.9653 6.77804 23.5459 6 22 6C20.4539 6 19.0345 6.77804 18.2032 8.08116L3.45741 31.1862C2.57234 32.5732 2.51363 34.3313 3.30467 35.7746C4.09572 37.2173 5.60918 38.1137 7.25444 38.1137H36.7456C38.3909 38.1137 39.9044 37.2175 40.6956 35.7742C41.4863 34.3313 41.4276 32.5733 40.5425 31.1863ZM22 34.2245C20.644 34.2245 19.5448 33.1252 19.5448 31.7694C19.5448 30.4133 20.6441 29.3141 22 29.3141C23.356 29.3141 24.4551 30.4133 24.4551 31.7694C24.4551 33.1252 23.3559 34.2245 22 34.2245ZM25.403 17.1635L24.1937 25.3052C24.0157 26.5037 22.8999 27.3309 21.7016 27.1529C20.7334 27.0091 20.0075 26.25 19.8582 25.333L18.5451 17.2074C18.2394 15.3155 19.5251 13.534 21.417 13.2283C23.3089 12.9226 25.0904 14.2083 25.3962 16.1002C25.4536 16.4565 25.4517 16.8243 25.403 17.1635Z" fill="white"/>
|
||||
</svg>
|
||||
<p><b>Ошибка</b>
|
||||
Пожалуйста, проверьте корректность заполнения данных в форме.
|
||||
</p>
|
||||
</div>
|
||||
) }
|
||||
<div className="form_field bg">
|
||||
<label>Наименование органа управления</label>
|
||||
<label>
|
||||
@ -100,6 +122,7 @@ class Form_5_Regulatory extends QuestionnaireForm
|
||||
<small>например, общее собрание акционеров, общее собрание участников, общее собрание членов, общее собрание трудового коллектива, съезд, совет и т.д.</small>
|
||||
</label>
|
||||
<textarea type="text"
|
||||
className={ errors.indexOf("main.high_level") > -1 ? "error" : "" }
|
||||
id={ "main.high_level" }
|
||||
name={ "main.high_level" }
|
||||
value={ this._checkStrValue(high_level) }
|
||||
@ -145,6 +168,7 @@ class Form_5_Regulatory extends QuestionnaireForm
|
||||
<small>например, Генеральный директор, Директор, Президент. Обязательно для заполнения</small>
|
||||
</label>
|
||||
<textarea type="text"
|
||||
className={ errors.indexOf("main.individual_executive") > -1 ? "error" : "" }
|
||||
id={ "main.individual_executive" }
|
||||
name={ "main.individual_executive" }
|
||||
value={ this._checkStrValue(individual_executive) }
|
||||
@ -170,11 +194,12 @@ class Form_5_Regulatory extends QuestionnaireForm
|
||||
<div className="action">
|
||||
<div></div>
|
||||
<div>
|
||||
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
|
||||
<button type="submit" className="button button-blue" onClick={ this._handle_onNextPage }>
|
||||
{ loading ? (
|
||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
|
||||
) : "Продолжить" }
|
||||
</button>
|
||||
<button ref={ this.ref_submit } type="submit" style={{ display: "none" }}/>
|
||||
{ status !== "empty" && (
|
||||
<>
|
||||
<br/><br/>
|
||||
|
||||
@ -32,7 +32,11 @@ class Form_6_NonProfit extends QuestionnaireForm
|
||||
},
|
||||
loading: false,
|
||||
status: "empty",
|
||||
errors: [],
|
||||
};
|
||||
|
||||
this.ref_form = React.createRef();
|
||||
this.ref_submit = React.createRef();
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
@ -130,7 +134,7 @@ class Form_6_NonProfit extends QuestionnaireForm
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_6 ${ checking && "disabled" }`}>
|
||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_6 ${ checking && "disabled" }`}>
|
||||
<p className="title">6. Данные о некомерческой организации</p>
|
||||
|
||||
<p>Источники происхождения денежных средств, из которых будут осуществляться лизинговые платежи:</p>
|
||||
|
||||
@ -31,13 +31,15 @@ class Form_8_Signing extends QuestionnaireForm
|
||||
certificates: [],
|
||||
filename: null,
|
||||
mobile: MatchMedia() === "mobile" ? true : false,
|
||||
company: {},
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState)
|
||||
{
|
||||
return {
|
||||
main: nextProps.main,
|
||||
main: nextProps.main,
|
||||
company: nextProps.company,
|
||||
};
|
||||
}
|
||||
|
||||
@ -92,7 +94,7 @@ class Form_8_Signing extends QuestionnaireForm
|
||||
|
||||
render()
|
||||
{
|
||||
const { filename, sign_digital, mobile } = this.state;
|
||||
const { filename, sign_digital, mobile, company } = this.state;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@ -127,7 +129,7 @@ class Form_8_Signing extends QuestionnaireForm
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<DigitalSignaturesList form={ null }/>
|
||||
<DigitalSignaturesList form={ null } company={ company } onSignDigital={ this._handle_onSignDigital }/>
|
||||
) }
|
||||
</>
|
||||
) }
|
||||
@ -169,6 +171,7 @@ function mapStateToProps(state, ownProps)
|
||||
{
|
||||
return {
|
||||
main: state.questionnaire.main,
|
||||
company: state.company,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import { SpinnerCircular } from 'spinners-react';
|
||||
import debounce from 'debounce-promise';
|
||||
import { set as _set, get as _get } from 'lodash';
|
||||
|
||||
import { updateQuestionnaire, getAddress, getSuggests, resetQuestionnaire } from "../../../actions";
|
||||
import { updateQuestionnaire, getAddress, getSuggests, resetQuestionnaire, questionnaireSetSign } from "../../../actions";
|
||||
|
||||
const suggestsAddressDebounce = (query) =>
|
||||
{
|
||||
@ -62,6 +62,16 @@ export default class QuestionnaireForm extends React.Component
|
||||
})
|
||||
}
|
||||
|
||||
_removeError = (name) =>
|
||||
{
|
||||
const errors = [ ...this.state.errors ];
|
||||
if(errors.indexOf(name) > -1)
|
||||
{
|
||||
errors.splice(errors.indexOf(name), 1);
|
||||
}
|
||||
this.setState({ errors });
|
||||
}
|
||||
|
||||
_handle_onTextFieldChange = (name, value) =>
|
||||
{
|
||||
//console.log("QuestionnaireForm", "_handle_onTextFieldChange", { name, value });
|
||||
@ -159,12 +169,23 @@ export default class QuestionnaireForm extends React.Component
|
||||
_handle_onReset = (event) =>
|
||||
{
|
||||
event.preventDefault();
|
||||
const { dispatch } = this.props;
|
||||
|
||||
const reset = window.confirm("Вы действительно хотите отменить изменения, внесенные в анкету? Состояние анкеты будет сброшено до версии, имеющейся у ООО \"ЛК Эволюция\"");
|
||||
if(reset)
|
||||
{
|
||||
this.props.onNextStep("main");
|
||||
resetQuestionnaire({ dispatch: this.props.dispatch, id: this.props.company.questionnaire_id });
|
||||
resetQuestionnaire({ dispatch, id: this.props.company.questionnaire_id });
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onSignDigital = () =>
|
||||
{
|
||||
const { dispatch } = this.props;
|
||||
questionnaireSetSign({ dispatch, sign: { digital: true, print: false, }});
|
||||
setTimeout(() =>
|
||||
{
|
||||
this.props.onNextStep("status");
|
||||
}, 10);
|
||||
}
|
||||
}
|
||||
@ -43,4 +43,5 @@ export const SUPPORT_APPEAL = 'SUPPORT_APPEAL';
|
||||
export const SUPPORT_RESET = 'SUPPORT_RESET';
|
||||
|
||||
export const QUESTIONNAIRE_UPDATE = 'QUESTIONNAIRE_UPDATE';
|
||||
export const QUESTIONNAIRE_RESET = 'QUESTIONNAIRE_RESET';
|
||||
export const QUESTIONNAIRE_RESET = 'QUESTIONNAIRE_RESET';
|
||||
export const QUESTIONNAIRE_SET_SIGN = 'QUESTIONNAIRE_SET_SIGN';
|
||||
@ -52,12 +52,15 @@ export default async function handler(req, res)
|
||||
upload.single("file")(req, {}, async (err) =>
|
||||
{
|
||||
const { file } = req;
|
||||
const { id } = req.body;
|
||||
const { id, digital } = req.body;
|
||||
const path = `${ process.env.CRM_API_HOST }/lk/Questionnaire/PreQuestionnaire/`;
|
||||
|
||||
const filetype = await fileTypeFromBuffer(file.buffer);
|
||||
console.log("fileTypeFromBuffer", filetype);
|
||||
const local_filename = `${ client_jwt_decoded.acc_number }_signed_questionnaire_${ moment().format("YYYY_MM_DD_HH:mm:ss") }.${ filetype.ext }`;
|
||||
|
||||
const local_filename = digital
|
||||
? `${ client_jwt_decoded.acc_number }_questionnaire_${ moment().format("YYYY_MM_DD_HH:mm:ss") }.sig`
|
||||
: `${ client_jwt_decoded.acc_number }_signed_questionnaire_${ moment().format("YYYY_MM_DD_HH:mm:ss") }.${ filetype.ext }`;
|
||||
|
||||
const key = md5(`questionnaire_${ client_jwt_decoded.acc_number }`);
|
||||
const questionnaire = await RedisClient.get(key);
|
||||
@ -255,7 +258,7 @@ export default async function handler(req, res)
|
||||
console.error("crm_send_error");
|
||||
console.error(crm_send_error);
|
||||
|
||||
res.status(500).send();
|
||||
res.status(500).json({ payload });
|
||||
resolve();
|
||||
});
|
||||
|
||||
|
||||
@ -30,6 +30,14 @@ const questionnaireReducer = (state = initialState.questionnaire, action) =>
|
||||
};
|
||||
}
|
||||
|
||||
case actionTypes.QUESTIONNAIRE_SET_SIGN:
|
||||
{
|
||||
return {
|
||||
...state,
|
||||
sign: { ...state.sign, ...action.data.sign, },
|
||||
};
|
||||
}
|
||||
|
||||
case actionTypes.QUESTIONNAIRE_RESET:
|
||||
{
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user