feat: refs #7248 modify VnNotes #1336
|
@ -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"
|
||||
|
|
|
@ -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,25 +12,14 @@ const $props = defineProps({
|
|||
const claimId = computed(() => $props.id || route.params.id);
|
||||
|
||||
const claimFilter = {
|
||||
fields: ['id', 'created', 'workerFk', 'text'],
|
||||
fields: ['id', 'created', 'userFk', 'text'],
|
||||
include: {
|
||||
relation: 'worker',
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'firstName', 'lastName'],
|
||||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const body = {
|
||||
claimFk: claimId.value,
|
||||
workerFk: user.value.id,
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<VnNotes
|
||||
|
@ -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"
|
||||
/>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'firstName', 'lastName'],
|
||||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const body = { workerFk: route.params.id };
|
||||
const body = {
|
||||
workerFk: route.params.id,
|
||||
userFk: user.value.id,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
Loading…
Reference in New Issue