import React from "react"; import Head from 'next/head'; import Image from 'next/image'; import Link from "next/link"; import cookie from 'cookie'; import numeral from "numeral"; import pluralize from 'pluralize-ru'; import Select from 'react-select' import { SpinnerCircular } from 'spinners-react'; import { connect } from "react-redux"; import { withRouter } from 'next/router'; import QuestionnaireForm from "../QuestionnaireForm"; import { reduxWrapper } from '../../../../store'; import AddressSuggests from "../../AddressSuggests"; import { saveQuestionnaire } from "../../../../actions"; class Form_2_Contacts extends QuestionnaireForm { constructor(props) { super(props); this.state = { contacts: { evo_mail_delivery_address_type: 100000000, loading: false, fact_address: { name: null, fias_id: null, }, legal_address: { name: null, fias_id: null, }, postal_address: { name: null, fias_id: null, }, }, errors: [], }; this.ref_form = React.createRef(); this.ref_submit = React.createRef(); } static getDerivedStateFromProps(nextProps, prevState) { return { main: nextProps.questionnaire.main, contacts: nextProps.questionnaire.contacts, step: nextProps.questionnaire.step, status: nextProps.questionnaire.status, }; } componentDidMount() { const { company } = this.props; const { evo_mail_delivery_address_type } = this.state.main; if(company.inn.length > 10 && evo_mail_delivery_address_type === 100000000) { this._handle_onCheckboxFieldChange("main.evo_mail_delivery_address_type", 100000001); } } _handle_onFormSubmit = (event) => { event.preventDefault(); this._handle_onJoinChange({ status: "draft", step: 3 }); setTimeout(() => { saveQuestionnaire(); this.props.onNextStep("signer"); }, 10); } _handle_onNextPage = () => { const { main, contacts } = this.state; const errors = []; const check = ["fact_address", "legal_address", "postal_address"]; if(contacts.fact_address.name === "") { errors.push(`contacts.fact_address`); } if(main.evo_mail_delivery_address_type === 100000002) { if(contacts.postal_address.name === "") { errors.push(`contacts.postal_address`); } } this.setState({ errors }, () => { window.scroll(0, 0); this.ref_submit.current.click(); }); } render() { const { company, checking } = this.props; const { main, contacts, loading, status, step, errors } = this.state; const { fact_address, postal_address, } = contacts; const { evo_mail_delivery_address_type } = main; return (
{if (e.key === 'Enter') e.preventDefault() }} className={`questionnaire questionnaire_2 ${ checking && "disabled" }`}>

2. Адреса лизингополучателя

{ errors.length > 0 && (

Ошибка Пожалуйста, проверьте корректность заполнения данных в форме.

) }
-1 ? "error" : "" } value={ this._checkStrValue(fact_address.name) } fias={ this._checkStrValue(fact_address.fias_id) } onChange={ (data) => { this._removeError("contacts.fact_address"); this._handle_onTextFieldChange("contacts.fact_address", data); } } required={ true } disabled={ false } />

для юр.диц - заполняется, если отличается от указанного в ЕГРЮЛ; для ИП - заполняется всегда

Прошу оригиналы счетов-фактур и актов отказанных услуг по заключенному договору лизинга направлять:

{ company.inn.length < 11 && (
{ this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } } disabled={ checking } />
) }
{ this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } } disabled={ checking } />
this._handle_onCheckboxFieldChange(event.target.name, event.target.value) } disabled={ checking } />
{ !checking && (
) }
) } } function mapStateToProps(state, ownProps) { return { questionnaire: state.questionnaire, } } export const getServerSideProps = reduxWrapper.getServerSideProps(store => async ({ req, res, query }) => { } ); export default connect(mapStateToProps)(Form_2_Contacts);