feat: refs #7248 modify VnNotes #1336

Open
robert wants to merge 7 commits from 7248-tablesObservation into dev
4 changed files with 23 additions and 34 deletions

View File

@ -219,15 +219,15 @@ const handleObservationTypes = (data) => {
<QCardSection horizontal>
<VnAvatar
:descriptor="false"
:worker-id="note.workerFk"
:worker-id="note.user?.id"
size="md"
:title="note.worker?.user.nickname"
:title="note.user?.nickname"
/>
<div class="full-width row justify-between q-pa-xs">
<div>
<VnUserLink
:name="`${note.worker.user.name}`"
:worker-id="note.worker.id"
:name="`${note.user?.name}`"
:worker-id="note.user?.id"
/>
<QBadge
class="q-ml-xs"

View File

@ -1,12 +1,9 @@
<script setup>
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import VnNotes from 'src/components/ui/VnNotes.vue';
const route = useRoute();
const state = useState();
const user = state.getUser();
const $props = defineProps({
id: { type: [Number, String], default: null },
@ -15,24 +12,13 @@ const $props = defineProps({
const claimId = computed(() => $props.id || route.params.id);
const claimFilter = {
fields: ['id', 'created', 'workerFk', 'text'],
include: {
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName'],
fields: ['id', 'created', 'userFk', 'text'],
include: {
relation: 'user',
scope: {
fields: ['id', 'nickname', 'name'],
},
},
},
},
};
const body = {
claimFk: claimId.value,
workerFk: user.value.id,
};
</script>
<template>
@ -41,7 +27,9 @@ const body = {
:add-note="$props.addNote"
:user-filter="claimFilter"
:filter="{ where: { claimFk: claimId } }"
:body="body"
:body="{
claimFk: claimId,
}"
v-bind="$attrs"
style="overflow-y: auto"
/>

View File

@ -1,12 +1,15 @@
<script setup>
import VnNotes from 'src/components/ui/VnNotes.vue';
import { useState } from 'src/composables/useState';
const state = useState();
const user = state.getUser();
</script>
<template>
<VnNotes
url="clientObservations"
:add-note="true"
:filter="{ where: { clientFk: $route.params.id } }"
:body="{ clientFk: $route.params.id }"
:body="{ clientFk: $route.params.id, userFk: user.id }"
style="overflow-y: auto"
:select-type="true"
required

View File

@ -1,28 +1,26 @@
<script setup>
import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import VnNotes from 'src/components/ui/VnNotes.vue';
const route = useRoute();
const state = useState();
const user = state.getUser();
const userFilter = {
order: 'created DESC',
include: {
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName'],
include: {
relation: 'user',
scope: {
fields: ['id', 'nickname', 'name'],
},
},
},
},
};
const body = { workerFk: route.params.id };
const body = {
workerFk: route.params.id,
userFk: user.value.id,
};
</script>
<template>