Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/catalog/store-use/src/ |
Upload File : |
import { ajax } from 'main.core'; import { EventEmitter } from 'main.core.events'; import { DialogCostPriceAccountingMethodSelection } from './dialog-cost-price-accounting-method-selection'; import { DialogClearing } from './dialog-clearing'; import { EventType } from './event-type'; export class DialogEnable { static QUANTITY_INCONSISTENCY_EXISTS = 'QUANTITY_INCONSISTENCY_EXISTS'; static CONDUCTED_DOCUMENTS_EXIST = 'CONDUCTED_DOCUMENTS_EXIST'; popup() { ajax.runAction( 'catalog.config.checkEnablingConditions', {}, ).then((response) => { const result = response.data; /** * if there are some existing documents or some quantities exist, we warn the user in the batch method popup * * if no documents and no unaccounted quantities exist, we show the batch method popup without any warnings */ const batchMethodPopupParams = { clearDocuments: false, }; if ( result.includes(DialogEnable.CONDUCTED_DOCUMENTS_EXIST) || result.includes(DialogEnable.QUANTITY_INCONSISTENCY_EXISTS) ) { batchMethodPopupParams.clearDocuments = true; } this.selectBatchMethodPopup(batchMethodPopupParams); }) .catch(() => {}); } selectBatchMethodPopup(params) { (new DialogCostPriceAccountingMethodSelection()) .popup() .then(() => { if (params.clearDocuments) { (new DialogClearing()).popup(); } else { EventEmitter.emit(EventType.popup.enableWithoutReset); } }) .catch(() => {}) ; } }