This commit is contained in:
@@ -87,7 +87,9 @@ const gchartEvents = ref({
|
||||
}
|
||||
},);
|
||||
|
||||
|
||||
const sleep = (ms) => {
|
||||
return new Promise(resolve => setTimeout(resolve, ms))
|
||||
}
|
||||
|
||||
const fetch = async () => {
|
||||
try {
|
||||
@@ -137,7 +139,7 @@ const fetch_ccodes = async () => {
|
||||
try {
|
||||
const response = await axios.get(route('ccountry.codes'))
|
||||
ccodes.value = response.data;
|
||||
ccodes.value = Object.entries(ccodes.value).map(([k,v]) => { if (v !== null) return { "country": k, "code": v } } ).filter( n => n);
|
||||
ccodes.value = Object.entries(ccodes.value).map(([k, v]) => { if (v !== null) return { "country": k, "code": v } }).filter(n => n);
|
||||
console.log("ccodes=", ccodes.value);
|
||||
} catch (e) {
|
||||
const response = await Swal.fire({
|
||||
@@ -155,8 +157,10 @@ const fetch_ccodes = async () => {
|
||||
const async_search = async (item) => {
|
||||
try {
|
||||
if (item.length >= 2) {
|
||||
console.log('SEARCH',item,form.country.code,route('products.search', [item, form.country.code]));
|
||||
|
||||
console.log('SEARCH', item, form.country.code, route('products.search', [item, form.country.code]));
|
||||
const response = await axios.get(route('products.search', [item, form.country.code]));
|
||||
|
||||
options_items.value = response.data.map((i) => { return { "item": i.name, "desc": i.typeName, "img": i.mainImageUrl, "code": i.code } });
|
||||
console.log("VALUES=", options_items.value);
|
||||
}
|
||||
@@ -233,7 +237,8 @@ const submit = () => {
|
||||
<span class="font-extrabold font-mono">Krajina produktu na vyhladanie</span>
|
||||
</div>
|
||||
<div>
|
||||
<multiselect :close-on-select="false" :multiple="false" v-model="form.country" :options="ccodes" label="country" track-by="code">
|
||||
<multiselect :close-on-select="false" :multiple="false" v-model="form.country" :options="ccodes"
|
||||
label="country" track-by="code">
|
||||
</multiselect>
|
||||
</div>
|
||||
<div>
|
||||
@@ -241,7 +246,8 @@ const submit = () => {
|
||||
</div>
|
||||
<div>
|
||||
<multiselect v-model="form.codes" label="item" track-by="item" :custom-label="customLabel"
|
||||
placeholder="Find item" :searchable="true" :options="options_items" @search-change="async_search" />
|
||||
:internal-search="false" placeholder="Find item" :searchable="true" :options="options_items"
|
||||
@search-change="async_search" />
|
||||
</div>
|
||||
<div>
|
||||
<span class="font-extrabold font-mono">Prepocet do meny</span>
|
||||
|
||||
Reference in New Issue
Block a user