update for suggests fields
This commit is contained in:
parent
2b88437b14
commit
1d6b7f5e09
@ -46,10 +46,14 @@ export default class AddressSuggests extends React.Component
|
||||
const { onChange } = this.props;
|
||||
|
||||
onChange({ name: value, fias_id: "" });
|
||||
if(focused)
|
||||
this.setState({ focused: true }, () =>
|
||||
{
|
||||
this._getAddress(value);
|
||||
}
|
||||
});
|
||||
|
||||
//if(focused)
|
||||
//{
|
||||
//}
|
||||
}
|
||||
|
||||
_handle_onSelect = (value) =>
|
||||
@ -57,31 +61,23 @@ export default class AddressSuggests extends React.Component
|
||||
const { fias, focused } = this.state;
|
||||
const { onChange } = this.props;
|
||||
|
||||
onChange({ name: value, fias_id: fias[value] });
|
||||
|
||||
setTimeout(() =>
|
||||
this.setState({ focused: false }, () =>
|
||||
{
|
||||
this.setState({ focused: false });
|
||||
}, 200);
|
||||
onChange({ name: value, fias_id: fias[value] });
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onFocus = (event) =>
|
||||
{
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
this.setState({ focused: true });
|
||||
}
|
||||
|
||||
_handle_onBlur = (event) =>
|
||||
{
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
setTimeout(() =>
|
||||
{
|
||||
this.setState({ focused: false });
|
||||
}, 200);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
_getAddress = (text) =>
|
||||
@ -141,6 +137,8 @@ export default class AddressSuggests extends React.Component
|
||||
onChange={ (event) => this._handle_onChange(event.target.value) }
|
||||
onFocus={ this._handle_onFocus }
|
||||
onBlur={ this._handle_onBlur }
|
||||
onMouseDown={ (event) => { this._handle_onFocus(event); } }
|
||||
onTouchStart={ (event) => { this._handle_onFocus(event); } }
|
||||
required={ required }
|
||||
disabled={ disabled }
|
||||
/>
|
||||
@ -149,7 +147,13 @@ export default class AddressSuggests extends React.Component
|
||||
<div className="react-select__menu-list">
|
||||
{ options.map((option, index) =>
|
||||
(
|
||||
<div className="react-select__option" style={{ minHeight: "26px", background: "#FFF", lineHeight: "18px", margin: "0px", padding: "5px 5px 5px 5px", }} key={ `${ index }_${ option.value }` } onClick={ (event) => { event.preventDefault(); this._handle_onSelect(option.value); } }><span>{ option.value }</span></div>
|
||||
<div
|
||||
className="react-select__option"
|
||||
style={{ minHeight: "26px", background: "#FFF", lineHeight: "18px", margin: "0px", padding: "5px 5px 5px 5px", }}
|
||||
key={ `${ index }_${ option.value }` }
|
||||
onMouseDown={ (event) => { event.preventDefault(); this._handle_onSelect(option.value); } }
|
||||
onTouchStart={ (event) => { event.preventDefault(); this._handle_onSelect(option.value); } }
|
||||
><span>{ option.value }</span></div>
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -69,10 +69,10 @@ export default class SuggestsInput extends React.Component
|
||||
const { onChange } = this.props;
|
||||
|
||||
onChange(value);
|
||||
if(focused)
|
||||
this.setState({ focused: true }, () =>
|
||||
{
|
||||
this._getValue(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onSelect = (value) =>
|
||||
@ -85,12 +85,12 @@ export default class SuggestsInput extends React.Component
|
||||
});
|
||||
}
|
||||
|
||||
_handle_onFocus = () =>
|
||||
_handle_onFocus = (event) =>
|
||||
{
|
||||
this.setState({ focused: true });
|
||||
}
|
||||
|
||||
_handle_onBlur = () =>
|
||||
_handle_onBlur = (event) =>
|
||||
{
|
||||
setTimeout(() =>
|
||||
{
|
||||
@ -189,7 +189,13 @@ export default class SuggestsInput extends React.Component
|
||||
<div className="react-select__menu-list">
|
||||
{ options.map((option, index) =>
|
||||
(
|
||||
<div className="react-select__option" style={{ minHeight: "26px", background: "#FFF", lineHeight: "18px", }} key={ index } onClick={ () => this._handle_onSelect(option.value) }>{ option.value }</div>
|
||||
<div
|
||||
className="react-select__option"
|
||||
style={{ minHeight: "26px", background: "#FFF", lineHeight: "18px", }}
|
||||
key={ index }
|
||||
onMouseDown={ (event) => { event.preventDefault(); this._handle_onSelect(option.value); } }
|
||||
onTouchStart={ (event) => { event.preventDefault(); this._handle_onSelect(option.value); } }
|
||||
><span>{ option.value }</span></div>
|
||||
)) }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -82,7 +82,7 @@ export default async function handler(req, res)
|
||||
|
||||
let payload = { ...parsed.main, ...{ head_person: parsed.head_person }, ...{ signatory_person: parsed.signatory_person }, };
|
||||
|
||||
payload.questionnaire_sign_type = parsed.sign.digital ? "eds" : "paper";
|
||||
payload.questionnaire_sign_type = digital ? "eds" : "paper";
|
||||
|
||||
payload.telephone = checkNullEmpty(payload.telephone) ? payload.telephone.replace(/[^0-9]/g, '') : null;
|
||||
payload.individual_executive_inn = checkNullEmpty(payload.individual_executive_inn) ? payload.individual_executive_inn.replace(/[^0-9]/g, '') : null;
|
||||
@ -97,7 +97,7 @@ export default async function handler(req, res)
|
||||
{
|
||||
payload.head_person.no_middle_name = true;
|
||||
}
|
||||
payload.head_person.identity_document.citizenship_code = payload.head_person.identity_document.citizenship.code;
|
||||
payload.head_person.identity_document.citizenship_code = payload.head_person.identity_document.citizenship.code.toString();
|
||||
payload.head_person.telephone = checkNullEmpty(payload.head_person.telephone) ? payload.head_person.telephone.replace(/[^0-9]/g, '') : null;
|
||||
payload.head_person.identity_document.issuedate = checkNullEmpty(payload.head_person.identity_document.issuedate) ? moment(payload.head_person.identity_document.issuedate).format("YYYY-MM-DD") : null;
|
||||
payload.head_person.evo_assignment_date = checkNullEmpty(payload.head_person.evo_assignment_date) ? moment(payload.head_person.evo_assignment_date).format("YYYY-MM-DD") : null;
|
||||
@ -119,7 +119,7 @@ export default async function handler(req, res)
|
||||
"lastname", "firstname", "middlename", "no_middle_name", "jobtitle", "telephone", "email", "identity_document", "evo_assignment_date", "evo_credentials_dateend", "evo_indefinite",
|
||||
]) };
|
||||
}
|
||||
payload.signatory_person.identity_document.citizenship_code = payload.signatory_person.identity_document.citizenship.code;
|
||||
payload.signatory_person.identity_document.citizenship_code = payload.signatory_person.identity_document.citizenship.code.toString();
|
||||
payload.signatory_person.telephone = checkNullEmpty(payload.signatory_person.telephone) ? payload.signatory_person.telephone.replace(/[^0-9]/g, '') : null;
|
||||
payload.signatory_person.identity_document.issuedate = checkNullEmpty(payload.signatory_person.identity_document.issuedate) ? moment(payload.signatory_person.identity_document.issuedate).format("YYYY-MM-DD") : null;
|
||||
payload.signatory_person.docdate = checkNullEmpty(payload.signatory_person.docdate) ? moment(payload.signatory_person.docdate).format("YYYY-MM-DD") : null;
|
||||
@ -132,6 +132,7 @@ export default async function handler(req, res)
|
||||
founder_persons[i].founder_number = parseInt(i, 10) + 1;
|
||||
founder_persons[i].telephone = checkNullEmpty(founder_persons[i].telephone) ? founder_persons[i].telephone.replace(/[^0-9]/g, '') : null;
|
||||
founder_persons[i].identity_document.issuedate = checkNullEmpty(founder_persons[i].identity_document.issuedate) ? moment(founder_persons[i].identity_document.issuedate).format("YYYY-MM-DD") : null;
|
||||
founder_persons[i].identity_document.citizenship_code = founder_persons[i].identity_document.citizenship.code.toString();
|
||||
|
||||
if(founder_persons[i].middlename !== "" && founder_persons[i].middlename !== null)
|
||||
{
|
||||
@ -204,7 +205,7 @@ export default async function handler(req, res)
|
||||
files_to_send.push({ ...{
|
||||
name: local_filename,
|
||||
filename: local_filename,
|
||||
}, ...{ number: 161, } });
|
||||
}, ...{ number: digital ? 162 : 161, } });
|
||||
|
||||
console.log("@".repeat(200));
|
||||
console.log(payload);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user