updates for suggests fields
This commit is contained in:
parent
486bbf9686
commit
adcf982285
@ -96,8 +96,8 @@ export const getQuestionnaire = ({ dispatch, id }) =>
|
|||||||
questionnaire.main.email = response.data.email;
|
questionnaire.main.email = response.data.email;
|
||||||
questionnaire.main.websiteurl = response.data.websiteurl !== null ? response.data.websiteurl : "";
|
questionnaire.main.websiteurl = response.data.websiteurl !== null ? response.data.websiteurl : "";
|
||||||
questionnaire.main.financial_loan = response.data.financial_loan !== null ? response.data.financial_loan : "";
|
questionnaire.main.financial_loan = response.data.financial_loan !== null ? response.data.financial_loan : "";
|
||||||
|
questionnaire.main.evo_mail_delivery_address_type = response.data.inn.length > 10 ? 100000001 : 100000000;
|
||||||
|
|
||||||
questionnaire.contacts.address_type = response.data.inn.length > 10 ? "fact" : "legal";
|
|
||||||
questionnaire.contacts.fact_address = response.data.fact_address;
|
questionnaire.contacts.fact_address = response.data.fact_address;
|
||||||
questionnaire.contacts.postal_address = response.data.postal_address;
|
questionnaire.contacts.postal_address = response.data.postal_address;
|
||||||
questionnaire.contacts.legal_address = response.data.legal_address;
|
questionnaire.contacts.legal_address = response.data.legal_address;
|
||||||
@ -124,6 +124,15 @@ export const getQuestionnaire = ({ dispatch, id }) =>
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(let i in response.data.client_contacts)
|
||||||
|
{
|
||||||
|
questionnaire.client_contacts[i] = response.data.client_contacts[i];
|
||||||
|
questionnaire.client_contacts[i].identity_document.citizenship = {
|
||||||
|
title: getCitizenshipTitleByCode(response.data.client_contacts[i].identity_document.citizenship_code),
|
||||||
|
code: response.data.client_contacts[i].identity_document.citizenship_code,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
//questionnaire.founder_persons = { ...questionnaire.head_person, ...response.data.head_person };
|
//questionnaire.founder_persons = { ...questionnaire.head_person, ...response.data.head_person };
|
||||||
|
|
||||||
console.log("questionnairequestionnairequestionnaire FROM JSON", questionnaire);
|
console.log("questionnairequestionnairequestionnaire FROM JSON", questionnaire);
|
||||||
|
|||||||
202
components/questionnaire/DocumentIssuerSuggestsInput.js
Normal file
202
components/questionnaire/DocumentIssuerSuggestsInput.js
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
import React from "react";
|
||||||
|
import Head from 'next/head';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import Link from "next/link";
|
||||||
|
import cookie from 'cookie';
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import numeral from "numeral";
|
||||||
|
import pluralize from 'pluralize-ru';
|
||||||
|
import { SpinnerCircular } from 'spinners-react';
|
||||||
|
import AsyncSelect from 'react-select/async';
|
||||||
|
import debounce from 'debounce-promise';
|
||||||
|
import { set as _set, get as _get } from 'lodash';
|
||||||
|
|
||||||
|
import { getSuggests } from '../../actions';
|
||||||
|
|
||||||
|
const suggestsAddressDebounce = (query) =>
|
||||||
|
{
|
||||||
|
return getSuggests("address", { query });
|
||||||
|
}
|
||||||
|
|
||||||
|
const suggestsFirstnameDebounce = (query) =>
|
||||||
|
{
|
||||||
|
return getSuggests("name", { query, parts: ["NAME"] });
|
||||||
|
}
|
||||||
|
|
||||||
|
const suggestsMiddlenameDebounce = (query) =>
|
||||||
|
{
|
||||||
|
return getSuggests("name", { query, parts: ["PATRONYMIC"] });
|
||||||
|
}
|
||||||
|
|
||||||
|
const suggestsLastnameDebounce = (query) =>
|
||||||
|
{
|
||||||
|
return getSuggests("name", { query, parts: ["SURNAME"] });
|
||||||
|
}
|
||||||
|
|
||||||
|
const suggestsIssuerDebounce = (query, max) =>
|
||||||
|
{
|
||||||
|
return getSuggests("document/issuer", { query, max });
|
||||||
|
}
|
||||||
|
|
||||||
|
const suggestsAddress = debounce(suggestsAddressDebounce, 200);
|
||||||
|
const suggestsFirstname = debounce(suggestsFirstnameDebounce, 200);
|
||||||
|
const suggestsMiddlename = debounce(suggestsMiddlenameDebounce, 200);
|
||||||
|
const suggestsLastname = debounce(suggestsLastnameDebounce, 200);
|
||||||
|
const suggestsIssuer = debounce(suggestsIssuerDebounce, 200);
|
||||||
|
|
||||||
|
export default class DocumentIssuerSuggestsInput extends React.Component
|
||||||
|
{
|
||||||
|
constructor(props)
|
||||||
|
{
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
focused: false,
|
||||||
|
options: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(prevProps, prevState)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_handle_onChange = (value) =>
|
||||||
|
{
|
||||||
|
console.log("DocumentIssuerSuggestsInput", "_handle_onChange", { value });
|
||||||
|
const { focused } = this.state;
|
||||||
|
const { onChange } = this.props;
|
||||||
|
|
||||||
|
onChange(value);
|
||||||
|
if(focused)
|
||||||
|
{
|
||||||
|
this._getValue(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_handle_onSelect = (option) =>
|
||||||
|
{
|
||||||
|
console.log("DocumentIssuerSuggestsInput", "_handle_onSelect", { option });
|
||||||
|
const { onChange } = this.props;
|
||||||
|
|
||||||
|
this.setState({ focused: false }, () =>
|
||||||
|
{
|
||||||
|
onChange(option);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_handle_onFocus = () =>
|
||||||
|
{
|
||||||
|
this.setState({ focused: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
_handle_onBlur = () =>
|
||||||
|
{
|
||||||
|
setTimeout(() =>
|
||||||
|
{
|
||||||
|
this.setState({ focused: false });
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
_getSuggests = (text) =>
|
||||||
|
{
|
||||||
|
const { type, maxResults } = this.props;
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) =>
|
||||||
|
{
|
||||||
|
if(type === "lastname")
|
||||||
|
{
|
||||||
|
suggestsLastname(text).then((result) => { resolve(result); }).catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type === "firstname")
|
||||||
|
{
|
||||||
|
suggestsFirstname(text).then((result) => { resolve(result); }).catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type === "middlename")
|
||||||
|
{
|
||||||
|
suggestsMiddlename(text).then((result) => { resolve(result); }).catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(type === "issuer")
|
||||||
|
{
|
||||||
|
suggestsIssuer(text, maxResults).then((result) => { resolve(result); }).catch(() => {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_getValue = (text) =>
|
||||||
|
{
|
||||||
|
return new Promise((resolve, reject) =>
|
||||||
|
{
|
||||||
|
if(text === "")
|
||||||
|
{
|
||||||
|
this.setState({ options: [], value: "" }, () =>
|
||||||
|
{
|
||||||
|
resolve([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._getSuggests(text)
|
||||||
|
.then((result) =>
|
||||||
|
{
|
||||||
|
const options = [];
|
||||||
|
|
||||||
|
for(let i in result.suggestions)
|
||||||
|
{
|
||||||
|
const s = result.suggestions[i];
|
||||||
|
options.push({ ...s, value: s.value, label: s.value });
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ options }, () =>
|
||||||
|
{
|
||||||
|
resolve(options);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
render()
|
||||||
|
{
|
||||||
|
const { focused, options } = this.state;
|
||||||
|
const { value, disabled, required, placeholder, name, className, innerStyle } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="autocomlete" style={{ ...{ position: "relative" }, ...innerStyle, }}>
|
||||||
|
<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 }` }
|
||||||
|
id={ name }
|
||||||
|
name={ name }
|
||||||
|
value={ value }
|
||||||
|
placeholder={ placeholder !== undefined ? placeholder : "Заполните поле" }
|
||||||
|
onChange={ (event) => this._handle_onChange(event.target.value) }
|
||||||
|
onFocus={ this._handle_onFocus }
|
||||||
|
onBlur={ this._handle_onBlur }
|
||||||
|
required={ required }
|
||||||
|
disabled={ disabled }
|
||||||
|
/>
|
||||||
|
{ focused && options.length > 0 && (
|
||||||
|
<div className="react-select__menu" style={{ position: "absolute", zIndex: 1, background: "#fff", width: "100%", left: "0px", top: "40px" }}>
|
||||||
|
<div className="react-select__menu-list">
|
||||||
|
{ options.map((option, index) =>
|
||||||
|
(
|
||||||
|
<div className="react-select__option" aria-disabled="false" tab-index="-1" key={ index } onClick={ () => this._handle_onSelect(option) }>{ option.value }</div>
|
||||||
|
)) }
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
) }
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -33,10 +33,16 @@ const suggestsLastnameDebounce = (query) =>
|
|||||||
return getSuggests("name", { query, parts: ["SURNAME"] });
|
return getSuggests("name", { query, parts: ["SURNAME"] });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const suggestsIssuerDebounce = (query) =>
|
||||||
|
{
|
||||||
|
return getSuggests("document/issuer", { query });
|
||||||
|
}
|
||||||
|
|
||||||
const suggestsAddress = debounce(suggestsAddressDebounce, 200);
|
const suggestsAddress = debounce(suggestsAddressDebounce, 200);
|
||||||
const suggestsFirstname = debounce(suggestsFirstnameDebounce, 200);
|
const suggestsFirstname = debounce(suggestsFirstnameDebounce, 200);
|
||||||
const suggestsMiddlename = debounce(suggestsMiddlenameDebounce, 200);
|
const suggestsMiddlename = debounce(suggestsMiddlenameDebounce, 200);
|
||||||
const suggestsLastname = debounce(suggestsLastnameDebounce, 200);
|
const suggestsLastname = debounce(suggestsLastnameDebounce, 200);
|
||||||
|
const suggestsIssuer = debounce(suggestsIssuerDebounce, 200);
|
||||||
|
|
||||||
export default class SuggestsInput extends React.Component
|
export default class SuggestsInput extends React.Component
|
||||||
{
|
{
|
||||||
@ -112,6 +118,11 @@ export default class SuggestsInput extends React.Component
|
|||||||
{
|
{
|
||||||
suggestsMiddlename(text).then((result) => { resolve(result); }).catch(() => {});
|
suggestsMiddlename(text).then((result) => { resolve(result); }).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(type === "issuer")
|
||||||
|
{
|
||||||
|
suggestsIssuer(text).then((result) => { resolve(result); }).catch(() => {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +185,7 @@ export default class SuggestsInput extends React.Component
|
|||||||
disabled={ disabled }
|
disabled={ disabled }
|
||||||
/>
|
/>
|
||||||
{ focused && options.length > 0 && (
|
{ focused && options.length > 0 && (
|
||||||
<div className="react-select__menu" style={{ position: "absolute", zIndex: 1, background: "#fff", width: "100%", left: "0px", top: "40px" }}>
|
<div className="react-select__menu" style={{ position: "absolute", zIndex: 100, background: "#fff", width: "100%", left: "0px", top: "40px" }}>
|
||||||
<div className="react-select__menu-list">
|
<div className="react-select__menu-list">
|
||||||
{ options.map((option, index) =>
|
{ options.map((option, index) =>
|
||||||
(
|
(
|
||||||
|
|||||||
@ -170,8 +170,7 @@ export default class DigitalSignaturesList extends React.Component
|
|||||||
<div className="feed_item user">
|
<div className="feed_item user">
|
||||||
<img src="/assets/images/icons/avatar.svg" alt="" />
|
<img src="/assets/images/icons/avatar.svg" alt="" />
|
||||||
<div>
|
<div>
|
||||||
|
<p className="item_title">{ certificate?.info?.subjectName.replace(/\""/g, '@').replace(/"/g, '').replace(/@/g, '"') }</p>
|
||||||
<p className="item_title">{ certificate?.info?.subjectName }</p>
|
|
||||||
<p className="item_desc">
|
<p className="item_desc">
|
||||||
{ certificate.info.subjectFields['SN'] || certificate.info.subjectFields['SN'] ? (<span>{ certificate.info.subjectFields['SN'] } { certificate.info.subjectFields['G'] }</span>) : null }
|
{ certificate.info.subjectFields['SN'] || certificate.info.subjectFields['SN'] ? (<span>{ certificate.info.subjectFields['SN'] } { certificate.info.subjectFields['G'] }</span>) : null }
|
||||||
<span>Подпись действительна до { certificate?.info?.validToDate }</span>
|
<span>Подпись действительна до { certificate?.info?.validToDate }</span>
|
||||||
|
|||||||
@ -94,7 +94,7 @@ export default class FilesList extends React.Component
|
|||||||
}
|
}
|
||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { files, checking, title, } = this.props;
|
const { files, checking, title, maxFiles = 5, } = this.props;
|
||||||
const { loading } = this.state;
|
const { loading } = this.state;
|
||||||
|
|
||||||
console.log("FilesList", "files", files);
|
console.log("FilesList", "files", files);
|
||||||
@ -128,7 +128,7 @@ export default class FilesList extends React.Component
|
|||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
|
|
||||||
{ !checking && (
|
{ files.length < (loading ? maxFiles - 1 : maxFiles) && !checking && (
|
||||||
<Dropzone onDrop={ (acceptedFiles) => this._handle_onAddFile(acceptedFiles) }>
|
<Dropzone onDrop={ (acceptedFiles) => this._handle_onAddFile(acceptedFiles) }>
|
||||||
{ ({getRootProps, getInputProps}) => (
|
{ ({getRootProps, getInputProps}) => (
|
||||||
<div className="file_upload dropzone" { ...getRootProps() } style={{ width: "32%", height: "100px", marginBottom: "25px", marginTop: "0px", cursor: "pointer", }}>
|
<div className="file_upload dropzone" { ...getRootProps() } style={{ width: "32%", height: "100px", marginBottom: "25px", marginTop: "0px", cursor: "pointer", }}>
|
||||||
|
|||||||
@ -79,7 +79,6 @@ class Form_1_Main extends QuestionnaireForm
|
|||||||
|
|
||||||
_handle_onNextPage = (event) =>
|
_handle_onNextPage = (event) =>
|
||||||
{
|
{
|
||||||
console.log("Form_1_Main", "_handle_onNextPage");
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const errors = [];
|
const errors = [];
|
||||||
@ -102,6 +101,7 @@ class Form_1_Main extends QuestionnaireForm
|
|||||||
|
|
||||||
this.setState({ errors }, () =>
|
this.setState({ errors }, () =>
|
||||||
{
|
{
|
||||||
|
window.scroll(0, 0);
|
||||||
this.ref_submit.current.click();
|
this.ref_submit.current.click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -153,8 +153,6 @@ class Form_1_Main extends QuestionnaireForm
|
|||||||
const digit = /[0-9]/;
|
const digit = /[0-9]/;
|
||||||
const fin_mask = [firstLetter, digit, letter, " ", digit, letter, digit];
|
const fin_mask = [firstLetter, digit, letter, " ", digit, letter, digit];
|
||||||
|
|
||||||
console.log({ errors });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} 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" }`}>
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
contacts: {
|
contacts: {
|
||||||
address_type: "legal",
|
evo_mail_delivery_address_type: 100000000,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
fact_address: {
|
fact_address: {
|
||||||
@ -48,6 +48,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
static getDerivedStateFromProps(nextProps, prevState)
|
static getDerivedStateFromProps(nextProps, prevState)
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
|
main: nextProps.questionnaire.main,
|
||||||
contacts: nextProps.questionnaire.contacts,
|
contacts: nextProps.questionnaire.contacts,
|
||||||
step: nextProps.questionnaire.step,
|
step: nextProps.questionnaire.step,
|
||||||
status: nextProps.questionnaire.status,
|
status: nextProps.questionnaire.status,
|
||||||
@ -57,11 +58,11 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
componentDidMount()
|
componentDidMount()
|
||||||
{
|
{
|
||||||
const { company } = this.props;
|
const { company } = this.props;
|
||||||
const { address_type } = this.state.contacts;
|
const { evo_mail_delivery_address_type } = this.state.main;
|
||||||
|
|
||||||
if(company.inn.length > 10 && address_type === "legal")
|
if(company.inn.length > 10 && evo_mail_delivery_address_type === 100000000)
|
||||||
{
|
{
|
||||||
this.setState({ address_type: "fact" });
|
this._handle_onCheckboxFieldChange("main.evo_mail_delivery_address_type", 100000001);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +80,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
|
|
||||||
_handle_onNextPage = () =>
|
_handle_onNextPage = () =>
|
||||||
{
|
{
|
||||||
const { contacts } = this.state;
|
const { main, contacts } = this.state;
|
||||||
|
|
||||||
const errors = [];
|
const errors = [];
|
||||||
const check = ["fact_address", "legal_address", "postal_address"];
|
const check = ["fact_address", "legal_address", "postal_address"];
|
||||||
@ -89,7 +90,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
errors.push(`contacts.fact_address`);
|
errors.push(`contacts.fact_address`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(contacts.address_type === "postal")
|
if(main.evo_mail_delivery_address_type === 100000002)
|
||||||
{
|
{
|
||||||
if(contacts.postal_address.name === "")
|
if(contacts.postal_address.name === "")
|
||||||
{
|
{
|
||||||
@ -99,6 +100,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
|
|
||||||
this.setState({ errors }, () =>
|
this.setState({ errors }, () =>
|
||||||
{
|
{
|
||||||
|
window.scroll(0, 0);
|
||||||
this.ref_submit.current.click();
|
this.ref_submit.current.click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -106,10 +108,9 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { company, checking } = this.props;
|
const { company, checking } = this.props;
|
||||||
const { contacts, loading, status, step, errors } = this.state;
|
const { main, contacts, loading, status, step, errors } = this.state;
|
||||||
const { address_type, legal_address, fact_address, postal_address, } = contacts;
|
const { fact_address, postal_address, } = contacts;
|
||||||
|
const { evo_mail_delivery_address_type } = main;
|
||||||
console.log("errors", errors);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
@ -148,10 +149,10 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
{ company.inn.length < 11 && (
|
{ company.inn.length < 11 && (
|
||||||
<div className="form_field checkbox">
|
<div className="form_field checkbox">
|
||||||
<input type="radio" hidden=""
|
<input type="radio" hidden=""
|
||||||
value="legal"
|
value={ 100000000 }
|
||||||
id="contacts.address_type_legal"
|
id="contacts.address_type_legal"
|
||||||
name="contacts.address_type"
|
name="main.evo_mail_delivery_address_type"
|
||||||
checked={ address_type === "legal" ? true : false }
|
checked={ parseInt(evo_mail_delivery_address_type, 10) === 100000000 ? true : false }
|
||||||
onChange={ (event) => { this._removeError("contacts.postal_address"); 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 }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
@ -161,10 +162,10 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
|
|
||||||
<div className="form_field checkbox">
|
<div className="form_field checkbox">
|
||||||
<input type="radio" hidden=""
|
<input type="radio" hidden=""
|
||||||
value="fact"
|
value={ 100000001 }
|
||||||
id="contacts.address_type_fact"
|
id="contacts.address_type_fact"
|
||||||
name="contacts.address_type"
|
name="main.evo_mail_delivery_address_type"
|
||||||
checked={ address_type === "fact" ? true : false }
|
checked={ parseInt(evo_mail_delivery_address_type, 10) === 100000001 ? true : false }
|
||||||
onChange={ (event) => { this._removeError("contacts.postal_address"); 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 }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
@ -173,22 +174,22 @@ class Form_2_Contacts extends QuestionnaireForm
|
|||||||
|
|
||||||
<div className="form_field checkbox">
|
<div className="form_field checkbox">
|
||||||
<input type="radio" hidden=""
|
<input type="radio" hidden=""
|
||||||
value="postal"
|
value={ 100000002 }
|
||||||
id="contacts.address_type_postal"
|
id="contacts.address_type_postal"
|
||||||
name="contacts.address_type"
|
name="main.evo_mail_delivery_address_type"
|
||||||
checked={ address_type === "postal" ? true : false }
|
checked={ parseInt(evo_mail_delivery_address_type, 10) === 100000002 ? true : false }
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
<label htmlFor="contacts.address_type_postal" className="unselectable" style={{ width: "100%" }}>
|
<label htmlFor="contacts.address_type_postal" className="unselectable" style={{ width: "100%" }}>
|
||||||
<span>По следующему адресу { address_type === "postal" && <sup className="required_label">*</sup> }</span>
|
<span>По следующему адресу { parseInt(evo_mail_delivery_address_type, 10) === 100000002 && <sup className="required_label">*</sup> }</span>
|
||||||
<AddressSuggests
|
<AddressSuggests
|
||||||
className={ errors.indexOf("contacts.postal_address") > -1 ? "error" : "" }
|
className={ errors.indexOf("contacts.postal_address") > -1 ? "error" : "" }
|
||||||
value={ this._checkStrValue(postal_address.name) }
|
value={ this._checkStrValue(postal_address.name) }
|
||||||
fias={ this._checkStrValue(postal_address.fias_id) }
|
fias={ this._checkStrValue(postal_address.fias_id) }
|
||||||
onChange={ (data) => { this._removeError("contacts.postal_address"); this._handle_onTextFieldChange("contacts.postal_address", data); } }
|
onChange={ (data) => { this._removeError("contacts.postal_address"); this._handle_onTextFieldChange("contacts.postal_address", data); } }
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ !checking && address_type === "postal" ? false : true }
|
disabled={ !checking && parseInt(evo_mail_delivery_address_type, 10) === 100000002 ? false : true }
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import { SpinnerCircular } from 'spinners-react';
|
|||||||
import Select from 'react-select';
|
import Select from 'react-select';
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { withRouter } from 'next/router';
|
import { withRouter } from 'next/router';
|
||||||
|
import debounce from 'debounce-promise';
|
||||||
import { get as _get } from 'lodash';
|
import { get as _get } from 'lodash';
|
||||||
|
|
||||||
import QuestionnaireForm from "../QuestionnaireForm";
|
import QuestionnaireForm from "../QuestionnaireForm";
|
||||||
@ -25,7 +26,15 @@ import AddressSuggests from "../../AddressSuggests";
|
|||||||
import InputMask from 'react-input-mask';
|
import InputMask from 'react-input-mask';
|
||||||
import SuggestsInput from "../../SuggestsInput";
|
import SuggestsInput from "../../SuggestsInput";
|
||||||
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
|
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
|
||||||
import { removeAttachmentFiles, saveQuestionnaire } from "../../../../actions";
|
import { removeAttachmentFiles, saveQuestionnaire, getSuggests } from "../../../../actions";
|
||||||
|
import DocumentIssuerSuggestsInput from "../../DocumentIssuerSuggestsInput";
|
||||||
|
|
||||||
|
const suggestsInnDebounce = (query) =>
|
||||||
|
{
|
||||||
|
return getSuggests("inn", { query });
|
||||||
|
}
|
||||||
|
|
||||||
|
const suggestsInn = debounce(suggestsInnDebounce, 200);
|
||||||
|
|
||||||
class Form_3_Signer extends QuestionnaireForm
|
class Form_3_Signer extends QuestionnaireForm
|
||||||
{
|
{
|
||||||
@ -155,7 +164,6 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
|
|
||||||
_handle_onCitizenshipChange = (name, value) =>
|
_handle_onCitizenshipChange = (name, value) =>
|
||||||
{
|
{
|
||||||
console.log("_handle_onCitizenshipChange", value);
|
|
||||||
let citizenship = getCitizenshipTitleByCode(value);
|
let citizenship = getCitizenshipTitleByCode(value);
|
||||||
|
|
||||||
this._handle_onFieldChange(name, {
|
this._handle_onFieldChange(name, {
|
||||||
@ -164,6 +172,40 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handle_onIssuerCodeChange = (branch, option) =>
|
||||||
|
{
|
||||||
|
this._removeError(`${ branch }.identity_document.code`);
|
||||||
|
|
||||||
|
if(typeof option === "string")
|
||||||
|
{
|
||||||
|
this._handle_onTextFieldChange(`${ branch }.identity_document.code`, option);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._handle_onBranchChange([
|
||||||
|
{ name: `${ branch }.identity_document.code`, value: option.data.code },
|
||||||
|
{ name: `${ branch }.identity_document.issueby`, value: option.value },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_handle_onIssuerChange = (branch, option) =>
|
||||||
|
{
|
||||||
|
this._removeError(`${ branch }.identity_document.issueby`);
|
||||||
|
|
||||||
|
if(typeof option === "string")
|
||||||
|
{
|
||||||
|
this._handle_onTextFieldChange(`${ branch }.identity_document.issueby`, option);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._handle_onBranchChange([
|
||||||
|
{ name: `${ branch }.identity_document.code`, value: option.data.code },
|
||||||
|
{ name: `${ branch }.identity_document.issueby`, value: option.value },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_handle_onIndefiniteChange = () =>
|
_handle_onIndefiniteChange = () =>
|
||||||
{
|
{
|
||||||
const { head_person } = this.state;
|
const { head_person } = this.state;
|
||||||
@ -203,9 +245,39 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handle_onInnChange = (inn) =>
|
||||||
|
{
|
||||||
|
this._handle_onTextFieldChange("main.individual_executive_inn", inn);
|
||||||
|
|
||||||
|
suggestsInn(inn.replace(/[^\d]+/g, ''))
|
||||||
|
.then((result) =>
|
||||||
|
{
|
||||||
|
if(result?.suggestions.length > 0)
|
||||||
|
{
|
||||||
|
if(inn.replace(/[^\d]+/g, '').length > 10)
|
||||||
|
{
|
||||||
|
this._handle_onTextFieldChange("main.individual_executive_oop", result?.suggestions[0]?.data?.name?.full_with_opf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._handle_onBranchChange([ {
|
||||||
|
name: "main.individual_executive_oop",
|
||||||
|
value: result?.suggestions[0]?.data?.name?.full_with_opf,
|
||||||
|
}, {
|
||||||
|
name: "main.individual_executive_kpp",
|
||||||
|
value: result?.suggestions[0]?.data?.kpp,
|
||||||
|
}]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_handle_onNextPage = (event) =>
|
_handle_onNextPage = (event) =>
|
||||||
{
|
{
|
||||||
console.log("Form_3_Signer", "_handle_onNextPage");
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const errors = [];
|
const errors = [];
|
||||||
@ -222,14 +294,18 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
"identity_document.seria",
|
"identity_document.seria",
|
||||||
"identity_document.docnumber",
|
"identity_document.docnumber",
|
||||||
"identity_document.issuedate",
|
"identity_document.issuedate",
|
||||||
"identity_document.code",
|
|
||||||
"identity_document.issueby",
|
|
||||||
"identity_document.placebirth",
|
"identity_document.placebirth",
|
||||||
"identity_document.citizenship_code",
|
"identity_document.citizenship_code",
|
||||||
"identity_document.registration_address.title",
|
"identity_document.registration_address.title",
|
||||||
"evo_assignment_date",
|
"evo_assignment_date",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(parseInt(_get(head_person, "identity_document.doctype"), 10) === 100000000)
|
||||||
|
{
|
||||||
|
head_person_check.push("identity_document.code");
|
||||||
|
head_person_check.push("identity_document.issueby");
|
||||||
|
}
|
||||||
|
|
||||||
for(let i in head_person_check)
|
for(let i in head_person_check)
|
||||||
{
|
{
|
||||||
let v = _get(head_person, head_person_check[i]);
|
let v = _get(head_person, head_person_check[i]);
|
||||||
@ -240,8 +316,6 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log({ errors });
|
|
||||||
|
|
||||||
if(!head_person.evo_indefinite)
|
if(!head_person.evo_indefinite)
|
||||||
{
|
{
|
||||||
if(head_person.evo_credentials_dateend === "")
|
if(head_person.evo_credentials_dateend === "")
|
||||||
@ -285,13 +359,17 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
"identity_document.seria",
|
"identity_document.seria",
|
||||||
"identity_document.docnumber",
|
"identity_document.docnumber",
|
||||||
"identity_document.issuedate",
|
"identity_document.issuedate",
|
||||||
"identity_document.code",
|
|
||||||
"identity_document.issueby",
|
|
||||||
"identity_document.placebirth",
|
"identity_document.placebirth",
|
||||||
"identity_document.citizenship.code",
|
"identity_document.citizenship.code",
|
||||||
"identity_document.registration_address.title",
|
"identity_document.registration_address.title",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(parseInt(_get(signatory_person, "identity_document.doctype"), 10) === 100000000)
|
||||||
|
{
|
||||||
|
signatory_person_check.push("identity_document.code");
|
||||||
|
signatory_person_check.push("identity_document.issueby");
|
||||||
|
}
|
||||||
|
|
||||||
if(signatory_person.signer_rule_basis === 100000003)
|
if(signatory_person.signer_rule_basis === 100000003)
|
||||||
{
|
{
|
||||||
signatory_person_check.push("signer_rule_basis_add");
|
signatory_person_check.push("signer_rule_basis_add");
|
||||||
@ -321,6 +399,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
|
|
||||||
this.setState({ errors }, () =>
|
this.setState({ errors }, () =>
|
||||||
{
|
{
|
||||||
|
window.scroll(0, 0);
|
||||||
this.ref_submit.current.click();
|
this.ref_submit.current.click();
|
||||||
});
|
});
|
||||||
//this.ref_form.current.submit();
|
//this.ref_form.current.submit();
|
||||||
@ -340,7 +419,6 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
_handle_onFormSubmit = (event) =>
|
_handle_onFormSubmit = (event) =>
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log("Form_3_Signer", "_handle_onFormSubmit");
|
|
||||||
|
|
||||||
this._handle_onCheckboxFieldChange("step", 4);
|
this._handle_onCheckboxFieldChange("step", 4);
|
||||||
setTimeout(() =>
|
setTimeout(() =>
|
||||||
@ -360,9 +438,6 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
delegation_files,
|
delegation_files,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
|
|
||||||
console.log("delegation_files", delegation_files);
|
|
||||||
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 };
|
let head_person_citizenship = { label: getCitizenshipTitleByCode(head_person.identity_document.citizenship.code), code: head_person.identity_document.citizenship.code };
|
||||||
let signatory_person_citizenship = { label: getCitizenshipTitleByCode(signatory_person.identity_document.citizenship.code), code: signatory_person.identity_document.citizenship.code };
|
let signatory_person_citizenship = { label: getCitizenshipTitleByCode(signatory_person.identity_document.citizenship.code), code: signatory_person.identity_document.citizenship.code };
|
||||||
|
|
||||||
@ -510,45 +585,78 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
placeholder="ДД.ММ.ГГГГ"
|
placeholder="ДД.ММ.ГГГГ"
|
||||||
id={ "head_person.identity_document.issuedate" }
|
id={ "head_person.identity_document.issuedate" }
|
||||||
value={ this._checkStrValue(head_person.identity_document.issuedate) !== "" ? this._checkStrValue(head_person.identity_document.issuedate) : null }
|
value={ this._checkStrValue(head_person.identity_document.issuedate) !== "" ? this._checkStrValue(head_person.identity_document.issuedate) : null }
|
||||||
onChange={ (date) => { this._removeError("head_person.identity_document.issuedate"); this._handle_onTextFieldChange("head_person.identity_document.issuedate", date) } }
|
onChange={ (date) => { this._removeError("head_person.identity_document.issuedate"); this._handle_onTextFieldChange("head_person.identity_document.issuedate", date); } }
|
||||||
required={ true }
|
|
||||||
disabled={ checking }
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="form_field">
|
|
||||||
<label>Код подразделения <sup className="required_label">*</sup></label>
|
|
||||||
<InputMask
|
|
||||||
mask='999-999'
|
|
||||||
id="head_person.identity_document.code"
|
|
||||||
name="head_person.identity_document.code"
|
|
||||||
value={ this._checkStrValue(head_person.identity_document.code) }
|
|
||||||
placeholder="Введите код"
|
|
||||||
onChange={ (event) => { this._removeError("head_person.identity_document.code"); this._handle_onTextFieldChange(event.target.name, event.target.value) } }
|
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{ parseInt(head_person.identity_document.doctype, 10) === 100000000 && (
|
||||||
|
<div className="form_field">
|
||||||
|
<label>Код подразделения <sup className="required_label">*</sup></label>
|
||||||
|
<DocumentIssuerSuggestsInput
|
||||||
|
className={ errors.indexOf("head_person.identity_document.code") > -1 ? "error" : "" }
|
||||||
|
type="issuer"
|
||||||
|
id="head_person.identity_document.code"
|
||||||
|
name="head_person.identity_document.code"
|
||||||
|
value={ this._checkStrValue(head_person.identity_document.code) }
|
||||||
|
placeholder="Введите код"
|
||||||
|
onChange={ (value) => { this._handle_onIssuerCodeChange("head_person", value); } }
|
||||||
|
maxResults={ 5 }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/*}
|
||||||
|
<InputMask
|
||||||
|
mask='999-999'
|
||||||
|
id="head_person.identity_document.code"
|
||||||
|
name="head_person.identity_document.code"
|
||||||
|
value={ this._checkStrValue(head_person.identity_document.code) }
|
||||||
|
placeholder="Введите код"
|
||||||
|
onChange={ (event) => { this._removeError("head_person.identity_document.code"); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{*/}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
) }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="form_field">
|
{ parseInt(head_person.identity_document.doctype, 10) === 100000000 && (
|
||||||
<label>Кем выдан <sup className="required_label">*</sup></label>
|
<div className="form_field">
|
||||||
<input type="text"
|
<label>Кем выдан <sup className="required_label">*</sup></label>
|
||||||
id="head_person.identity_document.issueby"
|
<DocumentIssuerSuggestsInput
|
||||||
name="head_person.identity_document.issueby"
|
className={ errors.indexOf("head_person.identity_document.issueby") > -1 ? "error" : "" }
|
||||||
value={ this._checkStrValue(head_person.identity_document.issueby) }
|
type="issuer"
|
||||||
placeholder="Введите наименование подразделения выдавшего документ"
|
id="head_person.identity_document.issueby"
|
||||||
onChange={ (event) => { this._removeError("head_person.identity_document.issueby"); this._handle_onTextFieldChange(event.target.name, event.target.value) } }
|
name="head_person.identity_document.issueby"
|
||||||
required={ true }
|
value={ this._checkStrValue(head_person.identity_document.issueby) }
|
||||||
disabled={ checking }
|
placeholder="Введите наименование подразделения выдавшего документ"
|
||||||
/>
|
onChange={ (value) => { this._handle_onIssuerChange("head_person", value); } }
|
||||||
</div>
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{/*}
|
||||||
|
<input type="text"
|
||||||
|
id="head_person.identity_document.issueby"
|
||||||
|
name="head_person.identity_document.issueby"
|
||||||
|
value={ this._checkStrValue(head_person.identity_document.issueby) }
|
||||||
|
placeholder="Введите наименование подразделения выдавшего документ"
|
||||||
|
onChange={ (event) => { this._removeError("head_person.identity_document.issueby"); this._handle_onTextFieldChange(event.target.name, event.target.value) } }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{*/}
|
||||||
|
</div>
|
||||||
|
) }
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
<label>Место рождения <sup className="required_label">*</sup></label>
|
<label>Место рождения <sup className="required_label">*</sup></label>
|
||||||
<AddressSuggests
|
<AddressSuggests
|
||||||
id={ "head_person.identity_document.placebirth" }
|
id={ "head_person.identity_document.placebirth" }
|
||||||
value={ this._checkStrValue(head_person.identity_document.placebirth) }
|
value={ this._checkStrValue(head_person.identity_document.placebirth) }
|
||||||
placeholder="Укажите место рождения"
|
placeholder="Укажите место рождения"
|
||||||
onChange={ (data) => { this._removeError("head_person.identity_document.issueby"); this._handle_onTextFieldChange("head_person.identity_document.placebirth", data.title) } }
|
onChange={ (data) => { this._removeError("head_person.identity_document.placebirth"); this._handle_onTextFieldChange("head_person.identity_document.placebirth", data.name) } }
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
@ -661,7 +769,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
placeholder="ДД.ММ.ГГГГ"
|
placeholder="ДД.ММ.ГГГГ"
|
||||||
id={ "head_person.evo_credentials_dateend" }
|
id={ "head_person.evo_credentials_dateend" }
|
||||||
value={ this._checkStrValue(head_person.evo_credentials_dateend) !== "" ? this._checkStrValue(head_person.evo_credentials_dateend) : null }
|
value={ this._checkStrValue(head_person.evo_credentials_dateend) !== "" ? this._checkStrValue(head_person.evo_credentials_dateend) : null }
|
||||||
onChange={ (date) => { console.log("date", date); this._handle_onTextFieldChange("head_person.evo_credentials_dateend", date) } }
|
onChange={ (date) => { this._handle_onTextFieldChange("head_person.evo_credentials_dateend", date) } }
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
style={{maxWidth: "320px"}}
|
style={{maxWidth: "320px"}}
|
||||||
@ -682,6 +790,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
<FilesList
|
<FilesList
|
||||||
|
maxFiles={ 2 }
|
||||||
name="head_person_files"
|
name="head_person_files"
|
||||||
files={ head_person_files }
|
files={ head_person_files }
|
||||||
onAddFile={ (name, files) => { this._removeError("head_person_files"); this._handle_onAddFile(name, files); } }
|
onAddFile={ (name, files) => { this._removeError("head_person_files"); this._handle_onAddFile(name, files); } }
|
||||||
@ -689,7 +798,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
checking={ checking }
|
checking={ checking }
|
||||||
title="Прикрепить скан паспорта единоличного исполнительного органа"
|
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" }}/>
|
<input type="text" id="head_person_files_error_check" onChange={ () => {} } 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 &&
|
{ main.inn !== null && main.inn.length < 11 &&
|
||||||
(
|
(
|
||||||
@ -725,7 +834,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
name="main.individual_executive_inn"
|
name="main.individual_executive_inn"
|
||||||
value={ this._checkStrValue(main.individual_executive_inn) }
|
value={ this._checkStrValue(main.individual_executive_inn) }
|
||||||
placeholder="Введите ИНН"
|
placeholder="Введите ИНН"
|
||||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
onChange={ (event) => this._handle_onInnChange(event.target.value) }
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
@ -807,13 +916,14 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
<FilesList
|
<FilesList
|
||||||
|
maxFiles={ 2 }
|
||||||
name="delegation_files"
|
name="delegation_files"
|
||||||
files={ delegation_files }
|
files={ delegation_files }
|
||||||
onAddFile={ (name, files) => { this._removeError("delegation_files"); this._handle_onAddFile(name, files); } }
|
onAddFile={ (name, files) => { this._removeError("delegation_files"); this._handle_onAddFile(name, files); } }
|
||||||
onRemoveFile={ this._handle_onRemoveFile }
|
onRemoveFile={ this._handle_onRemoveFile }
|
||||||
checking={ checking }
|
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" }}/>
|
<input type="text" id="delegation_files_error_check" onChange={ () => {} } value={ delegation_files.length > 0 ? delegation_files.length : "" } required={ true } style={{ opacity: 0.0, height: "0px", marginTop: "-25px", display: "flex" }}/>
|
||||||
|
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
) }
|
) }
|
||||||
@ -949,6 +1059,19 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
|
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
<label>Код подразделения <sup className="required_label">*</sup></label>
|
<label>Код подразделения <sup className="required_label">*</sup></label>
|
||||||
|
<DocumentIssuerSuggestsInput
|
||||||
|
className={ errors.indexOf("signatory_person.identity_document.code") > -1 ? "error" : "" }
|
||||||
|
type="issuer"
|
||||||
|
id="signatory_person.identity_document.code"
|
||||||
|
name="signatory_person.identity_document.code"
|
||||||
|
value={ this._checkStrValue(signatory_person.identity_document.code) }
|
||||||
|
placeholder="Введите код"
|
||||||
|
onChange={ (value) => { this._handle_onIssuerCodeChange("signatory_person", value); } }
|
||||||
|
maxResults={ 5 }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{/*}
|
||||||
<InputMask
|
<InputMask
|
||||||
className={ errors.indexOf("signatory_person.identity_document.code") > -1 ? "error" : "" }
|
className={ errors.indexOf("signatory_person.identity_document.code") > -1 ? "error" : "" }
|
||||||
mask='999-999'
|
mask='999-999'
|
||||||
@ -960,11 +1083,24 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
|
{*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
<label>Кем выдан <sup className="required_label">*</sup></label>
|
<label>Кем выдан <sup className="required_label">*</sup></label>
|
||||||
|
<DocumentIssuerSuggestsInput
|
||||||
|
className={ errors.indexOf("signatory_person.identity_document.issueby") > -1 ? "error" : "" }
|
||||||
|
type="issuer"
|
||||||
|
id="signatory_person.identity_document.issueby"
|
||||||
|
name="signatory_person.identity_document.issueby"
|
||||||
|
value={ this._checkStrValue(signatory_person.identity_document.issueby) }
|
||||||
|
placeholder="Введите наименование подразделения выдавшего документ"
|
||||||
|
onChange={ (value) => { this._handle_onIssuerChange("signatory_person", value); } }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{/*}
|
||||||
<input type="text"
|
<input type="text"
|
||||||
className={ errors.indexOf("signatory_person.identity_document.issueby") > -1 ? "error" : "" }
|
className={ errors.indexOf("signatory_person.identity_document.issueby") > -1 ? "error" : "" }
|
||||||
id="signatory_person.identity_document.issueby"
|
id="signatory_person.identity_document.issueby"
|
||||||
@ -975,6 +1111,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
|
{*/}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
@ -984,7 +1121,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
id={ "signatory_person.identity_document.placebirth" }
|
id={ "signatory_person.identity_document.placebirth" }
|
||||||
value={ this._checkStrValue(signatory_person.identity_document.placebirth) }
|
value={ this._checkStrValue(signatory_person.identity_document.placebirth) }
|
||||||
placeholder="Укажите место рождения"
|
placeholder="Укажите место рождения"
|
||||||
onChange={ (data) => this._handle_onTextFieldChange("signatory_person.identity_document.placebirth", data.name) }
|
onChange={ (data) => { this._handle_onTextFieldChange("signatory_person.identity_document.placebirth", data.name); } }
|
||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
@ -1088,6 +1225,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
<FilesList
|
<FilesList
|
||||||
|
maxFiles={ 2 }
|
||||||
title="Прикрепить скан паспорта подписанта"
|
title="Прикрепить скан паспорта подписанта"
|
||||||
name="signatory_person_files"
|
name="signatory_person_files"
|
||||||
files={ signatory_person_files }
|
files={ signatory_person_files }
|
||||||
@ -1095,7 +1233,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
onRemoveFile={ this._handle_onRemoveFile }
|
onRemoveFile={ this._handle_onRemoveFile }
|
||||||
checking={ checking }
|
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" }}/>
|
<input type="text" id="signatory_person_files_error_check" onChange={ () => {} } 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>
|
<p><b>Реквизиты документа подтверждающие полномочия на подписание договора лизинга</b></p>
|
||||||
|
|
||||||
@ -1177,6 +1315,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
<FilesList
|
<FilesList
|
||||||
|
maxFiles={ 2 }
|
||||||
title="Прикрепить скан документа на право подписи"
|
title="Прикрепить скан документа на право подписи"
|
||||||
name="signatory_corporate_files"
|
name="signatory_corporate_files"
|
||||||
files={ signatory_corporate_files }
|
files={ signatory_corporate_files }
|
||||||
@ -1184,7 +1323,7 @@ class Form_3_Signer extends QuestionnaireForm
|
|||||||
onRemoveFile={ this._handle_onRemoveFile }
|
onRemoveFile={ this._handle_onRemoveFile }
|
||||||
checking={ checking }
|
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" }}/>
|
<input type="text" id="signatory_corporate_files_error_check" onChange={ () => {} } value={ signatory_corporate_files.length > 0 ? signatory_corporate_files.length : "" } required={ true } style={{ opacity: 0.0, height: "0px", marginTop: "-25px", display: "flex" }}/>
|
||||||
</>
|
</>
|
||||||
) }
|
) }
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import InputMask from 'react-input-mask';
|
|||||||
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
|
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
|
||||||
import { saveQuestionnaire } from "../../../../actions";
|
import { saveQuestionnaire } from "../../../../actions";
|
||||||
import SuggestsInput from "../../SuggestsInput";
|
import SuggestsInput from "../../SuggestsInput";
|
||||||
|
import DocumentIssuerSuggestsInput from "../../DocumentIssuerSuggestsInput";
|
||||||
|
|
||||||
class ShareholderForm extends React.Component
|
class ShareholderForm extends React.Component
|
||||||
{
|
{
|
||||||
@ -29,6 +30,8 @@ class ShareholderForm extends React.Component
|
|||||||
_handle_onFieldChange = this.props._handle_onFieldChange;
|
_handle_onFieldChange = this.props._handle_onFieldChange;
|
||||||
_checkStrValue = this.props._checkStrValue;
|
_checkStrValue = this.props._checkStrValue;
|
||||||
_removeError = this.props._removeError;
|
_removeError = this.props._removeError;
|
||||||
|
_handle_onIssuerCodeChange = this.props._handle_onIssuerCodeChange;
|
||||||
|
_handle_onIssuerChange = this.props._handle_onIssuerChange;
|
||||||
|
|
||||||
_handle_onCitizenshipChange = (name, value) =>
|
_handle_onCitizenshipChange = (name, value) =>
|
||||||
{
|
{
|
||||||
@ -199,6 +202,21 @@ class ShareholderForm extends React.Component
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
|
<DocumentIssuerSuggestsInput
|
||||||
|
style={{ width: "calc(100% - 198px)" }}
|
||||||
|
innerStyle={{ width: "100%", }}
|
||||||
|
className={ errors.indexOf(`founder_persons[${ index }].identity_document.code`) > -1 ? "error" : "" }
|
||||||
|
type="issuer"
|
||||||
|
id={ `founder_persons[${ index }].identity_document.code` }
|
||||||
|
name={ `founder_persons[${ index }].identity_document.code` }
|
||||||
|
value={ this._checkStrValue(shareholder.identity_document.code) }
|
||||||
|
placeholder="Введите код"
|
||||||
|
onChange={ (value) => { this._handle_onIssuerCodeChange(`founder_persons[${ index }]`, index, value); } }
|
||||||
|
maxResults={ 5 }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{/*}
|
||||||
<InputMask
|
<InputMask
|
||||||
mask='999-999'
|
mask='999-999'
|
||||||
id={ `founder_persons[${ index }].identity_document.code` }
|
id={ `founder_persons[${ index }].identity_document.code` }
|
||||||
@ -209,6 +227,7 @@ class ShareholderForm extends React.Component
|
|||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
|
{*/}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -216,6 +235,19 @@ class ShareholderForm extends React.Component
|
|||||||
|
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
<label>Кем выдан <sup className="required_label">*</sup></label>
|
<label>Кем выдан <sup className="required_label">*</sup></label>
|
||||||
|
<DocumentIssuerSuggestsInput
|
||||||
|
className={ errors.indexOf(`founder_persons[${ index }].identity_document.issueby`) > -1 ? "error" : "" }
|
||||||
|
type="issuer"
|
||||||
|
id={ `founder_persons[${ index }].identity_document.issueby` }
|
||||||
|
name={ `founder_persons[${ index }].identity_document.issueby` }
|
||||||
|
value={ this._checkStrValue(shareholder.identity_document.issueby) }
|
||||||
|
placeholder="Введите наименование подразделения выдавшего документ"
|
||||||
|
onChange={ (value) => { this._handle_onIssuerChange(`founder_persons[${ index }]`, index, value); } }
|
||||||
|
maxResults={ 10 }
|
||||||
|
required={ true }
|
||||||
|
disabled={ checking }
|
||||||
|
/>
|
||||||
|
{/*}
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id={ `founder_persons[${ index }].identity_document.issueby` }
|
id={ `founder_persons[${ index }].identity_document.issueby` }
|
||||||
name={ `founder_persons[${ index }].identity_document.issueby` }
|
name={ `founder_persons[${ index }].identity_document.issueby` }
|
||||||
@ -225,6 +257,7 @@ class ShareholderForm extends React.Component
|
|||||||
required={ true }
|
required={ true }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
|
{*/}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="form_field" style={{ flex: 1 }}>
|
<div className="form_field" style={{ flex: 1 }}>
|
||||||
@ -286,12 +319,12 @@ class Shareholder extends React.Component
|
|||||||
_checkStrValue = this.props._checkStrValue;
|
_checkStrValue = this.props._checkStrValue;
|
||||||
_removeError = this.props._removeError;
|
_removeError = this.props._removeError;
|
||||||
|
|
||||||
_checkSignatoryDisabled = (signatory_id) =>
|
_checkContactListDisabled = (hash) =>
|
||||||
{
|
{
|
||||||
const { shareholders } = this.props;
|
const { shareholders } = this.props;
|
||||||
for(let i in shareholders)
|
for(let i in shareholders)
|
||||||
{
|
{
|
||||||
if(shareholders[i].signatory_id === signatory_id)
|
if(shareholders[i].hash === hash)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -302,7 +335,7 @@ class Shareholder extends React.Component
|
|||||||
|
|
||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { index, shareholders, removeShareholder, signatories, changeSignatorySelection, clearSignatorySelection, checking, errors, } = this.props;
|
const { index, shareholders, removeShareholder, signatories, contacts, changeFounderSelectionFromList, clearFounderFromListSelection, checking, errors, } = this.props;
|
||||||
const shareholder = shareholders[index];
|
const shareholder = shareholders[index];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -320,7 +353,7 @@ class Shareholder extends React.Component
|
|||||||
checked={ shareholder.founder_from_list }
|
checked={ shareholder.founder_from_list }
|
||||||
id={ `founder_persons[${ index }].founder_from_list` }
|
id={ `founder_persons[${ index }].founder_from_list` }
|
||||||
name={ `founder_persons[${ index }].founder_from_list` }
|
name={ `founder_persons[${ index }].founder_from_list` }
|
||||||
onChange={ (event) => clearSignatorySelection(`founder_persons[${ index }]`, { founder_from_list: !shareholder.founder_from_list ? true : false, lastname: "", firstname: "", middlename: "", no_middle_name: false, }) }
|
onChange={ (event) => clearFounderFromListSelection(`founder_persons[${ index }]`, { founder_from_list: !shareholder.founder_from_list ? true : false, lastname: "", firstname: "", middlename: "", no_middle_name: false, }) }
|
||||||
/>
|
/>
|
||||||
<label className="unselectable" htmlFor={ `founder_persons[${ index }].founder_from_list` }>Выбрать из списка</label>
|
<label className="unselectable" htmlFor={ `founder_persons[${ index }].founder_from_list` }>Выбрать из списка</label>
|
||||||
</div>
|
</div>
|
||||||
@ -348,12 +381,14 @@ class Shareholder extends React.Component
|
|||||||
<div className="feed">
|
<div className="feed">
|
||||||
<div className="feed_list">
|
<div className="feed_list">
|
||||||
|
|
||||||
{ signatories !== undefined && signatories !== null && signatories.map((signatory, s_index) => {
|
{ contacts !== undefined && contacts !== null && contacts.map((contact, s_index) =>
|
||||||
const disabled = signatory.signatoryid !== shareholder.signatory_id ? this._checkSignatoryDisabled(signatory.signatoryid) : false;
|
{
|
||||||
|
const hash = `${ contact.lastname }_${ contact.firstname }_${ contact.middlename }`;
|
||||||
|
const disabled = hash !== shareholder.hash ? this._checkContactListDisabled(hash) : false;
|
||||||
|
|
||||||
if(checking)
|
if(checking)
|
||||||
{
|
{
|
||||||
if(shareholder.signatory_id !== signatory.signatoryid)
|
if(shareholder.hash !== hash)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -362,25 +397,25 @@ class Shareholder extends React.Component
|
|||||||
return (
|
return (
|
||||||
<div className="form_field checkbox" key={ s_index }>
|
<div className="form_field checkbox" key={ s_index }>
|
||||||
<input type="radio" hidden=""
|
<input type="radio" hidden=""
|
||||||
id={ `founder_persons[${ index }].signatory_${ signatory.signatoryid }` }
|
id={ `founder_persons[${ index }].contact_${ hash }` }
|
||||||
name={ `founder_persons[${ index }].signatory_${ signatory.signatoryid }` }
|
name={ `founder_persons[${ index }].contact_${ hash }` }
|
||||||
checked={ signatory.signatoryid === shareholder.signatory_id }
|
checked={ hash === shareholder.hash }
|
||||||
onChange={ () => changeSignatorySelection(`founder_persons[${ index }]`, { ...shareholder, ...{
|
onChange={ () => changeFounderSelectionFromList(`founder_persons[${ index }]`, { ...shareholder, ...{
|
||||||
founder_from_list: true,
|
founder_from_list: true,
|
||||||
signatory_id: signatory.signatoryid,
|
hash: hash,
|
||||||
lastname: _checkStrValue(signatory.lastname),
|
lastname: _checkStrValue(contact.lastname),
|
||||||
firstname: _checkStrValue(signatory.firstname),
|
firstname: _checkStrValue(contact.firstname),
|
||||||
middlename: _checkStrValue(signatory.middlename),
|
middlename: _checkStrValue(contact.middlename),
|
||||||
} }) }
|
} }) }
|
||||||
disabled={ disabled }
|
disabled={ disabled }
|
||||||
/>
|
/>
|
||||||
<label className="unselectable" style={ disabled ? { opacity: "0.5" } : {} } htmlFor={ `founder_persons[${ index }].signatory_${ signatory.signatoryid }` }>
|
<label className="unselectable" style={ disabled ? { opacity: "0.5" } : {} } htmlFor={ `founder_persons[${ index }].contact_${ hash }` }>
|
||||||
<div className="feed_item user">
|
<div className="feed_item user">
|
||||||
<img src="/assets/images/icons/avatar.svg" alt="" />
|
<img src="/assets/images/icons/avatar.svg" alt="" />
|
||||||
<div>
|
<div>
|
||||||
<p className="item_title">{ signatory.lastname } { signatory.firstname } { signatory.middlename }</p>
|
<p className="item_title">{ contact.lastname } { contact.firstname } { contact.middlename }</p>
|
||||||
<p className="item_desc">
|
<p className="item_desc">
|
||||||
<span>{ signatory.jobtitle }</span>
|
<span>{ contact.jobtitle }</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -493,6 +528,7 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
errors: [
|
errors: [
|
||||||
[], [], [], []
|
[], [], [], []
|
||||||
],
|
],
|
||||||
|
client_contacts: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
this.ref_form = React.createRef();
|
this.ref_form = React.createRef();
|
||||||
@ -503,6 +539,7 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
founder_persons: nextProps.questionnaire.founder_persons,
|
founder_persons: nextProps.questionnaire.founder_persons,
|
||||||
|
client_contacts: nextProps.questionnaire.client_contacts,
|
||||||
status: nextProps.questionnaire.status,
|
status: nextProps.questionnaire.status,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -551,22 +588,57 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_handle_onClearSignatorySelection = (name, values) =>
|
_handle_onClearFounderFromListSelection = (name, values) =>
|
||||||
{
|
{
|
||||||
const founder_persons_template = JSON.parse(JSON.stringify(this.state.founder_persons_template));
|
const founder_persons_template = JSON.parse(JSON.stringify(this.state.founder_persons_template));
|
||||||
const update = { ...founder_persons_template , ...values };
|
const update = { ...founder_persons_template , ...values };
|
||||||
console.log("_handle_onClearSignatorySelection", update);
|
console.log("_handle_onClearFounderFromListSelection", update);
|
||||||
this._handle_onFieldChange(name, update );
|
this._handle_onFieldChange(name, update );
|
||||||
}
|
}
|
||||||
|
|
||||||
_handle_onChangeSignatorySelection = (name, values) =>
|
_handle_onChangeFounderSelectionFromList = (name, values) =>
|
||||||
{
|
{
|
||||||
console.log("_handle_onChangeSignatorySelection");
|
console.log("_handle_onChangeFounderSelectionFromList");
|
||||||
console.log(name, values);
|
console.log(name, values);
|
||||||
|
|
||||||
this._handle_onFieldChange(name, { ...values } );
|
this._handle_onFieldChange(name, { ...values } );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handle_onIssuerCodeChange = (branch, index, option) =>
|
||||||
|
{
|
||||||
|
this._onRemoveError(index, `${ branch }.identity_document.code`);
|
||||||
|
|
||||||
|
if(typeof option === "string")
|
||||||
|
{
|
||||||
|
this._handle_onTextFieldChange(`${ branch }.identity_document.code`, option);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._handle_onBranchChange([
|
||||||
|
{ name: `${ branch }.identity_document.code`, value: option.data.code },
|
||||||
|
{ name: `${ branch }.identity_document.issueby`, value: option.value },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_handle_onIssuerChange = (branch, index, option) =>
|
||||||
|
{
|
||||||
|
this._onRemoveError(index, `${ branch }.identity_document.issueby`);
|
||||||
|
|
||||||
|
if(typeof option === "string")
|
||||||
|
{
|
||||||
|
this._handle_onTextFieldChange(`${ branch }.identity_document.issueby`, option);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this._handle_onBranchChange([
|
||||||
|
{ name: `${ branch }.identity_document.code`, value: option.data.code },
|
||||||
|
{ name: `${ branch }.identity_document.issueby`, value: option.value },
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
_handle_onFormSubmit = (event) =>
|
_handle_onFormSubmit = (event) =>
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -604,6 +676,10 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
"identity_document.registration_address.title",
|
"identity_document.registration_address.title",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(parseInt(_get("signatory_person.identity_document.doctype"), 10) === 100000000)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
for(let f in founder_persons)
|
for(let f in founder_persons)
|
||||||
{
|
{
|
||||||
for(let i in check)
|
for(let i in check)
|
||||||
@ -617,6 +693,7 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
|
|
||||||
this.setState({ errors }, () =>
|
this.setState({ errors }, () =>
|
||||||
{
|
{
|
||||||
|
window.scroll(0, 0);
|
||||||
this.ref_submit.current.click();
|
this.ref_submit.current.click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -648,9 +725,11 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
|
|
||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { signatories, checking } = this.props;
|
const { client_contacts, checking } = this.props;
|
||||||
const { founder_persons, loading, address, status, errors, } = this.state;
|
const { founder_persons, loading, address, status, errors, } = this.state;
|
||||||
|
|
||||||
|
//console.log("questionnaire", questionnaire);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} 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 className="title">4. Сведения об участниках (акционерах) и бенефициарных владельцах</p>
|
||||||
@ -681,12 +760,14 @@ class Form_4_Shareholders extends QuestionnaireForm
|
|||||||
_handle_onTextFieldChange={ this._handle_onTextFieldChange }
|
_handle_onTextFieldChange={ this._handle_onTextFieldChange }
|
||||||
_handle_onCheckboxFieldChange={ this._handle_onCheckboxFieldChange }
|
_handle_onCheckboxFieldChange={ this._handle_onCheckboxFieldChange }
|
||||||
_handle_onFieldChange={ this._handle_onFieldChange }
|
_handle_onFieldChange={ this._handle_onFieldChange }
|
||||||
|
_handle_onIssuerCodeChange={ this._handle_onIssuerCodeChange }
|
||||||
|
_handle_onIssuerChange={ this._handle_onIssuerChange }
|
||||||
_checkStrValue={ this._checkStrValue }
|
_checkStrValue={ this._checkStrValue }
|
||||||
_removeError={ (name) => this._onRemoveError(index, name) }
|
_removeError={ (name) => this._onRemoveError(index, name) }
|
||||||
removeShareholder={ this._handle_onRemoveShareholder }
|
removeShareholder={ this._handle_onRemoveShareholder }
|
||||||
clearSignatorySelection={ this._handle_onClearSignatorySelection }
|
clearFounderFromListSelection={ this._handle_onClearFounderFromListSelection }
|
||||||
changeSignatorySelection={ this._handle_onChangeSignatorySelection }
|
changeFounderSelectionFromList={ this._handle_onChangeFounderSelectionFromList }
|
||||||
signatories={ signatories }
|
contacts={ client_contacts }
|
||||||
checking={ checking }
|
checking={ checking }
|
||||||
/>
|
/>
|
||||||
)) }
|
)) }
|
||||||
|
|||||||
@ -82,6 +82,7 @@ class Form_5_Regulatory extends QuestionnaireForm
|
|||||||
|
|
||||||
this.setState({ errors }, () =>
|
this.setState({ errors }, () =>
|
||||||
{
|
{
|
||||||
|
window.scroll(0, 0);
|
||||||
this.ref_submit.current.click();
|
this.ref_submit.current.click();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -97,7 +98,7 @@ class Form_5_Regulatory extends QuestionnaireForm
|
|||||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} 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 className="title">5. Сведения об органах управления</p>
|
||||||
<p>Заполняется юридическими лицами, индивидуальными предпринимателями не заполняется</p>
|
<p>Заполняется юридическими лицами, индивидуальными предпринимателями не заполняется</p>
|
||||||
{ errors.length > 0 &&
|
{ errors.length > 0 &&
|
||||||
(
|
(
|
||||||
<div className="questionnaire message error">
|
<div className="questionnaire message error">
|
||||||
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="44" height="45" viewBox="0 0 44 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|||||||
@ -109,6 +109,66 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_handle_onNextPage = (event) =>
|
||||||
|
{
|
||||||
|
console.log("Form_6_NonProfit", "_handle_onNextPage");
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
const { non_profit } = this.state;
|
||||||
|
|
||||||
|
const errors = [];
|
||||||
|
const fin_source = ["fin_source_business", "fin_source_donate", "fin_source_fees"];
|
||||||
|
let check_another_fin_source = true;
|
||||||
|
|
||||||
|
for(let i in fin_source)
|
||||||
|
{
|
||||||
|
if(non_profit[fin_source[i]] !== false)
|
||||||
|
{
|
||||||
|
check_another_fin_source = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(check_another_fin_source)
|
||||||
|
{
|
||||||
|
if(!non_profit.fin_source_another)
|
||||||
|
{
|
||||||
|
errors.push("non_profit.fin_source");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!this._checkStrNotEmpty(non_profit.fin_source_another_description))
|
||||||
|
{
|
||||||
|
errors.push("non_profit.fin_source_another_description");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const fin_goals = ["fin_goals_cars", "fin_goals_trucks", "fin_goals_special"];
|
||||||
|
let fin_goals_need = true;
|
||||||
|
|
||||||
|
for(let i in fin_goals)
|
||||||
|
{
|
||||||
|
if(this._checkStrNotEmpty(non_profit[fin_goals[i]]))
|
||||||
|
{
|
||||||
|
fin_goals_need = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fin_goals_need)
|
||||||
|
{
|
||||||
|
errors.push("non_profit.fin_goals");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setState({ errors }, () =>
|
||||||
|
{
|
||||||
|
window.scroll(0, 0);
|
||||||
|
if(errors.length === 0)
|
||||||
|
{
|
||||||
|
this.ref_submit.current.click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_checkRequired = (field) =>
|
_checkRequired = (field) =>
|
||||||
{
|
{
|
||||||
const { non_profit } = this.state;
|
const { non_profit } = this.state;
|
||||||
@ -130,13 +190,25 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
render()
|
render()
|
||||||
{
|
{
|
||||||
const { checking } = this.props;
|
const { checking } = this.props;
|
||||||
const { non_profit, loading, status } = this.state;
|
const { non_profit, loading, status, errors } = this.state;
|
||||||
|
|
||||||
|
console.log("errors", errors);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<form ref={ this.ref_form } onSubmit={ this._handle_onFormSubmit } onKeyDown={(e) => {if (e.key === 'Enter') e.preventDefault() }} 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 className="title">6. Данные о некомерческой организации</p>
|
||||||
|
{ errors.indexOf("non_profit.fin_source") > -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>
|
||||||
|
) }
|
||||||
<p>Источники происхождения денежных средств, из которых будут осуществляться лизинговые платежи:</p>
|
<p>Источники происхождения денежных средств, из которых будут осуществляться лизинговые платежи:</p>
|
||||||
|
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
@ -146,7 +218,7 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
id="non_profit.fin_source_business"
|
id="non_profit.fin_source_business"
|
||||||
name="non_profit.fin_source_business"
|
name="non_profit.fin_source_business"
|
||||||
checked={ non_profit.fin_source_business }
|
checked={ non_profit.fin_source_business }
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !non_profit.fin_source_business ? true : false) }
|
onChange={ (event) => { this._removeError("non_profit.fin_source"); this._handle_onCheckboxFieldChange(event.target.name, !non_profit.fin_source_business ? true : false); } }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
<label htmlFor="non_profit.fin_source_business" className="unselectable">От приносящей доход деятельности</label>
|
<label htmlFor="non_profit.fin_source_business" className="unselectable">От приносящей доход деятельности</label>
|
||||||
@ -156,7 +228,7 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
id="non_profit.fin_source_donate"
|
id="non_profit.fin_source_donate"
|
||||||
name="non_profit.fin_source_donate"
|
name="non_profit.fin_source_donate"
|
||||||
checked={ non_profit.fin_source_donate }
|
checked={ non_profit.fin_source_donate }
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !non_profit.fin_source_donate ? true : false) }
|
onChange={ (event) => { this._removeError("non_profit.fin_source"); this._handle_onCheckboxFieldChange(event.target.name, !non_profit.fin_source_donate ? true : false); } }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
<label htmlFor="non_profit.fin_source_donate" className="unselectable">Добровольные пожертвования</label>
|
<label htmlFor="non_profit.fin_source_donate" className="unselectable">Добровольные пожертвования</label>
|
||||||
@ -167,7 +239,7 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
id="non_profit.fin_source_fees"
|
id="non_profit.fin_source_fees"
|
||||||
name="non_profit.fin_source_fees"
|
name="non_profit.fin_source_fees"
|
||||||
checked={ non_profit.fin_source_fees }
|
checked={ non_profit.fin_source_fees }
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !non_profit.fin_source_fees ? true : false ) }
|
onChange={ (event) => { this._removeError("non_profit.fin_source"); this._handle_onCheckboxFieldChange(event.target.name, !non_profit.fin_source_fees ? true : false ); } }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
<label htmlFor="non_profit.fin_source_fees" className="unselectable">Вступительные членские взносы</label>
|
<label htmlFor="non_profit.fin_source_fees" className="unselectable">Вступительные членские взносы</label>
|
||||||
@ -178,18 +250,20 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
id="non_profit.fin_source_another"
|
id="non_profit.fin_source_another"
|
||||||
name="non_profit.fin_source_another"
|
name="non_profit.fin_source_another"
|
||||||
checked={ non_profit.fin_source_another }
|
checked={ non_profit.fin_source_another }
|
||||||
onChange={ (event) => this._handle_onAnother() }
|
onChange={ (event) => { this._removeError([ "non_profit.fin_source", "non_profit.fin_source_another_description" ]); this._handle_onAnother(); } }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
<label htmlFor="non_profit.fin_source_another" style={{ width: "100%" }} className="unselectable">
|
<label htmlFor="non_profit.fin_source_another" style={{ width: "100%" }} className="unselectable">
|
||||||
<span>Иное</span>
|
<span>Иное { non_profit.fin_source_another && (<sup className="required_label">*</sup>) }</span>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
|
className={ errors.indexOf("non_profit.fin_source_another_description") > -1 ? "error" : "" }
|
||||||
id="non_profit.fin_source_another_description"
|
id="non_profit.fin_source_another_description"
|
||||||
name="non_profit.fin_source_another_description"
|
name="non_profit.fin_source_another_description"
|
||||||
value={ this._checkStrValue(non_profit.fin_source_another_description) }
|
value={ this._checkStrValue(non_profit.fin_source_another_description) }
|
||||||
disabled={ checking ? true : non_profit.fin_source_another ? false : true }
|
disabled={ checking ? true : non_profit.fin_source_another ? false : true }
|
||||||
placeholder="Укажите источник"
|
placeholder="Укажите источник"
|
||||||
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
|
required={ non_profit.fin_source_another ? true : false }
|
||||||
|
onChange={ (event) => { this._removeError([ "non_profit.fin_source", "non_profit.fin_source_another_description" ]); this._handle_onTextFieldChange(event.target.name, event.target.value); } }
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@ -225,6 +299,18 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{ errors.indexOf("non_profit.fin_goals") > -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>
|
||||||
|
) }
|
||||||
|
|
||||||
<p>Укажите цели использования предмета лизинга и подтвердите их соответствие уставным целям для каждого предмета лизинга отдельно</p>
|
<p>Укажите цели использования предмета лизинга и подтвердите их соответствие уставным целям для каждого предмета лизинга отдельно</p>
|
||||||
|
|
||||||
<div className="form_field">
|
<div className="form_field">
|
||||||
@ -235,7 +321,7 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
value={ this._checkStrValue(non_profit.fin_goals_cars) }
|
value={ this._checkStrValue(non_profit.fin_goals_cars) }
|
||||||
placeholder="Введите данные"
|
placeholder="Введите данные"
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
||||||
required={ this._checkRequired("fin_goals_cars") }
|
required={ false }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -248,7 +334,7 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
value={ this._checkStrValue(non_profit.fin_goals_trucks) }
|
value={ this._checkStrValue(non_profit.fin_goals_trucks) }
|
||||||
placeholder="Введите данные"
|
placeholder="Введите данные"
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
||||||
required={ this._checkRequired("fin_goals_trucks") }
|
required={ false }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -261,18 +347,19 @@ class Form_6_NonProfit extends QuestionnaireForm
|
|||||||
value={ this._checkStrValue(non_profit.fin_goals_special) }
|
value={ this._checkStrValue(non_profit.fin_goals_special) }
|
||||||
placeholder="Введите данные"
|
placeholder="Введите данные"
|
||||||
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
|
||||||
required={ this._checkRequired("fin_goals_special") }
|
required={ false }
|
||||||
disabled={ checking }
|
disabled={ checking }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{ !checking && (
|
{ !checking && (
|
||||||
<div className="action">
|
<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 ? (
|
{ loading ? (
|
||||||
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
|
<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>
|
||||||
|
<button ref={ this.ref_submit } type="submit" style={{ display: "none" }}/>
|
||||||
{ status !== "empty" && (
|
{ status !== "empty" && (
|
||||||
<>
|
<>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
|
|||||||
@ -38,7 +38,16 @@ export default class QuestionnaireForm extends React.Component
|
|||||||
|
|
||||||
_checkStrValue = (value) =>
|
_checkStrValue = (value) =>
|
||||||
{
|
{
|
||||||
return value !== null ? value.toString() : "";
|
return value !== undefined && value !== null ? value.toString() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
_checkStrNotEmpty = (value) =>
|
||||||
|
{
|
||||||
|
if(value === null || value === undefined || value === "")
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_getAddress = (name, text) =>
|
_getAddress = (name, text) =>
|
||||||
@ -64,11 +73,28 @@ export default class QuestionnaireForm extends React.Component
|
|||||||
|
|
||||||
_removeError = (name) =>
|
_removeError = (name) =>
|
||||||
{
|
{
|
||||||
|
console.log("_removeError", name, typeof name);
|
||||||
const errors = [ ...this.state.errors ];
|
const errors = [ ...this.state.errors ];
|
||||||
if(errors.indexOf(name) > -1)
|
|
||||||
|
if(typeof name === "string")
|
||||||
{
|
{
|
||||||
errors.splice(errors.indexOf(name), 1);
|
if(errors.indexOf(name) > -1)
|
||||||
|
{
|
||||||
|
errors.splice(errors.indexOf(name), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(let i in name)
|
||||||
|
{
|
||||||
|
console.log("REMOVE", name[i]);
|
||||||
|
if(errors.indexOf(name[i]) > -1)
|
||||||
|
{
|
||||||
|
errors.splice(errors.indexOf(name[i]), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({ errors });
|
this.setState({ errors });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
lib/company_functions.json
Normal file
8
lib/company_functions.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[
|
||||||
|
{ "label": "Генеральный директор", "value": 100000000 },
|
||||||
|
{ "label": "Подписант", "value": 100000001 },
|
||||||
|
{ "label": "Бухгалтер", "value": 100000002 },
|
||||||
|
{ "label": "Бухгалтер (закрывающие док.)", "value": 100000005 },
|
||||||
|
{ "label": "Контактное лицо", "value": 100000003 },
|
||||||
|
{ "label": "Учредитель", "value": 100000004 }
|
||||||
|
]
|
||||||
@ -10,6 +10,12 @@ import fs from 'fs';
|
|||||||
import { PDFDocument } from 'pdf-lib';
|
import { PDFDocument } from 'pdf-lib';
|
||||||
import fontkit from '@pdf-lib/fontkit';
|
import fontkit from '@pdf-lib/fontkit';
|
||||||
|
|
||||||
|
const address = {
|
||||||
|
100000000: "legal",
|
||||||
|
100000001: "fact",
|
||||||
|
100000002: "postal",
|
||||||
|
};
|
||||||
|
|
||||||
const fields = {
|
const fields = {
|
||||||
main: {
|
main: {
|
||||||
title: { name: "main_title", type: "text", bind: null, },
|
title: { name: "main_title", type: "text", bind: null, },
|
||||||
@ -31,9 +37,9 @@ const fields = {
|
|||||||
collective_executive: { name: "execution_team", type: "text", bind: null, size: 6 },
|
collective_executive: { name: "execution_team", type: "text", bind: null, size: 6 },
|
||||||
individual_executive: { name: "execution_sole", type: "text", bind: null, size: 6 },
|
individual_executive: { name: "execution_sole", type: "text", bind: null, size: 6 },
|
||||||
other_control: { name: "execution_another", type: "text", bind: null, size: 6 },
|
other_control: { name: "execution_another", type: "text", bind: null, size: 6 },
|
||||||
|
evo_mail_delivery_address_type: { name: "evo_mail_delivery_address_type", type: "radio", bind: null },
|
||||||
},
|
},
|
||||||
contacts: {
|
contacts: {
|
||||||
address_type: { name: "address_type", type: "radio", bind: null },
|
|
||||||
fact_address: { name: "address_fact", type: "text", bind: null },
|
fact_address: { name: "address_fact", type: "text", bind: null },
|
||||||
postal_address: { name: "address_postal", type: "text", bind: null },
|
postal_address: { name: "address_postal", type: "text", bind: null },
|
||||||
},
|
},
|
||||||
@ -241,10 +247,10 @@ export default async function handler(req, res)
|
|||||||
fields[group][field].bind.setText(questionnaire[group].fact_address.name.toUpperCase());
|
fields[group][field].bind.setText(questionnaire[group].fact_address.name.toUpperCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(field === "address_type")
|
else if(field === "evo_mail_delivery_address_type")
|
||||||
{
|
{
|
||||||
fields[group][field].bind = form.getRadioGroup(fields[group][field].name);
|
fields[group][field].bind = form.getRadioGroup(fields[group][field].name);
|
||||||
fields[group][field].bind.select(questionnaire[group].address_type);
|
fields[group][field].bind.select(address[ questionnaire[group].evo_mail_delivery_address_type ]);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
else if(field === "foreign_payers")
|
else if(field === "foreign_payers")
|
||||||
|
|||||||
@ -45,23 +45,23 @@ export default async function handler(req, res)
|
|||||||
console.log("error");
|
console.log("error");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
console.error(e);
|
console.error(e);
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,23 +42,23 @@ export default async function handler(req, res)
|
|||||||
console.log("error");
|
console.log("error");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
console.error(e);
|
console.error(e);
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,9 +23,9 @@ export default async function handler(req, res)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
const { query, } = req.body;
|
const { query, max } = req.body;
|
||||||
|
|
||||||
axios.post(`https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/fms_unit`, { query }, {
|
axios.post(`https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/fms_unit`, { query, count: max ? max : 10 }, {
|
||||||
httpAgent: keepAliveAgent,
|
httpAgent: keepAliveAgent,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
@ -42,23 +42,23 @@ export default async function handler(req, res)
|
|||||||
console.log("error");
|
console.log("error");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
console.error(e);
|
console.error(e);
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
67
pages/api/suggests/inn.js
Normal file
67
pages/api/suggests/inn.js
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
||||||
|
import https from 'https';
|
||||||
|
import axios from 'axios';
|
||||||
|
import { Cookies } from 'react-cookie';
|
||||||
|
import cookie from 'cookie';
|
||||||
|
import moment from 'moment';
|
||||||
|
import jwt from 'jsonwebtoken';
|
||||||
|
import { cors } from '../../../lib/cors';
|
||||||
|
|
||||||
|
const keepAliveAgent = new https.Agent({ keepAlive: true });
|
||||||
|
|
||||||
|
export default async function handler(req, res)
|
||||||
|
{
|
||||||
|
await cors(req, res);
|
||||||
|
|
||||||
|
if(req.headers.cookie !== undefined)
|
||||||
|
{
|
||||||
|
const cookies = cookie.parse(req.headers?.cookie ? req.headers?.cookie : "");
|
||||||
|
|
||||||
|
if(cookies.jwt !== undefined && cookies.jwt !== null)
|
||||||
|
{
|
||||||
|
if(jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
const { query, } = req.body;
|
||||||
|
|
||||||
|
axios.post(`https://suggestions.dadata.ru/suggestions/api/4_1/rs/findById/party`, { query }, {
|
||||||
|
httpAgent: keepAliveAgent,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": `Token ${ process.env.DADATA_API_KEY }`,
|
||||||
|
"X-Secret": process.env.DADATA_SECRET_KEY
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((api_response) =>
|
||||||
|
{
|
||||||
|
//console.log("RESPONSE");
|
||||||
|
//console.log(api_response.data);
|
||||||
|
|
||||||
|
res.status(200).send(api_response.data);
|
||||||
|
})
|
||||||
|
.catch((error) =>
|
||||||
|
{
|
||||||
|
console.log("error");
|
||||||
|
console.error(error);
|
||||||
|
|
||||||
|
res.status(500).send();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch(e)
|
||||||
|
{
|
||||||
|
console.error(e);
|
||||||
|
res.status(500).send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.status(403).send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res.status(403).send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -42,23 +42,23 @@ export default async function handler(req, res)
|
|||||||
console.log("error");
|
console.log("error");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
console.error(e);
|
console.error(e);
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,23 +42,23 @@ export default async function handler(req, res)
|
|||||||
console.log("error");
|
console.log("error");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e)
|
catch(e)
|
||||||
{
|
{
|
||||||
console.error(e);
|
console.error(e);
|
||||||
res.status(500);
|
res.status(500).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res.status(403);
|
res.status(403).send();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ export const questionnaire_template = {
|
|||||||
},
|
},
|
||||||
delegation_files: [],
|
delegation_files: [],
|
||||||
contacts: {
|
contacts: {
|
||||||
address_type: "legal",
|
evo_mail_delivery_address_type: 100000000,
|
||||||
legal_address: {
|
legal_address: {
|
||||||
name: null,
|
name: null,
|
||||||
fias_id: null,
|
fias_id: null,
|
||||||
@ -106,42 +106,7 @@ export const questionnaire_template = {
|
|||||||
signatory_person_files: [],
|
signatory_person_files: [],
|
||||||
signatory_corporate_files: [],
|
signatory_corporate_files: [],
|
||||||
founder_persons: [],
|
founder_persons: [],
|
||||||
client_contacts: {
|
client_contacts: [],
|
||||||
lastname: null,
|
|
||||||
firstname: null,
|
|
||||||
middlename: null,
|
|
||||||
no_middle_name: false,
|
|
||||||
jobtitle: null,
|
|
||||||
assignment_date: null,
|
|
||||||
indefinite: false,
|
|
||||||
credentials_dateend: null,
|
|
||||||
telephone: null,
|
|
||||||
email: null,
|
|
||||||
signer_rule_basis: null,
|
|
||||||
signer_rule_basis_add: null,
|
|
||||||
docdate: null,
|
|
||||||
docnumber: null,
|
|
||||||
delegation_agreement: false,
|
|
||||||
functiontype: null,
|
|
||||||
identity_document: {
|
|
||||||
doctype: 100000000,
|
|
||||||
seria: null,
|
|
||||||
docnumber: null,
|
|
||||||
issuedate: null,
|
|
||||||
code: null,
|
|
||||||
issueby: null,
|
|
||||||
issueby_search_dadata: null,
|
|
||||||
placebirth: null,
|
|
||||||
citizenship: {
|
|
||||||
title: null,
|
|
||||||
code: null,
|
|
||||||
},
|
|
||||||
registration_address: {
|
|
||||||
name: null,
|
|
||||||
fias_id: null,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
non_profit: {
|
non_profit: {
|
||||||
fin_source_business: false,
|
fin_source_business: false,
|
||||||
fin_source_donate: false,
|
fin_source_donate: false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user