#7897 - masterTest_24_36 #669
|
@ -24,15 +24,28 @@ const companiesOptions = ref([]);
|
||||||
const printersOptions = ref([]);
|
const printersOptions = ref([]);
|
||||||
const clientsOptions = ref([]);
|
const clientsOptions = ref([]);
|
||||||
const serialTypesOptions = 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 formData = ref({});
|
||||||
|
|
||||||
const optionsInitialData = computed(() => {
|
const optionsInitialData = computed(() => {
|
||||||
return (
|
const optionsArrays = [
|
||||||
companiesOptions.value.length > 0 &&
|
companiesOptions.value,
|
||||||
printersOptions.value.length > 0 &&
|
printersOptions.value,
|
||||||
clientsOptions.value.length > 0 &&
|
clientsOptions.value,
|
||||||
serialTypesOptions.value.length > 0
|
serialTypesOptions.value,
|
||||||
);
|
];
|
||||||
|
return optionsArrays.every((arr) => arr.length > 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
const getStatus = computed({
|
const getStatus = computed({
|
||||||
|
@ -60,18 +73,7 @@ onMounted(async () => {
|
||||||
<FetchData url="Clients" @on-fetch="(data) => (clientsOptions = data)" auto-load />
|
<FetchData url="Clients" @on-fetch="(data) => (clientsOptions = data)" auto-load />
|
||||||
<FetchData
|
<FetchData
|
||||||
url="invoiceOutSerials"
|
url="invoiceOutSerials"
|
||||||
@on-fetch="
|
@on-fetch="handleInvoiceOutSerialsFetch"
|
||||||
(data) => {
|
|
||||||
const uniqueTypes = new Set();
|
|
||||||
serialTypesOptions = data.filter((item) => {
|
|
||||||
if (item.type === null || uniqueTypes.has(item.type)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uniqueTypes.add(item.type);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
"
|
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<QForm
|
<QForm
|
||||||
|
|
|
@ -16,7 +16,6 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const itemTypesOptions = ref([]);
|
const itemTypesOptions = ref([]);
|
||||||
const itemsWithNameOptions = ref([]);
|
|
||||||
const intrastatsOptions = ref([]);
|
const intrastatsOptions = ref([]);
|
||||||
const expensesOptions = ref([]);
|
const expensesOptions = ref([]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue