questionnaire full cycle from start

This commit is contained in:
merelendor 2023-03-28 10:50:57 +03:00
parent da301cc055
commit 8fe0457989
29 changed files with 843 additions and 236 deletions

View File

@ -0,0 +1,100 @@
import React from "react";
import DatePicker from "react-widgets/DatePicker";
import "react-widgets/styles.css";
import moment from "moment";
const messages = {
moveToday: "Сегодня",
moveBack: "Назад",
moveForward: "Вперед",
dateButton: "Выбрать дату",
};
const formats = [
'DD.MM.YYYY'
];
export default class CalendarDatePicker extends React.Component
{
constructor(props)
{
super(props);
this.state = {
readonly: true,
};
}
_handle_onChange = (date) =>
{
if(this.props.onChange !== undefined)
{
console.log("date.getTime", date.toJSON());
this.props.onChange(date.getTime !== undefined ? date.toJSON() : "");
}
}
_handle_onFocus = () =>
{
this.setState({ readonly: false });
}
_handle_onBlur = () =>
{
this.setState({ readonly: true });
}
render()
{
const { id, placeholder, value, min, max, disabled, plain, style } = this.props;
const { readonly } = this.state;
if(disabled)
{
return (
<div className="date_input_wrapper" style={{ ...{ position: "relative" }, ...this.props.style }}>
{ plain ? (
moment(value).format("DD.MM.YYYY")
) : (
<>
<DatePicker
//valueEditFormat={{ dateStyle: "short" }}
messages={ messages }
onFocus={ this._handle_onFocus }
onBlur={ this._handle_onBlur }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate() } }
id={ id }
placeholder={ placeholder }
value={ value !== "" && value !== null ? new Date(value) : null }
min={ min }
max={ max }
onChange={ this._handle_onChange }
/>
<div style={{ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", opacity: 0.0 }} onClick={ (event) => { event.stopPropagation(); event.preventDefault(); } }/>
</>
) }
</div>
)
}
else
{
console.log("FUCK", value);
return (
<div className="date_input_wrapper" style={ this.props.style }>
<DatePicker
//valueEditFormat={{ dateStyle: "short" }}
messages={ messages }
onFocus={ this._handle_onFocus }
onBlur={ this._handle_onBlur }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate() } }
id={ id }
placeholder={ placeholder }
value={ value !== "" && value !== null ? new Date(value) : null }
min={ min }
max={ max }
onChange={ this._handle_onChange }
/>
</div>
)
}
}
}

View File

