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 { SpinnerCircular } from 'spinners-react'; import { connect } from "react-redux"; import { withRouter } from 'next/router'; import InputMask from 'react-input-mask'; import CurrencyInput from 'react-currency-input'; import QuestionnaireForm from "../QuestionnaireForm"; import { reduxWrapper } from '../../../../store'; import { saveQuestionnaire } from "../../../../actions"; class Form_1_Main extends QuestionnaireForm { constructor(props) { super(props); this.state = { main: { title: null, inn: null, kpp: null, email: null, telephone: null, websiteurl: null, financial_loan: null, is_individual_executive: false, individual_executive_inn: "", individual_executive_kpp: "", individual_executive_oop: "", individual_executive_docnum: "", individual_executive_docdate: "", high_level: "", board_of_directors: "", collective_executive: "", individual_executive: "", other_control: "", nko: false, accept: false, }, non_profit_template: { fin_source_business: false, fin_source_donate: false, fin_source_fees: false, fin_source_another: false, fin_source_another_description: "", foreign_payers: false, fin_goals_cars: "", fin_goals_trucks: "", fin_goals_special: "", }, step: 1, status: "empty", loading: false, }; } static getDerivedStateFromProps(nextProps, prevState) { return { main: nextProps.questionnaire.main, step: nextProps.questionnaire.step, status: nextProps.questionnaire.status, }; } componentDidMount() { } _checkDisabled = () => { const { main } = this.state; const { company } = this.props; const check = ["title", "inn", "kpp", "email", "telephone", "financial_loan"]; if(company.inn.length > 10) { check.splice(check.indexOf("kpp"), 1); } for(let i in check) { if(main[check[i]] === "") { return true; } } return false; } _handle_onNonProfitChange = () => { const { main, non_profit_template, step } = this.state; this._handle_onFieldChange("non_profit", JSON.parse(JSON.stringify(non_profit_template))); this._handle_onCheckboxFieldChange("main.nko", !main.nko ? true : false); if(step > 6) { this._handle_onFieldChange("step", 6); } } _handle_onFormSubmit = (event) => { event.preventDefault(); this._handle_onJoinChange({ status: "draft", step: 2 }); setTimeout(() => { saveQuestionnaire(); this.props.onNextStep("contacts"); }, 10); } _check_fields_disabled = (values) => { for(let i in values) { if(values[i] === "") { return true; } } return false; } render() { const { company, checking } = this.props; const { loading, main, status } = 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]; return (

1. Информация о лизингополучателе

this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ true } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ true } maxLength={ 12 } />
{ company.inn.length < 11 && (
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ true } />
) }
this._handle_onTextFieldChange(event.target.name, event.target.value) } required={ true } disabled={ checking } >
this._handle_onTextFieldChange(event.target.name, event.target.value) } disabled={ checking } />
this._handle_onTextFieldChange(event.target.name, event.target.value) } disabled={ checking } />

может использоваться для отправки лизингодателем юридически значимых сообщений в соответсвии с условиями договора лизинга, а так же для операций в электронном ПТС/ПСМ

this._handle_onTextFieldChange(event.target.name, event.target.value) } disabled={ checking } />

сумма текущих ежемесячных платежей по действующим кредитам/договорам лизинга

{ company.inn.length < 11 && (
this._handle_onNonProfitChange() } disabled={ main.nko && checking } />
this._handle_onNonProfitChange() } disabled={ !main.nko && 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_1_Main);