File

projects/m2-core/src/lib/widget-modules/application/actions/application-actions.component.ts

Description

Multiple applications actions notes:

  1. Action button is available when it's applicable to at least one of the selected applications (so server should expect invalid requests for some applications)

  2. setApplicationsInProgress() - client navigates to the work handle of the first application from the response (so server should activate its tx). Agreed to temporary decide which application to focus by users's active tx.

  3. cancelNegotiation() - when we deal with several applications we always cancel the whole negotiation route

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Accessors

Constructor

constructor(router: Router, logger: Logger, actionsService: ActionsService, clientConfigService: ClientConfigService, applicationReadService: ApplicationReadService, applicationEditService: ApplicationEditService, applicationsService: ApplicationsService, applicationActionsService: ApplicationActionsService, notificationService: NotificationService, layerService: LayerService, systemService: SystemService, txService: TransactionService, transactionReadService: TransactionReadService, backgroundService: BackgroundService, dataService: DataService, globalModalsService: GlobalModalsService, store: Store)
Parameters :
Name Type Optional
router Router No
logger Logger No
actionsService ActionsService No
clientConfigService ClientConfigService No
applicationReadService ApplicationReadService No
applicationEditService ApplicationEditService No
applicationsService ApplicationsService No
applicationActionsService ApplicationActionsService No
notificationService NotificationService No
layerService LayerService No
systemService SystemService No
txService TransactionService No
transactionReadService TransactionReadService No
backgroundService BackgroundService No
dataService DataService No
globalModalsService GlobalModalsService No
store Store No

Inputs

application
attributesInfo
Type : ApplicationAttributesInfo
canManageApplications
Type : boolean
createNewClickFn
Type : function
isHidden
Type : boolean
myLogin
Type : string
negotiationProgress
onApplicationCreatedFn
Type : function
showClickFn
Type : function
showCloneBtn
Type : boolean
Default value : true
showCreateGroupBtn
Type : boolean
Default value : false
vicedLogins
Type : Set<string>

Methods

Public createItemByApplication
createItemByApplication(applicationId: number, nodeId: number, tableId: number)
Parameters :
Name Type Optional
applicationId number No
nodeId number No
tableId number No
Returns : void
Public getActionButtons
getActionButtons(applications: Application[], applicationIdToNegotiationProgress: NumberMap<NegotiationProgress>)

Can be used for generating context menu

Parameters :
Name Type Optional
applications Application[] No
applicationIdToNegotiationProgress NumberMap<NegotiationProgress> No
Returns : SdiButton[]
ngOnInit
ngOnInit()
Returns : void
onCancelNegotiationClick
onCancelNegotiationClick(event: MouseEvent)

Cancel negotiation

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onContinueProcessingClick
onContinueProcessingClick(event: MouseEvent)

Continue processing

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
Public Async onCreateItemByApplicationClick
onCreateItemByApplicationClick(applicationId: number, nodeId: number)

#20092 Create item by application В случае, если после выполнения первого действия (поиск похожих позиций через getSimilarItemIds()), система найдет позиции через поиск дубликатов, то система должна выдать диалог c кнопками "Да"/"Нет" и предупреждением: "ВНИМАНИЕ! По атрибутам заявки было найдено <кол-во найденных позиций> схожих позиций. Продолжить создание позиции?". Если пользователь ответит "Да", то требуется продолжить создание позиции. Если пользователь выберет "Нет", то требуется отменить создание и включить в заявке поиск позиций через поиск дубликатов, чтобы пользователь, после отказа создания позиции сразу смог увидеть найденные через поиск дубликатов позиции.

Parameters :
Name Type Optional
applicationId number No
nodeId number No
Returns : Promise<void>
onDeduplicateApplicationClick
onDeduplicateApplicationClick(event: MouseEvent)

Deduplicate and set InProgress

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onFindDuplicateApplicationClick
onFindDuplicateApplicationClick(event: MouseEvent)

Return as duplicate

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onOthersMenuClose
onOthersMenuClose()
Returns : void
onOthersMenuOpen
onOthersMenuOpen()

Others menu

Returns : void
onPendNegotiationClick
onPendNegotiationClick(event: MouseEvent)

Pend negotiation

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onReturnToApplicantClick
onReturnToApplicantClick(event: MouseEvent)

Return to applicant

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onSetApplicationCompletedClick
onSetApplicationCompletedClick(event: MouseEvent)

