feat: refs #7936 add useAccountShortToStandard composable
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
2ab6380f97
commit
482505b800
|
@ -0,0 +1,4 @@
|
|||
export function useAccountShortToStandard(val) {
|
||||
if (!val || !/^\d+(\.\d*)$/.test(val)) return;
|
||||
return val?.replace('.', '0'.repeat(11 - val.length));
|
||||
}
|
|
@ -12,6 +12,7 @@ import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
|||
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||
import CreateNewExpenseForm from 'src/components/CreateNewExpenseForm.vue';
|
||||
import { getExchange } from 'src/composables/getExchange';
|
||||
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
|
@ -172,6 +173,13 @@ const formatOpt = (row, { model, options }, prop) => {
|
|||
:option-label="col.optionLabel"
|
||||
:filter-options="['id', 'name']"
|
||||
:tooltip="t('Create a new expense')"
|
||||
:hide-selected="false"
|
||||
:display-value="formatOpt(row, col, 'name')"
|
||||
@keydown.tab="
|
||||
row[col.model] = useAccountShortToStandard(
|
||||
$event.target.value
|
||||
)
|
||||
"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
|
Loading…
Reference in New Issue