refs #5673 feat(claim): add development section
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-07-26 15:17:00 +02:00
parent 2b08924a61
commit 352e65c529
5 changed files with 228 additions and 13 deletions

View File

@ -38,11 +38,11 @@ export function useArrayData(key, userOptions) {
'limit', 'limit',
'skip', 'skip',
'userParams', 'userParams',
'userFilter' 'userFilter',
]; ];
if (typeof userOptions === 'object') { if (typeof userOptions === 'object') {
for (const option in userOptions) { for (const option in userOptions) {
const isEmpty = userOptions[option] == null || userOptions[option] == '' const isEmpty = userOptions[option] == null || userOptions[option] == '';
if (isEmpty || !allowedOptions.includes(option)) continue; if (isEmpty || !allowedOptions.includes(option)) continue;
if (Object.prototype.hasOwnProperty.call(store, option)) { if (Object.prototype.hasOwnProperty.call(store, option)) {
@ -73,7 +73,7 @@ export function useArrayData(key, userOptions) {
Object.assign(params, store.userParams); Object.assign(params, store.userParams);
store.isLoading = true store.isLoading = true;
const response = await axios.get(store.url, { const response = await axios.get(store.url, {
signal: canceller.signal, signal: canceller.signal,
params, params,
@ -94,7 +94,7 @@ export function useArrayData(key, userOptions) {
updateStateParams(); updateStateParams();
} }
store.isLoading = false store.isLoading = false;
canceller = null; canceller = null;
} }
@ -153,8 +153,8 @@ export function useArrayData(key, userOptions) {
}); });
} }
const totalRows = computed(() => store.data && store.data.length || 0); const totalRows = computed(() => (store.data && store.data.length) || 0);
const isLoading = computed(() => store.isLoading || false) const isLoading = computed(() => store.isLoading || false);
return { return {
fetch, fetch,
@ -167,6 +167,6 @@ export function useArrayData(key, userOptions) {
hasMoreData, hasMoreData,
totalRows, totalRows,
updateStateParams, updateStateParams,
isLoading isLoading,
}; };
} }

View File

@ -63,7 +63,7 @@ export default {
webPayments: 'Pagos Web', webPayments: 'Pagos Web',
createCustomer: 'Crear cliente', createCustomer: 'Crear cliente',
basicData: 'Datos básicos', basicData: 'Datos básicos',
summary: 'Resumen' summary: 'Resumen',
}, },
list: { list: {
phone: 'Teléfono', phone: 'Teléfono',
@ -243,6 +243,7 @@ export default {
lines: 'Líneas', lines: 'Líneas',
rma: 'RMA', rma: 'RMA',
photos: 'Fotos', photos: 'Fotos',
development: 'Trazabilidad',
log: 'Registros de auditoría', log: 'Registros de auditoría',
}, },
list: { list: {
@ -294,7 +295,7 @@ export default {
result: 'Consecuencias', result: 'Consecuencias',
responsible: 'Responsable', responsible: 'Responsable',
worker: 'Trabajador', worker: 'Trabajador',
redelivery: 'Devolución' redelivery: 'Devolución',
}, },
basicData: { basicData: {
customer: 'Cliente', customer: 'Cliente',
@ -411,7 +412,7 @@ export default {
wagonEdit: 'Editar tipo', wagonEdit: 'Editar tipo',
typesList: 'Listado tipos', typesList: 'Listado tipos',
typeCreate: 'Crear tipo', typeCreate: 'Crear tipo',
typeEdit: 'Editar tipo' typeEdit: 'Editar tipo',
}, },
type: { type: {
name: 'Nombre', name: 'Nombre',
@ -444,7 +445,7 @@ export default {
minHeightBetweenTrays: 'La distancia mínima entre bandejas es ', minHeightBetweenTrays: 'La distancia mínima entre bandejas es ',
maxWagonHeight: 'La altura máxima del vagón es ', maxWagonHeight: 'La altura máxima del vagón es ',
uncompleteTrays: 'Hay bandejas sin completar', uncompleteTrays: 'Hay bandejas sin completar',
} },
}, },
components: { components: {
topbar: {}, topbar: {},

View File

@ -23,7 +23,6 @@ const entityId = computed(() => {
}); });
const claimSections = [ const claimSections = [
{ name: 'Notes', url: '/note/index', icon: 'draft' }, { name: 'Notes', url: '/note/index', icon: 'draft' },
{ name: 'Development', url: '/development', icon: 'vn:traceability' },
{ name: 'Action', url: '/action', icon: 'vn:actions' }, { name: 'Action', url: '/action', icon: 'vn:actions' },
]; ];

View File

@ -0,0 +1,199 @@
<script setup>
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnPaginate from 'components/ui/VnPaginate.vue';
import FetchData from 'components/FetchData.vue';
const route = useRoute();
const { t } = useI18n();
const claimReasons = ref([]);
const claimResults = ref([]);
const claimResponsibles = ref([]);
const claimRedeliveries = ref([]);
const developmentsFilter = {
fields: [
'id',
'claimFk',
'claimReasonFk',
'claimResultFk',
'claimResponsibleFk',
'workerFk',
'claimRedeliveryFk',
],
where: {
claimFk: route.params.id,
},
};
const columns = computed(() => [
{
name: 'reason',
label: t('Reason'),
field: (row) => row.claimReasonFk,
sortable: true,
options: claimReasons,
},
{
name: 'result',
label: t('Result'),
field: (row) => row.claimResultFk,
sortable: true,
options: claimResults,
},
{
name: 'responsible',
label: t('Responsible'),
field: (row) => row.claimResponsibleFk,
sortable: true,
},
{
name: 'worker',
label: t('Worker'),
field: (row) => row.workerFk,
sortable: true,
},
{
name: 'redelivery',
label: t('Redelivery'),
field: (row) => row.claimRedeliveryFk,
sortable: true,
},
]);
</script>
<template>
<FetchData
url="ClaimReasons"
order="description"
@on-fetch="(data) => (claimReasons = data)"
auto-load
/>
<FetchData
url="ClaimResults"
order="description"
@on-fetch="(data) => (claimResults = data)"
auto-load
/>
<FetchData
url="ClaimResponsibles"
order="description"
@on-fetch="(data) => (claimResponsibles = data)"
auto-load
/>
<FetchData
url="ClaimRedeliveries"
order="description"
@on-fetch="(data) => (claimRedeliveries = data)"
auto-load
/>
<div class="column items-center">
<div class="list">
<VnPaginate
data-key="ClaimDevelopments"
url="ClaimDevelopments"
:filter="developmentsFilter"
auto-load
>
<template #body="{ rows }">
<QTable
:columns="columns"
:rows="rows"
:dense="$q.screen.lt.md"
:pagination="{ rowsPerPage: 0 }"
row-key="id"
selection="multiple"
hide-pagination
>
<template #body-cell-reason="{ row, column }">
{{ column }}
<QTd auto-width>
<QSelect
:label="t('Responsible')"
v-model="row.claimReasonFk"
:options="claimReasons"
option-value="id"
option-label="description"
emit-value
map-options
use-input
/>
</QTd>
</template>
<template #body-cell-result="{ row }">
{{ props }}
<QTd auto-width>
<QSelect
label=""
v-model="row.claimResultFk"
:options="claimResults"
option-value="id"
option-label="description"
emit-value
map-options
use-input
/>
</QTd>
</template>
<template #body-cell-responsible="{ row }">
<QTd auto-width>
<QSelect
:label="t('Responsible')"
v-model="row.claimResponsibleFk"
:options="claimResponsibles"
option-value="id"
option-label="description"
emit-value
map-options
use-input
/>
</QTd>
</template>
</QTable>
</template>
</VnPaginate>
</div>
</div>
<q-page-sticky position="bottom-right" :offset="[18, 18]">
<q-fab color="purple" icon="keyboard_arrow_up" direction="up">
<q-fab-action color="primary" icon="mail" />
<q-fab-action color="secondary" icon="alarm" />
</q-fab>
</q-page-sticky>
</template>
<style lang="scss" scoped>
.list {
padding-top: 50px;
max-width: 900px;
width: 100%;
}
.grid-style-transition {
transition: transform 0.28s, background-color 0.28s;
}
</style>
<i18n>
en:
You are about to remove {count} rows: '
You are about to remove <strong>{count}</strong> row |
You are about to remove <strong>{count}</strong> rows'
es:
Claimed lines: Líneas reclamadas
Delivered: Entregado
Quantity: Cantidad
Claimed: Reclamada
Description: Descripción
Price: Precio
Discount: Descuento
Actions: Acciones
Amount: Total
Amount Claimed: Cantidad reclamada
Delete claimed sales: Eliminar ventas reclamadas
Discount updated: Descuento actualizado
Claimed quantity: Cantidad reclamada
You are about to remove {count} rows: '
Vas a eliminar <strong>{count}</strong> línea |
Vas a eliminar <strong>{count}</strong> líneas'
</i18n>

View File

@ -11,7 +11,14 @@ export default {
redirect: { name: 'ClaimMain' }, redirect: { name: 'ClaimMain' },
menus: { menus: {
main: ['ClaimList', 'ClaimRmaList'], main: ['ClaimList', 'ClaimRmaList'],
card: ['ClaimBasicData', 'ClaimLines', 'ClaimRma', 'ClaimPhotos', 'ClaimLog'], card: [
'ClaimBasicData',
'ClaimLines',
'ClaimPhotos',
'ClaimDevelopment',
'ClaimRma',
'ClaimLog',
],
}, },
children: [ children: [
{ {
@ -94,6 +101,15 @@ export default {
}, },
component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'), component: () => import('src/pages/Claim/Card/ClaimPhoto.vue'),
}, },
{
name: 'ClaimDevelopment',
path: 'development',
meta: {
title: 'development',
icon: 'vn:traceability',
},
component: () => import('src/pages/Claim/Card/ClaimDevelopment.vue'),
},
{ {
name: 'ClaimLog', name: 'ClaimLog',
path: 'log', path: 'log',