fix for questionnaire signing when sign on paper
This commit is contained in:
parent
0139fae6d0
commit
1eabde05e3
@ -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(() => {});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -268,6 +268,8 @@ export default class DigitalCertificates extends React.Component
|
||||
{ (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" && (
|
||||
|
||||
@ -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 ? (
|
||||
|
||||
@ -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 = () =>
|
||||
|
||||
@ -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