forked from verdnatura/salix-front
Merge pull request '6336-migrationClaim-v5' (!531) from 6336-migrationClaim-v5 into dev
Reviewed-on: verdnatura/salix-front#531 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
fd9caea5c1
|
@ -138,14 +138,6 @@ const showFilter = computed(
|
|||
);
|
||||
</script>
|
||||
<template>
|
||||
<div
|
||||
v-if="showTitle"
|
||||
class="q-pt-sm q-px-sm ellipsis"
|
||||
:class="`text-${column?.align ?? 'left'}`"
|
||||
:style="!showFilter ? { 'min-height': 72 + 'px' } : ''"
|
||||
>
|
||||
{{ column?.label }}
|
||||
</div>
|
||||
<div v-if="showFilter" class="full-width" :class="alignRow()">
|
||||
<VnTableColumn
|
||||
:column="$props.column"
|
||||
|
|
|
@ -68,6 +68,10 @@ const $props = defineProps({
|
|||
type: Object,
|
||||
default: () => ({ card: false, table: false }),
|
||||
},
|
||||
withoutHeader: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
tableCode: {
|
||||
type: String,
|
||||
default: null,
|
||||
|
@ -281,7 +285,7 @@ defineExpose({
|
|||
@row-click="(_, row) => rowClickFunction(row)"
|
||||
@update:selected="emit('update:selected', $event)"
|
||||
>
|
||||
<template #top-left>
|
||||
<template #top-left v-if="!$props.withoutHeader">
|
||||
<slot name="top-left"></slot>
|
||||
</template>
|
||||
<template #top-right>
|
||||
|
@ -304,15 +308,24 @@ defineExpose({
|
|||
class="bg-vn-section-color q-ml-md"
|
||||
dense
|
||||
@click="stateStore.toggleRightDrawer()"
|
||||
v-if="$props.rightSearch"
|
||||
/>
|
||||
</template>
|
||||
<template #header-cell="{ col }">
|
||||
<QTh
|
||||
auto-width
|
||||
style="min-width: 100px"
|
||||
v-if="$props.columnSearch && col.visible"
|
||||
>
|
||||
<QTh v-if="col.visible" auto-width style="min-width: 100px">
|
||||
<div
|
||||
class="q-pt-sm q-px-sm ellipsis"
|
||||
:class="`text-${col?.align ?? 'left'}`"
|
||||
:style="
|
||||
$props.columnSearch && col.columnFilter == false
|
||||
? { 'min-height': 72 + 'px' }
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ col?.label }}
|
||||
</div>
|
||||
<VnTableFilter
|
||||
v-if="$props.columnSearch"
|
||||
:column="col"
|
||||
:show-title="true"
|
||||
:data-key="$attrs['data-key']"
|
||||
|
|
|
@ -56,7 +56,12 @@ onBeforeMount(async () => {
|
|||
skip: 0,
|
||||
});
|
||||
store = arrayData.store;
|
||||
entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data));
|
||||
entity = computed(() => {
|
||||
const data = (Array.isArray(store.data) ? store.data[0] : store.data) ?? {};
|
||||
if (data) emit('onFetch', data);
|
||||
return data;
|
||||
});
|
||||
|
||||
// It enables to load data only once if the module is the same as the dataKey
|
||||
if (!isSameDataKey.value || !route.params.id) await getData();
|
||||
watch(
|
||||
|
@ -85,9 +90,9 @@ function getValueFromPath(path) {
|
|||
const keys = path.toString().split('.');
|
||||
let current = entity.value;
|
||||
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
if (current[keys[i]] === undefined) return undefined;
|
||||
else current = current[keys[i]];
|
||||
for (const key of keys) {
|
||||
if (current[key] === undefined) return undefined;
|
||||
else current = current[key];
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
|
|
@ -631,69 +631,6 @@ ticket:
|
|||
landed: Landed
|
||||
warehouse: Warehouse
|
||||
agency: Agency
|
||||
claim:
|
||||
list:
|
||||
customer: Customer
|
||||
assignedTo: Assigned
|
||||
created: Created
|
||||
state: State
|
||||
rmaList:
|
||||
code: Code
|
||||
records: records
|
||||
card:
|
||||
claimId: Claim ID
|
||||
attendedBy: Attended by
|
||||
created: Created
|
||||
state: State
|
||||
ticketId: Ticket ID
|
||||
customerSummary: Customer summary
|
||||
claimedTicket: Claimed ticket
|
||||
saleTracking: Sale tracking
|
||||
ticketTracking: Ticket tracking
|
||||
commercial: Commercial
|
||||
province: Province
|
||||
zone: Zone
|
||||
customerId: client ID
|
||||
summary:
|
||||
customer: Customer
|
||||
assignedTo: Assigned
|
||||
attendedBy: Attended by
|
||||
created: Created
|
||||
state: State
|
||||
details: Details
|
||||
item: Item
|
||||
landed: Landed
|
||||
quantity: Quantity
|
||||
claimed: Claimed
|
||||
price: Price
|
||||
discount: Discount
|
||||
total: Total
|
||||
actions: Actions
|
||||
responsibility: Responsibility
|
||||
company: Company
|
||||
person: Employee/Customer
|
||||
notes: Notes
|
||||
photos: Photos
|
||||
development: Development
|
||||
reason: Reason
|
||||
result: Result
|
||||
responsible: Responsible
|
||||
worker: Worker
|
||||
redelivery: Redelivery
|
||||
changeState: Change state
|
||||
basicData:
|
||||
customer: Customer
|
||||
assignedTo: Assigned
|
||||
created: Created
|
||||
state: State
|
||||
pickup: Pick up
|
||||
null: No
|
||||
agency: Agency
|
||||
delivery: Delivery
|
||||
photo:
|
||||
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}'
|
||||
noData: 'There are no images/videos, click here or drag and drop the file'
|
||||
dragDrop: Drag and drop it here
|
||||
invoiceOut:
|
||||
list:
|
||||
ref: Reference
|
||||
|
|
|
@ -636,69 +636,6 @@ ticket:
|
|||
landed: F. entrega
|
||||
warehouse: Almacén
|
||||
agency: Agencia
|
||||
claim:
|
||||
list:
|
||||
customer: Cliente
|
||||
assignedTo: Asignada a
|
||||
created: Creada
|
||||
state: Estado
|
||||
rmaList:
|
||||
code: Código
|
||||
records: registros
|
||||
card:
|
||||
claimId: ID reclamación
|
||||
attendedBy: Atendida por
|
||||
created: Creada
|
||||
state: Estado
|
||||
ticketId: ID ticket
|
||||
customerSummary: Resumen del cliente
|
||||
claimedTicket: Ticket reclamado
|
||||
saleTracking: Líneas preparadas
|
||||
ticketTracking: Estados del ticket
|
||||
commercial: Comercial
|
||||
province: Provincia
|
||||
zone: Zona
|
||||
customerId: ID del cliente
|
||||
summary:
|
||||
customer: Cliente
|
||||
assignedTo: Asignada a
|
||||
attendedBy: Atendida por
|
||||
created: Creada
|
||||
state: Estado
|
||||
details: Detalles
|
||||
item: Artículo
|
||||
landed: Entregado
|
||||
quantity: Cantidad
|
||||
claimed: Reclamado
|
||||
price: Precio
|
||||
discount: Descuento
|
||||
total: Total
|
||||
actions: Acciones
|
||||
responsibility: Responsabilidad
|
||||
company: Empresa
|
||||
person: Comercial/Cliente
|
||||
notes: Observaciones
|
||||
photos: Fotos
|
||||
development: Trazabilidad
|
||||
reason: Motivo
|
||||
result: Consecuencias
|
||||
responsible: Responsable
|
||||
worker: Trabajador
|
||||
redelivery: Devolución
|
||||
changeState: Cambiar estado
|
||||
basicData:
|
||||
customer: Cliente
|
||||
assignedTo: Asignada a
|
||||
created: Creada
|
||||
state: Estado
|
||||
pickup: Recogida
|
||||
null: No
|
||||
agency: Agencia
|
||||
delivery: Reparto
|
||||
photo:
|
||||
fileDescription: 'Reclamacion ID {claimId} del cliente {clientName} id {clientId}'
|
||||
noData: No hay imágenes/videos haz click aquí o arrastra y suelta el archivo
|
||||
dragDrop: Arrástralo y sueltalo aquí
|
||||
invoiceOut:
|
||||
list:
|
||||
ref: Referencia
|
||||
|
|
|
@ -33,8 +33,8 @@ const DEFAULT_MAX_RESPONSABILITY = 5;
|
|||
const DEFAULT_MIN_RESPONSABILITY = 1;
|
||||
const arrayData = useArrayData('claimData');
|
||||
const marker_labels = [
|
||||
{ value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') },
|
||||
{ value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') },
|
||||
{ value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.company') },
|
||||
{ value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.person') },
|
||||
];
|
||||
const multiplicatorValue = ref();
|
||||
const loading = ref(false);
|
||||
|
@ -209,12 +209,12 @@ async function post(query, params) {
|
|||
<QItem class="justify-between">
|
||||
<QItemLabel class="slider-container">
|
||||
<p class="text-primary">
|
||||
{{ t('claim.summary.actions') }}
|
||||
{{ t('claim.actions') }}
|
||||
</p>
|
||||
<QSlider
|
||||
class="responsibility { 'background-color:primary': quasar.platform.is.mobile }"
|
||||
v-model="claim.responsibility"
|
||||
:label-value="t('claim.summary.responsibility')"
|
||||
:label-value="t('claim.responsibility')"
|
||||
@change="(value) => save({ responsibility: value })"
|
||||
label-always
|
||||
color="primary"
|
||||
|
|
|
@ -30,7 +30,7 @@ function setClaimStates(data) {
|
|||
}
|
||||
|
||||
async function getEnumValues() {
|
||||
optionsList.value = [{ id: null, description: t('claim.basicData.null') }];
|
||||
optionsList.value = [{ id: null, description: t('claim.null') }];
|
||||
const { data } = await axios.get(`Applications/get-enum-values`, {
|
||||
params: {
|
||||
schema: 'vn',
|
||||
|
@ -39,7 +39,7 @@ async function getEnumValues() {
|
|||
},
|
||||
});
|
||||
for (let value of data)
|
||||
optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) });
|
||||
optionsList.value.push({ id: value, description: t(`claim.${value}`) });
|
||||
}
|
||||
|
||||
getEnumValues();
|
||||
|
@ -77,17 +77,14 @@ const statesFilter = {
|
|||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput
|
||||
v-model="data.client.name"
|
||||
:label="t('claim.basicData.customer')"
|
||||
:label="t('claim.customer')"
|
||||
disable
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="data.created"
|
||||
:label="t('claim.basicData.created')"
|
||||
/>
|
||||
<VnInputDate v-model="data.created" :label="t('claim.created')" />
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelect
|
||||
:label="t('claim.basicData.assignedTo')"
|
||||
:label="t('claim.assignedTo')"
|
||||
v-model="data.workerFk"
|
||||
:options="workersOptions"
|
||||
option-value="id"
|
||||
|
@ -114,7 +111,7 @@ const statesFilter = {
|
|||
option-value="id"
|
||||
option-label="description"
|
||||
emit-value
|
||||
:label="t('claim.basicData.state')"
|
||||
:label="t('claim.state')"
|
||||
map-options
|
||||
use-input
|
||||
@filter="(value, update) => filter(value, update, statesFilter)"
|
||||
|
@ -136,7 +133,7 @@ const statesFilter = {
|
|||
option-value="id"
|
||||
option-label="description"
|
||||
emit-value
|
||||
:label="t('claim.basicData.pickup')"
|
||||
:label="t('claim.pickup')"
|
||||
map-options
|
||||
use-input
|
||||
:input-debounce="0"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { toDate, toPercentage } from 'src/filters';
|
||||
import { toDateHourMinSec, toPercentage } from 'src/filters';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
|
||||
|
@ -42,7 +42,7 @@ function stateColor(code) {
|
|||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => {
|
||||
if (!entity) return;
|
||||
data.value = useCardDescription(entity.client.name, entity.id);
|
||||
data.value = useCardDescription(entity?.client?.name, entity.id);
|
||||
state.set('ClaimDescriptor', entity);
|
||||
};
|
||||
onMounted(async () => {
|
||||
|
@ -52,7 +52,6 @@ onMounted(async () => {
|
|||
|
||||
<template>
|
||||
<CardDescriptor
|
||||
ref="descriptor"
|
||||
:url="`Claims/${entityId}`"
|
||||
:filter="filter"
|
||||
module="Claim"
|
||||
|
@ -64,7 +63,7 @@ onMounted(async () => {
|
|||
<ClaimDescriptorMenu :claim="entity" />
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv v-if="entity.claimState" :label="t('claim.card.state')">
|
||||
<VnLv v-if="entity.claimState" :label="t('claim.state')">
|
||||
<template #value>
|
||||
<QBadge
|
||||
:color="stateColor(entity.claimState.code)"
|
||||
|
@ -75,8 +74,8 @@ onMounted(async () => {
|
|||
</QBadge>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('claim.card.created')" :value="toDate(entity.created)" />
|
||||
<VnLv :label="t('claim.card.commercial')">
|
||||
<VnLv :label="t('claim.created')" :value="toDateHourMinSec(entity.created)" />
|
||||
<VnLv :label="t('claim.commercial')">
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="entity.client?.salesPersonUser?.name"
|
||||
|
@ -86,17 +85,17 @@ onMounted(async () => {
|
|||
</VnLv>
|
||||
<VnLv
|
||||
v-if="entity.worker"
|
||||
:label="t('claim.card.attendedBy')"
|
||||
:label="t('claim.attendedBy')"
|
||||
:value="entity.worker.user.name"
|
||||
>
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="entity.worker.user.nickname"
|
||||
:name="entity.worker.user.name"
|
||||
:worker-id="entity.worker.id"
|
||||
/>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('claim.card.zone')">
|
||||
<VnLv :label="t('claim.zone')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
{{ entity.ticket?.zone?.name }}
|
||||
|
@ -105,10 +104,10 @@ onMounted(async () => {
|
|||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
:label="t('claim.card.province')"
|
||||
:label="t('claim.province')"
|
||||
:value="entity.ticket?.address?.province?.name"
|
||||
/>
|
||||
<VnLv :label="t('claim.card.ticketId')">
|
||||
<VnLv :label="t('claim.ticketId')">
|
||||
<template #value>
|
||||
<span class="link">
|
||||
{{ entity.ticketFk }}
|
||||
|
@ -130,7 +129,7 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
:to="{ name: 'CustomerCard', params: { id: entity.clientFk } }"
|
||||
>
|
||||
<QTooltip>{{ t('claim.card.customerSummary') }}</QTooltip>
|
||||
<QTooltip>{{ t('claim.customerSummary') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
|
@ -138,7 +137,7 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
:to="{ name: 'TicketCard', params: { id: entity.ticketFk } }"
|
||||
>
|
||||
<QTooltip>{{ t('claim.card.claimedTicket') }}</QTooltip>
|
||||
<QTooltip>{{ t('claim.claimedTicket') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
|
@ -146,7 +145,7 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
:href="salixUrl + 'ticket/' + entity.ticketFk + '/sale-tracking'"
|
||||
>
|
||||
<QTooltip>{{ t('claim.card.saleTracking') }}</QTooltip>
|
||||
<QTooltip>{{ t('claim.saleTracking') }}</QTooltip>
|
||||
</QBtn>
|
||||
<QBtn
|
||||
size="md"
|
||||
|
@ -154,7 +153,7 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
:href="salixUrl + 'ticket/' + entity.ticketFk + '/tracking/index'"
|
||||
>
|
||||
<QTooltip>{{ t('claim.card.ticketTracking') }}</QTooltip>
|
||||
<QTooltip>{{ t('claim.ticketTracking') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QCardActions>
|
||||
</template>
|
||||
|
|
|
@ -9,7 +9,7 @@ const state = useState();
|
|||
const user = state.getUser();
|
||||
|
||||
const $props = defineProps({
|
||||
id: { type: Number, default: null },
|
||||
id: { type: [Number, String], default: null },
|
||||
addNote: { type: Boolean, default: true },
|
||||
});
|
||||
const claimId = computed(() => $props.id || route.params.id);
|
||||
|
|
|
@ -18,7 +18,7 @@ const claimId = computed(() => router.currentRoute.value.params.id);
|
|||
|
||||
const claimDms = ref([
|
||||
{
|
||||
dmsFk: 1,
|
||||
dmsFk: claimId,
|
||||
},
|
||||
]);
|
||||
const client = ref({});
|
||||
|
@ -113,7 +113,7 @@ async function create() {
|
|||
warehouseId: config.value.warehouseFk,
|
||||
companyId: config.value.companyFk,
|
||||
dmsTypeId: dmsType.value.id,
|
||||
description: t('claim.photo.fileDescription', {
|
||||
description: t('claim.fileDescription', {
|
||||
claimId: claimId.value,
|
||||
clientName: client.value.name,
|
||||
clientId: client.value.id,
|
||||
|
@ -177,7 +177,7 @@ function onDrag() {
|
|||
>
|
||||
<QIcon size="xl" name="file_download" />
|
||||
<h5>
|
||||
{{ t('claim.photo.dragDrop') }}
|
||||
{{ t('claim.dragDrop') }}
|
||||
</h5>
|
||||
</div>
|
||||
<div
|
||||
|
@ -188,7 +188,7 @@ function onDrag() {
|
|||
<QIcon size="xl" name="image"></QIcon>
|
||||
<QIcon size="xl" name="movie"></QIcon>
|
||||
<h5>
|
||||
{{ t('claim.photo.noData') }}
|
||||
{{ t('claim.noData') }}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="multimediaParent bg-transparent" v-if="claimDms?.length && !dragFile">
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { onMounted, ref, computed } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { toDate, toCurrency } from 'src/filters';
|
||||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import dashIfEmpty from 'src/filters/dashIfEmpty';
|
||||
import { getUrl } from 'src/composables/getUrl';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import CardSummary from 'components/ui/CardSummary.vue';
|
||||
|
||||
import ClaimSummaryAction from 'src/pages/Claim/Card/ClaimSummaryAction.vue';
|
||||
import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
|
||||
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import axios from 'axios';
|
||||
import dashIfEmpty from 'src/filters/dashIfEmpty';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
@ -34,6 +39,9 @@ const ClaimStates = ref([]);
|
|||
const claimUrl = ref();
|
||||
const salixUrl = ref();
|
||||
const claimDmsRef = ref();
|
||||
const claimDms = ref([]);
|
||||
const multimediaDialog = ref();
|
||||
const multimediaSlide = ref();
|
||||
const claimDmsFilter = ref({
|
||||
include: [
|
||||
{
|
||||
|
@ -42,34 +50,29 @@ const claimDmsFilter = ref({
|
|||
],
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
salixUrl.value = await getUrl('');
|
||||
claimUrl.value = salixUrl.value + `claim/${entityId.value}/`;
|
||||
});
|
||||
|
||||
const detailsColumns = ref([
|
||||
{
|
||||
name: 'item',
|
||||
label: 'claim.summary.item',
|
||||
label: 'claim.item',
|
||||
field: (row) => row.sale.itemFk,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: 'claim.summary.landed',
|
||||
label: 'claim.landed',
|
||||
field: (row) => row.sale.ticket.landed,
|
||||
format: (value) => toDate(value),
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'quantity',
|
||||
label: 'claim.summary.quantity',
|
||||
label: 'claim.quantity',
|
||||
field: (row) => row.sale.quantity,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'claimed',
|
||||
label: 'claim.summary.claimed',
|
||||
label: 'claim.claimed',
|
||||
field: (row) => row.quantity,
|
||||
sortable: true,
|
||||
},
|
||||
|
@ -80,32 +83,38 @@ const detailsColumns = ref([
|
|||
},
|
||||
{
|
||||
name: 'price',
|
||||
label: 'claim.summary.price',
|
||||
label: 'claim.price',
|
||||
field: (row) => row.sale.price,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'discount',
|
||||
label: 'claim.summary.discount',
|
||||
label: 'claim.discount',
|
||||
field: (row) => row.sale.discount,
|
||||
format: (value) => `${value} %`,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'total',
|
||||
label: 'claim.summary.total',
|
||||
label: 'claim.total',
|
||||
field: ({ sale }) =>
|
||||
toCurrency(sale.quantity * sale.price * ((100 - sale.discount) / 100)),
|
||||
sortable: true,
|
||||
},
|
||||
]);
|
||||
|
||||
const markerLabels = [
|
||||
{ value: 1, label: t('claim.company') },
|
||||
{ value: 5, label: t('claim.person') },
|
||||
];
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'warning',
|
||||
incomplete: 'info',
|
||||
resolved: 'positive',
|
||||
canceled: 'negative',
|
||||
};
|
||||
|
||||
function stateColor(code) {
|
||||
return STATE_COLOR[code];
|
||||
}
|
||||
|
@ -113,38 +122,40 @@ function stateColor(code) {
|
|||
const developmentColumns = ref([
|
||||
{
|
||||
name: 'claimReason',
|
||||
label: 'claim.summary.reason',
|
||||
label: 'claim.reason',
|
||||
field: (row) => row.claimReason.description,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'claimResult',
|
||||
label: 'claim.summary.result',
|
||||
label: 'claim.result',
|
||||
field: (row) => row.claimResult.description,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'claimResponsible',
|
||||
label: 'claim.summary.responsible',
|
||||
label: 'claim.responsible',
|
||||
field: (row) => row.claimResponsible.description,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'worker',
|
||||
label: 'claim.summary.worker',
|
||||
label: 'claim.worker',
|
||||
field: (row) => row.worker?.user.nickname,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
name: 'claimRedelivery',
|
||||
label: 'claim.summary.redelivery',
|
||||
label: 'claim.redelivery',
|
||||
field: (row) => row.claimRedelivery.description,
|
||||
sortable: true,
|
||||
},
|
||||
]);
|
||||
const claimDms = ref([]);
|
||||
const multimediaDialog = ref();
|
||||
const multimediaSlide = ref();
|
||||
|
||||
onMounted(async () => {
|
||||
salixUrl.value = await getUrl('');
|
||||
claimUrl.value = salixUrl.value + `claim/${entityId.value}/`;
|
||||
});
|
||||
|
||||
async function getClaimDms() {
|
||||
claimDmsFilter.value.where = { claimFk: entityId.value };
|
||||
|
@ -221,16 +232,13 @@ async function changeState(value) {
|
|||
</QBtnDropdown>
|
||||
</template>
|
||||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||
<QCard class="vn-one">
|
||||
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
||||
<VnTitle
|
||||
:url="`#/claim/${entityId}/basic-data`"
|
||||
:text="t('globals.pageTitles.basicData')"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('claim.summary.created')"
|
||||
:value="toDate(claim.created)"
|
||||
/>
|
||||
<VnLv :label="t('claim.summary.state')">
|
||||
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" />
|
||||
<VnLv :label="t('claim.state')">
|
||||
<template #value>
|
||||
<QChip :color="stateColor(claim.claimState.code)" dense>
|
||||
{{ claim.claimState.description }}
|
||||
|
@ -245,7 +253,7 @@ async function changeState(value) {
|
|||
/>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('claim.summary.attendedBy')">
|
||||
<VnLv :label="t('claim.attendedBy')">
|
||||
<template #value>
|
||||
<VnUserLink
|
||||
:name="claim.worker?.user?.nickname"
|
||||
|
@ -253,7 +261,7 @@ async function changeState(value) {
|
|||
/>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('claim.summary.customer')">
|
||||
<VnLv :label="t('claim.customer')">
|
||||
<template #value>
|
||||
<span class="link cursor-pointer">
|
||||
{{ claim.client?.name }}
|
||||
|
@ -262,15 +270,12 @@ async function changeState(value) {
|
|||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
:label="t('claim.basicData.pickup')"
|
||||
:label="t('claim.pickup')"
|
||||
:value="`${dashIfEmpty(claim.pickup)}`"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-three">
|
||||
<VnTitle
|
||||
:url="`#/claim/${entityId}/notes`"
|
||||
:text="t('claim.summary.notes')"
|
||||
/>
|
||||
<QCard class="vn-two">
|
||||
<VnTitle :url="`#/claim/${entityId}/notes`" :text="t('claim.notes')" />
|
||||
<ClaimNotes
|
||||
:id="entityId"
|
||||
:add-note="false"
|
||||
|
@ -278,53 +283,8 @@ async function changeState(value) {
|
|||
order="created ASC"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-two" v-if="salesClaimed.length > 0">
|
||||
<VnTitle
|
||||
:url="`#/claim/${entityId}/lines`"
|
||||
:text="t('claim.summary.details')"
|
||||
/>
|
||||
<QTable
|
||||
:columns="detailsColumns"
|
||||
:rows="salesClaimed"
|
||||
flat
|
||||
dense
|
||||
:rows-per-page-options="[0]"
|
||||
hide-bottom
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props">
|
||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||
{{ t(col.label) }}
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
<template #body="props">
|
||||
<QTr :props="props">
|
||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span v-if="col.name != 'description'">{{
|
||||
t(col.value)
|
||||
}}</span>
|
||||
<QBtn
|
||||
v-if="col.name == 'description'"
|
||||
flat
|
||||
color="blue"
|
||||
>{{ col.value }}</QBtn
|
||||
>
|
||||
<ItemDescriptorProxy
|
||||
v-if="col.name == 'description'"
|
||||
:id="props.row.sale.itemFk"
|
||||
:sale-fk="props.row.saleFk"
|
||||
></ItemDescriptorProxy>
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
</QTable>
|
||||
</QCard>
|
||||
<QCard class="vn-two" v-if="claimDms.length > 0">
|
||||
<VnTitle
|
||||
:url="`#/claim/${entityId}/photos`"
|
||||
:text="t('claim.summary.photos')"
|
||||
/>
|
||||
<VnTitle :url="`#/claim/${entityId}/photos`" :text="t('claim.photos')" />
|
||||
<div class="container">
|
||||
<div
|
||||
class="multimedia-container"
|
||||
|
@ -362,11 +322,47 @@ async function changeState(value) {
|
|||
</div>
|
||||
</div>
|
||||
</QCard>
|
||||
<QCard class="vn-two" v-if="salesClaimed.length > 0">
|
||||
<VnTitle :url="`#/claim/${entityId}/lines`" :text="t('claim.details')" />
|
||||
<QTable
|
||||
:columns="detailsColumns"
|
||||
:rows="salesClaimed"
|
||||
flat
|
||||
dense
|
||||
:rows-per-page-options="[0]"
|
||||
hide-bottom
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props">
|
||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||
{{ t(col.label) }}
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
<template #body="props">
|
||||
<QTr :props="props">
|
||||
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span v-if="col.name != 'description'">{{
|
||||
t(col.value)
|
||||
}}</span>
|
||||
<QBtn
|
||||
v-if="col.name == 'description'"
|
||||
flat
|
||||
color="blue"
|
||||
>{{ col.value }}</QBtn
|
||||
>
|
||||
<ItemDescriptorProxy
|
||||
v-if="col.name == 'description'"
|
||||
:id="props.row.sale.itemFk"
|
||||
:sale-fk="props.row.saleFk"
|
||||
></ItemDescriptorProxy>
|
||||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
</QTable>
|
||||
</QCard>
|
||||
<QCard class="vn-two" v-if="developments.length > 0">
|
||||
<VnTitle
|
||||
:url="claimUrl + 'development'"
|
||||
:text="t('claim.summary.development')"
|
||||
/>
|
||||
<VnTitle :url="claimUrl + 'development'" :text="t('claim.development')" />
|
||||
<QTable
|
||||
:columns="developmentColumns"
|
||||
:rows="developments"
|
||||
|
@ -382,27 +378,31 @@ async function changeState(value) {
|
|||
</QTh>
|
||||
</QTr>
|
||||
</template>
|
||||
<template #body-cell-worker="props">
|
||||
<QTd :props="props" class="link">
|
||||
{{ props.value }}
|
||||
<WorkerDescriptorProxy :id="props.row.worker.id" />
|
||||
</QTd>
|
||||
</template>
|
||||
</QTable>
|
||||
</QCard>
|
||||
<QCard class="vn-max">
|
||||
<VnTitle :url="claimUrl + 'action'" :text="t('claim.summary.actions')" />
|
||||
<VnTitle :url="claimUrl + 'action'" :text="t('claim.actions')" />
|
||||
<div id="slider-container" class="q-px-xl q-py-md">
|
||||
<QSlider
|
||||
v-model="claim.responsibility"
|
||||
label
|
||||
:label-value="t('claim.summary.responsibility')"
|
||||
:label-value="t('claim.responsibility')"
|
||||
label-always
|
||||
color="var()"
|
||||
markers
|
||||
:marker-labels="[
|
||||
{ value: 1, label: t('claim.summary.company') },
|
||||
{ value: 5, label: t('claim.summary.person') },
|
||||
]"
|
||||
:marker-labels="markerLabels"
|
||||
:min="1"
|
||||
:max="5"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
<ClaimSummaryAction :id="entityId" />
|
||||
</QCard>
|
||||
<QDialog
|
||||
v-model="multimediaDialog"
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { toDate, toPercentage } from 'filters/index';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
type: [Number, String],
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const columns = [
|
||||
{
|
||||
name: 'itemFk',
|
||||
label: t('Id item'),
|
||||
columnFilter: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'ticketFk',
|
||||
label: t('Ticket'),
|
||||
columnFilter: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'claimDestinationFk',
|
||||
label: t('Destination'),
|
||||
columnFilter: false,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'landed',
|
||||
label: t('Landed'),
|
||||
format: (row) => toDate(row.landed),
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'quantity',
|
||||
label: t('Quantity'),
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'concept',
|
||||
label: t('Description'),
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'price',
|
||||
label: t('Price'),
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'discount',
|
||||
label: t('Discount'),
|
||||
format: ({ discount }) => toPercentage(discount / 100),
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
name: 'total',
|
||||
label: t('Total'),
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
</script>
|
||||
<template>
|
||||
<VnTable
|
||||
data-key="ClaimEndsTable"
|
||||
url="ClaimEnds/filter"
|
||||
default-mode="table"
|
||||
:right-search="false"
|
||||
:column-search="false"
|
||||
:disable-option="{ card: true, table: true }"
|
||||
search-url="actions"
|
||||
:filter="{ where: { claimFk: $props.id } }"
|
||||
:columns="columns"
|
||||
:limit="0"
|
||||
:without-header="true"
|
||||
auto-load
|
||||
>
|
||||
<template #column-itemFk="{ row }">
|
||||
<span class="link">
|
||||
{{ row.itemFk }}
|
||||
<ItemDescriptorProxy :id="row.itemFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-ticketFk="{ row }">
|
||||
<span class="link">
|
||||
{{ row.ticketFk }}
|
||||
<TicketDescriptorProxy :id="row.ticketFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
|
@ -16,19 +16,12 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const workers = ref();
|
||||
const states = ref();
|
||||
const states = ref([]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
||||
<FetchData
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
@on-fetch="(data) => (workers = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true" search-url="table">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||
|
@ -36,156 +29,110 @@ const states = ref();
|
|||
</div>
|
||||
</template>
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem class="q-my-sm">
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Customer ID')"
|
||||
v-model="params.clientFk"
|
||||
lazy-rules
|
||||
is-outlined
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="badge" size="xs"></QIcon> </template
|
||||
></VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Client Name')"
|
||||
v-model="params.clientName"
|
||||
lazy-rules
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection v-if="!workers">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="workers">
|
||||
<VnSelect
|
||||
:label="t('Salesperson')"
|
||||
v-model="params.salesPersonFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="workers"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:input-debounce="0"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection v-if="!workers">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="workers">
|
||||
<VnSelect
|
||||
:label="t('Attender')"
|
||||
v-model="params.attenderFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="workers"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:input-debounce="0"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection v-if="!workers">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="workers">
|
||||
<VnSelect
|
||||
:label="t('Responsible')"
|
||||
v-model="params.claimResponsibleFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="workers"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
:input-debounce="0"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem class="q-mb-sm">
|
||||
<QItemSection v-if="!states">
|
||||
<QSkeleton type="QInput" class="full-width" />
|
||||
</QItemSection>
|
||||
<QItemSection v-if="states">
|
||||
<VnSelect
|
||||
:label="t('State')"
|
||||
v-model="params.claimStateFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="states"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<QCheckbox
|
||||
v-model="params.myTeam"
|
||||
:label="t('myTeam')"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QSeparator />
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<!-- <QItem>
|
||||
<QItemSection>
|
||||
<qSelect
|
||||
:label="t('Item')"
|
||||
v-model="params.itemFk"
|
||||
:options="items"
|
||||
:loading="loading"
|
||||
@filter="filterFn"
|
||||
@virtual-scroll="onScroll"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem> -->
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
v-model="params.created"
|
||||
:label="t('Created')"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</QExpansionItem>
|
||||
<div class="q-pa-sm q-gutter-y-sm">
|
||||
<VnInput
|
||||
:label="t('claim.customerId')"
|
||||
v-model="params.clientFk"
|
||||
lazy-rules
|
||||
is-outlined
|
||||
>
|
||||
<template #prepend> <QIcon name="badge" size="xs" /></template>
|
||||
</VnInput>
|
||||
<VnInput
|
||||
:label="t('Client Name')"
|
||||
v-model="params.clientName"
|
||||
lazy-rules
|
||||
is-outlined
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('Salesperson')"
|
||||
v-model="params.salesPersonFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
:use-like="false"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
option-filter="firstName"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('claim.attendedBy')"
|
||||
v-model="params.attenderFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
:use-like="false"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
option-filter="firstName"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('claim.state')"
|
||||
v-model="params.claimStateFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="states"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="params.created"
|
||||
@update:model-value="searchFn()"
|
||||
:label="t('claim.created')"
|
||||
outlined
|
||||
rounded
|
||||
dense
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('Item')"
|
||||
v-model="params.itemFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="Items/withName"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
sort-by="id DESC"
|
||||
outlined
|
||||
rounded
|
||||
dense
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel> #{{ scope.opt?.id }} </QItemLabel>
|
||||
<QItemLabel caption>{{ scope.opt?.name }}</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:label="t('claim.responsible')"
|
||||
v-model="params.claimResponsibleFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
:filter="{ where: { role: 'salesPerson' } }"
|
||||
:use-like="false"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
option-filter="firstName"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
/>
|
||||
<QCheckbox
|
||||
v-model="params.myTeam"
|
||||
:label="t('params.myTeam')"
|
||||
@update:model-value="searchFn()"
|
||||
toggle-indeterminate
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</VnFilterPanel>
|
||||
</template>
|
||||
|
@ -201,7 +148,8 @@ en:
|
|||
claimResponsibleFk: Responsible
|
||||
claimStateFk: State
|
||||
created: Created
|
||||
myTeam: My team
|
||||
myTeam: My team
|
||||
itemFk: Item
|
||||
es:
|
||||
params:
|
||||
search: Contiene
|
||||
|
@ -212,14 +160,9 @@ es:
|
|||
claimResponsibleFk: Responsable
|
||||
claimStateFk: Estado
|
||||
created: Creada
|
||||
Customer ID: ID cliente
|
||||
myTeam: Mi equipo
|
||||
itemFk: Artículo
|
||||
Client Name: Nombre del cliente
|
||||
Salesperson: Comercial
|
||||
Attender: Asistente
|
||||
Responsible: Responsable
|
||||
State: Estado
|
||||
Item: Artículo
|
||||
Created: Creada
|
||||
More options: Más opciones
|
||||
myTeam: Mi equipo
|
||||
</i18n>
|
||||
|
|
|
@ -1,38 +1,81 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { toDate } from 'filters/index';
|
||||
import VnPaginate from 'src/components/ui/VnPaginate.vue';
|
||||
import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
||||
import ClaimFilter from './ClaimFilter.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import CardList from 'src/components/ui/CardList.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import ClaimSummary from './Card/ClaimSummary.vue';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
name: 'id',
|
||||
label: t('customer.extendedList.tableVisibleColumns.id'),
|
||||
chip: {
|
||||
condition: () => true,
|
||||
},
|
||||
isId: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('customer.extendedList.tableVisibleColumns.name'),
|
||||
name: 'clientName',
|
||||
isTitle: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('claim.customer'),
|
||||
name: 'clientFk',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('claim.attendedBy'),
|
||||
name: 'attendedBy',
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('claim.created'),
|
||||
name: 'created',
|
||||
format: ({ created }) => toDate(created),
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
label: t('claim.state'),
|
||||
name: 'stateCode',
|
||||
chip: {
|
||||
condition: () => true,
|
||||
color: ({ stateCode }) => STATE_COLOR[stateCode] ?? 'bg-grey',
|
||||
},
|
||||
},
|
||||
{
|
||||
align: 'right',
|
||||
name: 'tableActions',
|
||||
actions: [
|
||||
{
|
||||
title: t('Client ticket list'),
|
||||
icon: 'preview',
|
||||
action: (row) => viewSummary(row.id, ClaimSummary),
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const STATE_COLOR = {
|
||||
pending: 'warning',
|
||||
managed: 'info',
|
||||
resolved: 'positive',
|
||||
pending: 'bg-warning',
|
||||
managed: 'bg-info',
|
||||
resolved: 'bg-positive',
|
||||
};
|
||||
function getApiUrl() {
|
||||
return new URL(window.location).origin;
|
||||
}
|
||||
function stateColor(code) {
|
||||
return STATE_COLOR[code];
|
||||
}
|
||||
function navigate(event, id) {
|
||||
if (event.ctrlKey || event.metaKey)
|
||||
return window.open(`${getApiUrl()}/#/claim/${id}/summary`);
|
||||
router.push({ path: `/claim/${id}` });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -46,78 +89,27 @@ function navigate(event, id) {
|
|||
<ClaimFilter data-key="ClaimList" />
|
||||
</template>
|
||||
</RightMenu>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<div class="vn-card-list">
|
||||
<VnPaginate
|
||||
data-key="ClaimList"
|
||||
url="Claims/filter"
|
||||
:order="['priority ASC', 'created DESC']"
|
||||
auto-load
|
||||
>
|
||||
<template #body="{ rows }">
|
||||
<CardList
|
||||
:id="row.id"
|
||||
:key="row.id"
|
||||
:title="row.clientName"
|
||||
@click="navigate($event, row.id)"
|
||||
v-for="row of rows"
|
||||
>
|
||||
<template #list-items>
|
||||
<VnLv :label="t('claim.list.customer')">
|
||||
<template #value>
|
||||
<span class="link" @click.stop>
|
||||
{{ row.clientName }}
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv :label="t('claim.list.assignedTo')">
|
||||
<template #value>
|
||||
<span @click.stop>
|
||||
<VnUserLink
|
||||
:name="row.workerName"
|
||||
:worker-id="row.workerFk"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
</VnLv>
|
||||
<VnLv
|
||||
:label="t('claim.list.created')"
|
||||
:value="toDate(row.created)"
|
||||
/>
|
||||
<VnLv :label="t('claim.list.state')">
|
||||
<template #value>
|
||||
<QBadge
|
||||
text-color="black"
|
||||
:color="stateColor(row.stateCode)"
|
||||
dense
|
||||
>
|
||||
{{ row.stateDescription }}
|
||||
</QBadge>
|
||||
</template>
|
||||
</VnLv>
|
||||
</template>
|
||||
<template #actions>
|
||||
<QBtn
|
||||
:label="t('globals.description')"
|
||||
@click.stop
|
||||
outline
|
||||
style="margin-top: 15px"
|
||||
>
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</QBtn>
|
||||
<QBtn
|
||||
:label="t('components.smartCard.openSummary')"
|
||||
@click.stop="viewSummary(row.id, ClaimSummary)"
|
||||
color="primary"
|
||||
style="margin-top: 15px"
|
||||
/>
|
||||
</template>
|
||||
</CardList>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
</div>
|
||||
</QPage>
|
||||
<VnTable
|
||||
data-key="ClaimList"
|
||||
url="Claims/filter"
|
||||
:order="['priority ASC', 'created DESC']"
|
||||
:columns="columns"
|
||||
redirect="claim"
|
||||
:right-search="false"
|
||||
auto-load
|
||||
>
|
||||
<template #column-clientFk="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.clientName }}
|
||||
<CustomerDescriptorProxy :id="row.clientFk" />
|
||||
</span>
|
||||
</template>
|
||||
<template #column-attendedBy="{ row }">
|
||||
<span @click.stop>
|
||||
<VnUserLink :name="row.workerName" :worker-id="row.workerFk" />
|
||||
</span>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
claim:
|
||||
customer: Customer
|
||||
code: Code
|
||||
records: records
|
||||
claimId: Claim ID
|
||||
attendedBy: Attended by
|
||||
ticketId: Ticket ID
|
||||
customerSummary: Customer summary
|
||||
claimedTicket: Claimed ticket
|
||||
saleTracking: Sale tracking
|
||||
ticketTracking: Ticket tracking
|
||||
commercial: Commercial
|
||||
province: Province
|
||||
zone: Zone
|
||||
customerId: client ID
|
||||
assignedTo: Assigned
|
||||
created: Created
|
||||
details: Details
|
||||
item: Item
|
||||
landed: Landed
|
||||
quantity: Quantity
|
||||
claimed: Claimed
|
||||
price: Price
|
||||
discount: Discount
|
||||
total: Total
|
||||
actions: Actions
|
||||
responsibility: Responsibility
|
||||
company: Company
|
||||
person: Employee/Customer
|
||||
notes: Notes
|
||||
photos: Photos
|
||||
development: Development
|
||||
reason: Reason
|
||||
result: Result
|
||||
responsible: Responsible
|
||||
worker: Worker
|
||||
redelivery: Redelivery
|
||||
changeState: Change state
|
||||
state: State
|
||||
pickup: Pick up
|
||||
null: No
|
||||
agency: Agency
|
||||
delivery: Delivery
|
||||
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}'
|
||||
noData: 'There are no images/videos, click here or drag and drop the file'
|
||||
dragDrop: Drag and drop it here
|
|
@ -1,2 +1,48 @@
|
|||
Search claim: Buscar reclamación
|
||||
You can search by claim id or customer name: Puedes buscar por id de la reclamación o nombre del cliente
|
||||
claim:
|
||||
customer: Cliente
|
||||
code: Código
|
||||
records: Registros
|
||||
claimId: ID de reclamación
|
||||
attendedBy: Atendido por
|
||||
ticketId: ID de ticket
|
||||
customerSummary: Resumen del cliente
|
||||
claimedTicket: Ticket reclamado
|
||||
saleTracking: Seguimiento de ventas
|
||||
ticketTracking: Seguimiento de tickets
|
||||
commercial: Comercial
|
||||
province: Provincia
|
||||
zone: Zona
|
||||
customerId: ID de cliente
|
||||
assignedTo: Asignado a
|
||||
created: Creado
|
||||
details: Detalles
|
||||
item: Artículo
|
||||
landed: Llegado
|
||||
quantity: Cantidad
|
||||
claimed: Reclamado
|
||||
price: Precio
|
||||
discount: Descuento
|
||||
total: Total
|
||||
actions: Acciones
|
||||
responsibility: Responsabilidad
|
||||
company: Empresa
|
||||
person: Empleado/Cliente
|
||||
notes: Notas
|
||||
photos: Fotos
|
||||
development: Trazabilidad
|
||||
reason: Razón
|
||||
result: Resultado
|
||||
responsible: Responsable
|
||||
worker: Trabajador
|
||||
redelivery: Reentrega
|
||||
changeState: Cambiar estado
|
||||
state: Estado
|
||||
pickup: Recoger
|
||||
null: No
|
||||
agency: Agencia
|
||||
delivery: Entrega
|
||||
fileDescription: 'ID de reclamación {claimId} del cliente {clientName} con ID {clientId}'
|
||||
noData: 'No hay imágenes/videos, haz clic aquí o arrastra y suelta el archivo'
|
||||
dragDrop: Arrastra y suelta aquí
|
||||
|
|
|
@ -32,7 +32,7 @@ const entityId = computed(() => {
|
|||
});
|
||||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => (data.value = useCardDescription(entity.name, entity.id));
|
||||
const setData = (entity) => (data.value = useCardDescription(entity?.name, entity?.id));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -73,7 +73,7 @@ onMounted(async () => {
|
|||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) =>
|
||||
(data.value = useCardDescription(entity.supplier.nickname, entity.id));
|
||||
(data.value = useCardDescription(entity.supplier?.nickname, entity.id));
|
||||
|
||||
const currentEntry = computed(() => state.get('entry'));
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ const total = ref(null);
|
|||
color="primary"
|
||||
:to="{ name: 'CustomerCard', params: { id: entity.clientFk } }"
|
||||
>
|
||||
<QTooltip>{{ t('claim.card.customerSummary') }}</QTooltip>
|
||||
<QTooltip>{{ t('claim.customerSummary') }}</QTooltip>
|
||||
</QBtn>
|
||||
</QCardActions>
|
||||
</template>
|
||||
|
|
|
@ -8,7 +8,8 @@ describe('InvoiceInCorrective', () => {
|
|||
it('should create a correcting invoice', () => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-in/1/summary?limit=10`);
|
||||
cy.visit(`/#/invoice-in/1/summary`);
|
||||
cy.waitForElement('.q-page');
|
||||
|
||||
cy.openActionsDescriptor();
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ describe('InvoiceInDescriptor', () => {
|
|||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/invoice-in/1/summary');
|
||||
cy.waitForElement('.q-page');
|
||||
|
||||
cy.openActionsDescriptor();
|
||||
cy.get(firstDescritorOpt).click();
|
||||
|
|
Loading…
Reference in New Issue