Skip to content

MrmPmShipmentComponent

reference
2 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/dashboard/dashboard-libary/widgets/mrm-pm-shipment/mrm-pm-shipment.component.ts (line 43)

Part of: Pams

MrmPmShipmentComponent is an Angular dashboard widget for presenting MRM PM shipment data and related performance values. It loads and initializes dashboard data, responds to lifecycle and resize events, formats display values, and stores cached state.

Methods

MethodSignatureReturns
ngOnInitngOnInit()void
ngOnChangesngOnChanges()void
ngOnDestroyngOnDestroy()void
getDashboardDatagetDashboardData()void
initalizingDatainitalizingData(value: BranchData[])void
calculatePerformancePercalculatePerformancePer(month: MonthData)number
translateMonthNametranslateMonthName(month: MonthData)string
getpriceFormattedgetpriceFormatted(x: undefined)string
onResizeonResize()void
setChachingsetChaching()void
getChachinggetChaching()void
onValueChangedonValueChanged(e: undefined)void
onChartInitonChartInit(e: any, index: number)void
switchChartTypeHandlerswitchChartTypeHandler()void
switchBasedOnTendencyHandlerswitchBasedOnTendencyHandler()void
comparingWithPrevMonthcomparingWithPrevMonth(month: MonthData, bIndex: number, index: number)string
comparingBookingWithPrevSummcomparingBookingWithPrevSumm(month: TotalBookingMonths, index: number)string
comparingForecastWithPrevSummcomparingForecastWithPrevSumm(month: TotalBookingMonths, index: number)string
setValuesetValue(value: number)void
setForecastValuesetForecastValue(value: number)void
setMarginAvaragesetMarginAvarage(value: number)void
isForecastisForecast(month: MonthData)boolean
isAchievedOrCurrentisAchievedOrCurrent(month: MonthData)boolean
getpriceForecastAmountgetpriceForecastAmount(month: MonthData)number
expectedCurrencyChangeexpectedCurrencyChange(e: undefined)void

Properties

PropertyType
_widgetWidget
_widgetTypestring
withoutOptionBarboolean
bookingOrSalesnumber
withNominalboolean
selectedTeamnumber
forecastRuleIdnumber
allowedtoEditboolean
allowedtoEnableEdtingboolean
forecastRulesany[]
selectedYearnumber
numYearsDatasourceany[]
todayWidgetsEnumany
cachingWidgetDataCachingWidgetData
dataBranchData[]
originalDataBranchData[]
singleMonthsMonthData
branchCurrencyany
basedOnTendencyboolean
subscriptionSubscription
SeriseRangeany[]
echartsIntanceany
totalBookingMonthsTotalBookingMonths[]
tempTotalMonthTotalBookingMonths
totalTargetsnumber
yearBookingnumber
totalForecastsnumber
tempTotalTargetTotalTargets

Where it refuses work

  • MrmPmShipmentComponent stops the work with an early return when month.MonthId == 12.
  • MrmPmShipmentComponent stops the work with an early return when month.TotalValue < this.data[bIndex].MrmBooking[index - 1].TotalValue.
  • MrmPmShipmentComponent stops the work with an early return when month.TotalBookingMonth < this.totalBookingMonths[index - 1].TotalBookingMonth.
  • MrmPmShipmentComponent stops the work with an early return when month.TotalForecastMonth < this.totalBookingMonths[index - 1].TotalForecastMonth.
  • MrmPmShipmentComponent stops the work with an early return when month.MonthId >= new Date().getMonth() + 1.
  • MrmPmShipmentComponent stops the work with an early return when month.MonthId <= new Date().getMonth() + 1.

Diagram

mermaid
graph LR
  A[Angular lifecycle] --> B[MrmPmShipmentComponent]
  B --> C[ngOnInit]
  B --> D[ngOnChanges]
  B --> E[ngOnDestroy]
  C --> F[getDashboardData]
  F --> G[initalizingData]
  G --> H[calculatePerformancePer]
  G --> I[translateMonthName]
  G --> J[getpriceFormatted]
  B --> K[onResize]
  B --> L[setChaching]

Usage

ts
import { Component, ViewChild } from '@angular/core';
import { MrmPmShipmentComponent } from './mrm-pm-shipment.component';

@Component({
  selector: 'app-dashboard-host',
  template: `
    <!-- Render the shipment widget through its configured Angular selector. -->
  `
})
export class DashboardHostComponent {
  @ViewChild(MrmPmShipmentComponent)
  shipmentWidget?: MrmPmShipmentComponent;

  refreshShipmentData(): void {
    this.shipmentWidget?.getDashboardData();
  }

  handleDashboardResize(): void {
    this.shipmentWidget?.onResize();
  }
}

AI Coding Instructions

  • Keep data loading inside getDashboardData() and use initalizingData() to prepare received values for display.
  • Do not call ngOnInit(), ngOnChanges(), or ngOnDestroy() directly; Angular invokes lifecycle hooks.
  • Update display calculations through calculatePerformancePer(), translateMonthName(), and getpriceFormatted() rather than duplicating formatting logic in templates.
  • Call setChaching() after updating data that should be retained for later dashboard rendering.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • TranslateHandlerPams/Web/Pams.Web/Client/app/app.module.ts:1

Was this page helpful?

Download as PDF