diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue
index b78c99b8a..243f3ece1 100644
--- a/src/components/common/VnSelect.vue
+++ b/src/components/common/VnSelect.vue
@@ -294,7 +294,7 @@ async function onScroll({ to, direction, from, index }) {
}
}
-defineExpose({ opts: myOptions });
+defineExpose({ opts: myOptions, vnSelectRef });
function handleKeyDown(event) {
if (event.key === 'Tab' && !event.shiftKey) {
@@ -346,7 +346,6 @@ function getCaption(opt) {
:emit-value="nullishToTrue($attrs['emit-value'])"
:map-options="nullishToTrue($attrs['map-options'])"
:use-input="nullishToTrue($attrs['use-input'])"
- :hide-selected="nullishToTrue($attrs['hide-selected'])"
:fill-input="nullishToTrue($attrs['fill-input'])"
ref="vnSelectRef"
lazy-rules
diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue
index 12322c3fa..a4cd0011d 100644
--- a/src/components/common/VnSelectDialog.vue
+++ b/src/components/common/VnSelectDialog.vue
@@ -1,5 +1,5 @@
emit('update:modelValue', ...args)"
diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue
index f7ef7d525..b702851b3 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue
@@ -33,15 +33,19 @@ defineProps({
},
});
+function test(row) {
+ console.log('test', row);
+ return `${row.id}: ${row.name}`;
+}
+
const columns = computed(() => [
{
name: 'expense',
label: t('Expense'),
- field: (row) => row.expenseFk,
options: expenses.value,
model: 'expenseFk',
optionValue: 'id',
- optionLabel: (row) => `${row.id}: ${row.name}`,
+ optionLabel: (row) => test(row),
sortable: true,
align: 'left',
},
@@ -119,6 +123,8 @@ function taxRate(invoiceInTax) {
return ((taxTypeSage / 100) * taxableBase).toFixed(2);
}
+const expensesRef = ref();
+const exponseShow = ref(false);
function autocompleteExpense(evt, row, col) {
const val = evt.target.value;
if (!val) return;
@@ -127,9 +133,17 @@ function autocompleteExpense(evt, row, col) {
const lookup = expenses.value.find(
({ id }) => id == useAccountShortToStandard(param)
);
-
- if (lookup) row[col.model] = lookup;
+ if (lookup) {
+ row[col.model] = lookup?.id;
+ expensesRef.value.showItem = true;
+ }
}
+
+const formatOpt = (row, { model, options }, prop) => {
+ const obj = row[model];
+ const option = options.find(({ id }) => id == obj);
+ return option ? `${obj}:${option[prop]}` : '';
+};
(row[col.model] = undefined)"
>
-
+
+ A{{ scope.opt.id }}B
+