Commit 7665e654 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

запуск маршрутов - fix выбор ответственного

parent 1e693f16
...@@ -43,12 +43,19 @@ const routeNames = { ...@@ -43,12 +43,19 @@ const routeNames = {
const getRouteName = routeType => routeNames[routeType] || routeType; const getRouteName = routeType => routeNames[routeType] || routeType;
const createUserParamBlock = (label, routeUserItem, itemContainer) => { const createUserParamBlock = (label, routeUserItem, itemContainer, panelType) => {
const fc = $('<div>', {class: 'uk-form-controls'}); const fc = $('<div>', {class: 'uk-form-controls'});
const button = $('<a class="uk-form-icon uk-form-icon-flip" href="javascript:void(0);" uk-icon="icon: users"></a>'); const button = $('<a class="uk-form-icon uk-form-icon-flip" href="javascript:void(0);" uk-icon="icon: users"></a>');
const input = $('<input style="background: #fff;" class="uk-input" type="text" disabled>'); const input = $('<input class="uk-input" type="text" disabled>');
const values = routeUserItem.userID !== '' ? [{personID: routeUserItem.userID, personName: routeUserItem.userName}] : null; const values = routeUserItem.userID !== '' ? [{personID: routeUserItem.userID, personName: routeUserItem.userName}] : null;
if(panelType == '_action') {
button.attr('disabled', true);
button.css('cursor', 'default');
} else {
input.css('background', '#fff');
}
fc.append($('<div class="uk-inline uk-width-expand">').append(button, input)); fc.append($('<div class="uk-inline uk-width-expand">').append(button, input));
if(values) { if(values) {
...@@ -57,6 +64,10 @@ const createUserParamBlock = (label, routeUserItem, itemContainer) => { ...@@ -57,6 +64,10 @@ const createUserParamBlock = (label, routeUserItem, itemContainer) => {
} }
button.on('click', e => { button.on('click', e => {
e.preventDefault();
if(panelType == '_action') return;
//(values, multiSelectable, isGroupSelectable, showWithoutPosition, filterPositionID, filterDepartmentID, locale, handler) //(values, multiSelectable, isGroupSelectable, showWithoutPosition, filterPositionID, filterDepartmentID, locale, handler)
AS.SERVICES.showUserChooserDialog(values, false, false, false, null, null, AS.OPTIONS.locale, users => { AS.SERVICES.showUserChooserDialog(values, false, false, false, null, null, AS.OPTIONS.locale, users => {
const userNames = users.map(x => x.personName).join('; '); const userNames = users.map(x => x.personName).join('; ');
...@@ -150,13 +161,13 @@ this.StartRegistryRoute = class { ...@@ -150,13 +161,13 @@ this.StartRegistryRoute = class {
}); });
} }
renderSettings(item, itemContainer){ renderSettings(item, itemContainer, panelType){
this.panelSettingsIsShow = true; this.panelSettingsIsShow = true;
this.showHidePanelSettings(); this.showHidePanelSettings();
this.panelSettings.empty(); this.panelSettings.empty();
const userBlock = createUserParamBlock(i18n.tr('Ответственный'), item, itemContainer); const userBlock = createUserParamBlock(i18n.tr('Ответственный'), item, itemContainer, panelType);
this.panelSettings.append(userBlock); this.panelSettings.append(userBlock);
} }
...@@ -186,7 +197,7 @@ this.StartRegistryRoute = class { ...@@ -186,7 +197,7 @@ this.StartRegistryRoute = class {
itemContainer.on('click', e => { itemContainer.on('click', e => {
e.preventDefault(); e.preventDefault();
if($(e.target).closest('span').hasClass("delete_item_route_button")) return; if($(e.target).closest('span').hasClass("delete_item_route_button")) return;
this.renderSettings(proc, itemContainer); this.renderSettings(proc, itemContainer, panelType);
$('.route_item_container').removeClass('selected'); $('.route_item_container').removeClass('selected');
itemContainer.addClass('selected'); itemContainer.addClass('selected');
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment