feat: refs #8118 add VnDropdown component and integrate it into Claim and Ticket summaries #1517
src
|
@ -48,15 +48,6 @@ async function changeState(value) {
|
|||
focus-on-mount
|
||||
@update:model-value="changeState"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>
|
||||
{{ scope.opt?.name || scope.opt?.description }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
benjaminedc marked this conversation as resolved
|
||||
</QBtnDropdown>
|
||||
</template>
|
||||
|
|
|
@ -183,14 +183,15 @@ async function changeState(value) {
|
|||
function claimUrl(section) {
|
||||
return '#/claim/' + entityId.value + '/' + section;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const { data } = await axios.get('ClaimStates');
|
||||
claimStates.value = data;
|
||||
});
|
||||
</script>
|
||||
|
||||
benjaminedc marked this conversation as resolved
Outdated
jorgep
commented
Pasar a fetchData y obtener solo los campos que necesitas(id y name) Pasar a fetchData y obtener solo los campos que necesitas(id y name)
|
||||
<template>
|
||||
<FetchData
|
||||
url="ClaimStates"
|
||||
:filter="{ fields: ['id', 'description'] }"
|
||||
@on-fetch="(data) => (claimStates = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
url="ClaimDms"
|
||||
:filter="claimDmsFilter"
|
||||
|
@ -208,7 +209,12 @@ onMounted(async () => {
|
|||
{{ claim.id }} - {{ claim.client.name }} ({{ claim.client.id }})
|
||||
</template>
|
||||
<template #header-right>
|
||||
<VnDropdown :options="claimStates" @change-state="changeState($event)" />
|
||||
<VnDropdown
|
||||
:options="claimStates"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
benjaminedc marked this conversation as resolved
Outdated
jorgep
commented
Si usas id no no hace falta pasar la propiedad, utiliza ese por defecto Si usas id no no hace falta pasar la propiedad, utiliza ese por defecto
|
||||
@change-state="changeState($event)"
|
||||
/>
|
||||
</template>
|
||||
<template #menu="{ entity }">
|
||||
<ClaimDescriptorMenu :claim="entity.claim" />
|
||||
|
|
|
@ -117,6 +117,8 @@ onMounted(async () => {
|
|||
:moduleId="entityId"
|
||||
:options="editableStates"
|
||||
:disable="!isEditable()"
|
||||
benjaminedc marked this conversation as resolved
Outdated
jorgep
commented
no hace falta usar ":" cuando es texto. no hace falta usar ":" cuando es texto.
|
||||
:option-label="'name'"
|
||||
benjaminedc marked this conversation as resolved
Outdated
jorgep
commented
Aquí tenías puesto antes el code, ahora usas el id,, pero el back espera un code. Aquí tenías puesto antes el code, ahora usas el id,, pero el back espera un code.
|
||||
:option-value="'code'"
|
||||
benjaminedc marked this conversation as resolved
jorgep
commented
No hace falta poner $event, con poner changeState es suficiente. No hace falta poner $event, con poner **changeState** es suficiente.
|
||||
@change-state="changeState($event)"
|
||||
/>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue
Este template es el que tiene por defecto VnSelect, no hace falta que lo añadas aquí.