(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pagesA/business-unit-dashboard/business-unit-dashboard"],{ /***/ 547: /*!**********************************************************************************************************!*\ !*** D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue ***! \**********************************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./business-unit-dashboard.vue?vue&type=template&id=3a4cd846&scoped=true& */ 548); /* harmony import */ var _business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./business-unit-dashboard.vue?vue&type=script&lang=js& */ 550); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony import */ var _business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./business-unit-dashboard.vue?vue&type=style&index=0&id=3a4cd846&lang=scss&scoped=true& */ 552); /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 32); var renderjs /* normalize component */ var component = Object(_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( _business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], _business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, "3a4cd846", null, false, _business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"], renderjs ) component.options.__file = "pagesA/business-unit-dashboard/business-unit-dashboard.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 548: /*!*****************************************************************************************************************************************************!*\ !*** D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue?vue&type=template&id=3a4cd846&scoped=true& ***! \*****************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns, recyclableRender, components */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./business-unit-dashboard.vue?vue&type=template&id=3a4cd846&scoped=true& */ 549); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_template_id_3a4cd846_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; }); /***/ }), /***/ 549: /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue?vue&type=template&id=3a4cd846&scoped=true& ***! \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns, recyclableRender, components */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; }); var components try { components = { uIcon: function () { return Promise.all(/*! import() | uni_modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-icon/u-icon.vue */ 639)) }, qiunDataCharts: function () { return Promise.all(/*! import() | uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts")]).then(__webpack_require__.bind(null, /*! @/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue */ 790)) }, uLoadingIcon: function () { return Promise.all(/*! import() | uni_modules/uview-ui/components/u-loading-icon/u-loading-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-loading-icon/u-loading-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-loading-icon/u-loading-icon.vue */ 762)) }, } } catch (e) { if ( e.message.indexOf("Cannot find module") !== -1 && e.message.indexOf(".vue") !== -1 ) { console.error(e.message) console.error("1. 排查组件名称拼写是否正确") console.error( "2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom" ) console.error( "3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件" ) } else { throw e } } var render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h var l0 = _vm.statistics ? _vm.__map(_vm.kpiListTop.slice(0, 2), function (kpi, index) { var $orig = _vm.__get_orig(kpi) var m0 = _vm.getKpiIconName(kpi.key) var m1 = kpi.isMoney ? _vm.formatMoney(kpi.value) : null var m2 = !kpi.isMoney ? _vm.formatNumber(kpi.value) : null return { $orig: $orig, m0: m0, m1: m1, m2: m2, } }) : null var l1 = _vm.statistics ? _vm.__map(_vm.kpiListTop.slice(2, 5), function (kpi, index) { var $orig = _vm.__get_orig(kpi) var m3 = _vm.formatNumber(kpi.value) return { $orig: $orig, m3: m3, } }) : null var l2 = _vm.statistics ? _vm.__map(_vm.categoryKpiList, function (kpi, index) { var $orig = _vm.__get_orig(kpi) var m4 = _vm.getCategoryKpiIconName(kpi.key) var m5 = kpi.isMoney ? _vm.formatMoney(kpi.value) : null var m6 = !kpi.isMoney ? _vm.formatNumber(kpi.value) : null return { $orig: $orig, m4: m4, m5: m5, m6: m6, } }) : null var g0 = _vm.performanceTrend.TrendData && _vm.performanceTrend.TrendData.length > 0 var g1 = _vm.storeDistribution.DistributionData && _vm.storeDistribution.DistributionData.length > 0 var l3 = g1 ? _vm.__map( _vm.storeDistribution.DistributionData.slice(0, 5), function (item, index) { var $orig = _vm.__get_orig(item) var m7 = _vm.getDistributionColor(index) var m8 = _vm.formatMoney(item.Performance) return { $orig: $orig, m7: m7, m8: m8, } } ) : null var g2 = _vm.storeRanking.length var l4 = g2 > 0 ? _vm.__map(_vm.storeRanking.slice(0, 10), function (item, index) { var $orig = _vm.__get_orig(item) var m9 = _vm.formatMoney(item.NetPerformance) return { $orig: $orig, m9: m9, } }) : null var g3 = _vm.managerRanking.length var l5 = g3 > 0 ? _vm.__map(_vm.managerRanking.slice(0, 10), function (item, index) { var $orig = _vm.__get_orig(item) var g4 = item.ManagerName ? item.ManagerName.substring(0, 1) : null var m10 = _vm.formatMoney(item.TotalBillingPerformance) return { $orig: $orig, g4: g4, m10: m10, } }) : null var g5 = _vm.storeManagerRanking.length var l6 = g5 > 0 ? _vm.__map(_vm.storeManagerRanking.slice(0, 10), function (item, index) { var $orig = _vm.__get_orig(item) var m11 = _vm.formatMoney(item.TotalPerformance) return { $orig: $orig, m11: m11, } }) : null var g6 = _vm.healthCoachRanking.length var l7 = g6 > 0 ? _vm.__map(_vm.healthCoachRanking.slice(0, 10), function (item, index) { var $orig = _vm.__get_orig(item) var m12 = _vm.formatMoney(item.TotalPerformance) return { $orig: $orig, m12: m12, } }) : null var m13 = _vm.operationStatistics ? _vm.formatNumber( (_vm.operationStatistics && _vm.operationStatistics.BillingAnalysis && _vm.operationStatistics.BillingAnalysis.BillingCount) || 0 ) : null var m14 = _vm.operationStatistics ? _vm.formatMoney( (_vm.operationStatistics && _vm.operationStatistics.BillingAnalysis && _vm.operationStatistics.BillingAnalysis.AverageBillingAmount) || 0 ) : null var m15 = _vm.operationStatistics ? _vm.formatNumber( (_vm.operationStatistics && _vm.operationStatistics.ConsumeAnalysis && _vm.operationStatistics.ConsumeAnalysis.ConsumeCount) || 0 ) : null var m16 = _vm.operationStatistics ? _vm.formatMoney( (_vm.operationStatistics && _vm.operationStatistics.ConsumeAnalysis && _vm.operationStatistics.ConsumeAnalysis.ConsumeAmount) || 0 ) : null var m17 = _vm.operationStatistics ? _vm.formatPercent( (_vm.operationStatistics && _vm.operationStatistics.ConsumeAnalysis && _vm.operationStatistics.ConsumeAnalysis.ConsumeRate) || 0 ) : null var m18 = _vm.operationStatistics ? _vm.formatNumber( (_vm.operationStatistics && _vm.operationStatistics.RefundAnalysis && _vm.operationStatistics.RefundAnalysis.RefundCount) || 0 ) : null var m19 = _vm.operationStatistics ? _vm.formatMoney( (_vm.operationStatistics && _vm.operationStatistics.RefundAnalysis && _vm.operationStatistics.RefundAnalysis.RefundAmount) || 0 ) : null var m20 = _vm.operationStatistics ? _vm.formatPercent( (_vm.operationStatistics && _vm.operationStatistics.RefundAnalysis && _vm.operationStatistics.RefundAnalysis.RefundRate) || 0 ) : null var m21 = _vm.comparisonAnalysis ? _vm.formatPercent( _vm.monthOverMonthComparison.BillingPerformanceChangeRate ) : null var m22 = _vm.comparisonAnalysis ? _vm.formatPercent( _vm.monthOverMonthComparison.ConsumePerformanceChangeRate ) : null var m23 = _vm.comparisonAnalysis ? _vm.formatPercent(_vm.monthOverMonthComparison.NetPerformanceChangeRate) : null var m24 = _vm.comparisonAnalysis ? _vm.formatPercent(_vm.monthOverMonthComparison.CompletionRateChange) : null var m25 = _vm.comparisonAnalysis ? _vm.formatPercent(_vm.yearOverYearComparison.BillingPerformanceChangeRate) : null var m26 = _vm.comparisonAnalysis ? _vm.formatPercent(_vm.yearOverYearComparison.ConsumePerformanceChangeRate) : null var m27 = _vm.comparisonAnalysis ? _vm.formatPercent(_vm.yearOverYearComparison.NetPerformanceChangeRate) : null var m28 = _vm.comparisonAnalysis ? _vm.formatPercent(_vm.yearOverYearComparison.CompletionRateChange) : null var g7 = !_vm.storeDetailList.loading ? _vm.storeDetailList.data.length : null var l8 = !_vm.storeDetailList.loading && g7 > 0 ? _vm.__map(_vm.storeDetailList.data, function (item, index) { var $orig = _vm.__get_orig(item) var m29 = _vm.formatMoney(item.BillingPerformance) var m30 = _vm.formatMoney(item.ConsumePerformance) var m31 = _vm.formatMoney(item.NetPerformance) var m32 = _vm.formatPercent(item.CompletionRate) return { $orig: $orig, m29: m29, m30: m30, m31: m31, m32: m32, } }) : null var g8 = !_vm.storeDetailList.loading && g7 > 0 && _vm.storeDetailList.pagination.total > _vm.storeDetailList.pagination.pageSize ? Math.ceil( _vm.storeDetailList.pagination.total / _vm.storeDetailList.pagination.pageSize ) : null var g9 = !_vm.storeDetailList.loading && g7 > 0 && _vm.storeDetailList.pagination.total > _vm.storeDetailList.pagination.pageSize ? Math.ceil( _vm.storeDetailList.pagination.total / _vm.storeDetailList.pagination.pageSize ) : null var g10 = !_vm.managerDetailList.loading ? _vm.managerDetailList.data.length : null var l9 = !_vm.managerDetailList.loading && g10 > 0 ? _vm.__map(_vm.managerDetailList.data, function (item, index) { var $orig = _vm.__get_orig(item) var m33 = _vm.formatMoney(item.TotalBillingPerformance) var m34 = _vm.formatMoney(item.TotalConsumePerformance) return { $orig: $orig, m33: m33, m34: m34, } }) : null var g11 = !_vm.managerDetailList.loading && g10 > 0 && _vm.managerDetailList.pagination.total > _vm.managerDetailList.pagination.pageSize ? Math.ceil( _vm.managerDetailList.pagination.total / _vm.managerDetailList.pagination.pageSize ) : null var g12 = !_vm.managerDetailList.loading && g10 > 0 && _vm.managerDetailList.pagination.total > _vm.managerDetailList.pagination.pageSize ? Math.ceil( _vm.managerDetailList.pagination.total / _vm.managerDetailList.pagination.pageSize ) : null var g13 = !_vm.storeManagerDetailList.loading ? _vm.storeManagerDetailList.data.length : null var l10 = !_vm.storeManagerDetailList.loading && g13 > 0 ? _vm.__map(_vm.storeManagerDetailList.data, function (item, index) { var $orig = _vm.__get_orig(item) var m35 = _vm.formatMoney(item.TotalPerformance) return { $orig: $orig, m35: m35, } }) : null var g14 = !_vm.storeManagerDetailList.loading && g13 > 0 && _vm.storeManagerDetailList.pagination.total > _vm.storeManagerDetailList.pagination.pageSize ? Math.ceil( _vm.storeManagerDetailList.pagination.total / _vm.storeManagerDetailList.pagination.pageSize ) : null var g15 = !_vm.storeManagerDetailList.loading && g13 > 0 && _vm.storeManagerDetailList.pagination.total > _vm.storeManagerDetailList.pagination.pageSize ? Math.ceil( _vm.storeManagerDetailList.pagination.total / _vm.storeManagerDetailList.pagination.pageSize ) : null var g16 = !_vm.healthCoachDetailList.loading ? _vm.healthCoachDetailList.data.length : null var l11 = !_vm.healthCoachDetailList.loading && g16 > 0 ? _vm.__map(_vm.healthCoachDetailList.data, function (item, index) { var $orig = _vm.__get_orig(item) var m36 = _vm.formatMoney(item.TotalPerformance) return { $orig: $orig, m36: m36, } }) : null var g17 = !_vm.healthCoachDetailList.loading && g16 > 0 && _vm.healthCoachDetailList.pagination.total > _vm.healthCoachDetailList.pagination.pageSize ? Math.ceil( _vm.healthCoachDetailList.pagination.total / _vm.healthCoachDetailList.pagination.pageSize ) : null var g18 = !_vm.healthCoachDetailList.loading && g16 > 0 && _vm.healthCoachDetailList.pagination.total > _vm.healthCoachDetailList.pagination.pageSize ? Math.ceil( _vm.healthCoachDetailList.pagination.total / _vm.healthCoachDetailList.pagination.pageSize ) : null if (!_vm._isMounted) { _vm.e0 = function ($event, kpi) { var _temp = arguments[arguments.length - 1].currentTarget.dataset, _temp2 = _temp.eventParams || _temp["event-params"], kpi = _temp2.kpi var _temp, _temp2 return _vm.handleKpiClick(kpi) } _vm.e1 = function ($event, kpi) { var _temp3 = arguments[arguments.length - 1].currentTarget.dataset, _temp4 = _temp3.eventParams || _temp3["event-params"], kpi = _temp4.kpi var _temp3, _temp4 return _vm.handleKpiClick(kpi) } } _vm.$mp.data = Object.assign( {}, { $root: { l0: l0, l1: l1, l2: l2, g0: g0, g1: g1, l3: l3, g2: g2, l4: l4, g3: g3, l5: l5, g5: g5, l6: l6, g6: g6, l7: l7, m13: m13, m14: m14, m15: m15, m16: m16, m17: m17, m18: m18, m19: m19, m20: m20, m21: m21, m22: m22, m23: m23, m24: m24, m25: m25, m26: m26, m27: m27, m28: m28, g7: g7, l8: l8, g8: g8, g9: g9, g10: g10, l9: l9, g11: g11, g12: g12, g13: g13, l10: l10, g14: g14, g15: g15, g16: g16, l11: l11, g17: g17, g18: g18, }, } ) } var recyclableRender = false var staticRenderFns = [] render._withStripped = true /***/ }), /***/ 550: /*!***********************************************************************************************************************************!*\ !*** D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue?vue&type=script&lang=js& ***! \***********************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./business-unit-dashboard.vue?vue&type=script&lang=js& */ 551); /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_tool_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ 551: /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue?vue&type=script&lang=js& ***! \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(uni) { var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 43)); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11)); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 45)); var _businessUnitDashboard = _interopRequireDefault(__webpack_require__(/*! @/apis/modules/business-unit-dashboard.js */ 55)); var _request = _interopRequireDefault(__webpack_require__(/*! @/service/request.js */ 35)); var _config = _interopRequireDefault(__webpack_require__(/*! @/common/config.js */ 37)); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var _default = { data: function data() { return { loading: false, screenshotLoading: false, // 截图加载状态 showScreenshotBtn: true, // 是否显示截图按钮 selectedMonth: '', businessUnitIndex: -1, businessUnitOptions: [], currentBusinessUnitName: '', currentBusinessUnitId: '', pageScrollTop: 0, trendMonthCount: 12, // 统计数据 statistics: null, performanceTrend: { TrendData: [] }, storeRanking: [], storeDistribution: { DistributionData: [] }, managerRanking: [], storeManagerRanking: [], healthCoachRanking: [], operationStatistics: null, comparisonAnalysis: null, // 明细列表数据 storeDetailList: { loading: false, data: [], pagination: { currentPage: 1, pageSize: 10, total: 0 } }, managerDetailList: { loading: false, data: [], pagination: { currentPage: 1, pageSize: 10, total: 0 } }, storeManagerDetailList: { loading: false, data: [], pagination: { currentPage: 1, pageSize: 10, total: 0 } }, healthCoachDetailList: { loading: false, data: [], pagination: { currentPage: 1, pageSize: 10, total: 0 } }, // 业绩趋势图表数据 performanceTrendChartData: {}, performanceTrendChartOpts: { color: ["#409EFF", "#67C23A", "#E6A23C"], padding: [15, 10, 0, 15], enableScroll: true, dataLabel: false, dataPointShape: true, legend: {}, xAxis: { disableGrid: true, scrollShow: true, itemCount: 4 }, yAxis: { gridType: "dash", dashLength: 2, format: function format(val) { return val >= 10000 ? (val / 10000).toFixed(1) + '万' : val.toString(); } }, extra: { line: { type: "straight", width: 2, activeType: "hollow" }, tooltip: { showBox: true, showArrow: true, showCategory: true, format: function format(item, category) { var val = item.data >= 10000 ? (item.data / 10000).toFixed(1) + '万' : item.data.toString(); return category + '\n' + item.name + ': ¥' + val; } } } }, // 门店分布图表数据 storeDistributionChartData: {}, storeDistributionChartOpts: { color: ["#F56C6C", "#67C23A", "#409EFF", "#E6A23C", "#909399"], padding: [15, 15, 0, 15], dataLabel: false, legend: { show: false }, extra: { pie: { activeOpacity: 0.5, activeRadius: 10, offsetAngle: 0, labelWidth: 15, border: true, borderWidth: 3, borderColor: '#FFFFFF', ringWidth: 30 }, tooltip: { showBox: true, showArrow: true, format: function format(item) { return item.name + ': ¥' + (item.data >= 10000 ? (item.data / 10000).toFixed(1) + '万' : item.data.toString()); } } } } }; }, computed: { selectedMonthText: function selectedMonthText() { if (!this.selectedMonth) return '请选择月份'; var date = new Date(this.selectedMonth); return "".concat(date.getFullYear(), "\u5E74").concat(String(date.getMonth() + 1).padStart(2, '0'), "\u6708"); }, kpiListTop: function kpiListTop() { var d = this.statistics || {}; return [{ key: 'billing', label: '开单业绩', value: d.BillingPerformance || 0, type: 'primary', isMoney: true, clickable: true }, { key: 'net', label: '净业绩', value: d.NetPerformance || 0, type: 'warning', isMoney: true, clickable: true }, { key: 'target', label: '目标业绩', value: d.TargetPerformance || 0, type: 'info', isMoney: true }, { key: 'completion', label: '完成率', value: d.CompletionRate || 0, type: d.CompletionRate >= 100 ? 'success' : 'danger', isPercent: true }, { key: 'managed', label: '管理门店数', value: d.ManagedStoreCount || 0, type: 'info', isMoney: false }]; }, categoryKpiList: function categoryKpiList() { var d = this.statistics || {}; return [{ key: 'lifeBeauty', label: '生美业绩', value: d.LifeBeautyPerformance || 0, type: 'primary', isMoney: true }, { key: 'techBeauty', label: '科美业绩', value: d.TechBeautyPerformance || 0, type: 'success', isMoney: true }, { key: 'medicalBeauty', label: '医美业绩', value: d.MedicalBeautyPerformance || 0, type: 'warning', isMoney: true }, { key: 'product', label: '产品业绩', value: d.ProductPerformance || 0, type: 'info', isMoney: true }]; }, // 对比分析数据简化 monthOverMonthComparison: function monthOverMonthComparison() { if (!this.comparisonAnalysis || !this.comparisonAnalysis.TimeComparison || !this.comparisonAnalysis.TimeComparison.MonthOverMonth) { return { BillingPerformanceChangeRate: 0, ConsumePerformanceChangeRate: 0, NetPerformanceChangeRate: 0, CompletionRateChange: 0 }; } var data = this.comparisonAnalysis.TimeComparison.MonthOverMonth; return { BillingPerformanceChangeRate: data.BillingPerformance && data.BillingPerformance.GrowthRate || 0, ConsumePerformanceChangeRate: data.ConsumePerformance && data.ConsumePerformance.GrowthRate || 0, NetPerformanceChangeRate: data.NetPerformance && data.NetPerformance.GrowthRate || 0, CompletionRateChange: data.CompletionRate && data.CompletionRate.GrowthRate || 0 }; }, yearOverYearComparison: function yearOverYearComparison() { if (!this.comparisonAnalysis || !this.comparisonAnalysis.TimeComparison || !this.comparisonAnalysis.TimeComparison.YearOverYear) { return { BillingPerformanceChangeRate: 0, ConsumePerformanceChangeRate: 0, NetPerformanceChangeRate: 0, CompletionRateChange: 0 }; } var data = this.comparisonAnalysis.TimeComparison.YearOverYear; return { BillingPerformanceChangeRate: data.BillingPerformance && data.BillingPerformance.GrowthRate || 0, ConsumePerformanceChangeRate: data.ConsumePerformance && data.ConsumePerformance.GrowthRate || 0, NetPerformanceChangeRate: data.NetPerformance && data.NetPerformance.GrowthRate || 0, CompletionRateChange: data.CompletionRate && data.CompletionRate.GrowthRate || 0 }; } }, onLoad: function onLoad() { var now = new Date(); this.selectedMonth = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, '0')); this.loadBusinessUnitOptions(); }, // 组件挂载时调用(作为组件使用时) mounted: function mounted() { this.init(); }, onPullDownRefresh: function onPullDownRefresh() { this.search().finally(function () { uni.stopPullDownRefresh(); }); }, onPageScroll: function onPageScroll(e) { this.pageScrollTop = e.scrollTop || 0; }, methods: { // 初始化方法(供父组件调用) init: function init() { var now = new Date(); this.selectedMonth = "".concat(now.getFullYear(), "-").concat(String(now.getMonth() + 1).padStart(2, '0')); this.loadBusinessUnitOptions(); }, // 月份选择变化 onMonthChange: function onMonthChange(e) { this.selectedMonth = e.detail.value; if (this.currentBusinessUnitId) { this.search(); } }, // 事业部选择变化 onBusinessUnitChange: function onBusinessUnitChange(e) { this.businessUnitIndex = e.detail.value; if (this.businessUnitIndex >= 0 && this.businessUnitOptions[this.businessUnitIndex]) { var dept = this.businessUnitOptions[this.businessUnitIndex]; this.currentBusinessUnitName = dept.fullName || dept.FullName || ''; this.currentBusinessUnitId = dept.id || dept.Id || ''; this.search(); } }, // 切换趋势月份数量 switchTrendMonthCount: function switchTrendMonthCount(count) { this.trendMonthCount = count; this.loadPerformanceTrend(); }, // 加载事业部选项 loadBusinessUnitOptions: function loadBusinessUnitOptions() { var _this = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var menuData, rootNode, newuserInfo, organizeId, res, allBusinessUnits, userBusinessUnit; return _regenerator.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; // 检查是否有事业部数据开关按钮权限 menuData = uni.getStorageSync('appMenuData') || []; if (!(Array.isArray(menuData) && menuData.length > 0)) { _context.next = 8; break; } rootNode = menuData.find(function (item) { return item.fullName == 'app事业部数据开关按钮'; }); if (!rootNode) { _context.next = 8; break; } _context.next = 7; return _this.loadAllBusinessUnits(); case 7: return _context.abrupt("return"); case 8: // 如果没有权限,只加载用户自己的事业部 newuserInfo = uni.getStorageSync('newuserInfo') || {}; organizeId = newuserInfo.organizeId || ''; if (organizeId) { _context.next = 13; break; } uni.showToast({ title: '未获取到用户组织信息', icon: 'none' }); return _context.abrupt("return"); case 13: _context.next = 15; return _request.default.get("".concat(_config.default.getApiBaseUrl(), "/api/Extend/Organize/GetByName"), { organizeName: '事业部' }); case 15: res = _context.sent; if (res.code === 200 && res.data) { allBusinessUnits = res.data.map(function (item) { return { id: item.Id || item.id, FullName: item.FullName || item.fullName, fullName: item.FullName || item.fullName }; }); // 筛选出用户自己的事业部 userBusinessUnit = allBusinessUnits.find(function (unit) { return unit.id === organizeId; }); if (userBusinessUnit) { // 找到用户自己的事业部,只显示这一个 _this.businessUnitOptions = [userBusinessUnit]; _this.businessUnitIndex = 0; _this.currentBusinessUnitName = userBusinessUnit.fullName; _this.currentBusinessUnitId = userBusinessUnit.id; // 自动加载数据 _this.search(); } else { // 如果找不到,提示用户 uni.showToast({ title: '未找到您的事业部信息', icon: 'none' }); _this.businessUnitOptions = []; } } _context.next = 23; break; case 19: _context.prev = 19; _context.t0 = _context["catch"](0); console.error('加载事业部列表失败:', _context.t0); uni.showToast({ title: '加载事业部列表失败', icon: 'none' }); case 23: case "end": return _context.stop(); } } }, _callee, null, [[0, 19]]); }))(); }, // 加载所有事业部 loadAllBusinessUnits: function loadAllBusinessUnits() { var _this2 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { var res, newuserInfo, organizeId, userBusinessUnitIndex, firstDept; return _regenerator.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.prev = 0; _context2.next = 3; return _request.default.get("".concat(_config.default.getApiBaseUrl(), "/api/Extend/Organize/GetByName"), { organizeName: '事业部' }); case 3: res = _context2.sent; if (res.code === 200 && res.data) { _this2.businessUnitOptions = res.data.map(function (item) { return { id: item.Id || item.id, FullName: item.FullName || item.fullName, fullName: item.FullName || item.fullName }; }); // 获取当前登录用户信息,尝试匹配默认选中 newuserInfo = uni.getStorageSync('newuserInfo') || {}; organizeId = newuserInfo.organizeId || ''; if (organizeId && _this2.businessUnitOptions.length > 0) { // 尝试找到用户自己的事业部 userBusinessUnitIndex = _this2.businessUnitOptions.findIndex(function (unit) { return unit.id === organizeId; }); if (userBusinessUnitIndex >= 0) { // 找到用户自己的事业部,默认选中 _this2.businessUnitIndex = userBusinessUnitIndex; _this2.currentBusinessUnitName = _this2.businessUnitOptions[userBusinessUnitIndex].fullName; _this2.currentBusinessUnitId = _this2.businessUnitOptions[userBusinessUnitIndex].id; } else { // 没找到,默认选择第一个 _this2.businessUnitIndex = 0; _this2.currentBusinessUnitName = _this2.businessUnitOptions[0].fullName; _this2.currentBusinessUnitId = _this2.businessUnitOptions[0].id; } // 自动加载数据 _this2.search(); } else if (_this2.businessUnitOptions.length > 0 && !_this2.currentBusinessUnitId) { // 如果没有用户信息,默认选择第一个事业部 firstDept = _this2.businessUnitOptions[0]; _this2.businessUnitIndex = 0; _this2.currentBusinessUnitName = firstDept.fullName || firstDept.FullName || ''; _this2.currentBusinessUnitId = firstDept.id || firstDept.Id || ''; // 自动加载数据 _this2.search(); } } _context2.next = 11; break; case 7: _context2.prev = 7; _context2.t0 = _context2["catch"](0); console.error('加载所有事业部失败:', _context2.t0); uni.showToast({ title: '加载事业部列表失败', icon: 'none' }); case 11: case "end": return _context2.stop(); } } }, _callee2, null, [[0, 7]]); }))(); }, // 主搜索方法 search: function search() { var _this3 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() { var statisticsMonth, params; return _regenerator.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: if (_this3.selectedMonth) { _context3.next = 3; break; } uni.showToast({ title: '请选择月份', icon: 'none' }); return _context3.abrupt("return"); case 3: if (_this3.currentBusinessUnitId) { _context3.next = 6; break; } uni.showToast({ title: '请选择事业部', icon: 'none' }); return _context3.abrupt("return"); case 6: _context3.prev = 6; _this3.loading = true; statisticsMonth = _this3.selectedMonth.replace('-', ''); params = { statisticsMonth: statisticsMonth, businessUnitId: _this3.currentBusinessUnitId, storeIds: [] }; _context3.next = 12; return Promise.all([_this3.loadStatistics(params), _this3.loadPerformanceTrend(), _this3.loadStoreRanking(params), _this3.loadStoreDistribution(params), _this3.loadManagerRanking(params), _this3.loadManagerDistribution(params), _this3.loadManagerTrend(), _this3.loadStoreManagerRanking(params), _this3.loadHealthCoachRanking(params), _this3.loadOperationStatistics(params), _this3.loadComparisonAnalysis(params), _this3.loadStoreDetailList(params), _this3.loadManagerDetailList(params), _this3.loadStoreManagerDetailList(params), _this3.loadHealthCoachDetailList(params)]); case 12: _context3.next = 18; break; case 14: _context3.prev = 14; _context3.t0 = _context3["catch"](6); console.error('加载数据失败:', _context3.t0); uni.showToast({ title: '网络错误,请重试', icon: 'none' }); case 18: _context3.prev = 18; _this3.loading = false; return _context3.finish(18); case 21: case "end": return _context3.stop(); } } }, _callee3, null, [[6, 14, 18, 21]]); }))(); }, // 加载统计数据 loadStatistics: function loadStatistics(params) { var _this4 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() { var res; return _regenerator.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: _context4.prev = 0; _context4.next = 3; return _businessUnitDashboard.default.getStatistics(params); case 3: res = _context4.sent; if (res.code === 200) { _this4.statistics = res.data || null; } _context4.next = 10; break; case 7: _context4.prev = 7; _context4.t0 = _context4["catch"](0); console.error('加载统计数据失败:', _context4.t0); case 10: case "end": return _context4.stop(); } } }, _callee4, null, [[0, 7]]); }))(); }, // 加载业绩趋势 loadPerformanceTrend: function loadPerformanceTrend() { var _this5 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() { var statisticsMonth, res; return _regenerator.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: if (!(!_this5.selectedMonth || !_this5.currentBusinessUnitId)) { _context5.next = 2; break; } return _context5.abrupt("return"); case 2: _context5.prev = 2; statisticsMonth = _this5.selectedMonth.replace('-', ''); _context5.next = 6; return _businessUnitDashboard.default.getPerformanceTrend({ statisticsMonth: statisticsMonth, businessUnitId: _this5.currentBusinessUnitId, storeIds: [], monthCount: _this5.trendMonthCount }); case 6: res = _context5.sent; if (res.code === 200) { _this5.performanceTrend = res.data || { TrendData: [] }; _this5.$nextTick(function () { _this5.drawPerformanceTrendChart(); }); } _context5.next = 13; break; case 10: _context5.prev = 10; _context5.t0 = _context5["catch"](2); console.error('加载业绩趋势失败:', _context5.t0); case 13: case "end": return _context5.stop(); } } }, _callee5, null, [[2, 10]]); }))(); }, // 加载门店排行 loadStoreRanking: function loadStoreRanking(params) { var _this6 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() { var res; return _regenerator.default.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: _context6.prev = 0; _context6.next = 3; return _businessUnitDashboard.default.getStoreRanking(params); case 3: res = _context6.sent; if (res.code === 200) { _this6.storeRanking = res.data && res.data.RankingData || []; } _context6.next = 10; break; case 7: _context6.prev = 7; _context6.t0 = _context6["catch"](0); console.error('加载门店排行失败:', _context6.t0); case 10: case "end": return _context6.stop(); } } }, _callee6, null, [[0, 7]]); }))(); }, // 加载门店分布 loadStoreDistribution: function loadStoreDistribution(params) { var _this7 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() { var res; return _regenerator.default.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: _context7.prev = 0; _context7.next = 3; return _businessUnitDashboard.default.getStoreDistribution(params); case 3: res = _context7.sent; if (res.code === 200) { _this7.storeDistribution = res.data || { DistributionData: [] }; _this7.$nextTick(function () { _this7.drawStoreDistributionChart(); }); } _context7.next = 10; break; case 7: _context7.prev = 7; _context7.t0 = _context7["catch"](0); console.error('加载门店分布失败:', _context7.t0); case 10: case "end": return _context7.stop(); } } }, _callee7, null, [[0, 7]]); }))(); }, // 加载经理排行 loadManagerRanking: function loadManagerRanking(params) { var _this8 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() { var res; return _regenerator.default.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: _context8.prev = 0; _context8.next = 3; return _businessUnitDashboard.default.getManagerRanking(params); case 3: res = _context8.sent; if (res.code === 200) { _this8.managerRanking = res.data && res.data.RankingData || []; // 加载经理排行后,触发经理趋势加载 _this8.$nextTick(function () { _this8.loadManagerTrend(); }); } _context8.next = 10; break; case 7: _context8.prev = 7; _context8.t0 = _context8["catch"](0); console.error('加载经理排行失败:', _context8.t0); case 10: case "end": return _context8.stop(); } } }, _callee8, null, [[0, 7]]); }))(); }, // 加载经理分布 loadManagerDistribution: function loadManagerDistribution(params) { return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() { var res; return _regenerator.default.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: _context9.prev = 0; _context9.next = 3; return _businessUnitDashboard.default.getManagerDistribution(params); case 3: res = _context9.sent; if (res.code === 200) { // H5端暂不展示经理分布图表,但接口已调用 // this.managerDistribution = res.data || { DistributionData: [] } } _context9.next = 10; break; case 7: _context9.prev = 7; _context9.t0 = _context9["catch"](0); console.error('加载经理分布失败:', _context9.t0); case 10: case "end": return _context9.stop(); } } }, _callee9, null, [[0, 7]]); }))(); }, // 加载经理趋势 loadManagerTrend: function loadManagerTrend() { var _this9 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() { var managerIds, statisticsMonth, res; return _regenerator.default.wrap(function _callee10$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: if (!(!_this9.selectedMonth || !_this9.currentBusinessUnitId)) { _context10.next = 2; break; } return _context10.abrupt("return"); case 2: if (!(!_this9.managerRanking || _this9.managerRanking.length === 0)) { _context10.next = 4; break; } return _context10.abrupt("return"); case 4: managerIds = _this9.managerRanking.slice(0, 5).map(function (item) { return item.ManagerId; }).filter(function (id) { return id; }); if (!(managerIds.length === 0)) { _context10.next = 7; break; } return _context10.abrupt("return"); case 7: _context10.prev = 7; statisticsMonth = _this9.selectedMonth.replace('-', ''); _context10.next = 11; return _businessUnitDashboard.default.getManagerTrend({ statisticsMonth: statisticsMonth, businessUnitId: _this9.currentBusinessUnitId, storeIds: [], monthCount: _this9.trendMonthCount, ManagerIds: managerIds }); case 11: res = _context10.sent; if (res.code === 200) { // H5端暂不展示经理趋势图表,但接口已调用 // this.managerTrend = res.data || { ManagerTrendData: [] } } _context10.next = 18; break; case 15: _context10.prev = 15; _context10.t0 = _context10["catch"](7); console.error('加载经理趋势失败:', _context10.t0); case 18: case "end": return _context10.stop(); } } }, _callee10, null, [[7, 15]]); }))(); }, // 加载店长排行 loadStoreManagerRanking: function loadStoreManagerRanking(params) { var _this10 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() { var res; return _regenerator.default.wrap(function _callee11$(_context11) { while (1) { switch (_context11.prev = _context11.next) { case 0: _context11.prev = 0; _context11.next = 3; return _businessUnitDashboard.default.getStoreManagerRanking(params); case 3: res = _context11.sent; if (res.code === 200) { _this10.storeManagerRanking = res.data && res.data.RankingData || []; } _context11.next = 10; break; case 7: _context11.prev = 7; _context11.t0 = _context11["catch"](0); console.error('加载店长排行失败:', _context11.t0); case 10: case "end": return _context11.stop(); } } }, _callee11, null, [[0, 7]]); }))(); }, // 加载健康师排行 loadHealthCoachRanking: function loadHealthCoachRanking(params) { var _this11 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() { var res; return _regenerator.default.wrap(function _callee12$(_context12) { while (1) { switch (_context12.prev = _context12.next) { case 0: _context12.prev = 0; _context12.next = 3; return _businessUnitDashboard.default.getHealthCoachRanking(params); case 3: res = _context12.sent; if (res.code === 200) { _this11.healthCoachRanking = res.data && res.data.RankingData || []; } _context12.next = 10; break; case 7: _context12.prev = 7; _context12.t0 = _context12["catch"](0); console.error('加载健康师排行失败:', _context12.t0); case 10: case "end": return _context12.stop(); } } }, _callee12, null, [[0, 7]]); }))(); }, // 加载运营统计 loadOperationStatistics: function loadOperationStatistics(params) { var _this12 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() { var res; return _regenerator.default.wrap(function _callee13$(_context13) { while (1) { switch (_context13.prev = _context13.next) { case 0: _context13.prev = 0; _context13.next = 3; return _businessUnitDashboard.default.getOperationStatistics(params); case 3: res = _context13.sent; if (res.code === 200) { _this12.operationStatistics = res.data || null; } _context13.next = 10; break; case 7: _context13.prev = 7; _context13.t0 = _context13["catch"](0); console.error('加载运营统计失败:', _context13.t0); case 10: case "end": return _context13.stop(); } } }, _callee13, null, [[0, 7]]); }))(); }, // 加载对比分析 loadComparisonAnalysis: function loadComparisonAnalysis(params) { var _this13 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() { var res; return _regenerator.default.wrap(function _callee14$(_context14) { while (1) { switch (_context14.prev = _context14.next) { case 0: _context14.prev = 0; _context14.next = 3; return _businessUnitDashboard.default.getComparisonAnalysis(params); case 3: res = _context14.sent; if (res.code === 200) { _this13.comparisonAnalysis = res.data || null; } _context14.next = 10; break; case 7: _context14.prev = 7; _context14.t0 = _context14["catch"](0); console.error('加载对比分析失败:', _context14.t0); case 10: case "end": return _context14.stop(); } } }, _callee14, null, [[0, 7]]); }))(); }, // 绘制业绩趋势图表 drawPerformanceTrendChart: function drawPerformanceTrendChart() { if (!this.performanceTrend.TrendData || this.performanceTrend.TrendData.length === 0) { this.performanceTrendChartData = {}; return; } var dates = this.performanceTrend.TrendData.map(function (item) { var month = item.Month; if (month && month.length === 6) { return month.substring(0, 4) + '-' + month.substring(4, 6); } return month; }); var series = [{ name: '开单业绩', data: this.performanceTrend.TrendData.map(function (item) { return parseFloat((item.BillingPerformance || 0).toFixed(2)); }) }, { name: '消耗业绩', data: this.performanceTrend.TrendData.map(function (item) { return parseFloat((item.ConsumePerformance || 0).toFixed(2)); }) }, { name: '净业绩', data: this.performanceTrend.TrendData.map(function (item) { return parseFloat((item.NetPerformance || 0).toFixed(2)); }) }]; this.performanceTrendChartData = { categories: dates, series: series }; }, // 绘制门店分布图表 drawStoreDistributionChart: function drawStoreDistributionChart() { if (!this.storeDistribution.DistributionData || this.storeDistribution.DistributionData.length === 0) { this.storeDistributionChartData = {}; return; } var colors = ['#F56C6C', '#67C23A', '#409EFF', '#E6A23C', '#909399']; var data = this.storeDistribution.DistributionData.map(function (item, index) { return { name: item.StoreName || '未知门店', value: item.Performance || 0, color: colors[index % colors.length] }; }); this.storeDistributionChartData = { series: [{ data: data }] }; }, // 获取KPI图标名称 getKpiIconName: function getKpiIconName(key) { var iconMap = { billing: 'grid', net: 'red-packet', target: 'aim', completion: 'checkmark-circle', managed: 'home' }; return iconMap[key] || 'chart'; }, // 获取品项分类KPI图标名称 getCategoryKpiIconName: function getCategoryKpiIconName(key) { var iconMap = { lifeBeauty: 'star', techBeauty: 'star', medicalBeauty: 'star', product: 'star' }; return iconMap[key] || 'chart'; }, // 获取分布颜色 getDistributionColor: function getDistributionColor(index) { var colors = ['#F56C6C', '#67C23A', '#409EFF', '#E6A23C', '#909399']; return colors[index % colors.length]; }, // 格式化数字 formatNumber: function formatNumber(num) { if (num === null || num === undefined) return '0'; if (typeof num === 'string') num = parseFloat(num); if (isNaN(num)) return '0'; if (num >= 10000) { return (num / 10000).toFixed(2) + '万'; } return num.toLocaleString(); }, // 格式化金额 formatMoney: function formatMoney(amount) { if (amount === null || amount === undefined) return '0.00'; if (typeof amount === 'string') amount = parseFloat(amount); if (isNaN(amount)) return '0.00'; if (amount >= 10000) { return (amount / 10000).toFixed(2) + '万'; } return amount.toFixed(2); }, // 格式化百分比 formatPercent: function formatPercent(percent) { if (percent === null || percent === undefined || isNaN(percent)) { return '0.00'; } if (typeof percent === 'string') { percent = parseFloat(percent); } if (isNaN(percent)) { return '0.00'; } return (Math.round(percent * 100) / 100).toFixed(2); }, // 格式化日期 formatDate: function formatDate(dateValue) { if (!dateValue) return '无'; // 如果是时间戳(数字或字符串数字) var timestamp = null; if (typeof dateValue === 'number') { timestamp = dateValue; } else if (typeof dateValue === 'string') { // 尝试解析为数字 var num = parseFloat(dateValue); if (!isNaN(num) && num > 1000000000000) { // 看起来是时间戳(毫秒) timestamp = num; } else if (dateValue.length === 8) { // YYYYMMDD格式 return dateValue.substring(0, 4) + '-' + dateValue.substring(4, 6) + '-' + dateValue.substring(6, 8); } else if (dateValue.includes('-')) { // 已经是日期格式 return dateValue; } } if (timestamp) { var date = new Date(timestamp); if (isNaN(date.getTime())) return dateValue; var year = date.getFullYear(); var month = String(date.getMonth() + 1).padStart(2, '0'); var day = String(date.getDate()).padStart(2, '0'); var hours = String(date.getHours()).padStart(2, '0'); var minutes = String(date.getMinutes()).padStart(2, '0'); return "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hours, ":").concat(minutes); } return dateValue; }, // 处理KPI点击 handleKpiClick: function handleKpiClick(kpi) { if (kpi.clickable) { this.openKpiDrill(kpi); } }, // KPI穿透功能 - 滚动到对应明细列表 openKpiDrill: function openKpiDrill(kpi) { var _this14 = this; var targetId = ''; switch (kpi.key) { case 'billing': case 'net': case 'managed': targetId = 'store-detail-list'; break; case 'manager': targetId = 'manager-detail-list'; break; case 'storeManager': targetId = 'store-manager-detail-list'; break; case 'healthCoach': targetId = 'health-coach-detail-list'; break; default: return; } if (targetId) { uni.createSelectorQuery().in(this).select('#' + targetId).boundingClientRect(function (data) { if (data) { uni.pageScrollTo({ scrollTop: data.top + _this14.pageScrollTop - 20, duration: 300 }); } }).exec(); } }, // 打开明细列表 // 加载门店明细列表 loadStoreDetailList: function loadStoreDetailList(params) { var _this15 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() { var requestParams, res; return _regenerator.default.wrap(function _callee15$(_context15) { while (1) { switch (_context15.prev = _context15.next) { case 0: _this15.storeDetailList.loading = true; _context15.prev = 1; requestParams = _objectSpread(_objectSpread({}, params), {}, { currentPage: _this15.storeDetailList.pagination.currentPage, pageSize: _this15.storeDetailList.pagination.pageSize }); _context15.next = 5; return _businessUnitDashboard.default.getStoreDetailList(requestParams); case 5: res = _context15.sent; if (res.code === 200 && res.data) { _this15.storeDetailList.data = res.data.list || []; _this15.storeDetailList.pagination.total = res.data.total || 0; } _context15.next = 12; break; case 9: _context15.prev = 9; _context15.t0 = _context15["catch"](1); console.error('加载门店明细列表失败:', _context15.t0); case 12: _context15.prev = 12; _this15.storeDetailList.loading = false; return _context15.finish(12); case 15: case "end": return _context15.stop(); } } }, _callee15, null, [[1, 9, 12, 15]]); }))(); }, // 加载经理明细列表 loadManagerDetailList: function loadManagerDetailList(params) { var _this16 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() { var requestParams, res; return _regenerator.default.wrap(function _callee16$(_context16) { while (1) { switch (_context16.prev = _context16.next) { case 0: _this16.managerDetailList.loading = true; _context16.prev = 1; requestParams = _objectSpread(_objectSpread({}, params), {}, { currentPage: _this16.managerDetailList.pagination.currentPage, pageSize: _this16.managerDetailList.pagination.pageSize }); _context16.next = 5; return _businessUnitDashboard.default.getManagerDetailList(requestParams); case 5: res = _context16.sent; if (res.code === 200 && res.data) { _this16.managerDetailList.data = res.data.list || []; _this16.managerDetailList.pagination.total = res.data.total || 0; } _context16.next = 12; break; case 9: _context16.prev = 9; _context16.t0 = _context16["catch"](1); console.error('加载经理明细列表失败:', _context16.t0); case 12: _context16.prev = 12; _this16.managerDetailList.loading = false; return _context16.finish(12); case 15: case "end": return _context16.stop(); } } }, _callee16, null, [[1, 9, 12, 15]]); }))(); }, // 加载店长明细列表 loadStoreManagerDetailList: function loadStoreManagerDetailList(params) { var _this17 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() { var requestParams, res; return _regenerator.default.wrap(function _callee17$(_context17) { while (1) { switch (_context17.prev = _context17.next) { case 0: _this17.storeManagerDetailList.loading = true; _context17.prev = 1; requestParams = _objectSpread(_objectSpread({}, params), {}, { currentPage: _this17.storeManagerDetailList.pagination.currentPage, pageSize: _this17.storeManagerDetailList.pagination.pageSize }); _context17.next = 5; return _businessUnitDashboard.default.getStoreManagerDetailList(requestParams); case 5: res = _context17.sent; if (res.code === 200 && res.data) { _this17.storeManagerDetailList.data = res.data.list || []; _this17.storeManagerDetailList.pagination.total = res.data.total || 0; } _context17.next = 12; break; case 9: _context17.prev = 9; _context17.t0 = _context17["catch"](1); console.error('加载店长明细列表失败:', _context17.t0); case 12: _context17.prev = 12; _this17.storeManagerDetailList.loading = false; return _context17.finish(12); case 15: case "end": return _context17.stop(); } } }, _callee17, null, [[1, 9, 12, 15]]); }))(); }, // 加载健康师明细列表 loadHealthCoachDetailList: function loadHealthCoachDetailList(params) { var _this18 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() { var requestParams, res; return _regenerator.default.wrap(function _callee18$(_context18) { while (1) { switch (_context18.prev = _context18.next) { case 0: _this18.healthCoachDetailList.loading = true; _context18.prev = 1; requestParams = _objectSpread(_objectSpread({}, params), {}, { currentPage: _this18.healthCoachDetailList.pagination.currentPage, pageSize: _this18.healthCoachDetailList.pagination.pageSize }); _context18.next = 5; return _businessUnitDashboard.default.getHealthCoachDetailList(requestParams); case 5: res = _context18.sent; if (res.code === 200 && res.data) { _this18.healthCoachDetailList.data = res.data.list || []; _this18.healthCoachDetailList.pagination.total = res.data.total || 0; } _context18.next = 12; break; case 9: _context18.prev = 9; _context18.t0 = _context18["catch"](1); console.error('加载健康师明细列表失败:', _context18.t0); case 12: _context18.prev = 12; _this18.healthCoachDetailList.loading = false; return _context18.finish(12); case 15: case "end": return _context18.stop(); } } }, _callee18, null, [[1, 9, 12, 15]]); }))(); }, // 门店明细列表分页变化 handleStoreDetailPageChange: function handleStoreDetailPageChange(page) { this.storeDetailList.pagination.currentPage = page; var statisticsMonth = this.selectedMonth.replace('-', ''); var params = { statisticsMonth: statisticsMonth, businessUnitId: this.currentBusinessUnitId, storeIds: [] }; this.loadStoreDetailList(params); }, // 经理明细列表分页变化 handleManagerDetailPageChange: function handleManagerDetailPageChange(page) { this.managerDetailList.pagination.currentPage = page; var statisticsMonth = this.selectedMonth.replace('-', ''); var params = { statisticsMonth: statisticsMonth, businessUnitId: this.currentBusinessUnitId, storeIds: [] }; this.loadManagerDetailList(params); }, // 店长明细列表分页变化 handleStoreManagerDetailPageChange: function handleStoreManagerDetailPageChange(page) { this.storeManagerDetailList.pagination.currentPage = page; var statisticsMonth = this.selectedMonth.replace('-', ''); var params = { statisticsMonth: statisticsMonth, businessUnitId: this.currentBusinessUnitId, storeIds: [] }; this.loadStoreManagerDetailList(params); }, // 健康师明细列表分页变化 handleHealthCoachDetailPageChange: function handleHealthCoachDetailPageChange(page) { this.healthCoachDetailList.pagination.currentPage = page; var statisticsMonth = this.selectedMonth.replace('-', ''); var params = { statisticsMonth: statisticsMonth, businessUnitId: this.currentBusinessUnitId, storeIds: [] }; this.loadHealthCoachDetailList(params); }, // 保存截图 saveScreenshot: function saveScreenshot() { var _this19 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() { return _regenerator.default.wrap(function _callee19$(_context19) { while (1) { switch (_context19.prev = _context19.next) { case 0: // 隐藏截图按钮 _this19.showScreenshotBtn = false; // 显示加载提示 uni.showLoading({ title: '截图中' }); _this19.screenshotLoading = true; _context19.prev = 3; _context19.next = 6; return _this19.saveScreenshotMiniProgram(); case 6: _context19.next = 12; break; case 8: _context19.prev = 8; _context19.t0 = _context19["catch"](3); console.error('截图生成失败:', _context19.t0); uni.showToast({ title: '截图生成失败: ' + (_context19.t0.message || '未知错误'), icon: 'none', duration: 3000 }); case 12: _context19.prev = 12; _this19.screenshotLoading = false; // 隐藏加载提示 uni.hideLoading(); // 恢复显示截图按钮 _this19.showScreenshotBtn = true; return _context19.finish(12); case 17: case "end": return _context19.stop(); } } }, _callee19, null, [[3, 8, 12, 17]]); }))(); }, // H5平台截图 saveScreenshotH5: function saveScreenshotH5() { var _this20 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() { var html2canvas, element, originalBg, options, canvas, dataUrl, link, fileName; return _regenerator.default.wrap(function _callee20$(_context20) { while (1) { switch (_context20.prev = _context20.next) { case 0: _context20.prev = 0; _context20.next = 3; return Promise.resolve().then(function () { return _interopRequireWildcard(__webpack_require__(/*! html2canvas */ 529)); }); case 3: html2canvas = _context20.sent; element = document.querySelector('.warpbox'); if (!element) element = document.querySelector('.page'); if (element) { _context20.next = 8; break; } throw new Error('未找到要截图的内容'); case 8: _context20.next = 10; return new Promise(function (resolve) { return setTimeout(resolve, 1000); }); case 10: window.scrollTo(0, 0); _context20.next = 13; return new Promise(function (resolve) { return setTimeout(resolve, 500); }); case 13: originalBg = element.style.background; element.style.background = '#ffffff'; _context20.next = 17; return new Promise(function (resolve) { return setTimeout(resolve, 200); }); case 17: options = { allowTaint: true, useCORS: true, scale: 2.0, backgroundColor: '#ffffff', logging: false, imageTimeout: 30000, scrollX: 0, scrollY: 0, onclone: function onclone(clonedDoc) { clonedDoc.body.style.backgroundColor = '#ffffff'; clonedDoc.documentElement.style.backgroundColor = '#ffffff'; } }; _context20.prev = 18; _context20.next = 21; return html2canvas.default(element, options); case 21: canvas = _context20.sent; _context20.next = 30; break; case 24: _context20.prev = 24; _context20.t0 = _context20["catch"](18); console.warn('第一次截图失败,尝试备选方案:', _context20.t0); _context20.next = 29; return html2canvas.default(element, { allowTaint: true, useCORS: true, scale: 2.0, backgroundColor: '#ffffff', logging: false, imageTimeout: 30000 }); case 29: canvas = _context20.sent; case 30: dataUrl = canvas.toDataURL('image/png', 1.0); link = document.createElement('a'); fileName = "\u4E8B\u4E1A\u90E8\u6570\u636E_".concat(_this20.currentBusinessUnitName || '未选择', "_").concat(_this20.selectedMonth, "_").concat(new Date().toISOString().slice(0, 19).replace(/:/g, '-'), ".png"); link.download = fileName; link.href = dataUrl; document.body.appendChild(link); link.click(); document.body.removeChild(link); element.style.background = originalBg; uni.showToast({ title: '截图保存成功', icon: 'success', duration: 2000 }); _context20.next = 46; break; case 42: _context20.prev = 42; _context20.t1 = _context20["catch"](0); console.error('H5截图失败:', _context20.t1); throw _context20.t1; case 46: case "end": return _context20.stop(); } } }, _callee20, null, [[0, 42], [18, 24]]); }))(); }, // 微信小程序截图 saveScreenshotMiniProgram: function saveScreenshotMiniProgram() { var _this21 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() { return _regenerator.default.wrap(function _callee21$(_context21) { while (1) { switch (_context21.prev = _context21.next) { case 0: _context21.prev = 0; uni.canvasToTempFilePath({ canvasId: 'screenshot-canvas', success: function success(res) { uni.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success: function success() { uni.showToast({ title: '截图已保存到相册', icon: 'success', duration: 2000 }); }, fail: function fail(err) { console.error('保存到相册失败:', err); uni.previewImage({ urls: [res.tempFilePath], current: res.tempFilePath }); } }); }, fail: function fail(err) { console.error('导出图片失败:', err); throw new Error('导出图片失败'); } }, _this21); _context21.next = 8; break; case 4: _context21.prev = 4; _context21.t0 = _context21["catch"](0); console.error('小程序截图失败:', _context21.t0); throw _context21.t0; case 8: case "end": return _context21.stop(); } } }, _callee21, null, [[0, 4]]); }))(); }, // 兜底截图方案 saveScreenshotFallback: function saveScreenshotFallback() { return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() { return _regenerator.default.wrap(function _callee22$(_context22) { while (1) { switch (_context22.prev = _context22.next) { case 0: _context22.next = 2; return new Promise(function (resolve) { return setTimeout(resolve, 2000); }); case 2: uni.showToast({ title: '截图功能暂不支持当前平台', icon: 'none', duration: 2000 }); case 3: case "end": return _context22.stop(); } } }, _callee22); }))(); } } }; exports.default = _default; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"])) /***/ }), /***/ 552: /*!********************************************************************************************************************************************************************!*\ !*** D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue?vue&type=style&index=0&id=3a4cd846&lang=scss&scoped=true& ***! \********************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_tool_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src??ref--8-oneOf-1-3!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../tool/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./business-unit-dashboard.vue?vue&type=style&index=0&id=3a4cd846&lang=scss&scoped=true& */ 553); /* harmony import */ var _tool_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_tool_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tool_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_tool_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _tool_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_tool_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _tool_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_tool_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_tool_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_tool_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_tool_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_tool_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_business_unit_dashboard_vue_vue_type_style_index_0_id_3a4cd846_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ 553: /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/pagesA/business-unit-dashboard/business-unit-dashboard.vue?vue&type=style&index=0&id=3a4cd846&lang=scss&scoped=true& ***! \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin if(false) { var cssReload; } /***/ }), /***/ 563: /*!*****************************************************************************************************************************!*\ !*** D:/work/daima/lvqianmeiye_ERP/绿纤uni-app/main.js?{"page":"pagesA%2Fbusiness-unit-dashboard%2Fbusiness-unit-dashboard"} ***! \*****************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(wx, createPage) { var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); __webpack_require__(/*! uni-pages */ 26); var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25)); var _businessUnitDashboard = _interopRequireDefault(__webpack_require__(/*! ./pagesA/business-unit-dashboard/business-unit-dashboard.vue */ 547)); // @ts-ignore wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__; createPage(_businessUnitDashboard.default); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["createPage"])) /***/ }) },[[563,"common/runtime","common/vendor"]]]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pagesA/business-unit-dashboard/business-unit-dashboard.js.map