{"version":3,"sources":["webpack:///./src/components/quotes/QuotesCustomersExpandedView.vue","webpack:///./src/models/Charts/quotesAbcCustomersDetailedGenerator.ts","webpack:///./src/components/quotes/QuotesCustomersExpandedView.vue?0b4d","webpack:///./src/components/quotes/QuotesCustomersExpandedView.vue?25d1","webpack:///./src/components/quotes/QuotesCustomersExpandedView.vue?519f","webpack:///./src/components/quotes/QuotesCustomersExpandedView.vue?276f","webpack:///./src/components/quotes/QuotesCustomersExpandedView.vue?4318"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","attrs","modalOpen","on","$event","_v","_s","$t","selectedCustomerFilter","onCustomerFilterChanged","_l","customerFilterOptions","option","index","key","domProps","concat","loading","noData","staticRenderFns","QuotesAbcCustomersDetailedGenerator","_QuotesAbcCustomersGe","procedure","tenantIdDh","_classCallCheck","_callSuper","_inherits","_createClass","value","data","parameters","arguments","length","undefined","prevOptions","options","_superPropGet","_objectSpread","label","position","overflow","formatter","params","_params$data$selectio","selection","id","categoryName","i18n","t","category","path","split","customer","find","item","no_","formattedRatio","formatPercentage","converted_amount","amount","name","abbreviateNumberWithCurrency","n_quotes","n_accepted","join","rich","fontSize","backgroundColor","borderRadius","padding","align","title","fontWeight","hr","width","borderColor","borderWidth","height","lineHeight","highlight","line","QuotesAbcCustomersGenerator","QuotesCustomersExpandedView","_Vue","_this","_len","args","Array","_key","_defineProperty","CustomerFilter","All","New","BestRates","WorstRates","Overdue","DetailedViewEnum","QuotesCustomerExpandedView","_mounted","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_context","prev","next","update","stop","mounted","apply","_update","_callee2","_context2","isEmpty","generator","getData","selectedTimeFilter","sent","abrupt","customerFilter","updateOptions","_onCustomerFilterChanged","_callee3","filter","_context3","_x","onClose","abort","get","tenantsService","store","current","tenant","Vue","__decorate","Prop","required","Watch","Component","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,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eN,KAAKmI,SAC5BnI,KAAKmI,YAER,CAAAjH,IAAA,gBAAAc,MAEO,WACNhC,KAAKuH,UAAUa,UAChB,CAAAlH,IAAA,SAAAmH,IAED,WACE,OAAOC,OAAeC,MAAMC,YAC7B,CAAAtH,IAAA,aAAAmH,IAED,WACE,OAAOrI,KAAKyI,OAAO9G,eAtEyB,CAAS+G,QAEvDC,eAAA,CADCC,kB,yCAIDD,eAAA,CADCC,eAAK,CAAEC,UAAU,K,8BAmDlBF,eAAA,CADCG,eAAM,c,uCAtDYxD,EAA2BqD,eAAA,CAD/CI,eAAU,KACUzD,WCbkZ,I,kCCSna0D,EAAY,eACd,EACAlJ,EACAyB,GACA,EACA,KACA,WACA,MAIa,aAAAyH,E,kECpBf,W,yDCAA","file":"js/chunk-2ad12796.8d7c2bcd.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('b-modal',{staticClass:\"modal-detailed\",attrs:{\"active\":_vm.modalOpen,\"can-cancel\":['escape', 'outside'],\"destroy-on-hide\":true,\"has-modal-card\":\"\",\"trap-focus\":\"\"},on:{\"update:active\":function($event){_vm.modalOpen=$event}}},[_c('div',{staticClass:\"modal-card detailed\"},[_c('header',{staticClass:\"modal-card-head\"},[_c('p',{staticClass:\"modal-card-title\"},[_vm._v(_vm._s(_vm.$t('report.abc_customer_quotes_detailed')))]),_c('b-select',{attrs:{\"value\":_vm.selectedCustomerFilter},on:{\"input\":_vm.onCustomerFilterChanged}},_vm._l((_vm.customerFilterOptions),function(option,index){return _c('option',{key:index,domProps:{\"value\":option}},[_vm._v(\" \"+_vm._s(_vm.$t(`report.business_console.${option}_customers`))+\" \")])}),0)],1),_c('div',{staticClass:\"modal-card-body\"},[_c('b-loading',{attrs:{\"active\":_vm.loading}}),(_vm.noData)?_c('div',{staticClass:\"no-info\"},[_c('span',{staticClass:\"no-data\"},[_vm._v(_vm._s(_vm.$t('no_data')))])]):_c('v-chart',{attrs:{\"autoresize\":\"\",\"option\":_vm.option}})],1),_c('div',{staticClass:\"modal-card-foot buttons is-right\"},[_c('b-button',{attrs:{\"label\":_vm.$t('action.close')},on:{\"click\":function($event){_vm.modalOpen = false}}})],1)])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","// Copyright (C) 2021 Bystronic Laser AG\n\nimport i18n from '@/i18n';\nimport { abbreviateNumberWithCurrency, formatPercentage } from '@/utils/number';\nimport { EChartsOption } from 'echarts';\nimport { ProcedureName } from './abstract/chartGenerator';\nimport { QuotesAbcCustomersData } from './chartsData';\nimport { GeneratorParams } from './generatorParams';\nimport QuotesAbcCustomersGenerator from './quotesAbcCustomersGenerator';\n\nexport default class QuotesAbcCustomersDetailedGenerator extends QuotesAbcCustomersGenerator {\n constructor(procedure: ProcedureName, tenantIdDh: number) {\n super(procedure, tenantIdDh);\n }\n\n override updateOptions(\n data: QuotesAbcCustomersData[],\n parameters: GeneratorParams = {},\n prevOptions?: EChartsOption,\n ): EChartsOption {\n const options = super.updateOptions(data, parameters, prevOptions);\n\n return {\n ...options,\n label: {\n position: 'insideTopLeft',\n overflow: 'breakAll',\n formatter: (params: any) => {\n if (!params.data.selection?.id) {\n // non-leaf nodes don't have the selection field\n return '';\n }\n\n const categoryName = i18n.t('widget_info_text.quotes_abc_customers_tooltip_category', {\n category: params.data.path.split('/')[0],\n });\n const customer = data.find((item) => item.no_ === params.data.selection.id)!;\n const formattedRatio = formatPercentage(\n (100 * customer.converted_amount) / customer.amount,\n );\n\n return [\n `{title|${params.name}} {category|${categoryName}}`,\n '{hr|}',\n `{highlight|${abbreviateNumberWithCurrency(customer.amount)}}` +\n ` {label|${i18n.t('widget_info_text.quotes_abc_customers_tooltip_amount')}}`,\n `{line|${abbreviateNumberWithCurrency(params.value)}} {label|${i18n.t(\n 'widget_info_text.quotes_abc_customers_tooltip_converted_amount',\n )}}`,\n `{line|${customer.n_quotes}} {label|${i18n.t(\n 'widget_info_text.quotes_abc_customers_tooltip_number_quotes',\n )}}`,\n `{line|${customer.n_accepted}} {label|${i18n.t(\n 'widget_info_text.quotes_abc_customers_tooltip_number_converted_quotes',\n )}}`,\n `{line|${formattedRatio}}` +\n ` {label|${i18n.t('widget_info_text.quotes_abc_customers_tooltip_ratio')}}`,\n ].join('\\n');\n },\n rich: {\n label: {\n fontSize: 9,\n backgroundColor: 'rgba(0, 0, 0, 0.3)',\n borderRadius: 2,\n padding: [2, 4],\n align: 'right',\n },\n title: {\n fontSize: 14,\n fontWeight: 'bold',\n padding: 3,\n },\n category: {\n align: 'right',\n },\n hr: {\n width: '100%',\n borderColor: 'rgba(255, 255, 255, 0.2)',\n borderWidth: 0.5,\n height: 0,\n lineHeight: 10,\n },\n highlight: {\n padding: 4,\n fontSize: 12,\n fontWeight: 'bold',\n },\n line: {\n padding: 3,\n },\n },\n },\n };\n }\n}\n","\nimport { Component, Prop, Vue, Watch } from 'vue-property-decorator';\nimport { CustomerFilter } from '@/models/Charts/quotesAbcCustomersGenerator';\nimport QuotesAbcCustomersDetailedGenerator from '@/models/Charts/quotesAbcCustomersDetailedGenerator';\nimport { DetailedViewEnum } from '@/models/enums/WidgetEnum';\nimport { Tenant } from '@/models/tenant';\nimport { EChartsOption } from 'echarts';\nimport { QuotesAbcCustomersData } from '@/models/Charts/chartsData';\nimport { isEmpty } from '@/utils/misc';\nimport { ChartGenerator } from '@/models/Charts/abstract/chartGenerator';\nimport { tenantsService } from '@/services/tenants.service';\n\n@Component({})\nexport default class QuotesCustomersExpandedView extends Vue {\n @Prop()\n private selectedTimeFilter!: [string, string];\n\n @Prop({ required: false })\n private onClose?: () => void;\n\n private modalOpen = true;\n private customerFilterOptions = [\n CustomerFilter.All,\n CustomerFilter.New,\n CustomerFilter.BestRates,\n CustomerFilter.WorstRates,\n CustomerFilter.Overdue,\n ];\n private selectedCustomerFilter = CustomerFilter.All;\n private noData = false;\n private loading = false;\n private data: QuotesAbcCustomersData[] | null = [];\n private option: EChartsOption | null = null;\n private generator: ChartGenerator =\n new QuotesAbcCustomersDetailedGenerator(\n DetailedViewEnum.QuotesCustomerExpandedView,\n this.tenantIdDh,\n );\n\n private async mounted() {\n await this.update();\n }\n\n private async update(): Promise {\n this.loading = true;\n if (isEmpty(this.data)) {\n this.data = await this.generator.getData([], [], this.selectedTimeFilter);\n }\n\n if (isEmpty(this.data)) {\n this.noData = true;\n this.loading = false;\n return;\n }\n\n const params = {\n customerFilter: this.selectedCustomerFilter,\n };\n this.option = this.generator.updateOptions(this.data!, params);\n this.loading = false;\n }\n\n private async onCustomerFilterChanged(filter: CustomerFilter) {\n this.selectedCustomerFilter = filter;\n await this.update();\n }\n\n @Watch('modalOpen')\n private onModalOpenChanged() {\n if (!this.modalOpen && !!this.onClose) {\n this.onClose();\n }\n }\n\n private beforeDestroy() {\n this.generator.abort();\n }\n\n private get tenant(): Tenant {\n return tenantsService.store.current()!;\n }\n\n private get tenantIdDh(): number {\n return this.tenant.tenantIdDh;\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./QuotesCustomersExpandedView.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./QuotesCustomersExpandedView.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./QuotesCustomersExpandedView.vue?vue&type=template&id=6c888eb3&scoped=true\"\nimport script from \"./QuotesCustomersExpandedView.vue?vue&type=script&lang=ts\"\nexport * from \"./QuotesCustomersExpandedView.vue?vue&type=script&lang=ts\"\nimport style0 from \"./QuotesCustomersExpandedView.vue?vue&type=style&index=0&id=6c888eb3&prod&lang=scss&scoped=true\"\nimport style1 from \"./QuotesCustomersExpandedView.vue?vue&type=style&index=1&id=6c888eb3&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6c888eb3\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./QuotesCustomersExpandedView.vue?vue&type=style&index=1&id=6c888eb3&prod&lang=scss\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./QuotesCustomersExpandedView.vue?vue&type=style&index=0&id=6c888eb3&prod&lang=scss&scoped=true\""],"sourceRoot":""}