@ -28,7 +28,8 @@ export default class DateInput extends React.Component
{
if(this.props.onChange !== undefined)
{
this.props.onChange(date);
console.log("date.getTime", date.toJSON());
this.props.onChange(date.getTime !== undefined ? date : "");
}
}
@ -44,13 +45,13 @@ export default class DateInput extends React.Component
render()
{
const { id, placeholder, value, min, max, disabled, plain } = this.props;
const { id, placeholder, value, min, max, disabled, plain, style } = this.props;
const { readonly } = this.state;
if(disabled)
{
return (
<div className="date_input_wrapper" style={[ { position: "relative", }, this.props.style ]}>
<div className="date_input_wrapper" style={{ ...{ position: "relative" }, ...this.props.style }}>
{ plain ? (
moment(value).format("DD.MM.YYYY")
) : (
@ -60,13 +61,13 @@ export default class DateInput extends React.Component
messages={ messages }
onFocus={ this._handle_onFocus }
onBlur={ this._handle_onBlur }
parse={ formats }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate() } }
id={ id }
placeholder={ placeholder }
value={ value }
min={ min }
max={ max }
onChange={ this._handle_onChange }
onChange={ this._handle_onChange }
/>
<div style={{ position: "absolute", left: 0, top: 0, width: "100%", height: "100%", opacity: 0.0 }} onClick={ (event) => { event.stopPropagation(); event.preventDefault(); } }/>
</>
@ -76,6 +77,7 @@ export default class DateInput extends React.Component
}
else
{
console.log("FUCK", value);
return (
<div className="date_input_wrapper" style={ this.props.style }>
<DatePicker
@ -83,7 +85,7 @@ export default class DateInput extends React.Component
messages={ messages }
onFocus={ this._handle_onFocus }
onBlur={ this._handle_onBlur }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate(); } }
parse={ str => { return moment(str, 'DD.MM.YYYY').toDate() } }
id={ id }
placeholder={ placeholder }
value={ value }

View File

@ -13,12 +13,14 @@ class InnerMenu extends React.Component
this.state = {
menuOpened: false,
step: 1,
};
}
static getDerivedStateFromProps(nextProps, prevState)
{
return {
step: nextProps.questionnaire.step,
};
}
@ -54,7 +56,7 @@ class InnerMenu extends React.Component
render()
{
console.log("questionnaire", this.props.questionnaire);
const { menuOpened, } = this.state;
const { menuOpened, step, } = this.state;
const { questionnaire } = this.props;
console.log("this.props.router.asPath", this.props.router.asPath);
@ -68,42 +70,42 @@ class InnerMenu extends React.Component
<ul className={ menuOpened ? "aside_nav open" : "aside_nav" } ref={ this.menuRef }>
<li>
<Link href={`/questionnaire/#main`} shallow>
<a style={{ fontWeight: 400, }} disabled={ questionnaire.step > 1 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#main") > -1 || this.props.router.asPath.indexOf("#") < 0 ? "active" : "" }>1. Информация о лизингополучателе</a>
<a style={{ fontWeight: 400, }} disabled={ step >= 1 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#main") > -1 || this.props.router.asPath.indexOf("#") < 0 ? "active" : "" }>1. Информация о лизингополучателе</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#contacts`} shallow>
<a style={{ fontWeight: 400, }} disabled={ questionnaire.step > 2 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#contacts") > -1 ? "active" : "" }>2. Адреса лизингополучателя</a>
<a style={{ fontWeight: 400, }} disabled={ step >= 2 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#contacts") > -1 ? "active" : "" }>2. Адреса лизингополучателя</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#signer`} shallow>
<a style={{ fontWeight: 400, }} disabled={ questionnaire.step > 3 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#signer") > -1 ? "active" : "" }>3. Информация о единоличном исполнительном органе, подписанте договора лизинга</a>
<a style={{ fontWeight: 400, }} disabled={ step >= 3 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#signer") > -1 ? "active" : "" }>3. Информация о единоличном исполнительном органе, подписанте договора лизинга</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#shareholders`} shallow>
<a style={{ fontWeight: 400, }} disabled={ questionnaire.step > 4 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#shareholders") > -1 ? "active" : "" }>4. Сведения об участниках (акционерах) и бенефициарных владельцах</a>
<a style={{ fontWeight: 400, }} disabled={ step >= 4 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#shareholders") > -1 ? "active" : "" }>4. Сведения об участниках (акционерах) и бенефициарных владельцах</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#regulatory`} shallow>
<a style={{ fontWeight: 400, }} disabled={ questionnaire.step > 5 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#regulatory") > -1 ? "active" : "" }>5. Сведения об органах управления</a>
<a style={{ fontWeight: 400, }} disabled={ step >= 5 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#regulatory") > -1 ? "active" : "" }>5. Сведения об органах управления</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#non-profit`} shallow>
<a style={{ fontWeight: 400, }} disabled={ questionnaire.step > 6 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#non-profit") > -1 ? "active" : "" }>6. Данные о некомерческой организации</a>
<a style={{ fontWeight: 400, }} disabled={ step >= 6 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#non-profit") > -1 ? "active" : "" }>6. Данные о некомерческой организации</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#check`} shallow>
<a style={{fontWeight: 400}} disabled={ questionnaire.step > 7 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#check") > -1 ? "active" : "" }>7. Проверка введеных данных</a>
<a style={{fontWeight: 400}} disabled={ step >= 7 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#check") > -1 ? "active" : "" }>7. Проверка введеных данных</a>
</Link>
</li>
<li>
<Link href={`/questionnaire/#signing`} shallow>
<a style={{fontWeight: 400}} disabled={ questionnaire.step > 8 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#signing") > -1 ? "active" : "" }>8. Выбор метода подписания</a>
<a style={{fontWeight: 400}} disabled={ step >= 8 ? false : true } className={ this.props.router && this.props.router.asPath.indexOf("#signing") > -1 ? "active" : "" }>8. Выбор метода подписания</a>
</Link>
</li>
</ul>

View File

@ -35,6 +35,7 @@ export default class AddressSuggestsSelect extends React.Component
componentDidMount()
{
console.log("AddressSuggestsSelect", "this.props", this.props);
//console.log("AddressSuggestsSelect", this.props);
this.setState({ value: this.props.value, custom: this.props.value !== "" ? true : false });
}
@ -50,7 +51,8 @@ export default class AddressSuggestsSelect extends React.Component
_handle_onChange = (data) =>
{
//console.log("_handle_onChange");
//console.log("AddressSuggestsSelect", "_handle_onChange");
const { fias } = this.state;
this.setState({ value_selected: data.value, value: data.value, custom: false, }, () =>
{
@ -60,6 +62,7 @@ export default class AddressSuggestsSelect extends React.Component
_handle_onBlur = (data, action) =>
{
//console.log("AddressSuggestsSelect", "_handle_onBlur");
const { value, value_selected } = this.state;
//console.log("_handle_onBlur", { value, value_selected }, { action });
@ -70,31 +73,64 @@ export default class AddressSuggestsSelect extends React.Component
//else
//{
//console.log("this", value);
this.props.onChange({ title: value, fias_id: "" });
//this.props.onChange({ title: value, fias_id: "" });
//}
}
_handle_onInputChange = (value, action) =>
{
//console.log("_handle_onInputChange", { value }, action);
//console.log("AddressSuggestsSelect", "_handle_onInputChange", action, { value });
if(action.action === "input-blur")
{
setTimeout(() =>
{
console.log("this.state.value_selected", this.state.value_selected);
if(this.state.value_selected === "")
{
this.setState({ custom: true }, () =>
{
this.props.onChange({ title: action.prevInputValue, fias_id: "" });
});
}
}, 10);
}
else
{
if(action.action === "input-change")
{
this.setState({ value });
}
}
/*
if (action.action !== "input-blur" && action.action !== "menu-close")
{
this.setState({ value });
console.log("AddressSuggestsSelect", "_handle_onInputChange", 1);
}
else
{
if(action.action === "input-blur" && action.prevInputValue !== "" && value === "")
{
this.setState({ value: action.prevInputValue, custom: true, });
this.setState({ value: action.prevInputValue, custom: true, }, () =>
{
console.log("AddressSuggestsSelect", "_handle_onInputChange", 2, "[", action.prevInputValue, "]");
this.props.onChange({ title: action.prevInputValue, fias_id: "" });
});
}
else
{
if(value === "" && action.prevInputValue === "")
{
this.setState({ value, value_selected: "", custom: false, });
this.setState({ value, value_selected: "", custom: false, }, () =>
{
console.log("AddressSuggestsSelect", "_handle_onInputChange", 3, "[", value, "]", "{", action.prevInputValue, "}");
this.props.onChange({ title: action.prevInputValue, fias_id: "" });
});
}
}
}
*/
//this.setState({ value });
}
@ -139,7 +175,8 @@ export default class AddressSuggestsSelect extends React.Component
render()
{
const { value, value_selected, custom, disabled } = this.state;
const { value, value_selected, custom } = this.state;
const { disabled } = this.props;
//console.log(">>>>>>>>>>|", value, "|", value_selected);
if(custom)
@ -159,7 +196,7 @@ export default class AddressSuggestsSelect extends React.Component
onChange={ this._handle_onChange }
//onBlur={ this._handle_onBlur }
onInputChange={ this._handle_onInputChange }
isDisabled={ disabled ? true : false }
//isDisabled={ disabled ? true : false }
/>
)
}
@ -181,7 +218,7 @@ export default class AddressSuggestsSelect extends React.Component
onChange={ this._handle_onChange }
//onBlur={ this._handle_onBlur }
onInputChange={ this._handle_onInputChange }
isDisabled={ disabled ? true : false }
//isDisabled={ disabled ? true : false }
/>
)
}

View File

@ -110,6 +110,7 @@ export default class DigitalSignaturesList extends React.Component
<div>
<p className="item_title">{ certificate?.info?.subjectName }</p>
<p className="item_desc">
{ certificate.info.subjectFields.map((field) => field.fieldName === "Имя" ? <span>{ field.value }</span> : null)}
<span>Подпись действительна до { certificate?.info?.validToDate }</span>
</p>
</div>

View File

@ -53,7 +53,7 @@ export default class FilesList extends React.Component
render()
{
const { files, } = this.props;
const { files, checking } = this.props;
console.log("FilesList", "files", files);
@ -65,29 +65,33 @@ export default class FilesList extends React.Component
<div className="row" style={{ alignItems: "center", justifyContent: "center", display: "flex", flexDirection: "row", flex: 1, marginBottom: "0px" }}>
<p className="doc_name i-pdf extension" style={{ wordBreak: "break-all", lineHeight: "15px" }}>{ this._renderFileName(file.name) }{/*}<span style={{width: "100%"}}>Постановление</span>{*/}</p>
</div>
<div style={{ position: "absolute", top: "5px", right: "5px", width: "20px", height: "20px", background: "#edeff5", flex: 1, justifyContent: "center", display: "flex", alignItems: "center", borderRadius: "10px", cursor: "pointer" }} onClick={ () => this._handle_onRemoveFile(file.name) }>
<span style={{ color: "#919399", fontSize: "12px" }}></span>
</div>
{ !checking && (
<div style={{ position: "absolute", top: "5px", right: "5px", width: "20px", height: "20px", background: "#edeff5", flex: 1, justifyContent: "center", display: "flex", alignItems: "center", borderRadius: "10px", cursor: "pointer" }} onClick={ () => this._handle_onRemoveFile(file.name) }>
<span style={{ color: "#919399", fontSize: "12px" }}></span>
</div>
) }
</div>
)) }
<Dropzone onDrop={ (acceptedFiles) => this._handle_onAddFile(acceptedFiles) }>
{ ({getRootProps, getInputProps}) => (
<div className="file_upload dropzone" { ...getRootProps() } style={{ width: "32%", height: "100px", marginBottom: "25px", marginTop: "0px", }}>
<div className="files"></div>
<div>
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28.1251 31.5H7.87402C7.57565 31.5 7.28951 31.3815 7.07853 31.1705C6.86755 30.9595 6.74902 30.6734 6.74902 30.375V5.625C6.74902 5.32663 6.86755 5.04048 7.07853 4.82951C7.28951 4.61853 7.57565 4.5 7.87402 4.5H21.3751L29.2501 12.375V30.375C29.2501 30.5227 29.221 30.669 29.1645 30.8055C29.108 30.942 29.0251 31.066 28.9206 31.1705C28.8162 31.275 28.6921 31.3578 28.5556 31.4144C28.4192 31.4709 28.2729 31.5 28.1251 31.5Z" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M21.375 4.5V12.375H29.2511" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M14.625 21.375H21.375" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M18 18V24.75" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
<label htmlFor="" className="blue unselectable">Прикрепить скан документов</label>
{ !checking && (
<Dropzone onDrop={ (acceptedFiles) => this._handle_onAddFile(acceptedFiles) }>
{ ({getRootProps, getInputProps}) => (
<div className="file_upload dropzone" { ...getRootProps() } style={{ width: "32%", height: "100px", marginBottom: "25px", marginTop: "0px", }}>
<div className="files"></div>
<div>
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28.1251 31.5H7.87402C7.57565 31.5 7.28951 31.3815 7.07853 31.1705C6.86755 30.9595 6.74902 30.6734 6.74902 30.375V5.625C6.74902 5.32663 6.86755 5.04048 7.07853 4.82951C7.28951 4.61853 7.57565 4.5 7.87402 4.5H21.3751L29.2501 12.375V30.375C29.2501 30.5227 29.221 30.669 29.1645 30.8055C29.108 30.942 29.0251 31.066 28.9206 31.1705C28.8162 31.275 28.6921 31.3578 28.5556 31.4144C28.4192 31.4709 28.2729 31.5 28.1251 31.5Z" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M21.375 4.5V12.375H29.2511" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M14.625 21.375H21.375" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M18 18V24.75" stroke="#1C01A9" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
<label htmlFor="" className="blue unselectable">Прикрепить скан документов</label>
</div>
<input type="file" />
</div>
<input type="file" />
</div>
) }
</Dropzone>
) }
</Dropzone>
) }
</div>
)

View File

@ -38,6 +38,7 @@ class Form_1_Main extends QuestionnaireForm
individual_executive: "",
other_control: "",
nko: false,
accept: false,
},
loading: false,
};
@ -74,7 +75,12 @@ class Form_1_Main extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_1_Main", "_handle_onFormSubmit");
const { address, phone_code, code_check_loading } = this.state;
this._handle_onCheckboxFieldChange("step", 2);
setTimeout(() =>
{
this.props.onNextStep("contacts");
}, 10);
}
_check_fields_disabled = (values) =>
@ -92,11 +98,12 @@ class Form_1_Main extends QuestionnaireForm
render()
{
const { checking } = this.props;
const { loading, main } = this.state;
return (
<React.Fragment>
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_1">
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_1 ${ checking && "disabled" }`}>
<p className="title">1. Информация о лизингополучателе</p>
<div className="form_field">
@ -107,7 +114,8 @@ class Form_1_Main extends QuestionnaireForm
value={ main.title }
placeholder="Введите наименование"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
@ -120,7 +128,8 @@ class Form_1_Main extends QuestionnaireForm
value={ main.inn }
placeholder="Введите ИНН"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -131,7 +140,8 @@ class Form_1_Main extends QuestionnaireForm
value={ main.kpp }
placeholder="Введите КПП"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -145,7 +155,8 @@ class Form_1_Main extends QuestionnaireForm
value={ main.telephone }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
@ -157,6 +168,7 @@ class Form_1_Main extends QuestionnaireForm
value={ main.websiteurl }
placeholder="Введите адрес сайта, если есть"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
</div>
</div>
@ -169,6 +181,7 @@ class Form_1_Main extends QuestionnaireForm
value={ main.email }
placeholder="Укажите адрес электронной почты"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
<p>может использоваться для отправки лизингодателем юридически значимых сообщений в соответсвии с условиями договора лизинга, а так же для операций в электронном ПТС/ПСМ</p>
</div>
@ -181,6 +194,7 @@ class Form_1_Main extends QuestionnaireForm
value={ main.financial_loan }
placeholder="Укажите сумму"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
<p>сумма текущих ежемесячных платежей по действующим кредитам/договорам лизинга</p>
</div>
@ -195,6 +209,7 @@ class Form_1_Main extends QuestionnaireForm
id="main.nko_0"
name="main.nko"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !main.nko ? true : false) }
disabled={ main.nko && checking }
/>
<label htmlFor="main.nko_0" className="unselectable">Нет</label>
</div>
@ -205,19 +220,22 @@ class Form_1_Main extends QuestionnaireForm
id="main.nko_1"
name="main.nko"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !main.nko ? true : false) }
disabled={ !main.nko && checking }
/>
<label htmlFor="main.nko_1" className="unselectable">Да</label>
</div>
</div>
</div>
<div className="action">
<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>
{ !checking && (
<div className="action">
<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>
) }
</form>
</React.Fragment>
)

View File

@ -55,13 +55,30 @@ class Form_2_Contacts extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_2_Contacts", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 3);
setTimeout(() =>
{
this.props.onNextStep("signer");
}, 10);
}
_check_fields_disabled = (values) =>
_checkDisabled = () =>
{
for(let i in values)
const { contacts } = this.state;
const check = ["fact_address", "legal_address", "postal_address"];
if(contacts.address_type === "fact")
{
if(values[i] === "")
if(contacts.fact_address.name === "")
{
return true;
}
}
if(contacts.address_type === "postal")
{
if(contacts.postal_address.name === "")
{
return true;
}
@ -72,12 +89,13 @@ class Form_2_Contacts extends QuestionnaireForm
render()
{
const { checking } = this.props;
const { contacts, loading } = this.state;
const { address_type, legal_address, fact_address, postal_address, } = contacts;
return (
<React.Fragment>
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_2">
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_2 ${ checking && "disabled" }`}>
<p className="title">2. Адреса лизингополучателя</p>
<div className="form_field">
@ -86,6 +104,7 @@ class Form_2_Contacts extends QuestionnaireForm
value={ fact_address.title }
fias={ fact_address.fias_id }
onChange={ (data) => this._handle_onTextFieldChange("contacts.fact_address", data) }
disabled={ checking }
/>
<p>для юр.диц - заполняется, если отличается от указанного в ЕГРЮЛ; для ИП - заполняется всегда</p>
</div>
@ -101,6 +120,7 @@ class Form_2_Contacts extends QuestionnaireForm
name="contacts.address_type"
checked={ address_type === "legal" ? true : false }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
<label htmlFor="contacts.address_type_legal" className="unselectable">По юридическому адресу, указанному в ЕГРЮЛ (для юрлиц)</label>
</div>
@ -112,6 +132,7 @@ class Form_2_Contacts extends QuestionnaireForm
name="contacts.address_type"
checked={ address_type === "fact" ? true : false }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
<label htmlFor="contacts.address_type_fact" className="unselectable">По фактическому адресу, указанному в настоящей анкете</label>
</div>
@ -122,7 +143,8 @@ class Form_2_Contacts extends QuestionnaireForm
id="contacts.address_type_postal"
name="contacts.address_type"
checked={ address_type === "postal" ? true : false }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
<label htmlFor="contacts.address_type_postal" className="unselectable" style={{ width: "100%" }}>
<span>По следующему адресу</span>
@ -130,20 +152,22 @@ class Form_2_Contacts extends QuestionnaireForm
value={ postal_address.title }
fias={ postal_address.fias_id }
onChange={ (data) => this._handle_onTextFieldChange("contacts.postal_address", data) }
disabled={ address_type === "postal" ? false : true }
disabled={ !checking && address_type === "postal" ? false : true }
/>
</label>
</div>
</div>
</div>
<div className="action">
<button type="submit" className="button button-blue" disabled={ false }>
{ 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>
{ !checking && (
<div className="action">
<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>
) }
</form>
</React.Fragment>
)

View File

@ -9,15 +9,17 @@ import { SpinnerCircular } from 'spinners-react';
import Select from 'react-select';
import { connect } from "react-redux";
import { withRouter } from 'next/router';
import { get as _get } from 'lodash';
import QuestionnaireForm from "../QuestionnaireForm";
import DateInput from '../../../../pages/components/DatePicker';
import CalendarDatePicker from '../../../CalendarDatePicker';
import FilesList from "../FilesList";
import Modal from "../../../../pages/components/Modal/modal";
import AddressSuggestsSelect from "../AddressSuggestsSelect";
import countries from "../../../../lib/countries.json";
import citizenships from "../../../../lib/citizenships.json";
import { reduxWrapper } from '../../../../store';
import moment from "moment";
class Form_3_Signer extends QuestionnaireForm
{
@ -124,6 +126,7 @@ class Form_3_Signer extends QuestionnaireForm
individual_executive_files: nextProps.questionnaire.individual_executive_files,
signatory_person: nextProps.questionnaire.signatory_person,
signatory_person_files: nextProps.questionnaire.signatory_person_files,
personal_data_consent: nextProps.questionnaire.personal_data_consent,
};
}
@ -135,23 +138,144 @@ class Form_3_Signer extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_3_Signer", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 4);
setTimeout(() =>
{
this.props.onNextStep("shareholders");
}, 10);
}
_check_fields_disabled = (values) =>
_checkDisabled = () =>
{
for(let i in values)
const { main, head_person, signatory_person, personal_data_consent } = this.state;
const head_person_check = [
"lastname",
"firstname",
"jobtitle",
"telephone",
"email",
"identity_document.seria",
"identity_document.docnumber",
"identity_document.issuedate",
"identity_document.code",
"identity_document.issueby",
"identity_document.placebirth",
"identity_document.citizenship_code",
"identity_document.registration_address.title",
"evo_assignment_date",
];
for(let i in head_person_check)
{
if(values[i] === "")
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 = [
"individual_executive_inn",
"individual_executive_kpp",
"individual_executive_oop",
"individual_executive_docnum",
"individual_executive_docdate",
];
for(let i in main_check)
{
if(_get(main, main_check[i]) === "")
{
console.log("DISABLED", "main", main_check[i]);
return true;
}
}
}
//иной подписант
if(signatory_person.delegation_agreement)
{
const signatory_person_check = [
"lastname",
"firstname",
"jobtitle",
"signer_rule_basis",
"signer_rule_basis_add",
"docdate",
"docnumber",
"telephone",
"email",
"identity_document.seria",
"identity_document.docnumber",
"identity_document.issuedate",
"identity_document.icode",
"identity_document.issueby",
"identity_document.placebirth",
"identity_document.citizenship_code",
"identity_document.registration_address.title",
];
for(let i in signatory_person_check)
{
if(_get(signatory_person, signatory_person_check[i]) === "")
{
console.log("DISABLED", "signatory_person", signatory_person_check[i]);
return true;
}
}
}
if(!personal_data_consent)
{
return true;
}
return false;
}
/*
_checkDisabled = () =>
{
const { main } = this.state;
const check = ["high_level", "board_of_directors", "collective_executive", "individual_executive"];
for(let i in check)
{
if(main[check[i]] === "")
{
return true;
}
}
if(!main.accept)
{
return true;
}
return false;
}
*/
render()
{
const { checking } = this.props;
const {
personal_data_consent,
head_person_files,
@ -165,9 +289,33 @@ class Form_3_Signer extends QuestionnaireForm
const { loading, } = this.state;
const { main, head_person, signatory_person } = this.state;
let head_person_citizenship = undefined;
if(head_person.identity_document.citizenship_code !== "")
{
for(let i in citizenships)
{
if(parseInt(citizenships[i].value, 10) === parseInt(head_person.identity_document.citizenship_code, 10))
{
head_person_citizenship = citizenships[i];
}
}
}
let signatory_person_citizenship = undefined;
if(signatory_person.identity_document.citizenship_code !== "")
{
for(let i in citizenships)
{
if(parseInt(citizenships[i].value, 10) === parseInt(signatory_person.identity_document.citizenship_code, 10))
{
signatory_person_citizenship = citizenships[i];
}
}
}
return (
<React.Fragment>
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_3">
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_3 ${ checking && "disabled" }`}>
<p className="title">3. Информация о единоличном исполнительном органе, подписанте договора лизинга</p>
<div className="form_field">
<label>Фамилия</label>
@ -177,7 +325,8 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.lastname }
placeholder="Введите фамилию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -188,7 +337,8 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.firstname }
placeholder="Введите имя"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -199,7 +349,7 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.middlename }
placeholder="Введите отчество"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="formgroup">
@ -211,7 +361,8 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.identity_document.seria }
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -222,19 +373,22 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.identity_document.docnumber }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
</div>
<div className="formgroup">
<div className="form_field">
<label>Дата выдачи</label>
<DateInput
<CalendarDatePicker
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.evo_assignment_date" }
id={ "head_person.identity_document.issuedate" }
value={ head_person.identity_document.issuedate !== "" ? head_person.identity_document.issuedate : null }
onChange={ (date) => this._handle_onTextFieldChange("head_person.identity_document.issuedate", date) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -245,7 +399,8 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.identity_document.code }
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -257,18 +412,19 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.identity_document.issueby }
placeholder="Введите наименование подразделения выдавшего документ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Место рождения</label>
<input type="text"
id="head_person.identity_document.placebirth"
name="head_person.identity_document.placebirth"
<AddressSuggestsSelect
id={ "head_person.identity_document.placebirth" }
value={ head_person.identity_document.placebirth }
placeholder="Введите данные"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
placeholder="Укажите место рождения"
onChange={ (data) => this._handle_onTextFieldChange("head_person.identity_document.placebirth", data.title) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -282,8 +438,10 @@ class Form_3_Signer extends QuestionnaireForm
isSearchable={ true }
className="autocomlete"
classNamePrefix="react-select"
value={ head_person_citizenship }
onChange={ (element) => this._handle_onTextFieldChange("head_person.identity_document.citizenship_code", element.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -291,7 +449,9 @@ class Form_3_Signer extends QuestionnaireForm
<AddressSuggestsSelect
value={ head_person.identity_document.registration_address.title }
fias={ head_person.identity_document.registration_address.fias_id }
placeholder="Укажите адрес регистрации"
onChange={ (data) => this._handle_onTextFieldChange("head_person.identity_document.registration_address", data) }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -302,24 +462,56 @@ class Form_3_Signer extends QuestionnaireForm
value={ head_person.jobtitle }
placeholder="Укажите должность"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Телефон</label>
<input type="text"
id={ "head_person.telephone" }
name={ "head_person.telephone" }
value={ head_person.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={ "head_person.email" }
name={ "head_person.email" }
value={ head_person.email }
placeholder="Введите E-mail"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field picker">
<label>Дата назначения</label>
<div style={{ display: "flex", flexWrap: "wrap", width: "calc(100% - 198px)" }}>
<DateInput
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.evo_assignment_date" }
value={ head_person.evo_assignment_date !== "" ? head_person.evo_assignment_date : null }
onChange={ (date) => this._handle_onTextFieldChange("head_person.evo_assignment_date", date) }
required={ true }
disabled={ checking }
/>
<div className="form_field checkbox" style={{width: "auto", marginLeft: "28px"}}>
<input type="checkbox"
hidden=""
id="head_person.evo_indefinite"
name="head_person.evo_indefinite"
checked={ head_person.evo_indefinite }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !head_person.evo_indefinite ? true : false) }
disabled={ checking }
/>
<label htmlFor="head_person.evo_indefinite" className="unselectable">Полномочия бессрочны</label>
</div>
@ -329,11 +521,13 @@ class Form_3_Signer extends QuestionnaireForm
<div className="form_field picker">
<label>Дата окончания полномочий</label>
<div style={{ display: "flex", flexWrap: "wrap", width: "calc(100% - 198px)" }}>
<DateInput
<CalendarDatePicker
placeholder="ДД.ММ.ГГГГ"
id={ "head_person.evo_credentials_dateend" }
onChange={ (date) => this._handle_onTextFieldChange("head_person.evo_credentials_dateend", date) }
value={ head_person.evo_credentials_dateend !== "" ? 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 }
/>
</div>
</div>
@ -344,6 +538,7 @@ class Form_3_Signer extends QuestionnaireForm
files={ head_person_files }
onAddFile={ this._handle_onAddFile }
onRemoveFile={ this._handle_onRemoveFile }
checking={ checking }
/>
<div className="form_field">
@ -352,7 +547,9 @@ class Form_3_Signer extends QuestionnaireForm
hidden=""
id="signatory_person.not_head_person"
name="signatory_person.not_head_person"
checked={ signatory_person.not_head_person }
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>
</div>
@ -371,6 +568,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Укажите управляющую организацию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -384,7 +582,8 @@ class Form_3_Signer extends QuestionnaireForm
value={ main.individual_executive_inn }
placeholder="Введите ИНН"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
@ -397,7 +596,8 @@ class Form_3_Signer extends QuestionnaireForm
value={ main.individual_executive_kpp }
placeholder="Введите КПП"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -412,6 +612,7 @@ class Form_3_Signer extends QuestionnaireForm
value={ main.individual_executive_docnum }
placeholder="Номер договора"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
</div>
@ -428,12 +629,14 @@ class Form_3_Signer extends QuestionnaireForm
required={ true }
/>
{*/}
<DateInput
<CalendarDatePicker
style={{ width: "100%", }}
placeholder="ДД.ММ.ГГГГ"
id={ "main.individual_executive_docdate" }
value={ main.individual_executive_docdate !== "" ? main.individual_executive_docdate : null }
onChange={ (date) => this._handle_onTextFieldChange("main.individual_executive_docdate", date) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -443,6 +646,7 @@ class Form_3_Signer extends QuestionnaireForm
files={ individual_executive_files }
onAddFile={ this._handle_onAddFile }
onRemoveFile={ this._handle_onRemoveFile }
checking={ checking }
/>
</React.Fragment>
@ -454,7 +658,9 @@ class Form_3_Signer extends QuestionnaireForm
hidden=""
id="signatory_person.delegation_agreement"
name="signatory_person.delegation_agreement"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !signatory_person.delegation_agreement ? true : false) }
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>
@ -473,6 +679,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите фамилию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -485,6 +692,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите имя"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -496,7 +704,7 @@ class Form_3_Signer extends QuestionnaireForm
value={ signatory_person.middlename }
placeholder="Введите отчество"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -510,6 +718,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -522,6 +731,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -529,13 +739,14 @@ class Form_3_Signer extends QuestionnaireForm
<div className="formgroup">
<div className="form_field">
<label>Дата выдачи</label>
<input type="text"
id="signatory_person.identity_document.issuedate"
name="signatory_person.identity_document.issuedate"
value={ signatory_person.identity_document.issuedate }
<CalendarDatePicker
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
id={ "signatory_person.identity_document.issuedate" }
value={ signatory_person.identity_document.issuedate !== "" ? signatory_person.identity_document.issuedate : null }
onChange={ (date) => this._handle_onTextFieldChange("signatory_person.identity_document.issuedate", date) }
required={ true }
disabled={ checking }
/>
</div>
@ -548,6 +759,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -561,18 +773,19 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Введите наименование подразделения выдавшего документ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Место рождения</label>
<input type="text"
id="signatory_person.identity_document.placebirth"
name="signatory_person.identity_document.placebirth"
<AddressSuggestsSelect
id={ "signatory_person.identity_document.placebirth" }
value={ signatory_person.identity_document.placebirth }
placeholder="Введите данные"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
placeholder="Укажите место рождения"
onChange={ (data) => this._handle_onTextFieldChange("signatory_person.identity_document.placebirth", data.title) }
required={ true }
disabled={ checking }
/>
</div>
@ -587,8 +800,10 @@ class Form_3_Signer extends QuestionnaireForm
isSearchable={ true }
className="autocomlete"
classNamePrefix="react-select"
value={ signatory_person_citizenship }
onChange={ (element) => this._handle_onTextFieldChange("signatory_person.identity_document.citizenship_code", element.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -598,6 +813,7 @@ class Form_3_Signer extends QuestionnaireForm
value={ signatory_person.identity_document.registration_address.title }
fias={ signatory_person.identity_document.registration_address.fias_id }
onChange={ (data) => this._handle_onTextFieldChange("signatory_person.identity_document.registration_address", data) }
disabled={ checking }
/>
{/*}
@ -615,19 +831,20 @@ class Form_3_Signer extends QuestionnaireForm
<div className="form_field">
<label>Должность</label>
<input type="text"
id="signatory_person.identity_document.jobtitle"
name="signatory_person.identity_document.jobtitle"
id="signatory_person.jobtitle"
name="signatory_person.jobtitle"
value={ signatory_person.jobtitle }
placeholder="Укажите должность"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<p><b>Реквизиты документа подтверждающие полномочия на подписание договора лизинга</b></p>
<div className="form_field">
<label>Наименование документа</label>
<label>Вид документа</label>
<input type="text"
id="signatory_person.signer_rule_basis"
name="signatory_person.signer_rule_basis"
@ -635,6 +852,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Вид документа"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -647,31 +865,34 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Наименование документа"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="formgroup">
<div className="form_field">
<label>Номер документы</label>
<label>Номер документа</label>
<input type="text"
id="signatory_person.docnumber"
name="signatory_person.docnumber"
value={ signatory_person.docnumber }
placeholder="Номер документы"
placeholder="Номер документа"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Дата</label>
<input type="text"
id="signatory_person.docdate"
name="signatory_person.docdate"
value={ signatory_person.docdate }
placeholder="Дата"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
<CalendarDatePicker
style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
id={ "signatory_person.docdate" }
value={ signatory_person.docdate !== "" ? signatory_person.docdate : null }
onChange={ (date) => this._handle_onTextFieldChange("signatory_person.docdate", date) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -686,6 +907,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="Телефон"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -698,6 +920,7 @@ class Form_3_Signer extends QuestionnaireForm
placeholder="E-mail"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -707,6 +930,7 @@ class Form_3_Signer extends QuestionnaireForm
files={ signatory_person_files }
onAddFile={ this._handle_onAddFile }
onRemoveFile={ this._handle_onRemoveFile }
checking={ checking }
/>
{/*}
@ -725,18 +949,22 @@ class Form_3_Signer extends QuestionnaireForm
hidden=""
id="personal_data_consent"
name="personal_data_consent"
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !personal_data_consent ? true : false) }
checked={ personal_data_consent }
onChange={ (event) => this._handle_onCheckboxFieldChange(event.target.name, !personal_data_consent ? true : false) }
disabled={ checking }
/>
<label htmlFor="personal_data_consent" className="unselectable">Даю согласие на&nbsp;<a style={{ cursor: "pointer", }} onClick={ () => { this.setState({ modal_show_personal_data: true, }) } }>обработку персональных данных</a></label>
</div>
</div>
<div className="action">
<button type="submit" className="button button-blue" disabled={ false }>
{ 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>
{ !checking && (
<div className="action">
<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>
) }
</form>
<Modal
open={ modal_show_personal_data }

View File

@ -9,9 +9,10 @@ import { SpinnerCircular } from 'spinners-react';
import Select from 'react-select';
import { connect } from "react-redux";
import { withRouter } from 'next/router';
import { get as _get } from 'lodash';
import QuestionnaireForm from "../QuestionnaireForm";
import DateInput from '../../../../pages/components/DatePicker';
import CalendarDatePicker from '../../../CalendarDatePicker';
import citizenships from "../../../../lib/citizenships.json";
import AddressSuggestsSelect from "../AddressSuggestsSelect";
import { reduxWrapper } from '../../../../store';
@ -23,7 +24,7 @@ class ShareholderForm extends React.Component
render()
{
const { index, shareholder } = this.props;
const { index, shareholder, checking } = this.props;
let citizenship = undefined;
if(shareholder.identity_document.citizenship_code !== "")
@ -48,6 +49,7 @@ class ShareholderForm extends React.Component
placeholder="Введите фамилию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -60,6 +62,7 @@ class ShareholderForm extends React.Component
placeholder="Введите имя"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -71,7 +74,46 @@ class ShareholderForm extends React.Component
value={ shareholder.middlename }
placeholder="Введите отчество"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Должность <small>если имеется</small></label>
<input type="text"
id={ `founded_persons[${ index }].jobtitle` }
name={ `founded_persons[${ index }].jobtitle` }
value={ shareholder.jobtitle }
placeholder="Введите должность"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ false }
disabled={ checking }
/>
</div>
<div className="form_field">
<label>Телефон</label>
<input type="text"
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 }
/>
</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 }
placeholder="Введите E-mail"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -87,6 +129,7 @@ class ShareholderForm extends React.Component
placeholder="Введите серию"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -97,6 +140,7 @@ class ShareholderForm extends React.Component
placeholder="Введите номер"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -108,13 +152,14 @@ class ShareholderForm extends React.Component
<label>Дата выдачи и код подразделения </label>
<div className="formgroup">
<div className="form_field">
<DateInput
<CalendarDatePicker
//style={{ width: "calc(100% - 198px)" }}
placeholder="ДД.ММ.ГГГГ"
id={ `founded_persons[${ index }].identity_document.issuedate` }
name={ `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) }
required={ true }
disabled={ checking }
/>
</div>
<div className="form_field">
@ -125,6 +170,7 @@ class ShareholderForm extends React.Component
placeholder="Код подразделения"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
</div>
@ -140,6 +186,7 @@ class ShareholderForm extends React.Component
placeholder="Введите наименование подразделения выдавшего документ"
onChange={ (event) => this._handle_onTextFieldChange(event.target.name, event.target.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -147,8 +194,9 @@ class ShareholderForm extends React.Component
<label>Место рождения</label>
<AddressSuggestsSelect
id={ `founded_persons[${ index }].identity_document.placebirth` }
value={ shareholder.identity_document.placebirth.title }
value={ shareholder.identity_document.placebirth }
onChange={ (data) => this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.placebirth`, data.title) }
disabled={ checking }
/>
</div>
@ -166,6 +214,7 @@ class ShareholderForm extends React.Component
classNamePrefix="react-select"
onChange={ (element) => this._handle_onTextFieldChange(`founded_persons[${ index }].identity_document.citizenship_code`, element.value) }
required={ true }
disabled={ checking }
/>
</div>
@ -176,6 +225,7 @@ class ShareholderForm extends React.Component
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) }
disabled={ checking }
/>
</div>
@ -211,7 +261,7 @@ class Shareholder extends React.Component
render()
{
const { index, shareholders, removeShareholder, signatories, changeSignatorySelection, clearSignatorySelection, } = this.props;
const { index, shareholders, removeShareholder, signatories, changeSignatorySelection, clearSignatorySelection, checking } = this.props;
const shareholder = shareholders[index];
return (
@ -223,26 +273,29 @@ class Shareholder extends React.Component
<label>Физическое лицо { index + 1 }</label>
<div className="formgroup control">
<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, }) }
/>
<label className="unselectable" htmlFor={ `founded_persons[${ index }].founder_from_list` }>Выбрать из списка</label>
</div>
<button className="delete" onClick={ (event) => { event.preventDefault(); removeShareholder(index) } }>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.25 5.25L3.75 5.25001" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M9.75 9.75V15.75" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M14.25 9.75V15.75" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M18.75 5.25V19.5C18.75 19.6989 18.671 19.8897 18.5303 20.0303C18.3897 20.171 18.1989 20.25 18 20.25H6C5.80109 20.25 5.61032 20.171 5.46967 20.0303C5.32902 19.8897 5.25 19.6989 5.25 19.5V5.25" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M15.75 5.25V3.75C15.75 3.35218 15.592 2.97064 15.3107 2.68934C15.0294 2.40804 14.6478 2.25 14.25 2.25H9.75C9.35218 2.25 8.97064 2.40804 8.68934 2.68934C8.40804 2.97064 8.25 3.35218 8.25 3.75V5.25" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
</button>
{ !checking && (
<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, }) }
/>
<label className="unselectable" htmlFor={ `founded_persons[${ index }].founder_from_list` }>Выбрать из списка</label>
</div>
) }
{ !checking && (
<button className="delete" onClick={ (event) => { event.preventDefault(); removeShareholder(index) } }>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.25 5.25L3.75 5.25001" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M9.75 9.75V15.75" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M14.25 9.75V15.75" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M18.75 5.25V19.5C18.75 19.6989 18.671 19.8897 18.5303 20.0303C18.3897 20.171 18.1989 20.25 18 20.25H6C5.80109 20.25 5.61032 20.171 5.46967 20.0303C5.32902 19.8897 5.25 19.6989 5.25 19.5V5.25" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
<path d="M15.75 5.25V3.75C15.75 3.35218 15.592 2.97064 15.3107 2.68934C15.0294 2.40804 14.6478 2.25 14.25 2.25H9.75C9.35218 2.25 8.97064 2.40804 8.68934 2.68934C8.40804 2.97064 8.25 3.35218 8.25 3.75V5.25" stroke="#ED0A34" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
</svg>
</button>
) }
</div>
</div>
) }
@ -253,8 +306,17 @@ class Shareholder extends React.Component
<div className="feed">
<div className="feed_list">
{ signatories.map((signatory, s_index) => {
{ signatories !== undefined && signatories !== null && signatories.map((signatory, s_index) => {
const disabled = signatory.signatoryid !== shareholder.signatory_id ? this._checkSignatoryDisabled(signatory.signatoryid) : false;
if(checking)
{
if(shareholder.signatory_id !== signatory.signatoryid)
{
return null;
}
}
return (
<div className="form_field checkbox" key={ s_index }>
<input type="radio" hidden=""
@ -353,8 +415,8 @@ class Form_4_Shareholders extends QuestionnaireForm
static getDerivedStateFromProps(nextProps, prevState)
{
return {
founded_persons: nextProps.founded_persons,
founded_persons_template: nextProps.founded_persons_template,
founded_persons: nextProps.questionnaire.founded_persons,
founded_persons_template: nextProps.questionnaire.founded_persons_template,
};
}
@ -365,7 +427,7 @@ class Form_4_Shareholders extends QuestionnaireForm
if(this.state.founded_persons.length === 0)
{
this._updateQuestionnaire({
founded_persons: [{ ...founded_persons_template }],
founded_persons: [{ ...founded_persons_template, ...{ founder_from_list: false, founder_number: this.state.founded_persons.length + 1 } }],
});
}
}
@ -410,15 +472,68 @@ class Form_4_Shareholders extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_4_Shareholders", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 5);
setTimeout(() =>
{
this.props.onNextStep("regulatory");
}, 10);
}
_check_fields_disabled = (values) =>
_checkDisabled = () =>
{
for(let i in values)
const { founded_persons } = this.state;
const check_all = [
"founder_part",
];
const check = [
"lastname",
"firstname",
"telephone",
"email",
"identity_document.seria",
"identity_document.docnumber",
"identity_document.issuedate",
"identity_document.icode",
"identity_document.issueby",
"identity_document.placebirth",
"identity_document.citizenship_code",
"identity_document.registration_address.title",
];
for(let f in founded_persons)
{
if(values[i] === "")
for(let i in check_all)
{
return true;
if(_get(founded_persons[f], check_all[i]) === "")
{
console.log("1. EMPTY", f, check_all[i]);
return true;
}
}
if(!founded_persons[f].founder_from_list)
{
for(let i in check)
{
if(_get(founded_persons[f], check[i]) === "")
{
console.log("2. EMPTY", f, check[i]);
return true;
}
}
}
else
{
if(founded_persons[f].signatory_id === null)
{
console.log("3. EMPTY", f, "signatory_id");
console.log("founded_persons[f]");
console.log(founded_persons[f]);
return true;
}
}
}
@ -427,11 +542,11 @@ class Form_4_Shareholders extends QuestionnaireForm
render()
{
const { signatories } = this.props;
const { signatories, checking } = this.props;
const { founded_persons, loading, address, } = this.state;
return (
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_4">
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_4 ${ checking && "disabled" }`}>
<p className="title">4. Сведения об участниках (акционерах) и бенефициарных владельцах</p>
<p> физических лицах, владеющих долей в уставном капитале более 25%
<small>*бенефициарный владелец (в соответствии с Федеральным законом от 07.08.2001 No115-ФЗ «О противодействии легализации (отмыванию) доходов, полученных преступным путем, и финансированию терроризма»)
@ -448,22 +563,24 @@ class Form_4_Shareholders extends QuestionnaireForm
address={ address }
_handle_onTextFieldChange={ this._handle_onTextFieldChange }
_handle_onCheckboxFieldChange={ this._handle_onCheckboxFieldChange }
selectSignatory={ this._handle_onSelectSignatory }
removeShareholder={ this._handle_onRemoveShareholder }
clearSignatorySelection={ this._handle_onClearSignatorySelection }
changeSignatorySelection={ this._handle_onChangeSignatorySelection }
signatories={ signatories }
checking={ checking }
/>
)) }
<div className="action">
<button className="button button-blue" disabled={ false } onClick={ (event) => { event.preventDefault(); this._handle_onAddShareholder(); }}>Добавить еще одного владельца</button>
<button type="submit" className="button button-blue" disabled={ false }>
{ 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>
{ !checking && (
<div className="action">
<button className="button button-blue" disabled={ false } onClick={ (event) => { event.preventDefault(); this._handle_onAddShareholder(); }}>Добавить еще одного владельца</button>
<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>
) }
</form>
)
}
@ -472,8 +589,7 @@ class Form_4_Shareholders extends QuestionnaireForm
function mapStateToProps(state, ownProps)
{
return {
founded_persons: state.questionnaire.founded_persons,
founded_persons_template: state.questionnaire.founded_persons_template,
questionnaire: state.questionnaire,
}
}

View File

@ -18,10 +18,6 @@ class Form_5_Regulatory extends QuestionnaireForm
{
super(props);
this.state = {
address: "",
phone_check_loading: false,
phone_number_format_error: false,
main: {
title: "",
inn: "",
@ -51,7 +47,7 @@ class Form_5_Regulatory extends QuestionnaireForm
static getDerivedStateFromProps(nextProps, prevState)
{
return {
main: nextProps.main,
main: nextProps.questionnaire.main,
};
}
@ -63,28 +59,43 @@ class Form_5_Regulatory extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_5_Regulatory", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 6);
setTimeout(() =>
{
this.props.onNextStep("non-profit");
}, 10);
}
_check_fields_disabled = (values) =>
_checkDisabled = () =>
{
for(let i in values)
const { main } = this.state;
const check = ["high_level", "board_of_directors", "collective_executive", "individual_executive"];
for(let i in check)
{
if(values[i] === "")
if(main[check[i]] === "")
{
return true;
}
}
if(!main.accept)
{
return true;
}
return false;
}
render()
{
const { checking } = this.props;
const { main, loading } = this.state;
return (
<React.Fragment>
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_5">
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_5 ${ checking && "disabled" }`}>
<p className="title">5. Сведения об органах управления</p>
<p>Заполняется юридическими лицами, индивидуальными предпринимателями не заполняется</p>
@ -191,14 +202,16 @@ class Form_5_Regulatory extends QuestionnaireForm
<li style={{ lineHeight: "18px" }}>Сведения об источниках происхождения денежных средств приносящая доход деятельность (кроме НКО и физ.лиц).</li>
</ul>
<div className="action">
<div></div>
<button type="submit" className="button button-blue" disabled={ false }>
{ 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>
{ !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>
) }
</form>
</React.Fragment>
)
@ -208,7 +221,7 @@ class Form_5_Regulatory extends QuestionnaireForm
function mapStateToProps(state, ownProps)
{
return {
main: state.questionnaire.main,
questionnaire: state.questionnaire,
}
}

View File

@ -36,7 +36,7 @@ class Form_6_NonProfit extends QuestionnaireForm
static getDerivedStateFromProps(nextProps, prevState)
{
return {
non_profit: nextProps.non_profit,
non_profit: nextProps.questionnaire.non_profit,
};
}
@ -48,28 +48,51 @@ class Form_6_NonProfit extends QuestionnaireForm
{
event.preventDefault();
console.log("Form_6_NonProfit", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 7);
setTimeout(() =>
{
this.props.onNextStep("check");
}, 10);
}
_check_fields_disabled = (values) =>
_checkDisabled = () =>
{
for(let i in values)
const { non_profit } = this.state;
const check = ["fin_goals_cars", "fin_goals_trucks", "fin_goals_special"];
for(let i in check)
{
if(values[i] === "")
if(non_profit[check[i]] === "")
{
return true;
}
}
if(non_profit.fin_source_another)
{
if(non_profit.fin_source_another_description === "")
{
return true;
}
}
if(!non_profit.fin_source_business && !non_profit.fin_source_donate && !non_profit.fin_source_fees)
{
return true;
}
return false;
}
render()
{
const { checking } = this.props;
const { non_profit, loading } = this.state;
return (
<React.Fragment>
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_6">
<form onSubmit={ this._handle_onFormSubmit } className={`questionnaire questionnaire_6 ${ checking && "disabled" }`}>
<p className="title">6. Данные о некомерческой организации</p>
<p>Источники происхождения денежных средств, из которых будут осуществляться лизинговые платежи:</p>
@ -192,13 +215,15 @@ class Form_6_NonProfit extends QuestionnaireForm
/>
</div>
<div className="action">
<button type="submit" className="button button-blue" disabled={ false }>
{ 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>
{ !checking && (
<div className="action">
<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>
) }
</form>
</React.Fragment>
)
@ -208,7 +233,7 @@ class Form_6_NonProfit extends QuestionnaireForm
function mapStateToProps(state, ownProps)
{
return {
non_profit: state.questionnaire.non_profit,
questionnaire: state.questionnaire,
}
}

View File

@ -11,6 +11,12 @@ import { withRouter } from 'next/router';
import QuestionnaireForm from "../QuestionnaireForm";
import { reduxWrapper } from '../../../../store';
import Form_1_Main from "../Form_1_Main";
import Form_2_Contacts from "../Form_2_Contacts";
import Form_3_Signer from "../Form_3_Signer";
import Form_4_Shareholders from "../Form_4_Shareholders";
import Form_5_Regulatory from "../Form_5_Regulatory";
import Form_6_NonProfit from "../Form_6_NonProfit";
class Form_7_Check extends QuestionnaireForm
{
@ -19,7 +25,7 @@ class Form_7_Check extends QuestionnaireForm
super(props);
this.state = {
address: "",
phone_check_loading: false,
loading: false,
phone_number_format_error: false,
step: 7,
@ -64,6 +70,13 @@ class Form_7_Check extends QuestionnaireForm
{
event.preventDefault();
console.log("FormAddress", "_handle_onFormSubmit");
this._handle_onCheckboxFieldChange("step", 8);
setTimeout(() =>
{
this.props.onNextStep("signing");
}, 10);
}
_handle_onAddressChange = (value) =>
@ -88,10 +101,19 @@ class Form_7_Check extends QuestionnaireForm
render()
{
const { address, phone_check_loading, phone_number_format_error } = this.state;
const { signatories } = this.props;
const { address, loading, phone_number_format_error } = this.state;
return (
<React.Fragment>
<Form_1_Main checking={ true }/>
<Form_2_Contacts checking={ true }/>
<Form_3_Signer checking={ true }/>
<Form_4_Shareholders checking={ true } signatories={ signatories }/>
<Form_5_Regulatory checking={ true }/>
<Form_6_NonProfit checking={ true }/>
{/*}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_1 disabled">
<p className="title">1. Информация о лизингополучателе</p>
@ -151,7 +173,9 @@ class Form_7_Check extends QuestionnaireForm
</div>
</div>
</form>
{*/}
{/*}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_2 disabled">
<p className="title">2. Адреса лизингополучателя</p>
@ -185,7 +209,9 @@ class Form_7_Check extends QuestionnaireForm
</div>
</div>
</form>
{*/}
{/*}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_3 disabled">
<p className="title">3. Информация о единоличном исполнительном органе, подписанте договора лизинга</p>
@ -433,7 +459,9 @@ class Form_7_Check extends QuestionnaireForm
</div>
</div>
</form>
{*/}
{/*}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_4 disabled">
<p className="title">4. Сведения об участниках (акционерах) и бенефициарных владельцах</p>
<p> физических лицах, владеющих долей в уставном капитале более 25%
@ -535,7 +563,9 @@ class Form_7_Check extends QuestionnaireForm
</div>
</div>
</form>
{*/}
{/*}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_5 disabled">
<p className="title">5. Сведения об органах управления</p>
<p>Заполняется юридическими лицами, индивидуальными предпринимателями не заполняется</p>
@ -600,7 +630,9 @@ class Form_7_Check extends QuestionnaireForm
<li>Сведения об источниках происхождения денежных средств приносящая доход деятельность (кроме НКО и физ.лиц).</li>
</ul>
</form>
{*/}
{/*}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_6 disabled">
<p className="title">6. Данные о некомерческой организации</p>
<p>Источники происхождения денежных средств, из которых будут осуществляться лизинговые платежи:</p>
@ -671,6 +703,16 @@ class Form_7_Check extends QuestionnaireForm
</button>
</div>
</form>
{*/}
<form onSubmit={ this._handle_onFormSubmit } className="questionnaire questionnaire_6">
<div className="action">
<button type="submit" className="button button-blue" disabled={ false }>
{ 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>
</form>
</React.Fragment>
)
}

View File

@ -108,8 +108,6 @@ export default class QuestionnaireForm extends React.Component
console.log("QuestionnaireForm", "_handle_onCheckboxFieldChange", { name, value });
const update = { ...this.state };
console.log("update", "BEFORE", update);
_set(update, name, value);
/*

View File

@ -12,7 +12,7 @@ import Header from "../components/Header";
import Footer from "../components/Footer";
import Company from "../components/Company";
import InnerMenu from "./components/InnerMenu";
import DateInput from "../components/DatePicker";
import DateInput from "../../components/DatePicker";
import SignatoriesList from "./change/components/SignatoriesList";
import CalculationsList from "./change/components/CalculationsList";

View File

@ -4,7 +4,7 @@ import moment from "moment";
import pluralize from 'pluralize-ru';
import numeral from "numeral";
import DateInput from "../../../../components/DatePicker";
import DateInput from "../../../../../components/DatePicker";
import { getContractGraphicChangeOptions, getContractGraphicChangeCalculate } from "../../../../../actions";

View File

@ -1,6 +1,6 @@
import React from "react";
import { SpinnerCircular } from "spinners-react";
import DateInput from "../../../../components/DatePicker";
import DateInput from "../../../../../components/DatePicker";
export default class VariantsList extends React.Component
{

View File

@ -11,7 +11,6 @@ import { reduxWrapper } from "../../../store";
import Header from "../../components/Header";
import Footer from "../../components/Footer";
import Company from "../../components/Company";
import DateInput from "../../components/DatePicker";
import InnerMenu from "./../components/InnerMenu";

View File

@ -11,8 +11,6 @@ import { reduxWrapper } from "../../store";
import Header from "../components/Header";
import Footer from "../components/Footer";
import Company from "../components/Company";
import InnerMenu from "./components/InnerMenu";
import DateInput from "./../components/DatePicker";
import {
getContractInfo,

View File

@ -1,7 +1,7 @@
import React from "react";
import moment from "moment";
import DateInput from "../../../components/DatePicker";
import DateInput from "../../../../components/DatePicker";
export default class PenaltiesCalculatorForm extends React.Component
{

View File

@ -2,7 +2,7 @@ import React from "react";
import moment from "moment";
import { SpinnerCircular } from "spinners-react";
import DateInput from "../../../components/DatePicker";
import DateInput from "../../../../components/DatePicker";
import { getReconciliationFile } from "../../../../actions";

View File

@ -17,9 +17,7 @@ import Header from "../components/Header";
import Footer from "../components/Footer";
import InnerMenu from "./components/InnerMenu";
import Company from "../components/Company";
import DateInput from "../components/DatePicker";
import DownloadPrintFormPdfButton from "../components/DownloadPrintFormPdfButton";
import DownloadFinesPdfButton from "../components/DownloadFinesPdfButton";
import PenaltiesCalculatorForm from "./components/PenaltiesCalculatorForm";

View File

@ -14,8 +14,6 @@ import Header from "../components/Header";
import Footer from "../components/Footer";
import InnerMenu from "./components/InnerMenu";
import Company from "../components/Company";
import DateInput from "../components/DatePicker";
import DownloadPrintFormPdfButton from "../components/DownloadPrintFormPdfButton";
import DownloadFinesPdfButton from "../components/DownloadFinesPdfButton";
import {

View File

@ -11,9 +11,6 @@ import { reduxWrapper } from "../../store";
import Header from "../components/Header";
import Footer from "../components/Footer";
import Company from "../components/Company";
import InnerMenu from "./components/InnerMenu";
import DateInput from "../components/DatePicker";
import {
getContractInfo,

View File

@ -12,7 +12,7 @@ import Header from '../components/Header';
import Footer from '../components/Footer';
import InnerMenu from "./components/InnerMenu";
import Company from "../components/Company";
import DateInput from '../components/DatePicker';
import DateInput from '../../components/DatePicker';
import { getContractsList, getReconciliationFile } from '../../actions';

View File

@ -14,7 +14,7 @@ import { reduxWrapper } from '../store';
import Header from './components/Header';
import Footer from './components/Footer';
import Company from "./components/Company";
import DateInput from './components/DatePicker';
import DateInput from '../components/DatePicker';
import Pagination from './components/Pagination';
import Manager from "./components/Manager";
import AccountLayout from "./components/Layout/Account";

View File

@ -67,21 +67,27 @@ class QuestionnairePage extends React.Component
return false;
}
_handle_onNextStep = (path) =>
{
window.scrollTo(0, 0);
this.props.router.push(`/questionnaire#${ path }`);
}
_renderForm = () =>
{
const { signatories } = this.state;
const route = this.props.router.asPath;
if (route.indexOf("#main") > -1) return (<Form_1_Main/>);
if (route.indexOf("#contacts") > -1) return (<Form_2_Contacts/>);
if (route.indexOf("#signer") > -1) return (<Form_3_Signer/>);
if (route.indexOf("#shareholders") > -1) return (<Form_4_Shareholders signatories={ signatories }/>);
if (route.indexOf("#regulatory") > -1) return (<Form_5_Regulatory/>);
if (route.indexOf("#non-profit") > -1) return (<Form_6_NonProfit/>);
if (route.indexOf("#check") > -1) return (<Form_7_Check/>);
if (route.indexOf("#main") > -1) return (<Form_1_Main onNextStep={ this._handle_onNextStep } checking={ false }/>);
if (route.indexOf("#contacts") > -1) return (<Form_2_Contacts onNextStep={ this._handle_onNextStep } checking={ false }/>);
if (route.indexOf("#signer") > -1) return (<Form_3_Signer onNextStep={ this._handle_onNextStep } checking={ false }/>);
if (route.indexOf("#shareholders") > -1) return (<Form_4_Shareholders signatories={ signatories } onNextStep={ this._handle_onNextStep } checking={ false }/>);
if (route.indexOf("#regulatory") > -1) return (<Form_5_Regulatory onNextStep={ this._handle_onNextStep } checking={ false }/>);
if (route.indexOf("#non-profit") > -1) return (<Form_6_NonProfit onNextStep={ this._handle_onNextStep } checking={ false }/>);
if (route.indexOf("#check") > -1) return (<Form_7_Check signatories={ signatories } onNextStep={ this._handle_onNextStep } checking={ true }/>);
if (route.indexOf("#signing") > -1) return (<Form_8_Signing/>);
return (<Form_1_Main/>);
return (<Form_1_Main onNextStep={ this._handle_onNextStep } checking={ false }/>);
}
render()

View File

@ -123,7 +123,7 @@ export const defaultState = {
accept: false,
},
questionnaire: {
step: 9,
step: 1,
main: {
title: "",
inn: "",
@ -234,7 +234,7 @@ export const defaultState = {
telephone: "",
email: "",
founder_from_list: true,
founder_number: "",
founder_number: 0,
founder_part: "",
is_beneficial: false,
identity_document:
@ -299,6 +299,7 @@ export const defaultState = {
fin_goals_trucks: "",
fin_goals_special: "",
},
personal_data_consent: false,
},
};

View File

@ -48,7 +48,7 @@ const makeStore = (context) =>
const persistConfig = {
key: 'lkevoleasing',
whitelist: [ 'auth', 'user', 'company', 'events', 'companies', 'contracts_info', 'contract_events', 'contract_fines', ],
whitelist: [ 'auth', 'user', 'company', 'events', 'companies', 'contracts_info', 'contract_events', 'contract_fines', 'questionnaire'],
storage
};