change mail delivery type key
This commit is contained in:
parent
dcb04b98e5
commit
1c35120321
@ -96,7 +96,7 @@ export const getQuestionnaire = ({ dispatch, id }) =>
|
||||
questionnaire.main.email = response.data.email;
|
||||
questionnaire.main.websiteurl = response.data.websiteurl !== null ? response.data.websiteurl : "";
|
||||
questionnaire.main.financial_loan = response.data.financial_loan !== null ? response.data.financial_loan : "";
|
||||
questionnaire.main.evo_mail_delivery_address_type = response.data.inn.length > 10 ? 100000001 : 100000000;
|
||||
questionnaire.main.mail_delivery_address_type = response.data.mail_delivery_address_type !== null ? response.data.mail_delivery_address_type : response.data.inn.length > 10 ? 100000001 : 100000000;
|
||||
|
||||
questionnaire.contacts.fact_address = response.data.fact_address;
|
||||
questionnaire.contacts.postal_address = response.data.postal_address;
|
||||
|
||||
@ -22,7 +22,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
super(props);
|
||||
this.state = {
|
||||
contacts: {
|
||||
evo_mail_delivery_address_type: 100000000,
|
||||
mail_delivery_address_type: 100000000,
|
||||
loading: false,
|
||||
|
||||
fact_address: {
|
||||
@ -58,11 +58,11 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
componentDidMount()
|
||||
{
|
||||
const { company } = this.props;
|
||||
const { evo_mail_delivery_address_type } = this.state.main;
|
||||
const { mail_delivery_address_type } = this.state.main;
|
||||
|
||||
if(company.inn.length > 10 && evo_mail_delivery_address_type === 100000000)
|
||||
if(company.inn.length > 10 && parseInt(mail_delivery_address_type, 10) === 100000000)
|
||||
{
|
||||
this._handle_onCheckboxFieldChange("main.evo_mail_delivery_address_type", 100000001);
|
||||
this._handle_onCheckboxFieldChange("main.mail_delivery_address_type", 100000001);
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
errors.push(`contacts.fact_address`);
|
||||
}
|
||||
|
||||
if(main.evo_mail_delivery_address_type === 100000002)
|
||||
if(main.mail_delivery_address_type === 100000002)
|
||||
{
|
||||
if(contacts.postal_address.name === "")
|
||||
{
|
||||
@ -110,7 +110,7 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
const { company, checking } = this.props;
|
||||
const { main, contacts, loading, status, step, errors } = this.state;
|
||||
const { fact_address, postal_address, } = contacts;
|
||||
const { evo_mail_delivery_address_type } = main;
|
||||
const { mail_delivery_address_type } = main;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@ -151,8 +151,8 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
<input type="radio" hidden=""
|
||||
value={ 100000000 }
|
||||
id="contacts.address_type_legal"
|
||||
name="main.evo_mail_delivery_address_type"
|
||||
checked={ parseInt(evo_mail_delivery_address_type, 10) === 100000000 ? true : false }
|
||||
name="main.mail_delivery_address_type"
|
||||
checked={ parseInt(mail_delivery_address_type, 10) === 100000000 ? true : false }
|
||||
onChange={ (event) => { this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } }
|
||||
disabled={ checking }
|
||||
/>
|
||||
@ -164,8 +164,8 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
<input type="radio" hidden=""
|
||||
value={ 100000001 }
|
||||
id="contacts.address_type_fact"
|
||||
name="main.evo_mail_delivery_address_type"
|
||||
checked={ parseInt(evo_mail_delivery_address_type, 10) === 100000001 ? true : false }
|
||||
name="main.mail_delivery_address_type"
|
||||
checked={ parseInt(mail_delivery_address_type, 10) === 100000001 ? true : false }
|
||||
onChange={ (event) => { this._removeError("contacts.postal_address"); this._handle_onCheckboxFieldChange(event.target.name, event.target.value); } }
|
||||
disabled={ checking }
|
||||
/>
|
||||
@ -176,20 +176,20 @@ class Form_2_Contacts extends QuestionnaireForm
|
||||
<input type="radio" hidden=""
|
||||
value={ 100000002 }
|
||||
id="contacts.address_type_postal"
|
||||
name="main.evo_mail_delivery_address_type"
|
||||
checked={ parseInt(evo_mail_delivery_address_type, 10) === 100000002 ? true : false }
|
||||
name="main.mail_delivery_address_type"
|
||||
checked={ parseInt(mail_delivery_address_type, 10) === 100000002 ? true : false }
|
||||
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>По следующему адресу { parseInt(evo_mail_delivery_address_type, 10) === 100000002 && <sup className="required_label">*</sup> }</span>
|
||||
<span>По следующему адресу { parseInt(mail_delivery_address_type, 10) === 100000002 && <sup className="required_label">*</sup> }</span>
|
||||
<AddressSuggests
|
||||
className={ errors.indexOf("contacts.postal_address") > -1 ? "error" : "" }
|
||||
value={ this._checkStrValue(postal_address.name) }
|
||||
fias={ this._checkStrValue(postal_address.fias_id) }
|
||||
onChange={ (data) => { this._removeError("contacts.postal_address"); this._handle_onTextFieldChange("contacts.postal_address", data); } }
|
||||
required={ true }
|
||||
disabled={ !checking && parseInt(evo_mail_delivery_address_type, 10) === 100000002 ? false : true }
|
||||
disabled={ !checking && parseInt(mail_delivery_address_type, 10) === 100000002 ? false : true }
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@ -338,6 +338,8 @@ class Shareholder extends React.Component
|
||||
const { index, shareholders, removeShareholder, signatories, contacts, changeFounderSelectionFromList, clearFounderFromListSelection, checking, errors, } = this.props;
|
||||
const shareholder = shareholders[index];
|
||||
|
||||
console.log({ contacts });
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="added_person">
|
||||
|
||||
@ -37,7 +37,7 @@ const fields = {
|
||||
collective_executive: { name: "execution_team", type: "text", bind: null, size: 6 },
|
||||
individual_executive: { name: "execution_sole", type: "text", bind: null, size: 6 },
|
||||
other_control: { name: "execution_another", type: "text", bind: null, size: 6 },
|
||||
evo_mail_delivery_address_type: { name: "evo_mail_delivery_address_type", type: "radio", bind: null },
|
||||
mail_delivery_address_type: { name: "mail_delivery_address_type", type: "radio", bind: null },
|
||||
},
|
||||
contacts: {
|
||||
fact_address: { name: "address_fact", type: "text", bind: null },
|
||||
@ -247,10 +247,10 @@ export default async function handler(req, res)
|
||||
fields[group][field].bind.setText(questionnaire[group].fact_address.name.toUpperCase());
|
||||
}
|
||||
}
|
||||
else if(field === "evo_mail_delivery_address_type")
|
||||
else if(field === "mail_delivery_address_type")
|
||||
{
|
||||
fields[group][field].bind = form.getRadioGroup(fields[group][field].name);
|
||||
fields[group][field].bind.select(address[ questionnaire[group].evo_mail_delivery_address_type ]);
|
||||
fields[group][field].bind.select(address[ questionnaire[group].mail_delivery_address_type ]);
|
||||
}
|
||||
/*
|
||||
else if(field === "foreign_payers")
|
||||
|
||||
@ -25,7 +25,7 @@ export const questionnaire_template = {
|
||||
},
|
||||
delegation_files: [],
|
||||
contacts: {
|
||||
evo_mail_delivery_address_type: 100000000,
|
||||
mail_delivery_address_type: 100000000,
|
||||
legal_address: {
|
||||
name: null,
|
||||
fias_id: null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user