API read with local saving

This commit is contained in:
merelendor 2023-04-05 14:42:56 +03:00
parent 0bca5b0e30
commit 90282c5d79
16 changed files with 546 additions and 485 deletions

View File

@ -31,60 +31,147 @@ export const getQuestionnaire = ({ dispatch, id }) =>
return new Promise((resolve, reject) =>
{
axios.get(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/questionnaire/get`, {
params: {
id
}
})
.then((response) =>
/*
axios.get(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/questionnaire/read`, {})
.then((response_read) =>
{
console.log("ACTION", "questionnaire", "getQuestionnaire()", "response", response.data);
const questionnaire = JSON.parse(JSON.stringify(global.store.getState().questionnaire));
if(questionnaire.status === "empty")
console.log("ACTION", "getQuestionnaire", "/api/questionnaire/read", response_read.data);
if(response_read.data !== "")
{
questionnaire.main.title = response.data.title;
questionnaire.main.inn = response.data.inn;
questionnaire.main.kpp = response.data.kpp;
questionnaire.main.telephone = response.data.telephone;
questionnaire.main.email = response.data.email;
questionnaire.main.websiteurl = response.data.websiteurl !== null ? response.data.websiteurl : "";
questionnaire.main.financial_loan = response.data.financial_loan !== null ? response.data.financial_loan : "";
questionnaire.contacts.address_type = response.data.inn.length > 10 ? "fact" : "legal";
questionnaire.contacts.fact_address = response.data.fact_address;
questionnaire.contacts.postal_address = response.data.postal_address;
questionnaire.contacts.legal_address = response.data.legal_address;
questionnaire.head_person = { ...questionnaire.head_person, ...response.data.head_person };
questionnaire.head_person.identity_document.citizenship = {
title: getCitizenshipTitleByCode(response.data.head_person.identity_document.citizenship_code),
code: response.data.head_person.identity_document.citizenship_code,
};
questionnaire.signatory_person = { ...questionnaire.signatory_person, ...response.data.signatory_person };
questionnaire.signatory_person.identity_document.citizenship = {
title: getCitizenshipTitleByCode(response.data.signatory_person.identity_document.citizenship_code),
code: response.data.signatory_person.identity_document.citizenship_code,
};
console.log("questionnairequestionnairequestionnaire FROM JSON", questionnaire);
updateQuestionnaire({ dispatch, questionnaire })
.then(() => {})
.catch(() => {});
//dispatch({ type: actionTypes.SUPPORT_APPEALS, data: { appeals: { list: response.data.appeals, new: response.data.new, } } });
updateQuestionnaire({ dispatch, questionnaire: response_read.data });
resolve();
}
else
{
resolve();
*/
axios.get(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/questionnaire/get`, {
params: {
id
}
})
.then((response) =>
{
console.log("ACTION", "questionnaire", "getQuestionnaire()", "response", response.data);
const founder_persons_template = {
signatory_id: null,
lastname: "",
firstname: "",
middlename: "",
no_middle_name: false,
jobtitle: "",
telephone: "",
email: "",
founder_from_list: true,
founder_number: 0,
founder_part: "",
is_beneficial: false,
identity_document:
{
doctype: "",
seria: "",
docnumber: "",
issuedate: "",
icode: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
citizenship: {
title: "",
code: "",
},
registration_address: {
title: "",
fias_id: "",
}
}
};
const questionnaire = JSON.parse(JSON.stringify(global.store.getState().questionnaire));
if(questionnaire.status === "empty")
{
questionnaire.main.title = response.data.title;
questionnaire.main.inn = response.data.inn;
questionnaire.main.kpp = response.data.kpp;
questionnaire.main.telephone = response.data.telephone;
questionnaire.main.email = response.data.email;
questionnaire.main.websiteurl = response.data.websiteurl !== null ? response.data.websiteurl : "";
questionnaire.main.financial_loan = response.data.financial_loan !== null ? response.data.financial_loan : "";
questionnaire.contacts.address_type = response.data.inn.length > 10 ? "fact" : "legal";
questionnaire.contacts.fact_address = response.data.fact_address;
questionnaire.contacts.postal_address = response.data.postal_address;
questionnaire.contacts.legal_address = response.data.legal_address;
questionnaire.head_person = { ...questionnaire.head_person, ...response.data.head_person };
questionnaire.head_person.identity_document.citizenship = {
title: getCitizenshipTitleByCode(response.data.head_person.identity_document.citizenship_code),
code: response.data.head_person.identity_document.citizenship_code,
};
questionnaire.signatory_person = { ...questionnaire.signatory_person, ...response.data.signatory_person };
questionnaire.signatory_person.identity_document.citizenship = {
title: getCitizenshipTitleByCode(response.data.signatory_person.identity_document.citizenship_code),
code: response.data.signatory_person.identity_document.citizenship_code,
};
for(let i in response.data.founder_persons)
{
console.log("response.data.founder_persons", response.data.founder_persons);
questionnaire.founder_persons[i] = response.data.founder_persons[i];
questionnaire.founder_persons[i].identity_document.citizenship = {
title: getCitizenshipTitleByCode(response.data.founder_persons[i].identity_document.citizenship_code),
code: response.data.founder_persons[i].identity_document.citizenship_code,
};
}
//questionnaire.founder_persons = { ...questionnaire.head_person, ...response.data.head_person };
console.log("questionnairequestionnairequestionnaire FROM JSON", questionnaire);
updateQuestionnaire({ dispatch, questionnaire })
.then(() => {})
.catch(() => {});
//dispatch({ type: actionTypes.SUPPORT_APPEALS, data: { appeals: { list: response.data.appeals, new: response.data.new, } } });
resolve();
}
else
{
resolve();
}
/*
})
.catch((error) =>
{
console.log("error");
console.error(error);
reject();
});
}
*/
})
.catch((error) =>
.catch(() =>
{
console.log("error");
console.error(error);
});
});
}
export const saveQuestionnaire = () =>
{
return new Promise((resolve, reject) =>
{
const questionnaire = JSON.parse(JSON.stringify(global.store.getState().questionnaire));
axios.post(`${ process.env.NEXT_PUBLIC_SELF_API_HOST }/api/questionnaire/save`, { questionnaire }, {
withCredentials: true,
})
.then((response) =>
{
resolve();
})
.catch(() =>
{
reject();
});
});
@ -174,8 +261,8 @@ export const downloadQuestionnaire = (download = true) =>
const { questionnaire } = global.store.getState();
console.log("questionnaire", questionnaire);
const { main, contacts, signatory_person, founded_persons, head_person, non_profit, } = questionnaire;
const playload = { main, contacts, signatory_person, founded_persons, head_person, non_profit, };
const { main, contacts, signatory_person, founder_persons, head_person, non_profit, } = questionnaire;
const playload = { main, contacts, signatory_person, founder_persons, head_person, non_profit, };
console.log({ playload });
/* axios.post(`${ process.env.NEXT_PUBLIC_INT_API_HOST }/questionnaire/download`, { questionnaire: playload }, {

View File

@ -21,17 +21,63 @@ export default class CalendarDatePicker extends React.Component
super(props);
this.state = {
readonly: true,
input_value: undefined,
};
}
_handle_onChange = (date) =>
{
//console.log("CalendarDatePicker", "_handle_onChange", date);
const { readonly } = this.state;
if(this.props.onChange !== undefined)
{
this.props.onChange(date.getTime !== undefined ? date.toJSON() : "");
/*
if(!readonly)
{
this.setState({ value: date });
}
else
{
}
*/
}
}
/*
_handle_onKeyDown = (event) =>
{
const { input_value } = this.state;
if(event.keyCode >= 48 && event.keyCode <= 57)
{
//const input_value
console.log("CalendarDatePicker", "_handle_onKeyChange", "key", event.key, event);
let new_value = `${ input_value !== undefined ? input_value : "" }${ event.key }`;
let masks = "ДД.ММ.ГГГГ".split("");
let letters = new_value.split("");
let chars = [];
console.log({ new_value, letters, masks });
for(let i in masks)
{
if(letters[i] !== undefined)
{
chars.push(letters[i]);
}
else
{
chars.push(masks[i]);
}
}
console.log("chars", chars, chars.join(""));
this.setState({ input_value: chars.join("") });
}
}
*/
_handle_onFocus = () =>
{
this.setState({ readonly: false });
@ -45,7 +91,7 @@ export default class CalendarDatePicker extends React.Component
render()
{
const { id, placeholder, value, min, max, disabled, plain, style } = this.props;
const { readonly } = this.state;
const { readonly, input_value } = this.state;
if(disabled)
{
@ -60,6 +106,7 @@ export default class CalendarDatePicker extends React.Component
messages={ messages }
onFocus={ this._handle_onFocus }
onBlur={ this._handle_onBlur }
//onKeyDown={ this._handle_onKeyDown }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate() } }
id={ id }
placeholder={ placeholder }
@ -83,13 +130,14 @@ export default class CalendarDatePicker extends React.Component
messages={ messages }
onFocus={ this._handle_onFocus }
onBlur={ this._handle_onBlur }
//onKeyDown={ this._handle_onKeyDown }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate() } }
id={ id }
placeholder={ placeholder }
value={ value !== "" && value !== null ? new Date(value) : null }
value={ input_value !== undefined ? input_value : value !== "" && value !== null ? new Date(value) : null }
min={ min }
max={ max }
onChange={ this._handle_onChange }
onChange={ this._handle_onChange }
/>
</div>
)

View File

@ -45,7 +45,7 @@ export default class AddressSuggests extends React.Component
const { fias, focused } = this.state;
const { onChange } = this.props;
onChange({ title: value, fias_id: "" });
onChange({ name: value, fias_id: "" });
if(focused)
{
this._getAddress(value);
@ -59,7 +59,7 @@ export default class AddressSuggests extends React.Component
this.setState({ focused: false }, () =>
{
onChange({ title: value, fias_id: fias[value] });
onChange({ name: value, fias_id: fias[value] });
});
}

View File

@ -13,6 +13,7 @@ import CurrencyInput from 'react-currency-input';
import QuestionnaireForm from "../QuestionnaireForm";
import { reduxWrapper } from '../../../../store';
import { saveQuestionnaire } from "../../../../actions";
class Form_1_Main extends QuestionnaireForm
{
@ -21,13 +22,13 @@ class Form_1_Main extends QuestionnaireForm
super(props);
this.state = {
main: {
title: "",
inn: "",
kpp: "",
email: "",
telephone: "",
websiteurl: "",
financial_loan: "",
title: null,
inn: null,
kpp: null,
email: null,
telephone: null,
websiteurl: null,
financial_loan: null,
is_individual_executive: false,
individual_executive_inn: "",
individual_executive_kpp: "",
@ -107,11 +108,12 @@ class Form_1_Main extends QuestionnaireForm
_handle_onFormSubmit = (event) =>
{
event.preventDefault();
console.log("Form_1_Main", "_handle_onFormSubmit");
this._handle_onFieldChange("status", "draft");
this._handle_onCheckboxFieldChange("step", 2);
setTimeout(() =>
{
saveQuestionnaire();
this.props.onNextStep("contacts");
}, 10);
}
@ -138,8 +140,6 @@ class Form_1_Main extends QuestionnaireForm
const digit = /[0-9]/;
const fin_mask = [firstLetter, digit, letter, " ", digit, letter, digit];
console.log("company", company);
return (
<React.Fragment>
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_1 ${ checking && "disabled" }`}>
@ -150,7 +150,7 @@ class Form_1_Main extends QuestionnaireForm
<input type="text"
id="main.title"
name="main.title"
value={ main.title }
value={ this._checkStrValue(main.title) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -164,7 +164,7 @@ class Form_1_Main extends QuestionnaireForm
<input type="text"
id="main.inn"
name="main.inn"
value={ main.inn }
value={ this._checkStrValue(main.inn) }
placeholder="Введите ИНН"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -178,7 +178,7 @@ class Form_1_Main extends QuestionnaireForm
<input type="text"
id="main.kpp"
name="main.kpp"
value={ main.kpp }
value={ this._checkStrValue(main.kpp) }
placeholder="Введите КПП"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -195,7 +195,7 @@ class Form_1_Main extends QuestionnaireForm
mask='+7 (999) 999 99 99'
id="main.telephone"
name="main.telephone"
value={ main.telephone }
value={ this._checkStrValue(main.telephone) }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -209,7 +209,7 @@ class Form_1_Main extends QuestionnaireForm
<input type="text"
id="main.websiteurl"
name="main.websiteurl"
value={ main.websiteurl }
value={ this._checkStrValue(main.websiteurl) }
placeholder="Введите адрес сайта, если есть"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
@ -222,7 +222,7 @@ class Form_1_Main extends QuestionnaireForm
<input type="email"
id="main.email"
name="main.email"
value={ main.email }
value={ this._checkStrValue(main.email) }
placeholder="Укажите адрес электронной почты"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
@ -235,7 +235,7 @@ class Form_1_Main extends QuestionnaireForm
<CurrencyInput
id="main.financial_loan"
name="main.financial_loan"
value={ main.financial_loan }
value={ this._checkStrValue(main.financial_loan) }
precision="2"
placeholder="Укажите сумму"
onChangeEvent={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }

View File

@ -13,6 +13,7 @@ import { withRouter } from 'next/router';
import QuestionnaireForm from "../QuestionnaireForm";
import { reduxWrapper } from '../../../../store';
import AddressSuggests from "../../AddressSuggests";
import { saveQuestionnaire } from "../../../../actions";
class Form_2_Contacts extends QuestionnaireForm
{
@ -25,22 +26,18 @@ class Form_2_Contacts extends QuestionnaireForm
loading: false,
fact_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
},
legal_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
},
postal_address: {
name: "",
fias_id: "",
},
name: null,
fias_id: null,
},
},
value: {
name: "",
fias_id: "",
}
};
}
@ -56,10 +53,8 @@ class Form_2_Contacts extends QuestionnaireForm
const { company } = this.props;
const { address_type } = this.state.contacts;
console.log("company.inncompany.inncompany.inncompany.inn", company.inn, address_type);
if(company.inn.length > 10 && address_type === "legal")
{
console.log("THIS ?");
this.setState({ address_type: "fact" });
}
}
@ -67,11 +62,11 @@ class Form_2_Contacts extends QuestionnaireForm
_handle_onFormSubmit = (event) =>
{
event.preventDefault();
console.log("Form_2_Contacts", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 3);
setTimeout(() =>
{
saveQuestionnaire();
this.props.onNextStep("signer");
}, 10);
}
@ -114,8 +109,8 @@ class Form_2_Contacts extends QuestionnaireForm
<div className="form_field">
<label>Фактический адрес</label>
<AddressSuggests
value={ fact_address.name }
fias={ fact_address.fias_id }
value={ this._checkStrValue(fact_address.name) }
fias={ this._checkStrValue(fact_address.fias_id) }
onChange={ (data) => this._handle_onTextFieldChange("contacts.fact_address", data) }
required={ address_type === "fact" ? true : false }
disabled={ checking }
@ -166,8 +161,8 @@ class Form_2_Contacts extends QuestionnaireForm
<label htmlFor="contacts.address_type_postal" className="unselectable" style={{ width: "100%" }}>
<span>По следующему адресу</span>
<AddressSuggests
value={ postal_address.name }
fias={ postal_address.fias_id }
value={ this._checkStrValue(postal_address.name) }
fias={ this._checkStrValue(postal_address.fias_id) }
onChange={ (data) => this._handle_onTextFieldChange("contacts.postal_address", data) }
required={ true }
disabled={ !checking && address_type === "postal" ? false : true }