Set completed

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onSetApplicationInProgressClick
onSetApplicationInProgressClick(event: MouseEvent)

InProcess

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onSetApplicationNegotiatedClick
onSetApplicationNegotiatedClick(event: MouseEvent)

Set application negotiated

Parameters :
Name Type Optional
event MouseEvent No
Returns : void
onSetApplicationNegotiatingClick
onSetApplicationNegotiatingClick(event: MouseEvent)

Set application negotiating

Parameters :
Name Type Optional
event MouseEvent No
Returns : void

Properties

_application
Type : Application
_applications
Type : Application[]
Default value : []
Optional _negotiationProgress
Type : NegotiationProgress
actionButtonList
Type : QueryList<ElementRef>
Decorators :
@ViewChildren('actionButton')
buttons
Type : SdiButton[]
Default value : [ // new SdiButton('Test', 'outlined', // event => { // // }, () => false, null, false, null, false, ButtonActionType.NOT_SET), new SdiButton($localize`:@@createApplicationBtn:Создать заявку`, 'outlined ok', event => this.createNewClickFn(), () => !this.createNewClickFn, null, null, null, false, ButtonActionType.CREATE) ,new SdiButton($localize`:@@createApplicationGroupBtn:Создать группу заявок`, 'outlined ok', event => this.applicationActionsService.onCreateApplicationsGroupClick(), () => !this.showCreateGroupBtn, null, null, null, false, 'CREATE_APPLICATIONS_GROUP') ,new SdiButton($localize`:@@clarifyBtn:Уточнить`, 'ok', // #22818 event => this.showClickFn(this.topApplication), () => !this.canClarify, null, null, null, false, 'CLARIFY') ,new SdiButton($localize`:@@sendBtn:Отправить`, 'ok', event => this.applicationActionsService.onSendApplicationsClick(this._applications, event), () => !this.canApply || this.canClarify, null, null, null, false, ButtonActionType.SEND, false, true) ,new SdiButton($localize`:@@setApplicationCompletedBtn:Выполнить`, 'success', event => this.onSetApplicationCompletedClick(event), () => !this.canSetApplicationCompleted, null, null, null, false, ButtonActionType.SET_COMPLETED, false, true) ,new SdiButton($localize`:@@pendNegotiationBtn:На согласование`, 'success', event => this.onPendNegotiationClick(event), () => !this.canPendNegotiation, 'fa-share', null, null, false, ButtonActionType.PEND_NEGOTIATION, false, true) ,new SdiButton($localize`:@@setApplicationNegotiatingBtn:Взять на согласование`, 'ok', event => this.onSetApplicationNegotiatingClick(event), () => !this.canSetApplicationNegotiating, null, null, null, false, ButtonActionType.SET_NEGOTIATING, false, true) ,new SdiButton($localize`:@@setApplicationNegotiatedBtn:Согласовать`, 'success', event => this.onSetApplicationNegotiatedClick(event), () => !this.canSetApplicationNegotiated, null, null, null, false, ButtonActionType.SET_NEGOTIATED, false, true) ,new SdiButton($localize`:@@cancelNegotiationBtn:Отменить согласование`, '', event => this.onCancelNegotiationClick(event), () => !this.canCancelNegotiation, null, null, null, false, ButtonActionType.CANCEL_NEGOTIATION, false, true) ,new SdiButton($localize`:@@createItemBtn:Создать позицию`, 'outlined ok', event => this.onCreateItemByApplicationClick(this.topApplication.id, this.activeNode.id), () => !this.canCreateItem, null, null, null, false, 'CREATE_ITEM') ,new SdiButton($localize`:@@storeItemPropertiesToItemBtn:Копировать атрибуты`, 'ok', event => this.applicationsService.storeItemPropertiesToItem(this.topApplication.id, this.activeItemId), () => !this.canStorePropertiesToItem, null, null, null, false, ButtonActionType.COPY_ATTRIBUTES) ,new SdiButton($localize`:@@setApplicationInProgressBtn:Взять в работу`, 'ok', event => this.onSetApplicationInProgressClick(event), () => !this.canStartProcessing, null, null, null, false, ButtonActionType.SET_IN_PROGRESS, false, true) ,new SdiButton($localize`:@@continueApplicationProcessingBtn:К редактированию`, 'ok', event => this.onContinueProcessingClick(event), () => !this.canContinueProcessing, null, null, null, false, ButtonActionType.CONTINUE_PROCESSING) ,new SdiButton($localize`:@@returnToApplicantBtn:Вернуть`, '', event => this.onReturnToApplicantClick(event), () => !this.canReturnToApplicant, null, null, null, false, ButtonActionType.RETURN, false, true) ,new SdiButton($localize`:@@rollbackApplicationTransactionBtn:Отменить изменения`, 'outlined', event => this.onRollbackTransactionClick(event), () => !this.canRollbackTransaction, 'fa-undo', null, null, false, ButtonActionType.ROLLBACK) ,new SdiButton($localize`:@@rejectApplicationBtn:Отменить`, '', event => this.applicationActionsService.onRejectApplicationsClick(this._applications, event), () => !this.canReject, null, null, null, false, ButtonActionType.REJECT, false, true) ,new SdiButton($localize`:@@delegateBtn:Передать`, 'outlined', event => this.applicationActionsService.onDelegateApplicationsClick(this._applications), () => !this.canDelegate, null, null, null, false, ButtonActionType.DELEGATE, false, true) ,new SdiButton($localize`:@@findDuplicateApplicationBtn:Дублирует заявку...`, '', event => this.onFindDuplicateApplicationClick(event), () => !this.canReturnAsDuplicate, null, null, null, true, ButtonActionType.SET_IS_DUPLICATE, false, true) ,new SdiButton($localize`:@@deduplicateApplicationBtn:Удалить связь с оригиналом`, '', event => this.onDeduplicateApplicationClick(event), () => !this.canDeduplicate, null, null, null, true, ButtonActionType.DEDUPLICATE, false, true) ,new SdiButton($localize`:@@showApplicationBtn:Открыть заявку`, 'ok', event => this.showClickFn(this.topApplication), () => !this.isSingleApplication || !this.showClickFn, null, null, null, true, ButtonActionType.OPEN) ,new SdiButton($localize`:@@openApplicationGroupBtn:Открыть группу заявок`, 'ok', event => this.applicationActionsService.onOpenApplicationsGroupClick(this.topApplication.groupUid, this.topApplication.groupName), () => !this.isSingleApplication || !this.topApplication.groupUid, null, null, null, true, 'OPEN_GROUP') ,new SdiButton($localize`:@@openInNewTabBtn:Открыть в новой вкладке`, 'ok', event => this.applicationsService.openApplicationInNewTab(this.topApplication.id), () => !this.isSingleApplication, null, null, null, true, ButtonActionType.OPEN_IN_NEW_TAB) ,new SdiButton($localize`:@@cloneApplicationBtn:Создать копию заявки`, 'outlined ok', event => this.applicationsService.createApplication(this.topApplication.id).then(createdApplication => { this.onApplicationCreatedFn && this.onApplicationCreatedFn(createdApplication); // #18662 if (this.showClickFn) { this.showClickFn(createdApplication); } else { this.applicationsService.openApplicationInNewTab(createdApplication.id); } }), () => !this.isSingleApplication || !this.showCloneBtn, null, null, null, true, ButtonActionType.COPY) ]
showOthersMenu
Type : boolean

Accessors

application
setapplication(value: Application)
Parameters :
Name Type Optional
value Application No
Returns : void
applications
setapplications(value: Application[])
Parameters :
Name Type Optional
value Application[] No
Returns : void
negotiationProgress
setnegotiationProgress(value: NegotiationProgress)
Parameters :
Name Type Optional
value NegotiationProgress No
Returns : void
canClarify
getcanClarify()

Permissions

Returns : boolean
canApply
getcanApply()
canReject
getcanReject()
canReturnToApplicant
getcanReturnToApplicant()
canReturnAsDuplicate
getcanReturnAsDuplicate()
canDeduplicate
getcanDeduplicate()
canDelegate
getcanDelegate()
canStartProcessing
getcanStartProcessing()
canContinueProcessing
getcanContinueProcessing()
canRollbackTransaction
getcanRollbackTransaction()
canSetApplicationCompleted
getcanSetApplicationCompleted()
canPendNegotiation
getcanPendNegotiation()
canSetApplicationNegotiating
getcanSetApplicationNegotiating()
canSetApplicationNegotiated
getcanSetApplicationNegotiated()
canCancelNegotiation
getcanCancelNegotiation()
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""