large update on questionnaire markup & logic

This commit is contained in:
merelendor 2023-04-06 13:46:32 +03:00
parent 4d87fb6c2f
commit 27ca486caa
14 changed files with 2235 additions and 411 deletions

View File

@ -8,6 +8,7 @@ import { eachSeries, each } from "async";
import * as actionTypes from '../constants/actionTypes';
import { getCitizenshipTitleByCode } from '../utils/citizenship';
import { questionnaire_template } from '../reducers/initialState';
if(process.browser)
{
@ -52,7 +53,7 @@ export const getQuestionnaire = ({ dispatch, id }) =>
.then((response) =>
{
console.log("ACTION", "questionnaire", "getQuestionnaire()", "response", response.data);
const founder_persons_template = {
signatory_id: null,
lastname: "",
@ -97,24 +98,24 @@ export const getQuestionnaire = ({ dispatch, id }) =>
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);
@ -124,9 +125,9 @@ export const getQuestionnaire = ({ dispatch, id }) =>
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(() => {})
@ -193,6 +194,17 @@ export const updateQuestionnaire = ({ dispatch, questionnaire }) =>
});
}
export const resetQuestionnaire = ({ dispatch, id }) =>
{
const template = JSON.parse(JSON.stringify(questionnaire_template));
dispatch({ type: actionTypes.QUESTIONNAIRE_UPDATE, data: { questionnaire: template, } });
saveQuestionnaire();
setTimeout(() =>
{
getQuestionnaire({ dispatch, id });
}, 10);
}
export const uploadAttachmentFile = (file) =>
{
console.log("ACTION", "questionnaireActions", "uploadAttachmentFile()", { file });
@ -222,6 +234,14 @@ export const uploadAttachmentFile = (file) =>
});
}
export const removeAttachmentFiles = (files) =>
{
for(let i in files)
{
removeAttachmentFile(files[i].id);
}
}
export const removeAttachmentFile = (id) =>
{
console.log("ACTION", "questionnaireActions", "removeAttachmentFile()", { id });

View File

@ -55,6 +55,7 @@ class Form_1_Main extends QuestionnaireForm
fin_goals_special: "",
},
step: 1,
status: "empty",
loading: false,
};
}
@ -64,6 +65,7 @@ class Form_1_Main extends QuestionnaireForm
return {
main: nextProps.questionnaire.main,
step: nextProps.questionnaire.step,
status: nextProps.questionnaire.status,
};
}
@ -109,8 +111,7 @@ class Form_1_Main extends QuestionnaireForm
{
event.preventDefault();
this._handle_onFieldChange("status", "draft");
this._handle_onCheckboxFieldChange("step", 2);
this._handle_onJoinChange({ status: "draft", step: 2 });
setTimeout(() =>
{
saveQuestionnaire();
@ -134,7 +135,7 @@ class Form_1_Main extends QuestionnaireForm
render()
{
const { company, checking } = this.props;
const { loading, main } = this.state;
const { loading, main, status } = this.state;
const firstLetter = /(?!.*[DFIOQU])[A-VXY]/i;
const letter = /(?!.*[DFIOQU])[A-Z]/i;
const digit = /[0-9]/;
@ -146,7 +147,7 @@ class Form_1_Main extends QuestionnaireForm
<p className="title">1. Информация о лизингополучателе</p>
<div className="form_field">
<label>Краткое наименование <sup className="requared_label">*</sup></label>
<label>Краткое наименование <sup className="required_label">*</sup></label>
<input type="text"
id="main.title"
name="main.title"
@ -160,7 +161,7 @@ class Form_1_Main extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>ИНН</label>
<label>ИНН <sup className="required_label">*</sup></label>
<input type="text"
id="main.inn"
name="main.inn"
@ -174,7 +175,7 @@ class Form_1_Main extends QuestionnaireForm
</div>
{ company.inn.length < 11 && (
<div className="form_field">
<label>КПП</label>
<label>КПП <sup className="required_label">*</sup></label>
<input type="text"
id="main.kpp"
name="main.kpp"
@ -190,7 +191,7 @@ class Form_1_Main extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>Телефон</label>
<label>Телефон <sup className="required_label">*</sup></label>
<InputMask
mask='+7 (999) 999 99 99'
id="main.telephone"
@ -201,7 +202,6 @@ class Form_1_Main extends QuestionnaireForm
required={ true }
disabled={ checking } >
</InputMask>
</div>
<div className="form_field">
@ -218,7 +218,7 @@ class Form_1_Main extends QuestionnaireForm
</div>
<div className="form_field">
<label>E-mail</label>
<label>E-mail <sup className="required_label">*</sup></label>
<input type="email"
id="main.email"
name="main.email"
@ -231,12 +231,13 @@ class Form_1_Main extends QuestionnaireForm
</div>
<div className="form_field">
<label>Финансовая нагрузка</label>
<label>Финансовая нагрузка <sup className="required_label">*</sup></label>
<CurrencyInput
id="main.financial_loan"
name="main.financial_loan"
value={ this._checkStrValue(main.financial_loan) }
value={ this._checkStrValue(main.financial_loan) !== "" ? this._checkStrValue(main.financial_loan) : null }
precision="2"
selectAllOnFocus={ true }
placeholder="Укажите сумму"
onChangeEvent={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
@ -275,12 +276,18 @@ class Form_1_Main extends QuestionnaireForm
) }
{ !checking && (
<div className="action">
<div className="action" style={{ flexDirection: "column" }}>
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
{ loading ? (
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
{ status !== "empty" && (
<>
<br/><br/>
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
</>
)}
</div>
) }
</form>

View File

@ -38,6 +38,7 @@ class Form_2_Contacts extends QuestionnaireForm
fias_id: null,
},
},
step: 1,
};
}
@ -45,6 +46,8 @@ class Form_2_Contacts extends QuestionnaireForm
{
return {
contacts: nextProps.questionnaire.contacts,
step: nextProps.questionnaire.step,
status: nextProps.questionnaire.status,
};
}
@ -63,7 +66,7 @@ class Form_2_Contacts extends QuestionnaireForm
{
event.preventDefault();
this._handle_onCheckboxFieldChange("step", 3);
this._handle_onJoinChange({ status: "draft", step: 3 });
setTimeout(() =>
{
saveQuestionnaire();
@ -98,7 +101,7 @@ class Form_2_Contacts extends QuestionnaireForm
render()
{
const { company, checking } = this.props;
const { contacts, loading } = this.state;
const { contacts, loading, status, step } = this.state;
const { address_type, legal_address, fact_address, postal_address, } = contacts;
return (
@ -107,13 +110,13 @@ class Form_2_Contacts extends QuestionnaireForm
<p className="title">2. Адреса лизингополучателя</p>
<div className="form_field">
<label>Фактический адрес</label>
<label>Фактический адрес { address_type === "fact" && <sup className="required_label">*</sup> }</label>
<AddressSuggests
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 }
disabled={ checking ? true : address_type === "fact" ? false : true }
/>
<p>для юр.диц - заполняется, если отличается от указанного в ЕГРЮЛ; для ИП - заполняется всегда</p>
</div>
@ -159,7 +162,7 @@ class Form_2_Contacts extends QuestionnaireForm
disabled={ checking }
/>
<label htmlFor="contacts.address_type_postal" className="unselectable" style={{ width: "100%" }}>
<span>По следующему адресу</span>
<span>По следующему адресу { address_type === "postal" && <sup className="required_label">*</sup> }</span>
<AddressSuggests
value={ this._checkStrValue(postal_address.name) }
fias={ this._checkStrValue(postal_address.fias_id) }
@ -179,6 +182,12 @@ class Form_2_Contacts extends QuestionnaireForm
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
{ status !== "empty" && (
<>
<br/><br/>
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
</>
) }
</div>
) }
</form>

View File

@ -23,7 +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";
import { removeAttachmentFiles, saveQuestionnaire } from "../../../../actions";
class Form_3_Signer extends QuestionnaireForm
{
@ -114,13 +114,15 @@ class Form_3_Signer extends QuestionnaireForm
}
}
},
individual_executive_files: [],
delegation_files: [],
head_person_files: [],
signatory_person_files: [],
personal_data_consent: false,
loading: false,
modal_show_personal_data: false,
step: 1,
status: "empty",
};
}
@ -130,9 +132,10 @@ class Form_3_Signer extends QuestionnaireForm
main: nextProps.questionnaire.main,
head_person: nextProps.questionnaire.head_person,
head_person_files: nextProps.questionnaire.head_person_files,
individual_executive_files: nextProps.questionnaire.individual_executive_files,
delegation_files: nextProps.questionnaire.delegation_files,
signatory_person: nextProps.questionnaire.signatory_person,
signatory_person_files: nextProps.questionnaire.signatory_person_files,
status: nextProps.questionnaire.status,
};
}
@ -166,6 +169,30 @@ class Form_3_Signer extends QuestionnaireForm
}
}
_handle_onChangeDelegationAgreement = () =>
{
const { signatory_person, delegation_files } = this.state;
if(!signatory_person.delegation_agreement)
{
this._handle_onCheckboxFieldChange("signatory_person.delegation_agreement", true);
}
else
{
removeAttachmentFiles(delegation_files);
this._handle_onBranchChange([
{ name: "signatory_person.delegation_agreement", value: false, },
{ name: "main.individual_executive_inn", value: "", },
{ name: "main.individual_executive_kpp", value: "", },
{ name: "main.individual_executive_oop", value: "", },
{ name: "main.individual_executive_docnum", value: "", },
{ name: "main.individual_executive_docdate", value: "", },
{ name: "delegation_files", value: [], },
]);
}
}
_handle_onFormSubmit = (event) =>
{
event.preventDefault();
@ -217,7 +244,7 @@ class Form_3_Signer extends QuestionnaireForm
}
//переданы
if(signatory_person.not_head_person)
if(signatory_person.delegation_agreement)
{
const main_check = [
"individual_executive_inn",
@ -237,7 +264,7 @@ class Form_3_Signer extends QuestionnaireForm
}
//иной подписант
if(signatory_person.delegation_agreement)
if(signatory_person.not_head_person)
{
const signatory_person_check = [
"lastname",
@ -301,14 +328,14 @@ class Form_3_Signer extends QuestionnaireForm
personal_data_consent,
head_person_files,
signatory_person_files,
individual_executive_files,
delegation_files,
modal_show_personal_data,
} = this.state;
console.log("individual_executive_files", individual_executive_files);
console.log("delegation_files", delegation_files);
const { loading, } = this.state;
const { main, head_person, signatory_person } = this.state;
const { main, head_person, signatory_person, status } = this.state;
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 };
@ -318,7 +345,7 @@ class Form_3_Signer extends QuestionnaireForm
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_3 ${ checking && "disabled" }`}>
<p className="title">3. Информация о единоличном исполнительном органе, подписанте договора лизинга</p>
<div className="form_field">
<label>Фамилия</label>
<label>Фамилия <sup className="required_label">*</sup></label>
<SuggestsInput
type="lastname"
id="head_person.lastname"
@ -342,7 +369,7 @@ class Form_3_Signer extends QuestionnaireForm
{*/}
</div>
<div className="form_field">
<label>Имя</label>
<label>Имя <sup className="required_label">*</sup></label>
<SuggestsInput
type="firstname"
id="head_person.firstname"
@ -374,7 +401,7 @@ class Form_3_Signer extends QuestionnaireForm
value={ this._checkStrValue(head_person.middlename) }
placeholder="Введите отчество"
onChange={ (value) => this._handle_onTextFieldChange("head_person.middlename", value) }
required={ true }
required={ false }
disabled={ checking }
/>
{/*}
@ -391,7 +418,7 @@ class Form_3_Signer extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>Серия паспорта</label>
<label>Серия паспорта <sup className="required_label">*</sup></label>
<InputMask
mask='9999'
id="head_person.identity_document.seria"
@ -400,11 +427,11 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }>
</InputMask>
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Номер паспорта</label>
<label>Номер паспорта <sup className="required_label">*</sup></label>
<InputMask
mask='999999'
id="head_person.identity_document.docnumber"
@ -420,7 +447,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="formgroup">
<div className="form_field">
<label>Дата выдачи</label>
<label>Дата выдачи <sup className="required_label">*</sup></label>
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.identity_document.issuedate" }
@ -431,7 +458,7 @@ class Form_3_Signer extends QuestionnaireForm
/>
</div>
<div className="form_field">
<label>Код подразделения</label>
<label>Код подразделения <sup className="required_label">*</sup></label>
<InputMask
mask='999-999'
id="head_person.identity_document.code"
@ -456,7 +483,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
</div>
<div className="form_field">
<label>Кем выдан</label>
<label>Кем выдан <sup className="required_label">*</sup></label>
<input type="text"
id="head_person.identity_document.issueby"
name="head_person.identity_document.issueby"
@ -468,7 +495,7 @@ class Form_3_Signer extends QuestionnaireForm
/>
</div>
<div className="form_field">
<label>Место рождения</label>
<label>Место рождения <sup className="required_label">*</sup></label>
<AddressSuggests
id={ "head_person.identity_document.placebirth" }
value={ this._checkStrValue(head_person.identity_document.placebirth) }
@ -479,7 +506,7 @@ class Form_3_Signer extends QuestionnaireForm
/>
</div>
<div className="form_field">
<label>Гражданство</label>
<label>Гражданство <sup className="required_label">*</sup></label>
<Select
id="head_person.identity_document.citizenship"
name="head_person.identity_document.citizenship"
@ -496,7 +523,7 @@ class Form_3_Signer extends QuestionnaireForm
/>
</div>
<div className="form_field">
<label>Адрес регистрации</label>
<label>Адрес регистрации <sup className="required_label">*</sup></label>
<AddressSuggests
value={ this._checkStrValue(head_person.identity_document.registration_address.name) }
fias={ this._checkStrValue(head_person.identity_document.registration_address.fias_id) }
@ -507,7 +534,7 @@ class Form_3_Signer extends QuestionnaireForm
/>
</div>
<div className="form_field">
<label>Должность</label>
<label>Должность <sup className="required_label">*</sup></label>
<input type="text"
id="head_person.jobtitle"
name="head_person.jobtitle"
@ -520,7 +547,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Телефон</label>
<label>Телефон <sup className="required_label">*</sup></label>
<InputMask
mask='+7 (999) 999 99 99'
id={ "head_person.telephone" }
@ -529,12 +556,12 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите номер телефона"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking } >
</InputMask>
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Адрес E-mail</label>
<label>Адрес E-mail <sup className="required_label">*</sup></label>
<input type="text"
id={ "head_person.email" }
name={ "head_person.email" }
@ -547,7 +574,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field picker">
<label>Дата назначения</label>
<label>Дата назначения <sup className="required_label">*</sup></label>
<div style={{ display: "flex", flexWrap: "wrap", width: "calc(100% - 198px)"}}>
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
@ -573,7 +600,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
{ !head_person.evo_indefinite && (
<div className="form_field picker">
<label>Дата окончания полномочий</label>
<label>Дата окончания полномочий <sup className="required_label">*</sup></label>
<div style={{ display: "flex", flexWrap: "wrap", width: "calc(100% - 198px)" }}>
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
@ -598,6 +625,130 @@ class Form_3_Signer extends QuestionnaireForm
title="Прикрепить скан паспорта единоличного исполнительного органа"
/>
{ main.inn.length < 11 &&
(
<React.Fragment>
<div className="form_field">
<div className="form_field checkbox">
<input type="checkbox"
hidden=""
id="signatory_person.delegation_agreement"
name="signatory_person.delegation_agreement"
checked={ signatory_person.delegation_agreement }
onChange={ this._handle_onChangeDelegationAgreement }
disabled={ checking }
/>
<label htmlFor="signatory_person.delegation_agreement" className="unselectable">Полномочия единоличного исполнительного органа переданы управляющей организации или управляющему</label>
</div>
</div>
{ signatory_person.delegation_agreement && (
<React.Fragment>
<p className="title">Информация об управляющей организации или управляющем</p>
<div className="formgroup" style={{ width: "100%" }}>
<div className="form_field" style={{ flexDirection: "row", flexWrap: "nowrap" }}>
<label>ИНН ? <sup className="required_label">*</sup></label>
<InputMask
style={{ width: "100%" }}
mask='999999999999'
//maskPlaceholder={ main.individual_executive_inn !== null && main.individual_executive_inn.replace(/[^\d.-]+/g, '').length < 11 ? "_" : " " }
alwaysShowMask={ false }
id="main.individual_executive_inn"
name="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 }
disabled={ checking }
/>
</div>
{ main.individual_executive_inn !== null && main.individual_executive_inn.replace(/[^\d.-]+/g, '').length < 11 && (
<div className="form_field" style={{ flexDirection: "row", flexWrap: "nowrap" }}>
<label>КПП <sup className="required_label">*</sup></label>
<InputMask
style={{ width: "100%" }}
mask='9999999999'
alwaysShowMask={ false }
id="main.individual_executive_kpp"
name="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 }
disabled={ checking }
/>
</div>
) }
</div>
<div className="form_field">
<p style={{ paddingBottom: "15px" }}><label>Организационно-правовая форма и полное наименование управляющей организации или управляющего <sup className="required_label">*</sup></label></p>
<input type="text"
style={{ width: "100%" }}
id="main.individual_executive_oop"
name="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 }
disabled={ checking }
/>
</div>
<div className="formgroup" style={{ width: "100%", }}>
<div className="form_field">
<label style={{ width: "100%", marginBottom: "12px" }}>Номер договора о передаче полномочий управляющей организации /управляющему</label>
<input type="text"
style={{ width: "100%" }}
id="main.individual_executive_docnum"
name="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 }
/>
</div>
<div className="form_field" style={{ alignItems: "flex-end" }}>
<label style={{ width: "100%", alignSelf: "flex-start" }}>Дата договора</label>
{/*}
<input type="text"
style={{ width: "100%", }}
id="main.individual_executive_docdate"
name="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 }
/>
{*/}
<CalendarDatePicker
style={{ width: "100%", }}
placeholder="ДД.ММ.ГГГГ"
id={ "main.individual_executive_docdate" }
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 }
/>
</div>
</div>
<FilesList
//group="individual_executive"
name="delegation_files"
files={ delegation_files }
onAddFile={ this._handle_onAddFile }
onRemoveFile={ this._handle_onRemoveFile }
checking={ checking }
/>
</React.Fragment>
) }
</React.Fragment>
) }
<div className="form_field">
<div className="form_field checkbox">
<input type="checkbox"
@ -608,147 +759,37 @@ class Form_3_Signer extends QuestionnaireForm
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !signatory_person.not_head_person ? true : false) }
disabled={ checking }
/>
<label htmlFor="signatory_person.not_head_person" className="unselectable">Полномочия единоличного исполнительного органа переданы управляющей организации или управляющему</label>
<label htmlFor="signatory_person.not_head_person" className="unselectable">Подписант отличается от единоличного исполнительного органа</label>
</div>
</div>
{ signatory_person.not_head_person && (
<React.Fragment>
<p className="title">Информация об управляющей организации или управляющем</p>
<p>Организационно-правовая форма и полное наименование управляющей организации или управляющего</p>
<div className="form_field">
<input type="text"
style={{ width: "100%" }}
id="main.individual_executive_oop"
name="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 }
disabled={ checking }
/>
</div>
<div className="formgroup" style={{ width: "100%" }}>
<div className="form_field" style={{ flexDirection: "row", flexWrap: "nowrap" }}>
<label>ИНН</label>
<input type="text"
style={{ width: "100%" }}
id="main.individual_executive_inn"
name="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 }
disabled={ checking }
/>
</div>
<div className="form_field" style={{ flexDirection: "row", flexWrap: "nowrap" }}>
<label>КПП</label>
<input type="text"
style={{ width: "100%" }}
id="main.individual_executive_kpp"
name="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 }
disabled={ checking }
/>
</div>
</div>
<div className="formgroup" style={{ width: "100%", }}>
<div className="form_field">
<label style={{ width: "100%", marginBottom: "12px" }}>Номер договора о передаче полномочий управляющей организации /управляющему</label>
<input type="text"
style={{ width: "100%" }}
id="main.individual_executive_docnum"
name="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 }
/>
</div>
<div className="form_field" style={{ alignItems: "flex-end" }}>
<label style={{ width: "100%", alignSelf: "flex-start" }}>Дата договора</label>
{/*}
<input type="text"
style={{ width: "100%", }}
id="main.individual_executive_docdate"
name="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 }
/>
{*/}
<CalendarDatePicker
style={{ width: "100%", }}
placeholder="ДД.ММ.ГГГГ"
id={ "main.individual_executive_docdate" }
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 }
/>
</div>
</div>
<FilesList
//group="individual_executive"
name="individual_executive_files"
files={ individual_executive_files }
onAddFile={ this._handle_onAddFile }
onRemoveFile={ this._handle_onRemoveFile }
checking={ checking }
/>
</React.Fragment>
) }
<div className="form_field">
<div className="form_field checkbox">
<input type="checkbox"
hidden=""
id="signatory_person.delegation_agreement"
name="signatory_person.delegation_agreement"
checked={ signatory_person.delegation_agreement }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !signatory_person.delegation_agreement ? true : false) }
disabled={ checking }
/>
<label htmlFor="signatory_person.delegation_agreement" className="unselectable">Подписант отличается от единоличного исполнительного органа</label>
</div>
</div>
{ signatory_person.delegation_agreement && (
<React.Fragment>
<p className="title">Информация о подписанте <small>(заполняется если подписант договора лизинга отличается от единоличного исполнительного органа)</small></p>
<div className="form_field">
<label>Фамилия</label>
<input type="text"
<label>Фамилия <sup className="required_label">*</sup></label>
<SuggestsInput
type="lastname"
id="signatory_person.lastname"
name="signatory_person.lastname"
value={ this._checkStrValue(signatory_person.lastname) }
placeholder="Введите фамилию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
onChange={ (value) => this._handle_onTextFieldChange("signatory_person.lastname", value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Имя</label>
<input type="text"
<label>Имя <sup className="required_label">*</sup></label>
<SuggestsInput
type="firstname"
id="signatory_person.firstname"
name="signatory_person.firstname"
value={ this._checkStrValue(signatory_person.firstname) }
placeholder="Введите имя"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
onChange={ (value) => this._handle_onTextFieldChange("signatory_person.firstname", value) }
required={ true }
disabled={ checking }
/>
@ -756,20 +797,23 @@ class Form_3_Signer extends QuestionnaireForm
<div className="form_field">
<label>Отчество <small>если имеется</small></label>
<input type="text"
<SuggestsInput
type="middlename"
id="signatory_person.middlename"
name="signatory_person.middlename"
value={ this._checkStrValue(signatory_person.middlename) }
placeholder="Введите отчество"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
placeholder="Введите имя"
onChange={ (value) => this._handle_onTextFieldChange("signatory_person.middlename", value) }
required={ false }
disabled={ checking }
/>
</div>
<div className="formgroup">
<div className="form_field">
<label>Серия паспорта</label>
<input type="text"
<label>Серия паспорта <sup className="required_label">*</sup></label>
<InputMask
mask='9999'
id="signatory_person.identity_document.seria"
name="signatory_person.identity_document.seria"
value={ this._checkStrValue(signatory_person.identity_document.seria) }
@ -781,8 +825,9 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Номер паспорта</label>
<input type="text"
<label>Номер паспорта <sup className="required_label">*</sup></label>
<InputMask
mask='999999'
id="signatory_person.identity_document.docnumber"
name="signatory_person.identity_document.docnumber"
value={ this._checkStrValue(signatory_person.identity_document.docnumber) }
@ -796,7 +841,7 @@ class Form_3_Signer extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>Дата выдачи</label>
<label>Дата выдачи <sup className="required_label">*</sup></label>
<CalendarDatePicker
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
@ -809,12 +854,13 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Код подразделения</label>
<input type="text"
<label>Код подразделения <sup className="required_label">*</sup></label>
<InputMask
mask='999-999'
id="signatory_person.identity_document.code"
name="signatory_person.identity_document.code"
value={ this._checkStrValue(signatory_person.identity_document.code) }
placeholder="Введите номер"
placeholder="Введите код"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
@ -823,7 +869,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Кем выдан</label>
<label>Кем выдан <sup className="required_label">*</sup></label>
<input type="text"
id="signatory_person.identity_document.issueby"
name="signatory_person.identity_document.issueby"
@ -836,7 +882,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Место рождения</label>
<label>Место рождения <sup className="required_label">*</sup></label>
<AddressSuggests
id={ "signatory_person.identity_document.placebirth" }
value={ this._checkStrValue(signatory_person.identity_document.placebirth) }
@ -848,7 +894,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Гражданство</label>
<label>Гражданство <sup className="required_label">*</sup></label>
<Select
id="signatory_person.identity_document.citizenship"
name="signatory_person.identity_document.citizenship"
@ -866,7 +912,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Адрес регистрации</label>
<label>Адрес регистрации <sup className="required_label">*</sup></label>
<AddressSuggests
value={ this._checkStrValue(signatory_person.identity_document.registration_address.name) }
fias={ this._checkStrValue(signatory_person.identity_document.registration_address.fias_id) }
@ -888,7 +934,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Должность</label>
<label>Должность <sup className="required_label">*</sup></label>
<input type="text"
id="signatory_person.jobtitle"
name="signatory_person.jobtitle"
@ -902,20 +948,21 @@ class Form_3_Signer extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>Телефон</label>
<input type="text"
id="signatory_person.telephone"
name="signatory_person.telephone"
<label>Телефон <sup className="required_label">*</sup></label>
<InputMask
id={ "signatory_person.telephone" }
name={ "signatory_person.telephone" }
value={ this._checkStrValue(signatory_person.telephone) }
placeholder="Телефон"
placeholder="Введите номер телефона"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
mask='+7 (999) 999 99 99'
/>
</div>
<div className="form_field">
<label>E-mail</label>
<label>E-mail <sup className="required_label">*</sup></label>
<input type="text"
id="signatory_person.email"
name="signatory_person.email"
@ -931,7 +978,7 @@ class Form_3_Signer extends QuestionnaireForm
<p><b>Реквизиты документа подтверждающие полномочия на подписание договора лизинга</b></p>
<div className="form_field">
<label>Вид документа</label>
<label>Вид документа <sup className="required_label">*</sup></label>
<input type="text"
id="signatory_person.signer_rule_basis"
name="signatory_person.signer_rule_basis"
@ -944,7 +991,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Наименование документа</label>
<label>Наименование документа <sup className="required_label">*</sup></label>
<input type="text"
id="signatory_person.signer_rule_basis_add"
name="signatory_person.signer_rule_basis_add"
@ -958,7 +1005,7 @@ class Form_3_Signer extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>Номер документа</label>
<label>Номер документа <sup className="required_label">*</sup></label>
<input type="text"
id="signatory_person.docnumber"
name="signatory_person.docnumber"
@ -971,7 +1018,7 @@ class Form_3_Signer extends QuestionnaireForm
</div>
<div className="form_field">
<label>Дата</label>
<label>Дата <sup className="required_label">*</sup></label>
<CalendarDatePicker
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
@ -1025,6 +1072,12 @@ class Form_3_Signer extends QuestionnaireForm
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
{ status !== "empty" && (
<>
<br/><br/>
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
</>
) }
</div>
) }
</form>

View File

@ -19,6 +19,7 @@ import AddressSuggests from "../../AddressSuggests";
import InputMask from 'react-input-mask';
import { getCitizenshipTitleByCode } from "../../../../utils/citizenship";
import { saveQuestionnaire } from "../../../../actions";
import SuggestsInput from "../../SuggestsInput";
class ShareholderForm extends React.Component
{
@ -49,45 +50,49 @@ class ShareholderForm extends React.Component
return (
<React.Fragment>
<div className="form_field">
<label>Фамилия</label>
<input type="text"
<label>Фамилия <sup className="required_label">*</sup></label>
<SuggestsInput
type="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) }
onChange={ (value) => this._handle_onTextFieldChange(`founder_persons[${ index }].lastname`, value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Имя</label>
<input type="text"
<label>Имя <sup className="required_label">*</sup></label>
<SuggestsInput
type="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) }
onChange={ (value) => this._handle_onTextFieldChange(`founder_persons[${ index }].firstname`, value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Отчество <small>если имеется</small></label>
<input type="text"
<label>Отчество <sup className="required_label">*</sup><small>если имеется</small></label>
<SuggestsInput
type="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) }
onChange={ (value) => this._handle_onTextFieldChange(`founder_persons[${ index }].middlename`, value) }
required={ false }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Должность <small>если имеется</small></label>
<label>Должность <sup className="required_label">*</sup><small>если имеется</small></label>
<input type="text"
id={ `founder_persons[${ index }].jobtitle` }
name={ `founder_persons[${ index }].jobtitle` }
@ -100,7 +105,7 @@ class ShareholderForm extends React.Component
</div>
<div className="form_field">
<label>Телефон</label>
<label>Телефон <sup className="required_label">*</sup></label>
<InputMask
mask='+7 (999) 999 99 99'
id={ `founder_persons[${ index }].telephone` }
@ -114,7 +119,7 @@ class ShareholderForm extends React.Component
</div>
<div className="form_field">
<label>Адрес E-mail</label>
<label>Адрес E-mail <sup className="required_label">*</sup></label>
<input type="text"
id={ `founder_persons[${ index }].email` }
name={ `founder_persons[${ index }].email` }
@ -128,7 +133,7 @@ class ShareholderForm extends React.Component
<div className="form_field ">
<div className="form_field">
<label>Серия и номер паспорта</label>
<label>Серия и номер паспорта <sup className="required_label">*</sup></label>
<div className="formgroup">
<div className="form_field">
<InputMask
@ -139,8 +144,8 @@ class ShareholderForm extends React.Component
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking } >
</InputMask>
disabled={ checking }
/>
</div>
<div className="form_field">
<InputMask
@ -151,8 +156,8 @@ class ShareholderForm extends React.Component
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking } >
</InputMask>
disabled={ checking }
/>
</div>
</div>
</div>
@ -160,7 +165,7 @@ class ShareholderForm extends React.Component
<div className="form_field ">
<div className="form_field">
<label>Дата выдачи и код подразделения </label>
<label>Дата выдачи и код подразделения <sup className="required_label">*</sup></label>
<div className="formgroup">
<div className="form_field">
<CalendarDatePicker
@ -174,11 +179,12 @@ class ShareholderForm extends React.Component
/>
</div>
<div className="form_field">
<input type="text"
<InputMask
mask='999-999'
id={ `founder_persons[${ index }].identity_document.code` }
name={ `founder_persons[${ index }].identity_document.code` }
value={ this._checkStrValue(shareholder.identity_document.code) }
placeholder="Код подразделения"
placeholder="Введите код"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
@ -189,7 +195,7 @@ class ShareholderForm extends React.Component
</div>
<div className="form_field">
<label>Кем выдан</label>
<label>Кем выдан <sup className="required_label">*</sup></label>
<input type="text"
id={ `founder_persons[${ index }].identity_document.issueby` }
name={ `founder_persons[${ index }].identity_document.issueby` }
@ -202,7 +208,7 @@ class ShareholderForm extends React.Component
</div>
<div className="form_field" style={{ flex: 1 }}>
<label>Место рождения</label>
<label>Место рождения <sup className="required_label">*</sup></label>
<AddressSuggests
id={ `founder_persons[${ index }].identity_document.placebirth` }
value={ this._checkStrValue(shareholder.identity_document.placebirth) }
@ -213,7 +219,7 @@ class ShareholderForm extends React.Component
</div>
<div className="form_field">
<label>Гражданство</label>
<label>Гражданство <sup className="required_label">*</sup></label>
<Select
id={ `founder_persons[${ index }].identity_document.citizenship` }
name={ `founder_persons[${ index }].identity_document.citizenship` }
@ -231,7 +237,7 @@ class ShareholderForm extends React.Component
</div>
<div className="form_field">
<label>Адрес регистрации</label>
<label>Адрес регистрации <sup className="required_label">*</sup></label>
<AddressSuggests
id={ `founder_persons[${ index }].identity_document.registration_address` }
value={ this._checkStrValue(shareholder.identity_document.registration_address.name) }
@ -371,7 +377,7 @@ class Shareholder extends React.Component
) }
<div className="form_field">
<label>Доля в уставном капитале (%)</label>
<label>Доля в уставном капитале (%) <sup className="required_label">*</sup></label>
<InputMask
mask='999'
formatChars={{ '9': '[0-9]', }}
@ -460,6 +466,7 @@ class Form_4_Shareholders extends QuestionnaireForm
}
},
loading: false,
status: "empty",
};
}
@ -467,6 +474,7 @@ class Form_4_Shareholders extends QuestionnaireForm
{
return {
founder_persons: nextProps.questionnaire.founder_persons,
status: nextProps.questionnaire.status,
};
}
@ -606,7 +614,7 @@ class Form_4_Shareholders extends QuestionnaireForm
render()
{
const { signatories, checking } = this.props;
const { founder_persons, loading, address, } = this.state;
const { founder_persons, loading, address, status, } = this.state;
return (
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_4 ${ checking && "disabled" }`}>
@ -643,11 +651,19 @@ class Form_4_Shareholders extends QuestionnaireForm
) : (
<div></div>
) }
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
{ loading ? (
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
<div>
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
{ loading ? (
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
{ status !== "empty" && (
<>
<br/><br/>
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
</>
) }
</div>
</div>
) }
</form>

View File

@ -21,6 +21,7 @@ class Form_5_Regulatory extends QuestionnaireForm
this.state = {
main: {},
loading: false,
status: "empty",
};
}
@ -28,6 +29,7 @@ class Form_5_Regulatory extends QuestionnaireForm
{
return {
main: nextProps.questionnaire.main,
status: nextProps.questionnaire.status,
};
}
@ -37,7 +39,7 @@ class Form_5_Regulatory extends QuestionnaireForm
_handle_onFormSubmit = (event) =>
{
const { nko } = this.state;
const { main } = this.state;
event.preventDefault();
console.log("Form_5_Regulatory", "_handle_onFormSubmit");
@ -45,7 +47,7 @@ class Form_5_Regulatory extends QuestionnaireForm
setTimeout(() =>
{
saveQuestionnaire();
if(nko)
if(main.nko)
{
this.props.onNextStep("non-profit");
}
@ -75,7 +77,7 @@ class Form_5_Regulatory extends QuestionnaireForm
render()
{
const { checking } = this.props;
const { main, loading } = this.state;
const { main, loading, status } = this.state;
const { high_level, board_of_directors, collective_executive, individual_executive, other_control, } = main;
return (
@ -94,7 +96,7 @@ class Form_5_Regulatory extends QuestionnaireForm
<div className="form_field">
<label>
Высший орган управления
Высший орган управления <sup className="required_label">*</sup>
<small>например, общее собрание акционеров, общее собрание участников, общее собрание членов, общее собрание трудового коллектива, съезд, совет и т.д.</small>
</label>
<textarea type="text"
@ -118,7 +120,7 @@ class Form_5_Regulatory extends QuestionnaireForm
value={ this._checkStrValue(board_of_directors) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ false }
/>
</div>
@ -133,13 +135,13 @@ class Form_5_Regulatory extends QuestionnaireForm
value={ this._checkStrValue(collective_executive) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ false }
/>
</div>
<div className="form_field">
<label>
Единоличный исполнительный орган
Единоличный исполнительный орган <sup className="required_label">*</sup>
<small>например, Генеральный директор, Директор, Президент. Обязательно для заполнения</small>
</label>
<textarea type="text"
@ -160,17 +162,26 @@ class Form_5_Regulatory extends QuestionnaireForm
value={ this._checkStrValue(other_control) }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ false }
/>
</div>
{ !checking && (
<div className="action">
<div></div>
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
{ loading ? (
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
<div>
<button type="submit" className="button button-blue" disabled={ this._checkDisabled() }>
{ loading ? (
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
{ status !== "empty" && (
<>
<br/><br/>
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
</>
) }
</div>
</div>
) }
</form>

View File

@ -31,6 +31,7 @@ class Form_6_NonProfit extends QuestionnaireForm
fin_goals_special: null,
},
loading: false,
status: "empty",
};
}
@ -38,6 +39,7 @@ class Form_6_NonProfit extends QuestionnaireForm
{
return {
non_profit: nextProps.questionnaire.non_profit,
status: nextProps.questionnaire.status,
};
}
@ -62,10 +64,10 @@ class Form_6_NonProfit extends QuestionnaireForm
{
const { non_profit } = this.state;
this._handle_onFieldChange("non_profit", {
this._handle_onFieldChange("non_profit", { ...this.state.non_profit, ...{
fin_source_another: !non_profit.fin_source_another ? true : false,
fin_source_another_description: non_profit.fin_source_another ? "" : non_profit.fin_source_another_description,
});
} });
}
_checkDisabled = () =>
@ -95,7 +97,7 @@ class Form_6_NonProfit extends QuestionnaireForm
}
}
if(!non_profit.fin_source_business && !non_profit.fin_source_donate && !non_profit.fin_source_fees)
if(!non_profit.fin_source_business && !non_profit.fin_source_donate && !non_profit.fin_source_fees && !non_profit.fin_source_another)
{
return true;
}
@ -103,10 +105,28 @@ class Form_6_NonProfit extends QuestionnaireForm
return false;
}
_checkRequired = (field) =>
{
const { non_profit } = this.state;
const check = ["fin_goals_cars", "fin_goals_trucks", "fin_goals_special"];
let need = true;
for(let i in check)
{
if(non_profit[check[i]] !== null && non_profit[check[i]] !== "")
{
need = false;
}
}
return need;
}
render()
{
const { checking } = this.props;
const { non_profit, loading } = this.state;
const { non_profit, loading, status } = this.state;
return (
<React.Fragment>
@ -211,7 +231,7 @@ class Form_6_NonProfit extends QuestionnaireForm
value={ this._checkStrValue(non_profit.fin_goals_cars) }
placeholder="Введите данные"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
required={ true }
required={ this._checkRequired("fin_goals_cars") }
disabled={ checking }
/>
</div>
@ -224,7 +244,7 @@ class Form_6_NonProfit extends QuestionnaireForm
value={ this._checkStrValue(non_profit.fin_goals_trucks) }
placeholder="Введите данные"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
required={ true }
required={ this._checkRequired("fin_goals_trucks") }
disabled={ checking }
/>
</div>
@ -237,7 +257,7 @@ class Form_6_NonProfit extends QuestionnaireForm
value={ this._checkStrValue(non_profit.fin_goals_special) }
placeholder="Введите данные"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
required={ true }
required={ this._checkRequired("fin_goals_special") }
disabled={ checking }
/>
</div>
@ -249,6 +269,12 @@ class Form_6_NonProfit extends QuestionnaireForm
<SpinnerCircular size={24} thickness={100} speed={100} color="rgba(255, 255, 255, 1)" secondaryColor="rgba(255, 255, 255, 0.5)" style={{ marginTop: "4px" }}/>
) : "Продолжить" }
</button>
{ status !== "empty" && (
<>
<br/><br/>
<a style={{ cursor: "pointer" }} onClick={ this._handle_onReset }>Отменить изменения в анкете</a>
</>
) }
</div>
) }
</form>

View File

@ -70,6 +70,15 @@ class Form_8_Signing extends QuestionnaireForm
});
}
_handle_onChangeSignMehod = () =>
{
const { sign_digital } = this.state;
this.setState({ sign_digital: sign_digital ? false : true }, () =>
{
window.scrollTo(0, 0);
});
}
render()
{
const { phone_check_loading, sign_digital, certificates } = this.state;
@ -86,7 +95,7 @@ class Form_8_Signing extends QuestionnaireForm
id="sign_digital"
name="sign_digital"
checked={ sign_digital }
onChange={ () => this.setState({ sign_digital: true }) }
onChange={ this._handle_onChangeSignMehod }
/>
<label htmlFor="sign_digital">
<b>Подписать онлайн используя ЭЦП</b>
@ -106,7 +115,7 @@ class Form_8_Signing extends QuestionnaireForm
id="sign_print"
name="sign_print"
checked={ !sign_digital }
onChange={ () => this.setState({ sign_digital: false }) }
onChange={ this._handle_onChangeSignMehod }
/>
<label htmlFor="sign_print">
<b>Подписать в бумажном виде</b>

View File

@ -9,7 +9,7 @@ import { SpinnerCircular } from 'spinners-react';
import debounce from 'debounce-promise';
import { set as _set, get as _get } from 'lodash';
import { updateQuestionnaire, getAddress, getSuggests } from "../../../actions";
import { updateQuestionnaire, getAddress, getSuggests, resetQuestionnaire } from "../../../actions";
const suggestsAddressDebounce = (query) =>
{
@ -90,6 +90,25 @@ export default class QuestionnaireForm extends React.Component
this._updateQuestionnaire(update);
}
_handle_onBranchChange = (payload) =>
{
console.log("_handle_onBranchChange", payload);
const update = JSON.parse(JSON.stringify(global.store.getState().questionnaire));
for(let i in payload)
{
_set(update, payload[i].name, payload[i].value);
}
this._updateQuestionnaire(update);
}
_handle_onJoinChange = (payload) =>
{
console.log("_handle_onJoinChange", payload);
this._updateQuestionnaire(payload);
}
_handle_onAddFile = (name, files) =>
{
console.log("QuestionnaireForm", "_handle_onAddFile", { name, files });
@ -136,4 +155,16 @@ export default class QuestionnaireForm extends React.Component
this._updateQuestionnaire(update);
}
_handle_onReset = (event) =>
{
event.preventDefault();
const reset = window.confirm("Вы действительно хотите отменить изменения, внесенные в анкету? Состояние анкеты будет сброшено до версии, имеющейся у ООО \"ЛК Эволюция\"");
if(reset)
{
this.props.onNextStep("main");
resetQuestionnaire({ dispatch: this.props.dispatch, id: this.props.company.questionnaire_id });
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -1449,13 +1449,14 @@
text-decoration: underline;
}
.requared_label {
.required_label {
color: #A8026B;
vertical-align: super;
font-size: 15px;
display: inline-block;
margin-left: 3px;
position: relative;
line-height: 8px;
&:hover:after {
content: "Обязательное поле";

View File

@ -33,7 +33,6 @@ export default async function handler(req, res)
upload.single("file")(req, {}, async (err) =>
{
console.log(req);
const { file, body } = req;
const id = md5(`${ file.buffer }`);
@ -48,7 +47,7 @@ export default async function handler(req, res)
try
{
fs.writeFileSync(`${ __dirname }/../../../../../../uploads/${ local_filename }`, file.buffer);
console.log("multer.upload.single", { file });
console.log("multer.upload.single file");
console.log({ file_payload });
res.status(200).json(file_payload);

View File

@ -86,6 +86,7 @@ class QuestionnairePage extends React.Component
_handle_onNextStep = (path) =>
{
console.log("_handle_onNextStep", path);
window.scrollTo(0, 0);
this.props.router.push(`/questionnaire#${ path }`);
}

View File

@ -1,3 +1,160 @@
export const questionnaire_template = {
step: 1,
status: "empty",
main: {
title: null,
inn: null,
kpp: null,
email: null,
telephone: null,
websiteurl: null,
financial_loan: null,
is_individual_executive: false,
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,
},
delegation_files: [],
contacts: {
address_type: "legal",
legal_address: {
name: null,
fias_id: null,
},
fact_address: {
name: null,
fias_id: null,
},
postal_address: {
name: null,
fias_id: null,
},
},
head_person: {
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: "Генеральный директор",
telephone: null,
email: null,
identity_document: {
doctype: null,
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,
}
},
evo_assignment_date: null,
evo_credentials_dateend: null,
evo_indefinite: false,
},
head_person_files: [],
signatory_person: {
not_head_person: false,
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: null,
signer_rule_basis: null,
signer_rule_basis_add: null,
docdate: null,
docnumber: null,
delegation_agreement: false,
telephone: null,
email: null,
identity_document: {
docype: null,
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,
}
}
},
signatory_person_files: [],
founder_persons: [],
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: null,
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: {
fin_source_business: false,
fin_source_donate: false,
fin_source_fees: false,
fin_source_another: false,
fin_source_another_description: null,
foreign_payers: false,
fin_goals_cars: null,
fin_goals_trucks: null,
fin_goals_special: null,
},
personal_data_consent: false,
};
export const defaultState = {
auth:
{
@ -100,162 +257,6 @@ export const defaultState = {
appeal: null,
request: null,
},
questionnaire: {
step: 1,
status: "empty",
main: {
title: null,
inn: null,
kpp: null,
email: null,
telephone: null,
websiteurl: null,
financial_loan: null,
is_individual_executive: false,
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,
},
individual_executive_files: [],
contacts: {
address_type: "legal",
legal_address: {
name: null,
fias_id: null,
},
fact_address: {
name: null,
fias_id: null,
},
postal_address: {
name: null,
fias_id: null,
},
},
head_person: {
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: "Генеральный директор",
telephone: null,
email: null,
identity_document: {
doctype: null,
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,
}
},
evo_assignment_date: null,
evo_credentials_dateend: null,
evo_indefinite: false,
},
head_person_files: [],
signatory_person: {
not_head_person: false,
lastname: null,
firstname: null,
middlename: null,
no_middle_name: false,
jobtitle: null,
signer_rule_basis: null,
signer_rule_basis_add: null,
docdate: null,
docnumber: null,
delegation_agreement: false,
telephone: null,
email: null,
identity_document: {
docype: null,
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,
}
}
},
signatory_person_files: [],
founder_persons: [],
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: null,
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: {
fin_source_business: false,
fin_source_donate: false,
fin_source_fees: false,
fin_source_another: false,
fin_source_another_description: null,
foreign_payers: false,
fin_goals_cars: null,
fin_goals_trucks: null,
fin_goals_special: null,
},
personal_data_consent: false,
},
};
export default JSON.parse(JSON.stringify(defaultState));
export default JSON.parse(JSON.stringify({ ...defaultState, ...{ questionnaire: questionnaire_template } }));