if (!model.EVENT_valueChange) {
    let textboxPassportNumberZ = model.playerModel.getModelWithId('textbox_passport_number_z'); //поменять на нужный textbox
    if (textboxPassportNumberZ) {
        textboxPassportNumberZ.setValue('мес.');

        model.on('valueChange', () => {
            let inputValue = textboxPassportNumberZ.getValue().replace(/\s*мес\.$/, '');

            let numberOnly = inputValue.replace(/\D/g, '');

            textboxPassportNumberZ.setValue(`${numberOnly} мес.`);
        });

        document.addEventListener('keydown', (event) => {
            if (event.key === 'Backspace') {
                let inputValue = textboxPassportNumberZ.getValue().replace(/\s*мес\.$/, '');
                let numberOnly = inputValue.slice(0, -1);

                textboxPassportNumberZ.setValue(`${numberOnly} мес.`);

                event.preventDefault();
            }
        });
    } else {
        console.error('Поле "textbox_passport_number_z" не найдено.');
    }

    model.EVENT_valueChange = true;
}