| Current Path : /var/www/homesaver/www/bitrix/js/catalog/warehouse-master/dist/ |
| Current File : /var/www/homesaver/www/bitrix/js/catalog/warehouse-master/dist/warehouse-master.bundle.min.js |
this.BX=this.BX||{};this.BX.Catalog=this.BX.Catalog||{};(function(t,e,n,i,s,r){"use strict";var o={props:{title:String,description:String,iconType:String},computed:{getIconClass:function t(){var e;var n={documents:"--docs",crm:"--crm",mobile:"--mobile"};return(e=n[this.$props.iconType])!==null&&e!==void 0?e:"--docs"}},template:'\n\t\t<div class="catalog-warehouse__master-clear__section">\n\t\t\t<div \n\t\t\t\tclass="catalog-warehouse__master-clear_section_icon"\n\t\t\t\t:class="getIconClass"\n\t\t\t></div>\n\t\t\t<div class="catalog-warehouse__master-clear_section_inner">\n\t\t\t\t<div class="catalog-warehouse__master-clear__title">{{title}}</div>\n\t\t\t\t<div class="catalog-warehouse__master-clear__text">{{description}}</div>\n\t\t\t</div>\n\t\t</div>\n\t'};function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){babelHelpers.defineProperty(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var l={components:{WarehouseSection:o},computed:a({sectionTitlePrefix:function t(){return"CAT_WAREHOUSE_MASTER_NEW_SECTION_TITLE_"},sectionDescriptionPrefix:function t(){return"CAT_WAREHOUSE_MASTER_NEW_SECTION_DESCRIPTION_"},getMobileBoxClass:function t(){var e={"catalog-warehouse__master-clear__mobile-box":true};if(this.getPreviewLang!=="ru"){e["--eng"]=true}return e}},n.mapGetters(["getPreviewLang"])),template:'\n\t\t<div class="catalog-warehouse__master-clear--content">\n\t\t\t<div class="catalog-warehouse__master-clear_inner">\n\t\t\t\t<div class="catalog-warehouse-master-clear-title">\n\t\t\t\t\t<div class="catalog-warehouse-master-clear-title-text--new">\n\t\t\t\t\t\t{{ $Bitrix.Loc.getMessage(\'CAT_WAREHOUSE_MASTER_NEW_TITLE\') }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="catalog-warehouse__master-clear__box">\n\t\t\t\t\t<div :class="getMobileBoxClass"></div>\n\t\t\t\t\t<div class="catalog-warehouse__master-clear__section_box">\n\t\t\t\t\t\t<WarehouseSection\n\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage(sectionTitlePrefix + \'DOCUMENTS\')"\n\t\t\t\t\t\t\t:description="$Bitrix.Loc.getMessage(sectionDescriptionPrefix + \'DOCUMENTS\')"\n\t\t\t\t\t\t\t:iconType="\'documents\'"\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<WarehouseSection\n\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage(sectionTitlePrefix + \'CRM\')"\n\t\t\t\t\t\t\t:description="$Bitrix.Loc.getMessage(sectionDescriptionPrefix + \'CRM\')"\n\t\t\t\t\t\t\t:iconType="\'crm\'"\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<WarehouseSection\n\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage(sectionTitlePrefix + \'MOBILE\')"\n\t\t\t\t\t\t\t:description="$Bitrix.Loc.getMessage(sectionDescriptionPrefix + \'MOBILE\')"\n\t\t\t\t\t\t\t:iconType="\'mobile\'"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t'};function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){babelHelpers.defineProperty(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d={computed:h({getButtonClass:function t(){var e=["ui-btn","ui-btn-round","ui-btn-no-caps","ui-btn-lg","catalog-warehouse__master-clear--btn"];if(this.isLoading===true){e.push("ui-btn-wait")}if(this.isRestrictedAccess===true){e.push("ui-btn-disabled")}if(this.isUsed===true){e.push("ui-btn-default")}else{e.push("ui-btn-success")}return e},getHintClass:function t(){return["ui-link-dashed","catalog-warehouse__master-clear--hint"]},getButtonText:function t(){return this.isUsed?this.$Bitrix.Loc.getMessage("CAT_WAREHOUSE_MASTER_NEW_DEACTIVATE_BUTTON"):this.$Bitrix.Loc.getMessage("CAT_WAREHOUSE_MASTER_NEW_ACTIVATE_BUTTON")}},n.mapGetters(["isLoading","isUsed","isRestrictedAccess"])),methods:h({openHelpdesk:function t(){if(top.BX.Helper){top.BX.Helper.show("redirect=detail&code=14566618")}},onButtonClick:function t(){this.$emit("onButtonClick")}},n.mapMutations(["setIsLoading"])),template:'\n\t<div class="catalog-warehouse__master-clear--footer">\n\t\t<button \n\t\t\t:class="getButtonClass"\n\t\t\tv-on:click="onButtonClick"\n\t\t>{{ getButtonText }}</button>\n\t\t<span \n\t\t\t:class="getHintClass"\n\t\t\tv-on:click="openHelpdesk"\n\t\t>\n\t\t\t{{ $Bitrix.Loc.getMessage(\'CAT_WAREHOUSE_MASTER_NEW_HINT_MORE\') }}\n\t\t</span>\n\t</div>\n\t'};var p=function(){function t(e){babelHelpers.classCallCheck(this,t);this.props=e;this.isUsed=e.isUsed;this.hasErrors=false;this.isPlanRestricted=e.isPlanRestricted;this.isUsed1C=e.isUsed1C;this.isWithOrdersMode=e.isWithOrdersMode;this.isRestrictedAccess=e.isRestrictedAccess}babelHelpers.createClass(t,[{key:"handle",value:function t(){if(this.isUsed){this.handleDisableInventoryManagement()}else{this.handleEnableInventoryManagement()}}},{key:"handleEnableInventoryManagement",value:function t(){this.checkAccess();this.checkPlanRestriction();this.checkUsage1C();this.checkWithOrdersMode();if(!this.hasErrors){this.showEnablePopup()}this.hasErrors=false}},{key:"handleDisableInventoryManagement",value:function t(){this.checkAccess();if(!this.hasErrors){this.showConfirmDisablePopup()}this.hasErrors=false}},{key:"showEnablePopup",value:function t(){(new BX.Catalog.StoreUse.DialogEnable).popup()}},{key:"showErrorPopup",value:function t(e){new BX.Catalog.StoreUse.DialogError(e).popup()}},{key:"showPlanRestrictionSlider",value:function t(){top.BX.UI.InfoHelper.show("limit_store_inventory_management")}},{key:"showConfirmDisablePopup",value:function t(){var e=new BX.Catalog.StoreUse.DialogDisable;e.disablePopup()}},{key:"checkAccess",value:function t(){if(this.hasErrors||!this.isRestrictedAccess){return}this.hasErrors=true;var e="16556596";this.showErrorPopup({text:s.Loc.getMessage("CAT_WAREHOUSE_MASTER_CLEAR_RIGHTS_RESTRICTED_MSGVER_1",{"#LINK_START#":'<a href="#" class="ui-link ui-link-dashed documents-grid-link">',"#LINK_END#":"</a>"}),helpArticleId:e})}},{key:"checkPlanRestriction",value:function t(){if(this.hasErrors||!this.isPlanRestricted){return}this.hasErrors=true;this.showPlanRestrictionSlider()}},{key:"checkUsage1C",value:function t(){if(this.hasErrors||!this.isUsed1C){return}this.hasErrors=true;this.showErrorPopup({text:s.Loc.getMessage("CAT_WAREHOUSE_MASTER_CLEAR_ERROR_1C_USED_MSGVER_1")})}},{key:"checkWithOrdersMode",value:function t(){if(this.hasErrors||!this.isWithOrdersMode){return}this.hasErrors=true;var e="15718276";this.showErrorPopup({text:s.Loc.getMessage("CAT_WAREHOUSE_MASTER_CLEAR_ERROR_ORDER_MODE_MSGVER_1",{"#LINK_START#":'<a href="#" class="ui-link ui-link-dashed documents-grid-link">',"#LINK_END#":"</a>"}),helpArticleId:e})}}]);return t}();function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){babelHelpers.defineProperty(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e){v(t,e);e.add(t)}function E(t,e,n){v(t,e);e.set(t,n)}function v(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function _(t,e,n){if(!e.has(t)){throw new TypeError("attempted to get private field on non-instance")}return n}var m=new WeakMap;var C=new WeakSet;var O=function(){function t(e){babelHelpers.classCallCheck(this,t);b(this,C);E(this,m,{writable:true,value:void 0});this.rootNode=document.getElementById(e.rootNodeId);this.store=_(this,C,y).call(this,e)}babelHelpers.createClass(t,[{key:"attachTemplate",value:function t(){babelHelpers.classPrivateFieldSet(this,m,e.BitrixVue.createApp({components:{Content:l,Footer:d},computed:f({},n.mapGetters(["getSelectedCostPriceAccountingMethod","getButtonClickHandler","getInventoryManagementSource"])),created:function t(){this.controller=new r.Controller},mounted:function t(){i.EventEmitter.subscribe(r.EventType.popup.disable,this.disable);i.EventEmitter.subscribe(r.EventType.popup.enableWithResetDocuments,this.enableWithResetDocuments);i.EventEmitter.subscribe(r.EventType.popup.enableWithoutReset,this.enableWithoutReset);i.EventEmitter.subscribe(r.EventType.popup.selectCostPriceAccountingMethod,this.handleAccountingMethodSelected)},unmounted:function t(){i.EventEmitter.unsubscribe(r.EventType.popup.disable,this.disable);i.EventEmitter.unsubscribe(r.EventType.popup.enableWithResetDocuments,this.enableWithResetDocuments);i.EventEmitter.unsubscribe(r.EventType.popup.enableWithoutReset,this.enableWithoutReset);i.EventEmitter.unsubscribe(r.EventType.popup.selectCostPriceAccountingMethod,this.handleAccountingMethodSelected)},methods:f(f({},n.mapMutations(["setIsLoading","setSelectedCostPriceAccountingMethod"])),{},{handleOnButtonClick:function t(){this.getButtonClickHandler.handle()},handleAccountingMethodSelected:function t(e){var n=e.data.method===r.DialogCostPriceAccountingMethodSelection.METHOD_FIFO?r.DialogCostPriceAccountingMethodSelection.METHOD_FIFO:r.DialogCostPriceAccountingMethodSelection.METHOD_AVERAGE;this.setSelectedCostPriceAccountingMethod(n)},closeSlider:function t(){var e=BX.SidePanel.Instance.getTopSlider();if(e){e.close()}},disable:function t(){this.setIsLoading(true);this.controller.inventoryManagementDisabled().then(this.handleSuccessfulChanging)["catch"](this.handleUnsuccessfulChanging)},enable:function t(){var e=this;this.enableBy((function(){return e.controller.inventoryManagementEnabled()}))},enableWithResetDocuments:function t(){var e=this;this.enableBy((function(){return e.controller.inventoryManagementEnableWithResetDocuments({costPriceAccountingMethod:e.getSelectedCostPriceAccountingMethod})}))},enableWithoutReset:function t(){var e=this;this.enableBy((function(){return e.controller.inventoryManagementEnableWithoutReset({costPriceAccountingMethod:e.getSelectedCostPriceAccountingMethod})}))},enableBy:function t(e){this.setIsLoading(true);e().then(this.handleSuccessfulChanging)["catch"](this.handleUnsuccessfulChanging)},handleSuccessfulChanging:function t(){this.setIsLoading(false);var e=BX.SidePanel.Instance.getTopSlider();if(e){e.getData().set("isInventoryManagementEnabled",true)}this.closeSlider()},handleUnsuccessfulChanging:function t(e){if(e.errors.length){top.BX.UI.Notification.Center.notify({content:s.Text.encode(e.errors[0].message)})}this.setIsLoading(false)}}),template:'\n\t\t\t\t<Content/>\n\t\t\t\t<Footer @onButtonClick="handleOnButtonClick"/>\n\t\t\t'}));babelHelpers.classPrivateFieldGet(this,m).use(this.store);babelHelpers.classPrivateFieldGet(this,m).mount(this.rootNode)}}]);return t}();function y(t){var e={state:function e(){return f({isLoading:false},t)},getters:{isUsed:function t(e){return e.isUsed},isLoading:function t(e){return e.isLoading},getSelectedCostPriceAccountingMethod:function t(e){return e.selectedCostPriceAccountingMethod},isPlanRestricted:function t(e){return e.isPlanRestricted},isUsed1C:function t(e){return e.isUsed1C},isWithOrdersMode:function t(e){return e.isWithOrdersMode},isRestrictedAccess:function t(e){return e.isRestrictedAccess},getInventoryManagementSource:function t(e){return e.inventoryManagementSource},getPreviewLang:function t(e){return e.previewLang},getButtonClickHandler:function t(e){return new p(e)}},mutations:{setIsLoading:function t(e,n){e.isLoading=n},setSelectedCostPriceAccountingMethod:function t(e,n){e.selectedCostPriceAccountingMethod=n}}};return n.createStore(e)}t.App=O})(this.BX.Catalog.WarehouseMaster=this.BX.Catalog.WarehouseMaster||{},BX.Vue3,BX.Vue3.Vuex,BX.Event,BX,BX.Catalog.StoreUse);
//# sourceMappingURL=warehouse-master.bundle.map.js