diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue index 88d55b0932..3dc34dc15b 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue @@ -24,15 +24,28 @@ const companiesOptions = ref([]); const printersOptions = ref([]); const clientsOptions = ref([]); const serialTypesOptions = ref([]); + +const handleInvoiceOutSerialsFetch = (data) => { + const uniqueTypes = new Set(); + serialTypesOptions.value = data.filter((item) => { + if (item.type === null || uniqueTypes.has(item.type)) { + return false; + } + uniqueTypes.add(item.type); + return true; + }); +}; + const formData = ref({}); const optionsInitialData = computed(() => { - return ( - companiesOptions.value.length > 0 && - printersOptions.value.length > 0 && - clientsOptions.value.length > 0 && - serialTypesOptions.value.length > 0 - ); + const optionsArrays = [ + companiesOptions.value, + printersOptions.value, + clientsOptions.value, + serialTypesOptions.value, + ]; + return optionsArrays.every((arr) => arr.length > 0); }); const getStatus = computed({ @@ -60,18 +73,7 @@ onMounted(async () => {