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: { address_type: "legal", loading: false, fact_address: { name: null, fias_id: null, }, legal_address: { name: null, fias_id: null, }, postal_address: { name: null, fias_id: null, }, }, step: 1, }; } static getDerivedStateFromProps(nextProps, prevState) { return { contacts: nextProps.questionnaire.contacts, step: nextProps.questionnaire.step, status: nextProps.questionnaire.status, }; } componentDidMount() { const { company } = this.props; const { address_type } = this.state.contacts; if(company.inn.length > 10 && address_type === "legal") { this.setState({ address_type: "fact" }); } } _handle_onFormSubmit = (event) => { event.preventDefault(); this._handle_onJoinChange({ status: "draft", step: 3 }); setTimeout(() => { saveQuestionnaire(); this.props.onNextStep("signer"); }, 10); } _checkDisabled = () => { const { contacts } = this.state; const check = ["fact_address", "legal_address", "postal_address"]; if(contacts.address_type === "fact") { if(contacts.fact_address.name === "") { return true; } } if(contacts.address_type === "postal") { if(contacts.postal_address.name === "") { return true; } } return false; } render() { const { company, checking } = this.props; const { contacts, loading, status, step } = this.state; const { address_type, legal_address, fact_address, postal_address, } = contacts; return (

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

this._handle_onTextFieldChange("contacts.fact_address", data) } required={ address_type === "fact" ? true : false } disabled={ checking ? true : address_type === "fact" ? false : true } />

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

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

{ company.inn.length < 11 && (
this._handle_onCheckboxFieldChange(event.target.name, event.target.value) } disabled={ checking } />
) }
this._handle_onCheckboxFieldChange(event.target.name, event.target.value) } disabled={ checking } />
this._handle_onCheckboxFieldChange(event.target.name, event.target.value) } disabled={ checking } />
{ !checking && (
{ status !== "empty" && ( <>

Отменить изменения в анкете ) }
) }
) } } 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);