Merge branch 'master' of https://github.com/merelendor/evoleasing-account
This commit is contained in:
commit
e2e4dc00af
@ -334,6 +334,7 @@ export const resetQuestionnaire = ({ dispatch, id }) =>
|
||||
{
|
||||
const template = JSON.parse(JSON.stringify(questionnaire_template));
|
||||
dispatch({ type: actionTypes.QUESTIONNAIRE_UPDATE, data: { questionnaire: template, } });
|
||||
|
||||
eraseQuestionnaire()
|
||||
.then(() =>
|
||||
{
|
||||
@ -341,13 +342,18 @@ export const resetQuestionnaire = ({ dispatch, id }) =>
|
||||
});
|
||||
}
|
||||
|
||||
export const defaultQuestionnaire = ({ dispatch }) =>
|
||||
export const defaultQuestionnaire = ({ dispatch, sign }) =>
|
||||
{
|
||||
//console.log("defaultQuestionnaire");
|
||||
|
||||
|
||||
const template = JSON.parse(JSON.stringify(questionnaire_template));
|
||||
if(sign !== undefined)
|
||||
{
|
||||
template.sign = sign;
|
||||
}
|
||||
dispatch({ type: actionTypes.QUESTIONNAIRE_UPDATE, data: { questionnaire: template, } });
|
||||
|
||||
eraseQuestionnaire().then(() => {}).catch(() => {});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ export default class DigitalCertificates extends React.Component
|
||||
certificates_error: null,
|
||||
certificate_selected: undefined,
|
||||
signing: false,
|
||||
show_all: false,
|
||||
};
|
||||
this.cryptopro = null;
|
||||
}
|
||||
@ -41,11 +42,17 @@ export default class DigitalCertificates extends React.Component
|
||||
.then((info) =>
|
||||
{
|
||||
//console.log('Initialized', info);
|
||||
// console.log('-'.repeat(20));
|
||||
// for(let i in this.cryptopro)
|
||||
// {
|
||||
// console.log(i);
|
||||
// }
|
||||
// console.log('-'.repeat(20));
|
||||
|
||||
this.cryptopro.listCertificates()
|
||||
.then((certificates_list) =>
|
||||
{
|
||||
//console.log({ certificates_list });
|
||||
console.log({ certificates_list });
|
||||
|
||||
console.log("all certificates", JSON.stringify(certificates_list));
|
||||
Sentry.captureMessage("Client digital sign step, list of all digital certificates");
|
||||
@ -57,63 +64,81 @@ export default class DigitalCertificates extends React.Component
|
||||
this.cryptopro.certificateInfo(certificate.id)
|
||||
.then((cert) =>
|
||||
{
|
||||
const errors = [];
|
||||
let apply = true;
|
||||
|
||||
console.log("certificate", JSON.stringify(cert));
|
||||
console.log("company", JSON.stringify(company));
|
||||
|
||||
//console.log({ cert });
|
||||
if(cert.IsValid)
|
||||
if(cert.Subject['OGRNIP'] !== undefined && cert.Subject['OGRNIP'] !== null && cert.Subject['OGRNIP'] !== "")
|
||||
{
|
||||
if(cert.Subject['OGRNIP'] !== undefined && cert.Subject['OGRNIP'] !== null && cert.Subject['OGRNIP'] !== "")
|
||||
if(cert.Subject['INN'] !== undefined && cert.Subject['INN'] !== null && cert.Subject['INN'] !== "")
|
||||
{
|
||||
if(cert.Subject['INN'] !== undefined && cert.Subject['INN'] !== null && cert.Subject['INN'] !== "")
|
||||
if(main.inn !== cert.Subject['INN'])
|
||||
{
|
||||
if(main.inn === cert.Subject['INN'])
|
||||
{
|
||||
callback(null, [ { id: certificate.id, fields: cert.Subject, valid_to_date: moment(cert.ValidToDate).format("DD.MM.YYYY") } ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(null, []);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(null, []);
|
||||
errors.push('inn');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cert.Subject['INNLE'] !== undefined && cert.Subject['INNLE'] !== null && cert.Subject['INNLE'] !== "")
|
||||
apply = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cert.Subject['INNLE'] !== undefined && cert.Subject['INNLE'] !== null && cert.Subject['INNLE'] !== "")
|
||||
{
|
||||
if(main.inn !== cert.Subject['INNLE'])
|
||||
{
|
||||
let owner_valid = true;
|
||||
const fields = [ "lastname", "firstname", "middlename", ];
|
||||
const cert_owner = `${ cert.Subject['SN']} ${ cert.Subject['G']}`.toUpperCase();
|
||||
|
||||
for(let i in fields)
|
||||
{
|
||||
if(head_person[fields[i]] !== null && head_person[fields[i]] !== "")
|
||||
{
|
||||
if(cert_owner.indexOf(head_person[fields[i]].toUpperCase().trim()) < 0)
|
||||
{
|
||||
owner_valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(owner_valid)
|
||||
{
|
||||
callback(null, [ { id: certificate.id, fields: cert.Subject, valid_to_date: moment(cert.ValidToDate).format("DD.MM.YYYY") } ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(null, []);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(null, []);
|
||||
errors.push('inn');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
apply = false;
|
||||
}
|
||||
}
|
||||
|
||||
let owner_valid = true;
|
||||
const fields = [ "lastname", "firstname", "middlename", ];
|
||||
const cert_owner = `${ cert.Subject['SN']} ${ cert.Subject['G']}`.toUpperCase();
|
||||
|
||||
for(let i in fields)
|
||||
{
|
||||
if(head_person[fields[i]] !== null && head_person[fields[i]] !== "")
|
||||
{
|
||||
if(cert_owner.indexOf(head_person[fields[i]].toUpperCase().trim()) < 0)
|
||||
{
|
||||
owner_valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!owner_valid)
|
||||
{
|
||||
errors.push('name');
|
||||
}
|
||||
|
||||
if(cert.ValidToDate !== null && cert.ValidToDate !== undefined && cert.ValidToDate !== "")
|
||||
{
|
||||
if(moment(cert.ValidToDate) < moment())
|
||||
{
|
||||
errors.push('date');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errors.push('date');
|
||||
}
|
||||
|
||||
if(!cert.IsValid)
|
||||
{
|
||||
errors.push('invalid');
|
||||
}
|
||||
if(apply)
|
||||
{
|
||||
callback(null, [ { id: certificate.id, fields: cert.Subject, valid_to_date: moment(cert.ValidToDate).format("DD.MM.YYYY"), errors } ]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -131,14 +156,34 @@ export default class DigitalCertificates extends React.Component
|
||||
{
|
||||
console.log("applicable certificates", JSON.stringify(certificates));
|
||||
Sentry.captureMessage("Client digital sign step, list of applicable digital certificates");
|
||||
|
||||
|
||||
if(certificates.length === 0)
|
||||
{
|
||||
this.setState({ loading: false, certificates_error: "ISSUED" });
|
||||
this.setState({ loading: false, certificates_error: "INVALID" });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setState({ loading: false, certificates });
|
||||
const list = [];
|
||||
let valid_certificate_exists = false;
|
||||
|
||||
for(let i in certificates) { if(certificates[i].errors.length === 0) { list.push(certificates[i]); valid_certificate_exists = true; } }
|
||||
for(let i in certificates) { if(certificates[i].errors.length !== 0) { list.push(certificates[i]); } }
|
||||
|
||||
const update = { loading: false, certificates: list, certificates_error: null };
|
||||
if(list[0] !== undefined)
|
||||
{
|
||||
if(list[0].errors.length === 0)
|
||||
{
|
||||
update.certificate_selected = list[0];
|
||||
}
|
||||
}
|
||||
|
||||
if(!valid_certificate_exists)
|
||||
{
|
||||
update.certificates_error = "INVALID";
|
||||
}
|
||||
|
||||
this.setState(update);
|
||||
}
|
||||
});
|
||||
})
|
||||
@ -201,9 +246,11 @@ export default class DigitalCertificates extends React.Component
|
||||
render()
|
||||
{
|
||||
const { company, main, head_person } = this.props;
|
||||
const { loading, certificates, certificates_error, certificate_selected, signing } = this.state;
|
||||
const { loading, certificates, certificates_error, certificate_selected, signing, show_all } = this.state;
|
||||
//console.log("render()", { certificates });
|
||||
|
||||
console.log({ certificates_error });
|
||||
|
||||
if(loading)
|
||||
{
|
||||
return (
|
||||
@ -214,88 +261,107 @@ export default class DigitalCertificates extends React.Component
|
||||
}
|
||||
else
|
||||
{
|
||||
if(certificates_error === null)
|
||||
{
|
||||
console.log({ certificates });
|
||||
return (
|
||||
<>
|
||||
{ certificates_error !== null && (
|
||||
<>
|
||||
{ (certificates_error === "NOT_INSTALLED" || certificates_error === "CERTIFICATES") && (
|
||||
<FormMessage type="moderate" title="Внимание!" message={ <>
|
||||
Плагин КриптоПРО не установлен или не активирован. Посмотите <a style={{ color: "#fff", textDecoration: "underline", }} href={ `${ process.env.NEXT_PUBLIC_MAIN_SITE }/upload/docs/anketa-sign.pdf` }>инструкцию</a> как установить, активировать и проверить работу плагина КриптоПро.<br/>
|
||||
<br/>
|
||||
После активации плагина, пожалуйста, обновите страницу.
|
||||
</> }/>
|
||||
) }
|
||||
{ certificates_error === "INVALID" && (
|
||||
<FormMessage type="moderate" title="Внимание!" message={ <>
|
||||
Анкету необходимо подписать по ЭЦП сертификатом юридического лица с ИНН: <br/>
|
||||
{ main.inn }, выданного: { head_person.lastname } { head_person.firstname } { head_person.middlename }. <br/>
|
||||
Такой сертификат не найден!<br/><br/>
|
||||
Если Вы уверены в наличии такого сертификата:
|
||||
<ol style={{ listStyle: "decimal", padding: "revert" }}>
|
||||
<li>Проверьте, вставлен ли ключ с этим сертификатом.</li>
|
||||
<li>Проверьте возможность подписания этим сертификатом с помощью средства <a style={{ color: "#fff", textDecoration: "underline", }} href="https://cryptopro.ru/sites/default/files/products/cades/demopage/cades_bes_sample.html">проверки КриптоПро</a>.</li>
|
||||
<li>Возможно, сертификат нужно установить. <a style={{ color: "#fff", textDecoration: "underline", }} href={ `${ process.env.NEXT_PUBLIC_MAIN_SITE }/upload/docs/anketa-sign.pdf` }>Воспользуйтесь инструкцией</a>.</li>
|
||||
</ol>
|
||||
</> }/>
|
||||
) }
|
||||
{ certificates_error === "MISMATCH" && (
|
||||
<FormMessage type="moderate" title="Внимание!" message={ <>Подписант не соответствует указанному подписанту в анкете.</> }/>
|
||||
) }
|
||||
</>
|
||||
)
|
||||
}
|
||||
{ certificates.length > 0 && (
|
||||
<>
|
||||
<div className="feed">
|
||||
<p>Список сертификатов, доступных на Вашем компьютере:</p>
|
||||
<div className="feed_list">
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="feed">
|
||||
<p>Выберите подписанта</p>
|
||||
<div className="feed_list">
|
||||
|
||||
{ certificates.map((certificate, index) => (
|
||||
<div className="form_field checkbox" key={ index }>
|
||||
<input type="radio"
|
||||
hidden=""
|
||||
id={ `certificate_${ certificate.id }` }
|
||||
name={ `certificate_${ certificate.id }` }
|
||||
checked={ certificate_selected !== undefined && certificate_selected.id === certificate.id ? true : false }
|
||||
onChange={ () => { this.setState({ certificate_selected: certificate }) } }
|
||||
/>
|
||||
<label htmlFor={ `certificate_${ certificate.id }` }>
|
||||
<div className="feed_item user">
|
||||
<img src="/assets/images/icons/avatar.svg" alt="" />
|
||||
<div>
|
||||
<p className="item_title">{ certificate.fields['CN'].replace(/"/g, '') }</p>
|
||||
<p className="item_desc">
|
||||
{ certificate.fields['SN'] ? (<span>{ certificate.fields['SN'] } { certificate.fields['G'] }</span>) : null }
|
||||
</p>
|
||||
<p className="item_desc">
|
||||
<span>ИНН { certificate.fields['INNLE'] !== undefined && certificate.fields['INNLE'] !== null ? certificate.fields['INNLE'] : certificate.fields['INN'] }</span>
|
||||
</p>
|
||||
<p className="item_desc">
|
||||
{ certificate.fields['OGRNIP'] && (<span>ОГРНИП { certificate.fields['OGRNIP'] }</span>) }
|
||||
{ certificate.fields['OGRN'] && (<span>ОГРН { certificate.fields['OGRN'] }</span>) }
|
||||
</p>
|
||||
<p className="item_desc">
|
||||
<span>Подпись действительна до { certificate.valid_to_date }</span>
|
||||
</p>
|
||||
{ certificates.slice(0, show_all ? certificates.length : 2).map((certificate, index) => (
|
||||
<div className={`form_field checkbox digital_certificates_status ${ certificate.errors.length > 0 ? "error" : "" } ${ certificates.length > 1 && !show_all && index === 1 ? "show_all_holder" : ""}`} key={ index }>
|
||||
<input type="radio"
|
||||
hidden=""
|
||||
id={ `certificate_${ certificate.id }` }
|
||||
name={ `certificate_${ certificate.id }` }
|
||||
checked={ certificate_selected !== undefined && certificate_selected.id === certificate.id ? true : false }
|
||||
onChange={ () => { this.setState({ certificate_selected: certificate }) } }
|
||||
/>
|
||||
<label htmlFor={ `certificate_${ certificate.id }` }>
|
||||
<div className="feed_item user">
|
||||
<img src="/assets/images/icons/avatar.svg" alt="" />
|
||||
<div>
|
||||
<p className="item_title">{ certificate.fields['CN'].replace(/"/g, '') }</p>
|
||||
<p className="item_desc">
|
||||
{ certificate.fields['SN'] ? (<span>{ certificate.fields['SN'] } { certificate.fields['G'] }</span>) : null }
|
||||
</p>
|
||||
<p className="item_desc">
|
||||
<span>ИНН { certificate.fields['INNLE'] !== undefined && certificate.fields['INNLE'] !== null ? certificate.fields['INNLE'] : certificate.fields['INN'] }</span>
|
||||
</p>
|
||||
<p className="item_desc">
|
||||
{ certificate.fields['OGRNIP'] && (<span>ОГРНИП { certificate.fields['OGRNIP'] }</span>) }
|
||||
{ certificate.fields['OGRN'] && (<span>ОГРН { certificate.fields['OGRN'] }</span>) }
|
||||
</p>
|
||||
<p className="item_desc">
|
||||
<span>Подпись действительна до { certificate.valid_to_date }</span>
|
||||
</p>
|
||||
</div>
|
||||
{ certificate.errors.length > 0 && (
|
||||
<div>
|
||||
<p className="item_title"> </p>
|
||||
{ certificate.errors.indexOf("name") > -1 ? <p className="item_desc" style={{ color: "#A8026B" }}>Не соответствует ФИО</p> : <p className="item_desc"> </p>}
|
||||
{ certificate.errors.indexOf("inn") > -1 ? <p className="item_desc" style={{ color: "#A8026B" }}>Не соответствует ИНН</p> : <p className="item_desc"> </p>}
|
||||
<p className="item_desc"> </p>
|
||||
{ certificate.errors.indexOf("date") > -1 ? <p className="item_desc" style={{ color: "#A8026B" }}>{ certificate.errors.indexOf('date') > 1 ? "Срок действия закончился" : certificate.errors.indexOf('invalid') > 1 ? "Сертификат недействителен или нарушена цепочка сертификации" : null }</p> : <p className="item_desc"> </p>}
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
)) }
|
||||
</label>
|
||||
{ certificates.length > 1 && !show_all && index === 1 && (
|
||||
<div className="show_all" onClick={ () => this.setState({ show_all: true }) }><span>Посмотреть все</span></div>
|
||||
) }
|
||||
</div>
|
||||
)) }
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="action" style={{marginBottom: "20px"}}>
|
||||
<div></div>
|
||||
<button
|
||||
type="submit"
|
||||
className="button button-blue"
|
||||
disabled={ certificate_selected !== undefined ? false : true }
|
||||
onClick={ this._sign }
|
||||
style={{ minWidth: "250px" }}
|
||||
>
|
||||
{ signing ? (
|
||||
<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>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
else
|
||||
{
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ certificates_error === "NOT_INSTALLED" && (
|
||||
<FormMessage type="moderate" title="Внимание" message={ <>Плагин КриптоПРО не установлен, <Link href="https://cryptopro.ru/products/cades/plugin"><a target="_blank" rel="noopener noreferrer" style={{ color: "white", textDecoration: "underline" }}>посмотрите инструкцию</a></Link> как установить плагин КриптоПРО.</> }/>
|
||||
) }
|
||||
{ certificates_error === "CERTIFICATES" && (
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Плагин КриптоПРО не активирован, пожалуйста, обновите страницу и подтвердите разрешение для сайта на доступ к списку сертификатов.</> }/>
|
||||
) }
|
||||
{ certificates_error === "ISSUED" && (
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Анкету необходимо подписать по ЭЦП сертификатом юридического лица с ИНН: { main.inn }, выданного: { head_person.lastname } { head_person.firstname } { head_person.middlename }. Такой сертификат не найден.</> }/>
|
||||
) }
|
||||
{ certificates_error === "MISMATCH" && (
|
||||
<FormMessage type="moderate" title="Ошибка" message={ <>Подписант не соответствует указанному подписанту в анкете.</> }/>
|
||||
) }
|
||||
</React.Fragment>
|
||||
|
||||
)
|
||||
}
|
||||
<div className="action" style={{marginBottom: "20px"}}>
|
||||
<div></div>
|
||||
<button
|
||||
type="submit"
|
||||
className="button button-blue"
|
||||
disabled={ certificate_selected !== null && certificate_selected !== undefined ? false : true }
|
||||
onClick={ this._sign }
|
||||
style={{ minWidth: "250px" }}
|
||||
>
|
||||
{ signing ? (
|
||||
<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>
|
||||
</>
|
||||
) }
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -359,7 +359,7 @@ class ShareholderForm extends React.Component
|
||||
) }
|
||||
|
||||
<div className="form_field">
|
||||
<label>Доля в уставном капитале (%) <sup className="required_label">*</sup></label>
|
||||
<label>Доля в уставном капитале (%) <sup className="required_label">*</sup>{ index > 0 && (<small>не менее 25%</small>) }</label>
|
||||
{/*}
|
||||
<InputMask
|
||||
className={ errors.indexOf("founder_part") > -1 ? "error" : "" }
|
||||
@ -791,6 +791,14 @@ class Form_4_Shareholders extends QuestionnaireForm
|
||||
if(v !== "" && v !== null && !isNaN(parseFloat(v)))
|
||||
{
|
||||
total_parts = total_parts + parseFloat(v)
|
||||
|
||||
if(i > 0)
|
||||
{
|
||||
if(parseFloat(v) < 25)
|
||||
{
|
||||
errors[f].push(`founder_part`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -53,40 +53,28 @@ class Form_8_Signing extends QuestionnaireForm
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
//console.log("Form_8_Signing", "CDM");
|
||||
const { main, head_person, signatory_person } = this.state;
|
||||
|
||||
const update = { filename: `${ main.inn }_questionnaire_${ moment().format("DDMMYYYY_HHmmss") }.pdf` };
|
||||
let digital = true;
|
||||
|
||||
//setTimeout(() =>
|
||||
//{
|
||||
//console.log("Form_8_Signing", "CDM", { state: this.state });
|
||||
if(signatory_person.not_head_person)
|
||||
{
|
||||
update.digital_disabled = true;
|
||||
digital = false;
|
||||
}
|
||||
|
||||
|
||||
const { main, head_person, signatory_person } = this.state;
|
||||
|
||||
const update = { filename: `${ main.inn }_questionnaire_${ moment().format("DDMMYYYY_HHmmss") }.pdf` };
|
||||
let digital = true;
|
||||
|
||||
if(signatory_person.not_head_person)
|
||||
{
|
||||
update.digital_disabled = true;
|
||||
digital = false;
|
||||
}
|
||||
|
||||
this.setState({ ...this.state, ...update, ...{ loading: false } }, () =>
|
||||
{
|
||||
this._handle_onBranchChange([
|
||||
{ name: `sign.digital`, value: digital },
|
||||
]);
|
||||
});
|
||||
|
||||
//}, 50);
|
||||
this.setState({ ...this.state, ...update, ...{ loading: false } }, () =>
|
||||
{
|
||||
this._handle_onBranchChange([
|
||||
{ name: `sign.digital`, value: digital },
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onFormSubmit = (event) =>
|
||||
{
|
||||
event.preventDefault();
|
||||
//console.log("FormAddress", "_handle_onFormSubmit");
|
||||
|
||||
};
|
||||
|
||||
_check_fields_disabled = (values) =>
|
||||
@ -147,9 +135,6 @@ class Form_8_Signing extends QuestionnaireForm
|
||||
{
|
||||
const { loading, filename, sign_digital, sign, head_person, mobile, company, main, downloading, error, digital_disabled } = this.state;
|
||||
|
||||
//console.log({ sign });
|
||||
|
||||
|
||||
if(loading)
|
||||
{
|
||||
return (
|
||||
|
||||
@ -44,7 +44,13 @@ class Form_9_Status extends QuestionnaireForm
|
||||
}
|
||||
|
||||
componentDidMount()
|
||||
{
|
||||
{
|
||||
const { sign } = this.state;
|
||||
|
||||
if(sign.digital)
|
||||
{
|
||||
this.props.onSuccess(this.state.sign);
|
||||
}
|
||||
}
|
||||
|
||||
_handle_onFileUpload = () =>
|
||||
@ -73,7 +79,7 @@ class Form_9_Status extends QuestionnaireForm
|
||||
{
|
||||
this.setState({ uploading: false, sent: true, error_send: false, }, () =>
|
||||
{
|
||||
this.props.onSuccess();
|
||||
this.props.onSuccess(this.state.sign);
|
||||
});
|
||||
})
|
||||
.catch(() =>
|
||||
@ -89,10 +95,9 @@ class Form_9_Status extends QuestionnaireForm
|
||||
const { sign, file, uploading, sent, error_file_size, error_send, filename } = this.state;
|
||||
//console.log("Form_9_Status", "render", { sign });
|
||||
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{ sign.digital && (
|
||||
{ sign.digital ? (
|
||||
<React.Fragment>
|
||||
<FormMessage
|
||||
type="success"
|
||||
@ -103,8 +108,7 @@ class Form_9_Status extends QuestionnaireForm
|
||||
<button className="button button-blue" style={{ width: "100%", minWidth: "255px" }} onClick={ () => this.props.router.push("/") }>Перейти на главную страницу </button>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
) }
|
||||
{ !sign.digital && (
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<input type="file" id="file" multiple={ false } ref={ this.ref_file_input } style={{ display: "none" }} onChange={ this._handle_onFileChange }/>
|
||||
{ file === null ? (
|
||||
|
||||
@ -114,7 +114,6 @@ export default class QuestionnaireForm extends React.Component
|
||||
{
|
||||
//console.log("QuestionnaireForm", "_handle_onCheckboxFieldChange", { name, value });
|
||||
|
||||
|
||||
const update = { ...this.state };
|
||||
_set(update, name, value);
|
||||
this._updateQuestionnaire(update);
|
||||
|
||||
@ -1663,3 +1663,44 @@
|
||||
.deal_offers_table {
|
||||
width: 100%;
|
||||
}
|
||||
.digital_certificates_status {
|
||||
position: relative;
|
||||
}
|
||||
.digital_certificates_status.error {
|
||||
border: none !important;
|
||||
}
|
||||
.digital_certificates_status.error label {
|
||||
pointer-events: none;
|
||||
cursor: unset;
|
||||
}
|
||||
.digital_certificates_status.error label::before {
|
||||
border: none !important;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: url("/assets/images/icons/delete_red.svg") no-repeat center;
|
||||
z-index: 2;
|
||||
transform: scale(1.3);
|
||||
margin-right: 12px;
|
||||
}
|
||||
.digital_certificates_status.show_all_holder {
|
||||
margin-bottom: 40px !important;
|
||||
}
|
||||
.digital_certificates_status .show_all {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 10px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-start;
|
||||
background: linear-gradient(0deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
.digital_certificates_status .show_all span {
|
||||
color: var(--blue);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
.digital_certificates_status .show_all span:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@ -1947,4 +1947,51 @@
|
||||
|
||||
.deal_offers_table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.digital_certificates_status {
|
||||
position: relative;
|
||||
|
||||
&.error {
|
||||
border: none !important;
|
||||
label {
|
||||
pointer-events: none;
|
||||
cursor: unset;
|
||||
&::before {
|
||||
border: none !important;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: url("/assets/images/icons/delete_red.svg") no-repeat center;
|
||||
z-index: 2;
|
||||
transform: scale(1.3);
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.show_all_holder {
|
||||
margin-bottom: 40px !important;
|
||||
}
|
||||
|
||||
.show_all {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 10px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-start;
|
||||
background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
|
||||
|
||||
span {
|
||||
color: var(--blue);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -114,7 +114,7 @@ main .title_wrapper .right {
|
||||
}
|
||||
main .title_wrapper .company-dropdown {
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
z-index: 90;
|
||||
}
|
||||
main .title_wrapper .company-dropdown .arrow {
|
||||
cursor: pointer;
|
||||
@ -3598,7 +3598,7 @@ main .dropdown_blocks_list .dropdown_block .block_body .fines_detail ul li {
|
||||
bottom: -30px;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
z-index: 98;
|
||||
z-index: 80;
|
||||
margin: 0 auto;
|
||||
max-width: 1310px;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ main {
|
||||
|
||||
.company-dropdown {
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
z-index: 90;
|
||||
|
||||
.arrow {
|
||||
cursor: pointer;
|
||||
@ -4019,7 +4019,7 @@ main .dropdown_blocks_list .dropdown_block .block_body {
|
||||
bottom: -30px;
|
||||
right: 0;
|
||||
pointer-events: none;
|
||||
z-index: 98;
|
||||
z-index: 80;
|
||||
margin: 0 auto;
|
||||
max-width: 1310px;
|
||||
|
||||
|
||||
@ -298,6 +298,17 @@ export default async function handler(req, res)
|
||||
}
|
||||
}
|
||||
|
||||
if(group === "head_person")
|
||||
{
|
||||
if(field === "credentials_dateend")
|
||||
{
|
||||
if(questionnaire[group].indefinite)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(field === "fullname")
|
||||
{
|
||||
fields[group][field].bind = form.getTextField(fields[group][field].name);
|
||||
|
||||
@ -23,36 +23,44 @@ export default async function handler(req, res)
|
||||
{
|
||||
if(jwt.verify(cookies.jwt, process.env.JWT_SECRET_CLIENT))
|
||||
{
|
||||
try
|
||||
if(parseInt(process.env.DADATA_API_CHECK_DOCUMENT_ENABLED, 10) === 1)
|
||||
{
|
||||
const { seria, number } = req.body;
|
||||
try
|
||||
{
|
||||
const { seria, number } = req.body;
|
||||
|
||||
axios.post(`https://cleaner.dadata.ru/api/v1/clean/passport`, [ `${ seria } ${ number }` ], {
|
||||
httpAgent: keepAliveAgent,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Token ${ process.env.DADATA_API_KEY }`,
|
||||
"X-Secret": process.env.DADATA_SECRET_KEY
|
||||
},
|
||||
})
|
||||
.then((api_response) =>
|
||||
axios.post(`https://cleaner.dadata.ru/api/v1/clean/passport`, [ `${ seria } ${ number }` ], {
|
||||
httpAgent: keepAliveAgent,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Token ${ process.env.DADATA_API_KEY }`,
|
||||
"X-Secret": process.env.DADATA_SECRET_KEY
|
||||
},
|
||||
})
|
||||
.then((api_response) =>
|
||||
{
|
||||
res.status(200).send(api_response.data);
|
||||
resolve();
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.log("error");
|
||||
console.error(error);
|
||||
|
||||
res.status(500).send();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
res.status(200).send(api_response.data);
|
||||
resolve();
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
console.log("error");
|
||||
console.error(error);
|
||||
|
||||
console.error(e);
|
||||
res.status(500).send();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
else
|
||||
{
|
||||
console.error(e);
|
||||
res.status(500).send();
|
||||
res.status(200).json([{ qc: 0 }]);
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,12 +109,12 @@ class QuestionnairePage extends React.Component
|
||||
this.props.router.push(`/questionnaire#${ path }`);
|
||||
}
|
||||
|
||||
_handle_onSuccess = () =>
|
||||
_handle_onSuccess = (sign) =>
|
||||
{
|
||||
//console.log("_handle_onSuccess");
|
||||
|
||||
getCompanyInfo({ dispatch: this.props.dispatch });
|
||||
defaultQuestionnaire({ dispatch: this.props.dispatch });
|
||||
defaultQuestionnaire({ dispatch: this.props.dispatch, sign });
|
||||
}
|
||||
|
||||
_renderForm = () =>
|
||||
|
||||
@ -29,7 +29,7 @@ export default class RecoveryPage extends React.Component
|
||||
email_error: false,
|
||||
recovery_form_step: 1,
|
||||
email_code_error: false,
|
||||
email_send_disabled: false,
|
||||
email_send_disabled: true,
|
||||
set_password_disabled: true,
|
||||
email_code_submit_disabled: true,
|
||||
email_code_resend_disabled: true,
|
||||
@ -137,17 +137,26 @@ export default class RecoveryPage extends React.Component
|
||||
|
||||
_handle_onEmailChange = (value) =>
|
||||
{
|
||||
this.setState({ email: value, email_send_disabled: this._check_fields_disabled([ value, this.state.email ]), email_error: false });
|
||||
this.setState({ email: value, email_error: false }, () =>
|
||||
{
|
||||
this.setState({ email_send_disabled: this._check_fields_disabled([ value, this.state.email ]) });
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onPasswordChange = (value) =>
|
||||
{
|
||||
this.setState({ password: value, set_password_disabled: this._check_fields_disabled([ value, this.state.password ]), password_error: false });
|
||||
this.setState({ password: value, password_error: false }, () =>
|
||||
{
|
||||
this.setState({ set_password_disabled: this._check_fields_disabled([ value, this.state.password ]) });
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onPasswordCheckChange = (value) =>
|
||||
{
|
||||
this.setState({ password_repeat: value, set_password_disabled: this._check_fields_disabled([ value, this.state.password_repeat ]), password_error: false });
|
||||
this.setState({ password_repeat: value, password_error: false }, () =>
|
||||
{
|
||||
this.setState({ set_password_disabled: this._check_fields_disabled([ value, this.state.password_repeat ]) });
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onEmailCodeChange = (value) =>
|
||||
|
||||
3
public/assets/images/icons/delete_red.svg
Normal file
3
public/assets/images/icons/delete_red.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.58625 7.9995L4.29325 5.7065C3.90225 5.3165 3.90225 4.6825 4.29325 4.2925C4.68325 3.9025 5.31725 3.9025 5.70725 4.2925L8.00025 6.5855L10.2933 4.2925C10.6832 3.9025 11.3173 3.9025 11.7073 4.2925C12.0972 4.6825 12.0972 5.3165 11.7073 5.7065L9.41425 7.9995L11.7073 10.2925C12.0972 10.6825 12.0972 11.3165 11.7073 11.7065C11.3173 12.0965 10.6832 12.0965 10.2933 11.7065L8.00025 9.4135L5.70725 11.7065C5.31725 12.0965 4.68325 12.0965 4.29325 11.7065C3.90225 11.3165 3.90225 10.6825 4.29325 10.2925L6.58625 7.9995Z" fill="#A8026B"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 681 B |
@ -1,3 +1,12 @@
|
||||
export const questionnaire_sign_template = {
|
||||
digital: true,
|
||||
uploading: false,
|
||||
uploaded: false,
|
||||
sent: false,
|
||||
filename: null,
|
||||
filedate: null,
|
||||
};
|
||||
|
||||
export const questionnaire_template = {
|
||||
step: 1,
|
||||
status: "empty",
|
||||
@ -119,14 +128,7 @@ export const questionnaire_template = {
|
||||
fin_goals_special: null,
|
||||
},
|
||||
personal_data_consent: true,
|
||||
sign: {
|
||||
digital: true,
|
||||
uploading: false,
|
||||
uploaded: false,
|
||||
sent: false,
|
||||
filename: null,
|
||||
filedate: null,
|
||||
},
|
||||
sign: questionnaire_sign_template,
|
||||
licenses: [],
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user