View File

@ -23,6 +23,7 @@ import AddressSuggests from "../../AddressSuggests";
import InputMask from 'react-input-mask';
import SuggestsInput from "../../SuggestsInput";
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
import { saveQuestionnaire } from "../../../../actions";
class Form_3_Signer extends QuestionnaireForm
{
@ -31,13 +32,13 @@ class Form_3_Signer extends QuestionnaireForm
super(props);
this.state = {
main: {
title: "",
inn: "",
kpp: "",
email: "",
telephone: "",
websiteurl: "",
financial_loan: "",
title: null,
inn: null,
kpp: null,
email: null,
telephone: null,
websiteurl: null,
financial_loan: null,
is_individual_executive: false,
individual_executive_inn: "",
individual_executive_kpp: "",
@ -99,7 +100,7 @@ class Form_3_Signer extends QuestionnaireForm
seria: "",
docnumber: "",
issuedate: "",
icode: "",
code: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
@ -173,6 +174,7 @@ class Form_3_Signer extends QuestionnaireForm
this._handle_onCheckboxFieldChange("step", 4);
setTimeout(() =>
{
saveQuestionnaire();
this.props.onNextStep("shareholders");
}, 10);
}
@ -202,24 +204,19 @@ class Form_3_Signer extends QuestionnaireForm
{
if(_get(head_person, head_person_check[i]) === "")
{
console.log("DISABLED", "head_person", head_person_check[i]);
return true;
}
}
console.log("head_person.evo_indefinite", head_person.evo_indefinite, "head_person.evo_credentials_dateend", head_person.evo_credentials_dateend);
if(!head_person.evo_indefinite)
{
if(head_person.evo_credentials_dateend === "")
{
console.log("DISABLED", "head_person.evo_credentials_dateend === ''");
return true;
}
}
//переданы
console.log("main.not_head_personmain.not_head_personmain.not_head_personmain.not_head_person", main.not_head_person);
if(signatory_person.not_head_person)
{
const main_check = [
@ -234,7 +231,6 @@ class Form_3_Signer extends QuestionnaireForm
{
if(_get(main, main_check[i]) === "")
{
console.log("DISABLED", "main", main_check[i]);
return true;
}
}
@ -256,7 +252,7 @@ class Form_3_Signer extends QuestionnaireForm
"identity_document.seria",
"identity_document.docnumber",
"identity_document.issuedate",
"identity_document.icode",
"identity_document.code",
"identity_document.issueby",
"identity_document.placebirth",
"identity_document.citizenship.code",
@ -267,7 +263,6 @@ class Form_3_Signer extends QuestionnaireForm
{
if(_get(signatory_person, signatory_person_check[i]) === "")
{
console.log("DISABLED", "signatory_person", signatory_person_check[i]);
return true;
}
}
@ -328,7 +323,7 @@ class Form_3_Signer extends QuestionnaireForm
type="lastname"
id="head_person.lastname"
name="head_person.lastname"
value={ head_person.lastname }
value={ this._checkStrValue(head_person.lastname) }
placeholder="Введите фамилию"
onChange={ (value) => this._handle_onTextFieldChange("head_person.lastname", value) }
required={ true }
@ -352,7 +347,7 @@ class Form_3_Signer extends QuestionnaireForm
type="firstname"
id="head_person.firstname"
name="head_person.firstname"
value={ head_person.firstname }
value={ this._checkStrValue(head_person.firstname) }
placeholder="Введите имя"
onChange={ (value) => this._handle_onTextFieldChange("head_person.firstname", value) }
required={ true }
@ -376,7 +371,7 @@ class Form_3_Signer extends QuestionnaireForm
type="middlename"
id="head_person.middlename"
name="head_person.middlename"
value={ head_person.middlename }
value={ this._checkStrValue(head_person.middlename) }
placeholder="Введите отчество"
onChange={ (value) => this._handle_onTextFieldChange("head_person.middlename", value) }
required={ true }
@ -401,7 +396,7 @@ class Form_3_Signer extends QuestionnaireForm
mask='9999'
id="head_person.identity_document.seria"
name="head_person.identity_document.seria"
value={ head_person.identity_document.seria }
value={ this._checkStrValue(head_person.identity_document.seria) }
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -414,7 +409,7 @@ class Form_3_Signer extends QuestionnaireForm
mask='999999'
id="head_person.identity_document.docnumber"
name="head_person.identity_document.docnumber"
value={ head_person.identity_document.docnumber }
value={ this._checkStrValue(head_person.identity_document.docnumber) }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -429,7 +424,7 @@ class Form_3_Signer extends QuestionnaireForm
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.identity_document.issuedate" }
value={ head_person.identity_document.issuedate !== "" ? 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._handle_onTextFieldChange("head_person.identity_document.issuedate", date) }
required={ true }
disabled={ checking }
@ -441,7 +436,7 @@ class Form_3_Signer extends QuestionnaireForm
mask='999-999'
id="head_person.identity_document.code"
name="head_person.identity_document.code"
value={ head_person.identity_document.code }
value={ this._checkStrValue(head_person.identity_document.code) }
placeholder="Введите код"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -451,7 +446,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="head_person.identity_document.code"
name="head_person.identity_document.code"
value={ head_person.identity_document.code }
value={ this._checkStrValue(head_person.identity_document.code) }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -465,7 +460,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="head_person.identity_document.issueby"
name="head_person.identity_document.issueby"
value={ head_person.identity_document.issueby }
value={ this._checkStrValue(head_person.identity_document.issueby) }
placeholder="Введите наименование подразделения выдавшего документ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -476,7 +471,7 @@ class Form_3_Signer extends QuestionnaireForm
<label>Место рождения</label>
<AddressSuggests
id={ "head_person.identity_document.placebirth" }
value={ head_person.identity_document.placebirth }
value={ this._checkStrValue(head_person.identity_document.placebirth) }
placeholder="Укажите место рождения"
onChange={ (data) => this._handle_onTextFieldChange("head_person.identity_document.placebirth", data.title) }
required={ true }
@ -494,7 +489,7 @@ class Form_3_Signer extends QuestionnaireForm
isSearchable={ true }
className="autocomlete"
classNamePrefix="react-select"
value={ head_person_citizenship }
value={ head_person_citizenship.code !== null ? head_person_citizenship : undefined }
onChange={ (element) => this._handle_onCitizenshipChange(`head_person.identity_document.citizenship`, element.value) }
required={ true }
isDisabled={ checking }
@ -503,8 +498,8 @@ class Form_3_Signer extends QuestionnaireForm
<div className="form_field">
<label>Адрес регистрации</label>
<AddressSuggests
value={ head_person.identity_document.registration_address.name }
fias={ head_person.identity_document.registration_address.fias_id }
value={ this._checkStrValue(head_person.identity_document.registration_address.name) }
fias={ this._checkStrValue(head_person.identity_document.registration_address.fias_id) }
placeholder="Укажите адрес регистрации"
onChange={ (data) => this._handle_onTextFieldChange("head_person.identity_document.registration_address", data) }
required={ true }
@ -516,7 +511,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="head_person.jobtitle"
name="head_person.jobtitle"
value={ head_person.jobtitle }
value={ this._checkStrValue(head_person.jobtitle) }
placeholder="Укажите должность"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -530,7 +525,7 @@ class Form_3_Signer extends QuestionnaireForm
mask='+7 (999) 999 99 99'
id={ "head_person.telephone" }
name={ "head_person.telephone" }
value={ head_person.telephone }
value={ this._checkStrValue(head_person.telephone) }
placeholder="Введите номер телефона"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -543,7 +538,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id={ "head_person.email" }
name={ "head_person.email" }
value={ head_person.email }
value={ this._checkStrValue(head_person.email) }
placeholder="Введите E-mail"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -557,7 +552,7 @@ class Form_3_Signer extends QuestionnaireForm
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.evo_assignment_date" }
value={ head_person.evo_assignment_date !== "" ? head_person.evo_assignment_date : null }
value={ this._checkStrValue(head_person.evo_assignment_date) !== "" ? this._checkStrValue(head_person.evo_assignment_date) : null }
onChange={ (date) => this._handle_onTextFieldChange("head_person.evo_assignment_date", date) }
required={ true }
disabled={ checking }
@ -582,7 +577,7 @@ class Form_3_Signer extends QuestionnaireForm
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.evo_credentials_dateend" }
value={ head_person.evo_credentials_dateend !== "" ? 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) } }
required={ true }
disabled={ checking }
@ -624,7 +619,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "100%" }}
id="main.individual_executive_oop"
name="main.individual_executive_oop"
value={ main.individual_executive_oop }
value={ this._checkStrValue(main.individual_executive_oop) }
placeholder="Укажите управляющую организацию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -639,7 +634,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "100%" }}
id="main.individual_executive_inn"
name="main.individual_executive_inn"
value={ main.individual_executive_inn }
value={ this._checkStrValue(main.individual_executive_inn) }
placeholder="Введите ИНН"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -653,7 +648,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "100%" }}
id="main.individual_executive_kpp"
name="main.individual_executive_kpp"
value={ main.individual_executive_kpp }
value={ this._checkStrValue(main.individual_executive_kpp) }
placeholder="Введите КПП"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -669,7 +664,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "100%" }}
id="main.individual_executive_docnum"
name="main.individual_executive_docnum"
value={ main.individual_executive_docnum }
value={ this._checkStrValue(main.individual_executive_docnum) }
placeholder="Номер договора"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
@ -683,7 +678,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "100%", }}
id="main.individual_executive_docdate"
name="main.individual_executive_docdate"
value={ main.individual_executive_docdate }
value={ this._checkStrValue(main.individual_executive_docdate) }
placeholder="Дата"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -693,7 +688,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "100%", }}
placeholder="ДД.ММ.ГГГГ"
id={ "main.individual_executive_docdate" }
value={ main.individual_executive_docdate !== "" ? main.individual_executive_docdate : null }
value={ this._checkStrValue(main.individual_executive_docdate) !== "" ? this._checkStrValue(main.individual_executive_docdate) : null }
onChange={ (date) => this._handle_onTextFieldChange("main.individual_executive_docdate", date) }
required={ true }
disabled={ checking }
@ -736,7 +731,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.lastname"
name="signatory_person.lastname"
value={ signatory_person.lastname }
value={ this._checkStrValue(signatory_person.lastname) }
placeholder="Введите фамилию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -749,7 +744,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.firstname"
name="signatory_person.firstname"
value={ signatory_person.firstname }
value={ this._checkStrValue(signatory_person.firstname) }
placeholder="Введите имя"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -762,7 +757,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.middlename"
name="signatory_person.middlename"
value={ signatory_person.middlename }
value={ this._checkStrValue(signatory_person.middlename) }
placeholder="Введите отчество"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
@ -775,7 +770,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.identity_document.seria"
name="signatory_person.identity_document.seria"
value={ signatory_person.identity_document.seria }
value={ this._checkStrValue(signatory_person.identity_document.seria) }
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -788,7 +783,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.identity_document.docnumber"
name="signatory_person.identity_document.docnumber"
value={ signatory_person.identity_document.docnumber }
value={ this._checkStrValue(signatory_person.identity_document.docnumber) }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -804,7 +799,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
id={ "signatory_person.identity_document.issuedate" }
value={ signatory_person.identity_document.issuedate !== "" ? signatory_person.identity_document.issuedate : null }
value={ this._checkStrValue(signatory_person.identity_document.issuedate) !== "" ? this._checkStrValue(signatory_person.identity_document.issuedate) : null }
onChange={ (date) => this._handle_onTextFieldChange("signatory_person.identity_document.issuedate", date) }
required={ true }
disabled={ checking }
@ -814,9 +809,9 @@ class Form_3_Signer extends QuestionnaireForm
<div className="form_field">
<label>Код подразделения</label>
<input type="text"
id="signatory_person.identity_document.icode"
name="signatory_person.identity_document.icode"
value={ signatory_person.identity_document.icode }
id="signatory_person.identity_document.code"
name="signatory_person.identity_document.code"
value={ this._checkStrValue(signatory_person.identity_document.code) }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -830,7 +825,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.identity_document.issueby"
name="signatory_person.identity_document.issueby"
value={ signatory_person.identity_document.issueby }
value={ this._checkStrValue(signatory_person.identity_document.issueby) }
placeholder="Введите наименование подразделения выдавшего документ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -842,7 +837,7 @@ class Form_3_Signer extends QuestionnaireForm
<label>Место рождения</label>
<AddressSuggests
id={ "signatory_person.identity_document.placebirth" }
value={ signatory_person.identity_document.placebirth }
value={ this._checkStrValue(signatory_person.identity_document.placebirth) }
placeholder="Укажите место рождения"
onChange={ (data) => this._handle_onTextFieldChange("signatory_person.identity_document.placebirth", data.name) }
required={ true }
@ -861,7 +856,7 @@ class Form_3_Signer extends QuestionnaireForm
isSearchable={ true }
className="autocomlete"
classNamePrefix="react-select"
value={ signatory_person_citizenship }
value={ signatory_person_citizenship.code !== null ? signatory_person_citizenship : undefined }
onChange={ (element) => this._handle_onCitizenshipChange(`signatory_person.identity_document.citizenship`, element.value) }
required={ true }
isDisabled={ checking }
@ -871,8 +866,8 @@ class Form_3_Signer extends QuestionnaireForm
<div className="form_field">
<label>Адрес регистрации</label>
<AddressSuggests
value={ signatory_person.identity_document.registration_address.name }
fias={ signatory_person.identity_document.registration_address.fias_id }
value={ this._checkStrValue(signatory_person.identity_document.registration_address.name) }
fias={ this._checkStrValue(signatory_person.identity_document.registration_address.fias_id) }
onChange={ (data) => this._handle_onTextFieldChange("signatory_person.identity_document.registration_address", data) }
required={ true }
disabled={ checking }
@ -882,7 +877,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.identity_document.registration_address.title"
name="signatory_person.identity_document.registration_address.title"
value={ signatory_person.identity_document.registration_address.title }
value={ this._checkStrValue(signatory_person.identity_document.registration_address.title) }
placeholder="Введите адрес"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -895,7 +890,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.jobtitle"
name="signatory_person.jobtitle"
value={ signatory_person.jobtitle }
value={ this._checkStrValue(signatory_person.jobtitle) }
placeholder="Укажите должность"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -909,7 +904,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.telephone"
name="signatory_person.telephone"
value={ signatory_person.telephone }
value={ this._checkStrValue(signatory_person.telephone) }
placeholder="Телефон"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -922,7 +917,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.email"
name="signatory_person.email"
value={ signatory_person.email }
value={ this._checkStrValue(signatory_person.email) }
placeholder="E-mail"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -938,7 +933,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.signer_rule_basis"
name="signatory_person.signer_rule_basis"
value={ signatory_person.signer_rule_basis }
value={ this._checkStrValue(signatory_person.signer_rule_basis) }
placeholder="Вид документа"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -951,7 +946,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.signer_rule_basis_add"
name="signatory_person.signer_rule_basis_add"
value={ signatory_person.signer_rule_basis_add }
value={ this._checkStrValue(signatory_person.signer_rule_basis_add) }
placeholder="Наименование документа"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -965,7 +960,7 @@ class Form_3_Signer extends QuestionnaireForm
<input type="text"
id="signatory_person.docnumber"
name="signatory_person.docnumber"
value={ signatory_person.docnumber }
value={ this._checkStrValue(signatory_person.docnumber) }
placeholder="Номер документа"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -979,7 +974,7 @@ class Form_3_Signer extends QuestionnaireForm
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
id={ "signatory_person.docdate" }
value={ signatory_person.docdate !== "" ? signatory_person.docdate : null }
value={ this._checkStrValue(signatory_person.docdate) !== "" ? this._checkStrValue(signatory_person.docdate) : null }
onChange={ (date) => this._handle_onTextFieldChange("signatory_person.docdate", date) }
required={ true }
disabled={ checking }

