Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-warehouse-supplier/mrm-warehouse-supplier.component.ts (line 84)
Part of: Pams
MrmWarehouseSupplierComponent manages warehouse-supplier dashboard data within the dashboard widget library. It handles authorization checks, lifecycle updates, data initialization and persistence, monthly totals, month-name translation, and synchronized scrolling.
Methods
| Method | Signature | Returns |
|---|---|---|
GetAuthorizationAccess | GetAuthorizationAccess(url: string) | void |
ngOnInit | ngOnInit() | void |
ngOnChanges | ngOnChanges() | void |
ngOnDestroy | ngOnDestroy() | void |
getDashboardData | getDashboardData() | void |
initalizingData | initalizingData(value: BranchData[]) | void |
saveDashboardData | saveDashboardData() | void |
calculateSumByMonth | calculateSumByMonth(monthIndex: number) | void |
translateMonthName | translateMonthName(month: MonthData) | string |
syncScroll | syncScroll(e: undefined) | void |
getpriceFormatted | getpriceFormatted(x: undefined) | string |
onResize | onResize() | void |
setChaching | setChaching() | void |
getChaching | getChaching() | void |
switchChartTypeHandler | switchChartTypeHandler() | void |
switchBasedOnTendencyHandler | switchBasedOnTendencyHandler() | void |
comparingWithPrevMonth | comparingWithPrevMonth(month: MonthData, bIndex: number, index: number) | string |
comparingBookingWithPrevSumm | comparingBookingWithPrevSumm(month: MonthsSum, index: number, propertyName: string) | string |
isCurrentMonth | isCurrentMonth(month: MonthData) | boolean |
getpriceForecastAmount | getpriceForecastAmount(month: MonthData) | number |
expectedCurrencyChange | expectedCurrencyChange(e: undefined) | void |
selectText | selectText(e: undefined) | void |
editSelectedMonthPrepare | editSelectedMonthPrepare(month: MonthData, supplierId: number) | void |
copyValueFromPrevMonth | copyValueFromPrevMonth(month: MonthData, monthIndex: number) | void |
sorting | sorting(propertyName: string, propertyType: string, monthIndex: number) | void |
openPopup | openPopup(n: string, t: string, i: string, btnTxt: string) | void |
savePopup | savePopup() | void |
ClosewithDonotSave | ClosewithDonotSave() | void |
OnOpenedPopup | OnOpenedPopup() | void |
closePopup | closePopup() | void |
Properties
| Property | Type |
|---|---|
sharedPopup | SharedPopupComponent |
scrollOne | ElementRef |
scrollTwo | ElementRef |
scrollThree | ElementRef |
_widget | Widget |
_widgetType | string |
withoutOptionBar | boolean |
editMode | boolean |
bookingOrSales | number |
withNominal | boolean |
selectedTeam | number |
forecastRuleId | number |
allowedtoEdit | boolean |
allowedtoEnableEdting | boolean |
widgetEditRequest | any |
widgetEditEnd | any |
forecastRules | any[] |
selectedYear | number |
numYearsDatasource | any[] |
todayWidgetsEnum | any |
cachingWidgetData | CachingWidgetData |
data | BranchData[] |
originalData | BranchData[] |
selectedData | BranchData[] |
singleMonths | MonthData |
branchCurrency | any |
basedOnTendency | boolean |
subscription | Subscription |
SeriseRange | any[] |
echartsIntance | any |
totalBookingMonths | MonthsSum[] |
tempMonthSum | MonthsSum |
totalTargets | number |
yearBooking | number |
totalForecasts | number |
tempTotalTarget | TotalTargets |
popup | any |
searchText | string |
isModeOfInsertFromPrevMonthActive | boolean |
sortingDirection | number |
Where it refuses work
MrmWarehouseSupplierComponentstops the work with an early return whena[propertyName] < b[propertyName], in 2 places.MrmWarehouseSupplierComponentstops the work with an early return whena[propertyName] > b[propertyName], in 2 places.MrmWarehouseSupplierComponentstops the work with an early return whenmonth.MonthId == 12.MrmWarehouseSupplierComponentstops the work with an early return whenmonth.GoodsTotal < this.data[bIndex].MrmStock[index - 1].GoodsTotal.MrmWarehouseSupplierComponentstops the work with an early return whenmonth[propertyName] < this.totalBookingMonths[index - 1][propertyName].MrmWarehouseSupplierComponentstops the work with an early return whenthis.allowedtoEnableEdting.
Diagram
mermaidgraph LR A[Angular lifecycle] --> B[GetAuthorizationAccess] A --> C[initalizingData] C --> D[getDashboardData] D --> E[calculateSumByMonth] E --> F[translateMonthName] F --> G[Dashboard widget view] G --> H[syncScroll] G --> I[saveDashboardData] A --> J[ngOnDestroy]
Usage
tsimport { Component, ViewChild } from '@angular/core';
import { MrmWarehouseSupplierComponent } from './mrm-warehouse-supplier.component';
@Component({
selector: 'app-dashboard-page',
template: `
<app-mrm-warehouse-supplier></app-mrm-warehouse-supplier>
<button type="button" (click)="refreshWidget()">
Refresh
</button>
`
})
export class DashboardPageComponent {
@ViewChild(MrmWarehouseSupplierComponent)
warehouseSupplierWidget!: MrmWarehouseSupplierComponent;
refreshWidget(): void {
this.warehouseSupplierWidget.getDashboardData();
this.warehouseSupplierWidget.calculateSumByMonth();
this.warehouseSupplierWidget.syncScroll();
}
saveWidgetState(): void {
this.warehouseSupplierWidget.saveDashboardData();
}
}
AI Coding Instructions
- Keep authorization checks in
GetAuthorizationAccess()before loading or saving dashboard data. - Follow Angular lifecycle flow: initialize data in
ngOnInit(), respond to updated bindings inngOnChanges(), and release subscriptions or listeners inngOnDestroy(). - Preserve the existing
initalizingData()method name when calling or modifying it, even though its spelling differs frominitializingData. - Recalculate monthly totals with
calculateSumByMonth()after dashboard data changes, then update month labels throughtranslateMonthName(). - Keep linked scroll containers synchronized through
syncScroll()without creating recursive scroll event updates.
Used by
3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (3)
TranslateHandler—Pams/Web/Pams.Web/Client/app/app.module.ts:1DashboardTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/dashboard-tab/dashboard-tab.component.ts:1ReportsTabComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/reports-library/reports-tab/reports-tab.component.ts:1
Was this page helpful?