View File

@ -18,12 +18,14 @@ import { reduxWrapper } from '../../../../store';
import AddressSuggests from "../../AddressSuggests";
import InputMask from 'react-input-mask';
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
import { saveQuestionnaire } from "../../../../actions";
class ShareholderForm extends React.Component
{
_handle_onTextFieldChange = this.props._handle_onTextFieldChange;
_handle_onCheckboxFieldChange = this.props._handle_onCheckboxFieldChange;
_handle_onFieldChange = this.props._handle_onFieldChange;
_checkStrValue = this.props._checkStrValue;
_handle_onCitizenshipChange = (name, value) =>
{
@ -41,15 +43,17 @@ class ShareholderForm extends React.Component
const { index, shareholder, checking } = this.props;
let citizenship = { label: getCitizenshipTitleByCode(shareholder.identity_document.citizenship.code), code: shareholder.identity_document.citizenship.code };
console.log("shareholder", "citizenship", citizenship);
console.log("shareholder", shareholder);
return (
<React.Fragment>
<div className="form_field">
<label>Фамилия</label>
<input type="text"
id={ `founded_persons[${ index }].lastname` }
name={ `founded_persons[${ index }].lastname` }
value={ shareholder.lastname }
id={ `founder_persons[${ index }].lastname` }
name={ `founder_persons[${ index }].lastname` }
value={ this._checkStrValue(shareholder.lastname) }
placeholder="Введите фамилию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -60,9 +64,9 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Имя</label>
<input type="text"
id={ `founded_persons[${ index }].firstname` }
name={ `founded_persons[${ index }].firstname` }
value={ shareholder.firstname }
id={ `founder_persons[${ index }].firstname` }
name={ `founder_persons[${ index }].firstname` }
value={ this._checkStrValue(shareholder.firstname) }
placeholder="Введите имя"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -73,9 +77,9 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Отчество <small>если имеется</small></label>
<input type="text"
id={ `founded_persons[${ index }].middlename` }
name={ `founded_persons[${ index }].middlename` }
value={ shareholder.middlename }
id={ `founder_persons[${ index }].middlename` }
name={ `founder_persons[${ index }].middlename` }
value={ this._checkStrValue(shareholder.middlename) }
placeholder="Введите отчество"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
@ -85,9 +89,9 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Должность <small>если имеется</small></label>
<input type="text"
id={ `founded_persons[${ index }].jobtitle` }
name={ `founded_persons[${ index }].jobtitle` }
value={ shareholder.jobtitle }
id={ `founder_persons[${ index }].jobtitle` }
name={ `founder_persons[${ index }].jobtitle` }
value={ this._checkStrValue(shareholder.jobtitle) }
placeholder="Введите должность"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ false }
@ -98,23 +102,23 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Телефон</label>
<InputMask
mask='+7 (999) 999 99 99'
id={ `founded_persons[${ index }].telephone` }
name={ `founded_persons[${ index }].telephone` }
value={ shareholder.telephone }
placeholder="Введите номер телефона"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking } >
</InputMask>
mask='+7 (999) 999 99 99'
id={ `founder_persons[${ index }].telephone` }
name={ `founder_persons[${ index }].telephone` }
value={ this._checkStrValue(shareholder.telephone) }
placeholder="Введите номер телефона"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Адрес E-mail</label>
<input type="text"
id={ `founded_persons[${ index }].email` }
name={ `founded_persons[${ index }].email` }
value={ shareholder.email }
id={ `founder_persons[${ index }].email` }
name={ `founder_persons[${ index }].email` }
value={ this._checkStrValue(shareholder.email) }
placeholder="Введите E-mail"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -129,9 +133,9 @@ class ShareholderForm extends React.Component
<div className="form_field">
<InputMask
mask='9999'
id={ `founded_persons[${ index }].identity_document.seria` }
name={ `founded_persons[${ index }].identity_document.seria` }
value={ shareholder.identity_document.seria }
id={ `founder_persons[${ index }].identity_document.seria` }
name={ `founder_persons[${ index }].identity_document.seria` }
value={ this._checkStrValue(shareholder.identity_document.seria) }
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -141,9 +145,9 @@ class ShareholderForm extends React.Component
<div className="form_field">
<InputMask
mask='999999'
id={ `founded_persons[${ index }].identity_document.docnumber` }
name={ `founded_persons[${ index }].identity_document.docnumber` }
value={ shareholder.identity_document.docnumber }
id={ `founder_persons[${ index }].identity_document.docnumber` }
name={ `founder_persons[${ index }].identity_document.docnumber` }
value={ this._checkStrValue(shareholder.identity_document.docnumber) }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -162,18 +166,18 @@ class ShareholderForm extends React.Component
<CalendarDatePicker
//style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
id={ `founded_persons[${ index }].identity_document.issuedate` }
value={ shareholder.identity_document.issuedate !== "" ? shareholder.identity_document.issuedate : null }
onChange={ (date) => this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.issuedate`, date) }
id={ `founder_persons[${ index }].identity_document.issuedate` }
value={ this._checkStrValue(shareholder.identity_document.issuedate) !== "" ? this._checkStrValue(shareholder.identity_document.issuedate) : null }
onChange={ (date) => this._handle_onTextFieldChange(`founder_persons[${ index }].identity_document.issuedate`, date) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<input type="text"
id={ `founded_persons[${ index }].identity_document.icode` }
name={ `founded_persons[${ index }].identity_document.icode` }
value={ shareholder.identity_document.icode }
id={ `founder_persons[${ index }].identity_document.code` }
name={ `founder_persons[${ index }].identity_document.code` }
value={ this._checkStrValue(shareholder.identity_document.code) }
placeholder="Код подразделения"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -187,9 +191,9 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Кем выдан</label>
<input type="text"
id={ `founded_persons[${ index }].identity_document.issueby` }
name={ `founded_persons[${ index }].identity_document.issueby` }
value={ shareholder.identity_document.issueby }
id={ `founder_persons[${ index }].identity_document.issueby` }
name={ `founder_persons[${ index }].identity_document.issueby` }
value={ this._checkStrValue(shareholder.identity_document.issueby) }
placeholder="Введите наименование подразделения выдавшего документ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -200,9 +204,9 @@ class ShareholderForm extends React.Component
<div className="form_field" style={{ flex: 1 }}>
<label>Место рождения</label>
<AddressSuggests
id={ `founded_persons[${ index }].identity_document.placebirth` }
value={ shareholder.identity_document.placebirth }
onChange={ (data) => this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.placebirth`, data.title) }
id={ `founder_persons[${ index }].identity_document.placebirth` }
value={ this._checkStrValue(shareholder.identity_document.placebirth) }
onChange={ (data) => this._handle_onTextFieldChange(`founder_persons[${ index }].identity_document.placebirth`, data.title) }
required={ true }
disabled={ checking }
/>
@ -211,16 +215,16 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Гражданство</label>
<Select
id={ `founded_persons[${ index }].identity_document.citizenship` }
name={ `founded_persons[${ index }].identity_document.citizenship` }
value={ citizenship }
id={ `founder_persons[${ index }].identity_document.citizenship` }
name={ `founder_persons[${ index }].identity_document.citizenship` }
options={ [ ...citizenships ] }
placeholder="Выберите страну"
noOptionsMessage={ ({ inputValue }) => !inputValue ? noOptionsText :"Ничего не найдено" }
isSearchable={ true }
className="autocomlete"
classNamePrefix="react-select"
onChange={ (element) => this._handle_onCitizenshipChange(`founded_persons[${ index }].identity_document.citizenship`, element.value) }
value={ citizenship.code !== null ? citizenship : undefined }
onChange={ (element) => this._handle_onCitizenshipChange(`founder_persons[${ index }].identity_document.citizenship`, element.value) }
required={ true }
isDisabled={ checking }
/>
@ -229,10 +233,10 @@ class ShareholderForm extends React.Component
<div className="form_field">
<label>Адрес регистрации</label>
<AddressSuggests
id={ `founded_persons[${ index }].identity_document.registration_address` }
value={ shareholder.identity_document.registration_address.title }
fias={ shareholder.identity_document.registration_address.fias_id }
onChange={ (data) => this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.registration_address`, data) }
id={ `founder_persons[${ index }].identity_document.registration_address` }
value={ this._checkStrValue(shareholder.identity_document.registration_address.name) }
fias={ this._checkStrValue(shareholder.identity_document.registration_address.fias_id) }
onChange={ (data) => this._handle_onTextFieldChange(`founder_persons[${ index }].identity_document.registration_address`, data) }
required={ true }
disabled={ checking }
/>
@ -253,6 +257,7 @@ class Shareholder extends React.Component
_handle_onTextFieldChange = this.props._handle_onTextFieldChange;
_handle_onCheckboxFieldChange = this.props._handle_onCheckboxFieldChange;
_checkStrValue = this.props._checkStrValue;
_checkSignatoryDisabled = (signatory_id) =>
{
@ -286,11 +291,11 @@ class Shareholder extends React.Component
<div className="form_field checkbox">
<input type="checkbox" hidden=""
checked={ shareholder.founder_from_list }
id={ `founded_persons[${ index }].founder_from_list` }
name={ `founded_persons[${ index }].founder_from_list` }
onChange={ (event) => clearSignatorySelection(`founded_persons[${ index }]`, { founder_from_list: !shareholder.founder_from_list ? true : false, lastname: "", firstname: "", middlename: "", no_middle_name: false, }) }
id={ `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, }) }
/>
<label className="unselectable" htmlFor={ `founded_persons[${ index }].founder_from_list` }>Выбрать из списка</label>
<label className="unselectable" htmlFor={ `founder_persons[${ index }].founder_from_list` }>Выбрать из списка</label>
</div>
) }
@ -329,19 +334,19 @@ class Shareholder extends React.Component
return (
<div className="form_field checkbox" key={ s_index }>
<input type="radio" hidden=""
id={ `founded_persons[${ index }].signatory_${ signatory.signatoryid }` }
name={ `founded_persons[${ index }].signatory_${ signatory.signatoryid }` }
id={ `founder_persons[${ index }].signatory_${ signatory.signatoryid }` }
name={ `founder_persons[${ index }].signatory_${ signatory.signatoryid }` }
checked={ signatory.signatoryid === shareholder.signatory_id }
onChange={ () => changeSignatorySelection(`founded_persons[${ index }]`, { ...shareholder, ...{
onChange={ () => changeSignatorySelection(`founder_persons[${ index }]`, { ...shareholder, ...{
founder_from_list: true,
signatory_id: signatory.signatoryid,
lastname: signatory.lastname,
firstname: signatory.firstname,
middlename: signatory.middlename,
lastname: _checkStrValue(signatory.lastname),
firstname: _checkStrValue(signatory.firstname),
middlename: _checkStrValue(signatory.middlename),
} }) }
disabled={ disabled }
/>
<label className="unselectable" style={ disabled ? { opacity: "0.5" } : {} } htmlFor={ `founded_persons[${ index }].signatory_${ signatory.signatoryid }` }>
<label className="unselectable" style={ disabled ? { opacity: "0.5" } : {} } htmlFor={ `founder_persons[${ index }].signatory_${ signatory.signatoryid }` }>
<div className="feed_item user">
<img src="/assets/images/icons/avatar.svg" alt="" />
<div>
@ -367,13 +372,16 @@ class Shareholder extends React.Component
<div className="form_field">
<label>Доля в уставном капитале (%)</label>
<input type="text"
id={ `founded_persons[${ index }].founder_part` }
name={ `founded_persons[${ index }].founder_part` }
value={ shareholder.founder_part }
<InputMask
mask='999'
formatChars={{ '9': '[0-9]', }}
id={ `founder_persons[${ index }].founder_part` }
name={ `founder_persons[${ index }].founder_part` }
value={ this._checkStrValue(shareholder.founder_part) }
placeholder="Укажите размер доли"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value > 100 ? 100 : event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -383,24 +391,24 @@ class Shareholder extends React.Component
<div className="form_field checkbox">
<input type="radio" hidden=""
value="1"
id={ `founded_persons[${ index }].is_beneficial_1` }
name={ `founded_persons[${ index }].is_beneficial` }
id={ `founder_persons[${ index }].is_beneficial_1` }
name={ `founder_persons[${ index }].is_beneficial` }
checked={ shareholder.is_beneficial ? true : false }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, parseInt(event.target.value, 10)) }
disabled={ checking }
/>
<label className="unselectable" htmlFor={ `founded_persons[${ index }].is_beneficial_1` }>Да</label>
<label className="unselectable" htmlFor={ `founder_persons[${ index }].is_beneficial_1` }>Да</label>
</div>
<div className="form_field checkbox">
<input type="radio" hidden=""
value="0"
id={ `founded_persons[${ index }].is_beneficial_0` }
name={ `founded_persons[${ index }].is_beneficial` }
id={ `founder_persons[${ index }].is_beneficial_0` }
name={ `founder_persons[${ index }].is_beneficial` }
checked={ shareholder.is_beneficial ? false : true }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, parseInt(event.target.value, 10)) }
disabled={ checking }
/>
<label className="unselectable" htmlFor={ `founded_persons[${ index }].is_beneficial_0` }>Нет</label>
<label className="unselectable" htmlFor={ `founder_persons[${ index }].is_beneficial_0` }>Нет</label>
</div>
</div>
</div>
@ -417,37 +425,37 @@ class Form_4_Shareholders extends QuestionnaireForm
{
super(props);
this.state = {
founded_persons: [],
founded_persons_template: {
founder_persons: [],
founder_persons_template: {
signatory_id: null,
lastname: "",
firstname: "",
middlename: "",
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: "",
telephone: "",
email: "",
jobtitle: null,
telephone: null,
email: null,
founder_from_list: true,
founder_number: 0,
founder_part: "",
founder_part: null,
is_beneficial: false,
identity_document:
{
doctype: "",
seria: "",
docnumber: "",
issuedate: "",
icode: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
doctype: null,
seria: null,
docnumber: null,
issuedate: null,
code: null,
issueby: null,
issueby_search_dadata: null,
placebirth: null,
citizenship: {
title: "",
code: "",
title: null,
code: null,
},
registration_address: {
title: "",
fias_id: "",
name: null,
fias_id: null,
}
}
},
@ -458,7 +466,7 @@ class Form_4_Shareholders extends QuestionnaireForm
static getDerivedStateFromProps(nextProps, prevState)
{
return {
founded_persons: nextProps.questionnaire.founded_persons,
founder_persons: nextProps.questionnaire.founder_persons,
};
}
@ -466,12 +474,12 @@ class Form_4_Shareholders extends QuestionnaireForm
{
console.log("Form_4_Shareholders", "this.state", this.state);
console.log("Form_4_Shareholders", "global.store.getState()", global.store.getState());
const founded_persons_template = JSON.parse(JSON.stringify(this.state.founded_persons_template));
const founder_persons_template = JSON.parse(JSON.stringify(this.state.founder_persons_template));
if(this.state.founded_persons.length === 0)
if(this.state.founder_persons.length === 0)
{
this._updateQuestionnaire({
founded_persons: [{ ...founded_persons_template, ...{ founder_from_list: false, founder_number: this.state.founded_persons.length + 1 } }],
founder_persons: [{ ...founder_persons_template, ...{ founder_from_list: false, founder_number: this.state.founder_persons.length + 1 } }],
});
}
}
@ -480,36 +488,36 @@ class Form_4_Shareholders extends QuestionnaireForm
{
console.log("_handle_onAddShareholder");
const founded_persons = [ ...this.state.founded_persons ];
const founded_persons_template = JSON.parse(JSON.stringify(this.state.founded_persons_template));
const founder_persons = [ ...this.state.founder_persons ];
const founder_persons_template = JSON.parse(JSON.stringify(this.state.founder_persons_template));
console.log("_handle_onAddShareholder", { founded_persons_template });
console.log("_handle_onAddShareholder", { founder_persons_template });
if(founded_persons.length < 4)
if(founder_persons.length < 4)
{
founded_persons.push(founded_persons_template);
founder_persons.push(founder_persons_template);
this._updateQuestionnaire({
founded_persons,
founder_persons,
});
}
}
_handle_onRemoveShareholder = (index) =>
{
const founded_persons = [ ...this.state.founded_persons ];
const founder_persons = [ ...this.state.founder_persons ];
founded_persons.splice(index, 1);
founder_persons.splice(index, 1);
this._updateQuestionnaire({
founded_persons,
founder_persons,
});
}
_handle_onClearSignatorySelection = (name, values) =>
{
const founded_persons_template = JSON.parse(JSON.stringify(this.state.founded_persons_template));
const update = { ...founded_persons_template , ...values };
const founder_persons_template = JSON.parse(JSON.stringify(this.state.founder_persons_template));
const update = { ...founder_persons_template , ...values };
console.log("_handle_onClearSignatorySelection", update);
this._handle_onFieldChange(name, update );
}
@ -530,13 +538,14 @@ class Form_4_Shareholders extends QuestionnaireForm
this._handle_onCheckboxFieldChange("step", 5);
setTimeout(() =>
{
saveQuestionnaire();
this.props.onNextStep("regulatory");
}, 10);
}
_checkDisabled = () =>
{
const { founded_persons } = this.state;
const { founder_persons } = this.state;
const check_all = [
"founder_part",
];
@ -556,22 +565,22 @@ class Form_4_Shareholders extends QuestionnaireForm
"identity_document.registration_address.title",
];
for(let f in founded_persons)
for(let f in founder_persons)
{
for(let i in check_all)
{
if(_get(founded_persons[f], check_all[i]) === "")
if(_get(founder_persons[f], check_all[i]) === "")
{
console.log("1. EMPTY", f, check_all[i]);
return true;
}
}
if(!founded_persons[f].founder_from_list)
if(!founder_persons[f].founder_from_list)
{
for(let i in check)
{
if(_get(founded_persons[f], check[i]) === "")
if(_get(founder_persons[f], check[i]) === "")
{
console.log("2. EMPTY", f, check[i]);
return true;
@ -580,11 +589,11 @@ class Form_4_Shareholders extends QuestionnaireForm
}
else
{
if(founded_persons[f].signatory_id === null)
if(founder_persons[f].signatory_id === null)
{
console.log("3. EMPTY", f, "signatory_id");
console.log("founded_persons[f]");
console.log(founded_persons[f]);
console.log("founder_persons[f]");
console.log(founder_persons[f]);
return true;
}
@ -597,7 +606,7 @@ class Form_4_Shareholders extends QuestionnaireForm
render()
{
const { signatories, checking } = this.props;
const { founded_persons, loading, address, } = this.state;
const { founder_persons, loading, address, } = this.state;
return (
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_4 ${ checking && "disabled" }`}>
@ -609,15 +618,16 @@ class Form_4_Shareholders extends QuestionnaireForm
полагать, что бенефициарным владельцем является иное физическое лицо. В случае, если бенефициарным владельцем являются несколько человек, сведения предоставляются в отношении каждого.</small>
</p>
{ founded_persons.map((shareholder, index) => (
{ founder_persons.map((shareholder, index) => (
<Shareholder
key={ index }
index={ index }
shareholders={ founded_persons }
shareholders={ founder_persons }
address={ address }
_handle_onTextFieldChange={ this._handle_onTextFieldChange }
_handle_onCheckboxFieldChange={ this._handle_onCheckboxFieldChange }
_handle_onFieldChange={ this._handle_onFieldChange }
_checkStrValue={ this._checkStrValue }
removeShareholder={ this._handle_onRemoveShareholder }
clearSignatorySelection={ this._handle_onClearSignatorySelection }
changeSignatorySelection={ this._handle_onChangeSignatorySelection }
@ -628,7 +638,7 @@ class Form_4_Shareholders extends QuestionnaireForm
{ !checking && (
<div className="action">
{ founded_persons.length < 4 ? (
{ founder_persons.length < 4 ? (
<button className="button button-blue" disabled={ false } onClick={ (event) => { event.preventDefault(); this._handle_onAddShareholder(); }}>Добавить еще одного владельца</button>
) : (
<div></div>

View File

@ -11,6 +11,7 @@ import { withRouter } from 'next/router';
import QuestionnaireForm from "../QuestionnaireForm";
import { reduxWrapper } from '../../../../store';
import { saveQuestionnaire } from "../../../../actions";
class Form_5_Regulatory extends QuestionnaireForm
{
@ -18,28 +19,7 @@ class Form_5_Regulatory extends QuestionnaireForm
{
super(props);
this.state = {
main: {
title: "",
inn: "",
kpp: "",
email: "",
telephone: "",
websiteurl: "",
financial_loan: "",
is_individual_executive: false,
individual_executive_inn: "",
individual_executive_kpp: "",
individual_executive_oop: "",
individual_executive_docnum: "",
individual_executive_docdate: "",
high_level: "",
board_of_directors: "",
collective_executive: "",
individual_executive: "",
other_control: "",
nko: false,
accept: false,
},
main: {},
loading: false,
};
}
@ -57,14 +37,15 @@ class Form_5_Regulatory extends QuestionnaireForm
_handle_onFormSubmit = (event) =>
{
const { main } = this.state;
const { nko } = this.state;
event.preventDefault();
console.log("Form_5_Regulatory", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 6);
setTimeout(() =>
{
if(main.nko)
saveQuestionnaire();
if(nko)
{
this.props.onNextStep("non-profit");
}
@ -82,26 +63,20 @@ class Form_5_Regulatory extends QuestionnaireForm
for(let i in check)
{
if(main[check[i]] === "")
if(this.state.main[check[i]] === "")
{
return true;
}
}
/*
if(!main.accept)
{
return true;
}
*/
return false;
}
render()
{
const { checking } = this.props;
const { main, loading } = this.state;
const { main, loading } = this.state;
const { high_level, board_of_directors, collective_executive, individual_executive, other_control, } = main;
return (
<React.Fragment>
@ -125,7 +100,7 @@ class Form_5_Regulatory extends QuestionnaireForm
<textarea type="text"
id={ "main.high_level" }
name={ "main.high_level" }
value={ main.high_level }
value={ this._checkStrValue(high_level) }
placeholder="Введите наименование органа управления"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -140,7 +115,7 @@ class Form_5_Regulatory extends QuestionnaireForm
<input type="text"
id={ "main.board_of_directors" }
name={ "main.board_of_directors" }
value={ main.board_of_directors }
value={ this._checkStrValue(board_of_directors) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -155,7 +130,7 @@ class Form_5_Regulatory extends QuestionnaireForm
<textarea type="text"
id={ "main.collective_executive" }
name={ "main.collective_executive" }
value={ main.collective_executive }
value={ this._checkStrValue(collective_executive) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -170,7 +145,7 @@ class Form_5_Regulatory extends QuestionnaireForm
<textarea type="text"
id={ "main.individual_executive" }
name={ "main.individual_executive" }
value={ main.individual_executive }
value={ this._checkStrValue(individual_executive) }
placeholder="Введите наименование должности"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
@ -182,38 +157,12 @@ class Form_5_Regulatory extends QuestionnaireForm
<input type="text"
id={ "main.other_control" }
name={ "main.other_control" }
value={ main.other_control }
value={ this._checkStrValue(other_control) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
/>
</div>
{/*}
<div className="form_field">
<input type="checkbox" hidden=""
id={ "main.accept" }
name={ "main.accept" }
checked={ main.accept }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !main.accept ? true : false) }
required={ true }
/>
<label className="unselectable" htmlFor={ "main.accept" } style={{ width: "100%" }}>Настоящим я заявляю, что перечисленные в анкете представители лизингополучателя не являются:</label>
</div>
<ul>
<li style={{ lineHeight: "18px" }}>иностранным публичным должностным лицом (ИПДЛ) или родственниками ИПДЛ (супруг, близкий родственник
(родственник по прямой восходящей и нисходящей линии (родитель и ребенок, дедушка, бабушка и внук), полнородный и неполнородный (имеющий общих отца или мать) брат и сестра, усыновитель и усыновленный);</li>
<li style={{ lineHeight: "18px" }}>должностным лицом публичных международных организаций;</li>
<li style={{ lineHeight: "18px" }}>публичным должностным лицом Российской Федерации.</li>
</ul>
<ul>
<li style={{ lineHeight: "18px" }}>Сведения о целях установления отношений заключение договора лизинга.</li>
<li style={{ lineHeight: "18px" }}>Сведения о целях финансово-хозяйственной деятельности получение прибыли (кроме НКО).</li>
<li style={{ lineHeight: "18px" }}>Сведения о характере деловых отношений длящиеся.</li>
<li style={{ lineHeight: "18px" }}>Сведения об источниках происхождения денежных средств приносящая доход деятельность (кроме НКО и физ.лиц).</li>
</ul>
{*/}
{ !checking && (
<div className="action">
<div></div>

View File

@ -11,6 +11,7 @@ import { withRouter } from 'next/router';
import QuestionnaireForm from "../QuestionnaireForm";
import { reduxWrapper } from '../../../../store';
import { saveQuestionnaire } from "../../../../actions";
class Form_6_NonProfit extends QuestionnaireForm
{
@ -23,11 +24,11 @@ class Form_6_NonProfit extends QuestionnaireForm
fin_source_donate: false,
fin_source_fees: false,
fin_source_another: false,
fin_source_another_description: "",
fin_source_another_description: null,
foreign_payers: false,
fin_goals_cars: "",
fin_goals_trucks: "",
fin_goals_special: "",
fin_goals_cars: null,
fin_goals_trucks: null,
fin_goals_special: null,
},
loading: false,
};
@ -52,6 +53,7 @@ class Form_6_NonProfit extends QuestionnaireForm
this._handle_onCheckboxFieldChange("step", 7);
setTimeout(() =>
{
saveQuestionnaire();
this.props.onNextStep("check");
}, 10);
}
@ -70,13 +72,13 @@ class Form_6_NonProfit extends QuestionnaireForm
{
const { non_profit } = this.state;
const check = ["fin_goals_cars", "fin_goals_trucks", "fin_goals_special"];
let need = false;
let need = true;
for(let i in check)
{
if(non_profit[check[i]] === "")
if(non_profit[check[i]] !== null && non_profit[check[i]] !== "")
{
need = true;
need = false;
}
}
@ -160,7 +162,7 @@ class Form_6_NonProfit extends QuestionnaireForm
<input type="text"
id="non_profit.fin_source_another_description"
name="non_profit.fin_source_another_description"
value={ 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 }
placeholder="Укажите источник"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
@ -206,7 +208,7 @@ class Form_6_NonProfit extends QuestionnaireForm
<input type="text"
id="non_profit.fin_goals_cars"
name="non_profit.fin_goals_cars"
value={ non_profit.fin_goals_cars }
value={ this._checkStrValue(non_profit.fin_goals_cars) }
placeholder="Введите данные"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
required={ true }
@ -219,7 +221,7 @@ class Form_6_NonProfit extends QuestionnaireForm
<input type="text"
id="non_profit.fin_goals_trucks"
name="non_profit.fin_goals_trucks"
value={ non_profit.fin_goals_trucks }
value={ this._checkStrValue(non_profit.fin_goals_trucks) }
placeholder="Введите данные"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
required={ true }
@ -232,7 +234,7 @@ class Form_6_NonProfit extends QuestionnaireForm
<input type="text"
id="non_profit.fin_goals_special"
name="non_profit.fin_goals_special"
value={ non_profit.fin_goals_special }
value={ this._checkStrValue(non_profit.fin_goals_special) }
placeholder="Введите данные"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
required={ true }

View File

@ -38,7 +38,7 @@ class Form_7_Check extends QuestionnaireForm
head_person_files: [],
signatory_person: {},
signatory_person_files: [],
founded_persons: [],
founder_persons: [],
client_contacts: {},
non_profit: {},
personal_data_consent: false,
@ -60,7 +60,7 @@ class Form_7_Check extends QuestionnaireForm
head_person_files: nextProps.head_person_files,
signatory_person: nextProps.signatory_person,
signatory_person_files: nextProps.signatory_person_files,
founded_persons: nextProps.founded_persons,
founder_persons: nextProps.founder_persons,
client_contacts: nextProps.client_contacts,
non_profit: nextProps.non_profit,
personal_data_consent: nextProps.personal_data_consent,
@ -127,7 +127,7 @@ class Form_7_Check extends QuestionnaireForm
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !personal_data_consent ? true : false) }
disabled={ false }
/>
<label htmlFor="personal_data_consent" className="unselectable">Даю согласие на&nbsp;<a style={{ cursor: "pointer", }} onClick={ () => { this.setState({ modal_show_personal_data: true, }) } }>обработку персональных данных и уточняю статус ПДЛ</a></label>
<label htmlFor="personal_data_consent" className="unselectable">Даю согласие на&nbsp;<a style={{ cursor: "pointer", }} onClick={ (event) => { event.stopPropagation(); event.preventDefault(); this.setState({ modal_show_personal_data: true, }) } }>обработку персональных данных и уточняю статус ПДЛ</a></label>
</div>
</div>
<div className="action">
@ -156,13 +156,6 @@ class Form_7_Check extends QuestionnaireForm
<li style={{ lineHeight: "18px" }}>должностным лицом публичных международных организаций;</li>
<li style={{ lineHeight: "18px" }}>публичным должностным лицом Российской Федерации.</li>
</ul>
<ul>
<li style={{ lineHeight: "18px" }}>Сведения о целях установления отношений заключение договора лизинга.</li>
<li style={{ lineHeight: "18px" }}>Сведения о целях финансово-хозяйственной деятельности получение прибыли (кроме НКО).</li>
<li style={{ lineHeight: "18px" }}>Сведения о характере деловых отношений длящиеся.</li>
<li style={{ lineHeight: "18px" }}>Сведения об источниках происхождения денежных средств приносящая доход деятельность (кроме НКО и физ.лиц).</li>
</ul>
</div>
</Modal>
@ -183,7 +176,7 @@ function mapStateToProps(state, ownProps)
head_person_files: state.questionnaire.head_person_files,
signatory_person: state.questionnaire.signatory_person,
signatory_person_files: state.questionnaire.signatory_person_files,
founded_persons: state.questionnaire.founded_persons,
founder_persons: state.questionnaire.founder_persons,
client_contacts: state.questionnaire.client_contacts,
non_profit: state.questionnaire.non_profit,
personal_data_consent: state.questionnaire.personal_data_consent,

View File

@ -143,7 +143,7 @@ function mapStateToProps(state, ownProps)
head_person_files: state.questionnaire.head_person_files,
signatory_person: state.questionnaire.signatory_person,
signatory_person_files: state.questionnaire.signatory_person_files,
founded_persons: state.questionnaire.founded_persons,
founder_persons: state.questionnaire.founder_persons,
client_contacts: state.questionnaire.client_contacts,
non_profit: state.questionnaire.non_profit,
}

View File

@ -36,6 +36,11 @@ export default class QuestionnaireForm extends React.Component
});
}
_checkStrValue = (value) =>
{
return value !== null ? value.toString() : "";
}
_getAddress = (name, text) =>
{
return new Promise((resolve, reject) =>

View File

@ -55,7 +55,7 @@ const fields = {
telephone: { name: "signer_phone", type: "text", bind: null },
email: { name: "signer_email", type: "text", bind: null },
},
founded_persons:
founder_persons:
[
{
fullname: { name: "shareholder_1_fullname", type: "text", bind: null, size: 6 },
@ -143,7 +143,7 @@ export default async function handler(req, res)
for(let group in fields)
{
if(group === "founded_persons")
if(group === "founder_persons")
{
for(let p in questionnaire[group])
{
@ -157,10 +157,10 @@ export default async function handler(req, res)
}
else if(field === "personal")
{
const { citizenship, doctype, seria, docnumber, icode, issueby, issuedate, } = questionnaire[group][p].identity_document;
const { citizenship, doctype, seria, docnumber, code, issueby, issuedate, } = questionnaire[group][p].identity_document;
fields[group][p][field].bind = form.getTextField(fields[group][p][field].name);
if(fields[group][p][field].size !== undefined) { fields[group][p][field].bind.setFontSize(fields[group][p][field].size); }
fields[group][p][field].bind.setText(`Гражданство: ${ citizenship.title }, паспорт ${ seria } ${ docnumber }, выдан \n${ issueby }, ${ icode } ${ moment(issuedate).format("DD.MM.YYYY") }`.toUpperCase());
fields[group][p][field].bind.setText(`Гражданство: ${ citizenship.title }, паспорт ${ seria.toString() } ${ docnumber.toString() }, выдан \n${ issueby.toString() }, ${ code.toString() } ${ moment(issuedate).format("DD.MM.YYYY") }`.toUpperCase());
}
else if(field === "registration")
{
@ -169,7 +169,7 @@ export default async function handler(req, res)
{
fields[group][p][field].bind = form.getTextField(fields[group][p][field].name);
if(fields[group][p][field].size !== undefined) { fields[group][p][field].bind.setFontSize(fields[group][p][field].size); }
fields[group][p][field].bind.setText(registration_address.title.toUpperCase());
fields[group][p][field].bind.setText(registration_address.title.toString().toUpperCase());
}
}
else
@ -205,7 +205,7 @@ export default async function handler(req, res)
{
fields[group][p][field].bind = form.getTextField(fields[group][p][field].name);
if(fields[group][p][field].size !== undefined) { fields[group][p][field].bind.setFontSize(fields[group][p][field].size); }
fields[group][p][field].bind.setText(questionnaire[group][p][field]);
fields[group][p][field].bind.setText(questionnaire[group][p][field].toString());
}
}
}
@ -290,7 +290,7 @@ export default async function handler(req, res)
}
else
{
fields[group][field].bind.setText(questionnaire[group][field].toUpperCase());
fields[group][field].bind.setText(questionnaire[group][field].toString().toUpperCase());
}
}
}

View File

@ -4,9 +4,10 @@ import { Cookies } from 'react-cookie';
import cookie from 'cookie';
import moment from 'moment';
import jwt from 'jsonwebtoken';
import { cors } from '../../../lib/cors';
import { inspect } from 'util';
import md5 from 'md5';
import { cors } from '../../../lib/cors';
import RedisClient from '../../../lib/RedisClient';
/*
@ -38,9 +39,8 @@ export default async function handler(req, res)
{
const key = md5(`questionnaire_${ client_jwt_decoded.acc_number }`);
const questionnaire = await RedisClient.get(key);
console.error("JSON.parse(questionnaire)");
console.error(JSON.parse(questionnaire));
console.log("JSON.parse(questionnaire)");
console.log(JSON.parse(questionnaire));
res.status(200).json(JSON.parse(questionnaire));
}

View File

@ -5,9 +5,8 @@ import { Cookies } from 'react-cookie';
import cookie from 'cookie';
import moment from 'moment';
import jwt from 'jsonwebtoken';
import Redis from 'ioredis';
import md5 from 'md5';
import { inspect } from 'util';
import md5 from 'md5';
import { cors } from '../../../lib/cors';
import RedisClient from '../../../lib/RedisClient';

View File

@ -100,50 +100,28 @@ export const defaultState = {
appeal: null,
request: null,
},
questionnaire_main: {
title: "",
inn: "",
kpp: "",
email: "",
telephone: "",
websiteurl: "",
financial_loan: "",
is_individual_executive: false,
individual_executive_inn: "",
individual_executive_kpp: "",
individual_executive_oop: "",
individual_executive_docnum: "",
individual_executive_docdate: "",
high_level: "",
board_of_directors: "",
collective_executive: "",
individual_executive: "",
other_control: "",
nko: false,
accept: false,
},
questionnaire: {
step: 1,
status: "empty",
main: {
title: "",
inn: "",
kpp: "",
email: "",
telephone: "",
websiteurl: "",
financial_loan: "",
title: null,
inn: null,
kpp: null,
email: null,
telephone: null,
websiteurl: null,
financial_loan: null,
is_individual_executive: false,
individual_executive_inn: "",
individual_executive_kpp: "",
individual_executive_oop: "",
individual_executive_docnum: "",
individual_executive_docdate: "",
high_level: "",
board_of_directors: "",
collective_executive: "",
individual_executive: "",
other_control: "",
individual_executive_inn: null,
individual_executive_kpp: null,
individual_executive_oop: null,
individual_executive_docnum: null,
individual_executive_docdate: null,
high_level: null,
board_of_directors: null,
collective_executive: null,
individual_executive: null,
other_control: null,
nko: false,
accept: false,
},
@ -151,117 +129,117 @@ export const defaultState = {
contacts: {
address_type: "legal",
legal_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
},
fact_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
},
postal_address: {
name: "",
fias_id: "",
},
name: null,
fias_id: null,
},
},
head_person: {
lastname: "",
firstname: "",
middlename: "",
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: "Генеральный директор",
telephone: "",
email: "",
telephone: null,
email: null,
identity_document: {
doctype: "",
seria: "",
docnumber: "",
issuedate: "",
code: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
doctype: null,
seria: null,
docnumber: null,
issuedate: null,
code: null,
issueby: null,
issueby_search_dadata: null,
placebirth: null,
citizenship: {
title: "",
code: "",
title: null,
code: null,
},
registration_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
}
},
evo_assignment_date: "",
evo_credentials_dateend: "",
evo_assignment_date: null,
evo_credentials_dateend: null,
evo_indefinite: false,
},
head_person_files: [],
signatory_person: {
not_head_person: false,
lastname: "",
firstname: "",
middlename: "",
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: "",
signer_rule_basis: "",
signer_rule_basis_add: "",
docdate: "",
docnumber: "",
jobtitle: null,
signer_rule_basis: null,
signer_rule_basis_add: null,
docdate: null,
docnumber: null,
delegation_agreement: false,
telephone: "",
email: "",
telephone: null,
email: null,
identity_document: {
docype: "",
seria: "",
docnumber: "",
issuedate: "",
icode: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
docype: null,
seria: null,
docnumber: null,
issuedate: null,
code: null,
issueby: null,
issueby_search_dadata: null,
placebirth: null,
citizenship: {
title: "",
code: "",
title: null,
code: null,
},
registration_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
}
}
},
signatory_person_files: [],
founded_persons: [],
founder_persons: [],
client_contacts: {
lastname: "",
firstname: "",
middlename: "",
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: "",
assignment_date: "",
jobtitle: null,
assignment_date: null,
indefinite: false,
credentials_dateend: "",
telephone: "",
email: "",
signer_rule_basis: "",
signer_rule_basis_add: "",
docdate: "",
docnumber: "",
credentials_dateend: null,
telephone: null,
email: null,
signer_rule_basis: null,
signer_rule_basis_add: null,
docdate: null,
docnumber: null,
delegation_agreement: false,
functiontype: "",
functiontype: null,
identity_document: {
doctype: "",
seria: "",
docnumber: "",
issuedate: "",
code: "",
issueby: "",
issueby_search_dadata: "",
placebirth: "",
doctype: null,
seria: null,
docnumber: null,
issuedate: null,
code: null,
issueby: null,
issueby_search_dadata: null,
placebirth: null,
citizenship: {
title: "",
code: "",
title: null,
code: null,
},
registration_address: {
name: "",
fias_id: "",
name: null,
fias_id: null,
}
}
},
@ -270,11 +248,11 @@ export const defaultState = {
fin_source_donate: false,
fin_source_fees: false,
fin_source_another: false,
fin_source_another_description: "",
fin_source_another_description: null,
foreign_payers: false,
fin_goals_cars: "",
fin_goals_trucks: "",
fin_goals_special: "",
fin_goals_cars: null,
fin_goals_trucks: null,
fin_goals_special: null,
},
personal_data_consent: false,
},