forked from verdnatura/salix-front
resolve conflicts
This commit is contained in:
commit
c3835dfd7a
|
@ -3,6 +3,7 @@ const { defineConfig } = require('cypress');
|
|||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
baseUrl: 'http://localhost:9000/',
|
||||
experimentalStudio: true,
|
||||
fixturesFolder: 'test/cypress/fixtures',
|
||||
screenshotsFolder: 'test/cypress/screenshots',
|
||||
supportFile: 'test/cypress/support/index.js',
|
||||
|
|
|
@ -16,7 +16,7 @@ onMounted(() => {
|
|||
if (availableLocales.includes(userLang)) {
|
||||
locale.value = userLang;
|
||||
} else {
|
||||
locale.value = fallbackLocale;
|
||||
locale.value = fallbackLocale.value;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -28,8 +28,23 @@ const countriesOptions = ref([]);
|
|||
const provincesOptions = ref([]);
|
||||
const townsLocationOptions = ref([]);
|
||||
|
||||
const onDataSaved = (dataSaved) => {
|
||||
emit('onDataSaved', dataSaved);
|
||||
const onDataSaved = (formData) => {
|
||||
const newPostcode = {
|
||||
...formData
|
||||
};
|
||||
const townObject = townsLocationOptions.value.find(
|
||||
({id}) => id === formData.townFk
|
||||
);
|
||||
newPostcode.town = townObject?.name;
|
||||
const provinceObject = provincesOptions.value.find(
|
||||
({id}) => id === formData.provinceFk
|
||||
);
|
||||
newPostcode.province = provinceObject?.name;
|
||||
const countryObject = countriesOptions.value.find(
|
||||
({id}) => id === formData.countryFk
|
||||
);
|
||||
newPostcode.country = countryObject?.country;
|
||||
emit('onDataSaved', newPostcode);
|
||||
};
|
||||
|
||||
const onCityCreated = async ({ name, provinceFk }, formData) => {
|
||||
|
@ -73,7 +88,7 @@ const onProvinceCreated = async ({ name }, formData) => {
|
|||
:title="t('New postcode')"
|
||||
:subtitle="t('Please, ensure you put the correct data!')"
|
||||
:form-initial-data="postcodeFormData"
|
||||
@on-data-saved="onDataSaved($event)"
|
||||
@on-data-saved="onDataSaved"
|
||||
>
|
||||
<template #form-inputs="{ data, validate }">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { h, onMounted } from 'vue';
|
||||
import { onMounted } from 'vue';
|
||||
import axios from 'axios';
|
||||
|
||||
const $props = defineProps({
|
||||
|
|
|
@ -132,12 +132,12 @@ const formUrl = computed(() => $props.url);
|
|||
const defaultButtons = computed(() => ({
|
||||
save: {
|
||||
color: 'primary',
|
||||
icon: 'restart_alt',
|
||||
icon: 'save',
|
||||
label: 'globals.save',
|
||||
},
|
||||
reset: {
|
||||
color: 'primary',
|
||||
icon: 'save',
|
||||
icon: 'restart_alt',
|
||||
label: 'globals.reset',
|
||||
},
|
||||
...$props.defaultButtons,
|
||||
|
@ -227,6 +227,7 @@ watch(formUrl, async () => {
|
|||
defineExpose({
|
||||
save,
|
||||
isLoading,
|
||||
hasChanges,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
@ -284,6 +285,9 @@ defineExpose({
|
|||
/>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.q-notifications {
|
||||
color: black;
|
||||
}
|
||||
#formModel {
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
|
|
|
@ -20,12 +20,7 @@ const itemComputed = computed(() => {
|
|||
});
|
||||
</script>
|
||||
<template>
|
||||
<QItem
|
||||
active-class="text-primary"
|
||||
:to="{ name: itemComputed.name }"
|
||||
clickable
|
||||
v-ripple
|
||||
>
|
||||
<QItem active-class="bg-hover" :to="{ name: itemComputed.name }" clickable v-ripple>
|
||||
<QItemSection avatar v-if="itemComputed.icon">
|
||||
<QIcon :name="itemComputed.icon" />
|
||||
</QItemSection>
|
||||
|
|
|
@ -88,6 +88,10 @@ function locationFilter(search = '') {
|
|||
function handleFetch(data) {
|
||||
postcodesOptions.value = data;
|
||||
}
|
||||
function onDataSaved(newPostcode) {
|
||||
postcodesOptions.value.push(newPostcode);
|
||||
value.value = newPostcode.code;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -111,11 +115,13 @@ function handleFetch(data) {
|
|||
clearable
|
||||
>
|
||||
<template #form>
|
||||
<CreateNewPostcode @on-data-saved="locationFilter()" />
|
||||
<CreateNewPostcode
|
||||
@on-data-saved="onDataSaved"
|
||||
/>
|
||||
</template>
|
||||
<template #option="{ itemProps, opt }">
|
||||
<QItem v-bind="itemProps">
|
||||
<QItemSection v-if="opt">
|
||||
<QItemSection v-if="opt.code">
|
||||
<QItemLabel>{{ opt.code }}</QItemLabel>
|
||||
<QItemLabel caption>{{ showLabel(opt) }}</QItemLabel>
|
||||
</QItemSection>
|
||||
|
|
|
@ -1030,7 +1030,7 @@ en:
|
|||
ticketCreated: Created
|
||||
created: Created
|
||||
isChargedToMana: Charged to mana
|
||||
hasToPickUp: Has to pick Up
|
||||
pickup: Type of pickup
|
||||
dmsFk: Document ID
|
||||
text: Description
|
||||
claimStateFk: Claim State
|
||||
|
@ -1069,7 +1069,7 @@ es:
|
|||
ticketCreated: Creado
|
||||
created: Creado
|
||||
isChargedToMana: Cargado a maná
|
||||
hasToPickUp: Se debe recoger
|
||||
pickup: Se debe recoger
|
||||
dmsFk: ID documento
|
||||
text: Descripción
|
||||
claimStateFk: Estado de la reclamación
|
||||
|
|
|
@ -157,7 +157,7 @@ const emit = defineEmits(['onFetch']);
|
|||
<div class="icons">
|
||||
<slot name="icons" :entity="entity" />
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="actions justify-center">
|
||||
<slot name="actions" :entity="entity" />
|
||||
</div>
|
||||
<slot name="after" />
|
||||
|
@ -176,22 +176,23 @@ const emit = defineEmits(['onFetch']);
|
|||
.body {
|
||||
background-color: var(--vn-section-color);
|
||||
.text-h5 {
|
||||
font-size: 20px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
.q-item {
|
||||
min-height: 20px;
|
||||
|
||||
.link {
|
||||
margin-left: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
.vn-label-value {
|
||||
display: flex;
|
||||
padding: 2px 16px;
|
||||
padding: 0px 16px;
|
||||
.label {
|
||||
color: var(--vn-label-color);
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
|
||||
&:not(:has(a))::after {
|
||||
content: ':';
|
||||
|
@ -200,7 +201,7 @@ const emit = defineEmits(['onFetch']);
|
|||
.value {
|
||||
color: var(--vn-text-color);
|
||||
font-size: 14px;
|
||||
margin-left: 12px;
|
||||
margin-left: 4px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
@ -218,18 +219,19 @@ const emit = defineEmits(['onFetch']);
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
span {
|
||||
color: $primary;
|
||||
color: var(--vn-text-color);
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.subtitle {
|
||||
color: var(--vn-text-color);
|
||||
font-size: 16px;
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.list-box {
|
||||
.q-item__label {
|
||||
color: var(--vn-label-color);
|
||||
padding-bottom: 0%;
|
||||
}
|
||||
}
|
||||
.descriptor {
|
||||
|
@ -247,6 +249,7 @@ const emit = defineEmits(['onFetch']);
|
|||
}
|
||||
.actions {
|
||||
margin: 0 5px;
|
||||
justify-content: center !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -74,7 +74,7 @@ async function fetch() {
|
|||
</router-link>
|
||||
<span v-else></span>
|
||||
</slot>
|
||||
<slot name="header" :entity="entity">
|
||||
<slot name="header" :entity="entity" dense>
|
||||
<VnLv :label="`${entity.id} -`" :value="entity.name" />
|
||||
</slot>
|
||||
<slot name="header-right">
|
||||
|
@ -97,7 +97,6 @@ async function fetch() {
|
|||
|
||||
.cardSummary {
|
||||
width: 100%;
|
||||
|
||||
.summaryHeader {
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
|
@ -132,6 +131,7 @@ async function fetch() {
|
|||
padding: 7px;
|
||||
font-size: 16px;
|
||||
min-width: 275px;
|
||||
box-shadow: none;
|
||||
|
||||
.vn-label-value {
|
||||
display: flex;
|
||||
|
|
|
@ -15,7 +15,6 @@ const { t } = useI18n();
|
|||
color="primary"
|
||||
padding="none"
|
||||
:href="`sip:${props.phoneNumber}`"
|
||||
:title="t('globals.microsip')"
|
||||
@click.stop
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -14,7 +14,7 @@ onUnmounted(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<QToolbar class="justify-end sticky">
|
||||
<QToolbar class="bg-vn-section-color justify-end sticky">
|
||||
<slot name="st-data">
|
||||
<div id="st-data"></div>
|
||||
</slot>
|
||||
|
@ -24,6 +24,11 @@ onUnmounted(() => {
|
|||
</slot>
|
||||
</QToolbar>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
.q-toolbar {
|
||||
background: var(--vn-section-color);
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.sticky {
|
||||
position: sticky;
|
||||
|
|
|
@ -14,8 +14,8 @@ export function useSession() {
|
|||
return localToken || sessionToken || '';
|
||||
}
|
||||
function getTokenMultimedia() {
|
||||
const localTokenMultimedia = localStorage.getItem('tokenMultimedia');
|
||||
const sessionTokenMultimedia = sessionStorage.getItem('tokenMultimedia');
|
||||
const localTokenMultimedia = localStorage.getItem('token'); // Temporal
|
||||
const sessionTokenMultimedia = sessionStorage.getItem('token'); // Temporal
|
||||
|
||||
return localTokenMultimedia || sessionTokenMultimedia || '';
|
||||
}
|
||||
|
|
|
@ -15,21 +15,15 @@ body.body--light {
|
|||
.q-header .q-toolbar {
|
||||
color: var(--font-color);
|
||||
}
|
||||
.q-card,
|
||||
.q-table,
|
||||
.q-table__bottom,
|
||||
.q-drawer {
|
||||
background-color: var(--vn-section-color);
|
||||
}
|
||||
}
|
||||
|
||||
body.body--dark {
|
||||
--vn-section-color: #403c3c;
|
||||
--vn-page-color: #222;
|
||||
--vn-section-color: #3d3d3d;
|
||||
--vn-text-color: white;
|
||||
--vn-label-color: #a8a8a8;
|
||||
--vn-accent-color: #424242;
|
||||
|
||||
background-color: #222;
|
||||
background-color: var(--vn-page-color);
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -77,6 +71,9 @@ select:-webkit-autofill {
|
|||
.bg-vn-section-color {
|
||||
background-color: var(--vn-section-color);
|
||||
}
|
||||
.bg-hover {
|
||||
background-color: #666666;
|
||||
}
|
||||
|
||||
.color-vn-text {
|
||||
color: var(--vn-text-color);
|
||||
|
@ -86,6 +83,11 @@ select:-webkit-autofill {
|
|||
color: $white;
|
||||
}
|
||||
|
||||
.card-width {
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.vn-card {
|
||||
background-color: var(--vn-section-color);
|
||||
color: var(--vn-text-color);
|
||||
|
@ -119,9 +121,36 @@ select:-webkit-autofill {
|
|||
content: ' *';
|
||||
}
|
||||
|
||||
.q-chip {
|
||||
.q-card,
|
||||
.q-table,
|
||||
.q-table__bottom,
|
||||
.q-drawer {
|
||||
background-color: var(--vn-section-color);
|
||||
}
|
||||
|
||||
.q-chip,
|
||||
.q-notification__message,
|
||||
.q-notification__icon {
|
||||
color: black;
|
||||
}
|
||||
.q-notification--standard.bg-negative {
|
||||
background-color: #fa3939 !important;
|
||||
}
|
||||
.q-notification--standard.bg-positive {
|
||||
background-color: #a3d131 !important;
|
||||
}
|
||||
|
||||
.q-tooltip {
|
||||
background-color: var(--vn-page-color);
|
||||
color: var(--font-color);
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
.q-card__actions {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* q-notification row items-stretch q-notification--standard bg-negative text-white */
|
||||
|
||||
input[type='number'] {
|
||||
-moz-appearance: textfield;
|
||||
|
|
|
@ -22,7 +22,7 @@ $warning: #f4b974;
|
|||
$success: $positive;
|
||||
$alert: $negative;
|
||||
$white: #fff;
|
||||
$dark: #3c3b3b;
|
||||
$dark: #3d3d3d;
|
||||
// custom
|
||||
$color-link: #66bfff;
|
||||
$color-spacer-light: #a3a3a31f;
|
||||
|
|
|
@ -48,7 +48,6 @@ export default {
|
|||
today: 'Today',
|
||||
yesterday: 'Yesterday',
|
||||
dateFormat: 'en-GB',
|
||||
microsip: 'Open in MicroSIP',
|
||||
noSelectedRows: `You don't have any line selected`,
|
||||
downloadCSVSuccess: 'CSV downloaded successfully',
|
||||
reference: 'Reference',
|
||||
|
@ -545,6 +544,7 @@ export default {
|
|||
assignedTo: 'Assigned',
|
||||
attendedBy: 'Attended by',
|
||||
created: 'Created',
|
||||
pickup: 'Pickup',
|
||||
state: 'State',
|
||||
details: 'Details',
|
||||
item: 'Item',
|
||||
|
@ -566,13 +566,19 @@ export default {
|
|||
responsible: 'Responsible',
|
||||
worker: 'Worker',
|
||||
redelivery: 'Redelivery',
|
||||
null: 'No',
|
||||
agency: 'Agency',
|
||||
delivery: 'Delivery',
|
||||
},
|
||||
basicData: {
|
||||
customer: 'Customer',
|
||||
assignedTo: 'Assigned',
|
||||
created: 'Created',
|
||||
state: 'State',
|
||||
picked: 'Picked',
|
||||
pickup: 'Pickup',
|
||||
null: 'No',
|
||||
agency: 'Agency',
|
||||
delivery: 'Delivery',
|
||||
},
|
||||
photo: {
|
||||
fileDescription: 'Claim id {claimId} from client {clientName} id {clientId}',
|
||||
|
@ -852,13 +858,15 @@ export default {
|
|||
pageTitles: {
|
||||
workers: 'Workers',
|
||||
list: 'List',
|
||||
basicData: 'Basic data',
|
||||
summary: 'Summary',
|
||||
notifications: 'Notifications',
|
||||
workerCreate: 'New worker',
|
||||
department: 'Department',
|
||||
basicData: 'Basic data',
|
||||
notes: 'Notes',
|
||||
pda: 'PDA',
|
||||
calendar: 'Calendar',
|
||||
notifications: 'Notifications',
|
||||
pbx: 'Private Branch Exchange',
|
||||
log: 'Log',
|
||||
},
|
||||
list: {
|
||||
|
|
|
@ -49,7 +49,6 @@ export default {
|
|||
yesterday: 'Ayer',
|
||||
dateFormat: 'es-ES',
|
||||
noSelectedRows: `No tienes ninguna línea seleccionada`,
|
||||
microsip: 'Abrir en MicroSIP',
|
||||
downloadCSVSuccess: 'Descarga de CSV exitosa',
|
||||
reference: 'Referencia',
|
||||
agency: 'Agencia',
|
||||
|
@ -544,6 +543,7 @@ export default {
|
|||
assignedTo: 'Asignada a',
|
||||
attendedBy: 'Atendida por',
|
||||
created: 'Creada',
|
||||
pickup: 'Recogida',
|
||||
state: 'Estado',
|
||||
details: 'Detalles',
|
||||
item: 'Artículo',
|
||||
|
@ -565,13 +565,19 @@ export default {
|
|||
responsible: 'Responsable',
|
||||
worker: 'Trabajador',
|
||||
redelivery: 'Devolución',
|
||||
null: 'No',
|
||||
agency: 'Agencia',
|
||||
delivery: 'Reparto',
|
||||
},
|
||||
basicData: {
|
||||
customer: 'Cliente',
|
||||
assignedTo: 'Asignada a',
|
||||
created: 'Creada',
|
||||
state: 'Estado',
|
||||
picked: 'Recogida',
|
||||
pickup: 'Recogida',
|
||||
null: 'No',
|
||||
agency: 'Agencia',
|
||||
delivery: 'Reparto',
|
||||
},
|
||||
photo: {
|
||||
fileDescription:
|
||||
|
@ -851,13 +857,15 @@ export default {
|
|||
pageTitles: {
|
||||
workers: 'Trabajadores',
|
||||
list: 'Listado',
|
||||
basicData: 'Datos básicos',
|
||||
summary: 'Resumen',
|
||||
notifications: 'Notificaciones',
|
||||
workerCreate: 'Nuevo trabajador',
|
||||
department: 'Departamentos',
|
||||
basicData: 'Datos básicos',
|
||||
notes: 'Notas',
|
||||
pda: 'PDA',
|
||||
calendar: 'Calendario',
|
||||
notifications: 'Notificaciones',
|
||||
pbx: 'Centralita',
|
||||
log: 'Historial',
|
||||
},
|
||||
list: {
|
||||
|
|
|
@ -9,6 +9,7 @@ import VnRow from 'components/ui/VnRow.vue';
|
|||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -24,7 +25,7 @@ const claimFilter = {
|
|||
'workerFk',
|
||||
'claimStateFk',
|
||||
'packages',
|
||||
'hasToPickUp',
|
||||
'pickup',
|
||||
],
|
||||
include: [
|
||||
{
|
||||
|
@ -50,6 +51,20 @@ function setClaimStates(data) {
|
|||
claimStates.value = data;
|
||||
claimStatesCopy.value = data;
|
||||
}
|
||||
let optionsList;
|
||||
async function getEnumValues() {
|
||||
optionsList = [{ id: null, description: t('claim.basicData.null') }];
|
||||
const { data } = await axios.get(`Applications/get-enum-values`, {
|
||||
params: {
|
||||
schema: 'vn',
|
||||
table: 'claim',
|
||||
column: 'pickup',
|
||||
},
|
||||
});
|
||||
for (let value of data)
|
||||
optionsList.push({ id: value, description: t(`claim.basicData.${value}`) });
|
||||
}
|
||||
getEnumValues();
|
||||
|
||||
const workerFilter = {
|
||||
options: workers,
|
||||
|
@ -168,13 +183,19 @@ const statesFilter = {
|
|||
type="number"
|
||||
/>
|
||||
</div>
|
||||
</VnRow>
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<div class="col">
|
||||
<QCheckbox
|
||||
v-model="data.hasToPickUp"
|
||||
:label="t('claim.basicData.picked')"
|
||||
/>
|
||||
<QSelect
|
||||
v-model="data.pickup"
|
||||
:options="optionsList"
|
||||
option-value="id"
|
||||
option-label="description"
|
||||
emit-value
|
||||
:label="t('claim.basicData.pickup')"
|
||||
map-options
|
||||
use-input
|
||||
:input-debounce="0"
|
||||
>
|
||||
</QSelect>
|
||||
</div>
|
||||
</VnRow>
|
||||
</template>
|
||||
|
|
|
@ -220,10 +220,9 @@ function openDialog(dmsId) {
|
|||
/>
|
||||
</template>
|
||||
</VnLv>
|
||||
<QCheckbox
|
||||
:label="t('claim.basicData.picked')"
|
||||
v-model="claim.hasToPickUp"
|
||||
:disable="true"
|
||||
<VnLv
|
||||
:label="t('claim.summary.pickup')"
|
||||
:value="t(`claim.summary.${claim.pickup}`)"
|
||||
/>
|
||||
</QCard>
|
||||
<QCard class="vn-three">
|
||||
|
|
|
@ -29,6 +29,7 @@ const suppliersRef = ref();
|
|||
order="nickname"
|
||||
limit="30"
|
||||
@on-fetch="(data) => (suppliers = data)"
|
||||
auto-load
|
||||
/>
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
|
@ -38,46 +39,6 @@ const suppliersRef = ref();
|
|||
</div>
|
||||
</template>
|
||||
<template #body="{ params, searchFn }">
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('Id or Supplier')"
|
||||
v-model="params.search"
|
||||
is-outlined
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="badge" size="sm"></QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="useCapitalize(t('params.correctedFk'))"
|
||||
v-model="params.correctedFk"
|
||||
is-outlined
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="attachment" size="sm" />
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.supplierRef')"
|
||||
v-model="params.supplierRef"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="vn:client" size="sm"></QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelectFilter
|
||||
|
@ -97,31 +58,31 @@ const suppliersRef = ref();
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.fi')"
|
||||
v-model="params.fi"
|
||||
:label="t('params.supplierRef')"
|
||||
v-model="params.supplierRef"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="badge" size="sm"></QIcon>
|
||||
<QIcon name="vn:client" size="sm"></QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.serialNumber')"
|
||||
v-model="params.serialNumber"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="badge" size="sm"></QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('From')"
|
||||
v-model="params.from"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
|
@ -152,6 +113,34 @@ const suppliersRef = ref();
|
|||
</QItemSection>
|
||||
</QItem>
|
||||
<QExpansionItem :label="t('More options')" expand-separator>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.fi')"
|
||||
v-model="params.fi"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="badge" size="sm"></QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.serialNumber')"
|
||||
v-model="params.serialNumber"
|
||||
is-outlined
|
||||
lazy-rules
|
||||
>
|
||||
<template #prepend>
|
||||
<QIcon name="badge" size="sm"></QIcon>
|
||||
</template>
|
||||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
|
@ -180,20 +169,6 @@ const suppliersRef = ref();
|
|||
</VnInput>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
:label="t('From')"
|
||||
v-model="params.from"
|
||||
is-outlined
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate
|
||||
|
|
|
@ -55,7 +55,7 @@ async function onSubmit() {
|
|||
if (res.response?.data?.error?.code === 'REQUIRES_2FA') {
|
||||
Notify.create({
|
||||
message: t('login.twoFactorRequired'),
|
||||
icon: 'phonelink_lock',
|
||||
icon: 'phoneLink_lock',
|
||||
type: 'warning',
|
||||
});
|
||||
params.keepLogin = keepLogin.value;
|
||||
|
|
|
@ -277,7 +277,6 @@ function navigateToRoadmapSummary(event, row) {
|
|||
.route-list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-actions {
|
||||
gap: 12px;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { onMounted, ref, computed, onUpdated } from 'vue';
|
||||
import { onMounted, ref, computed } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import axios from 'axios';
|
||||
|
@ -14,8 +14,6 @@ import { getUrl } from 'src/composables/getUrl';
|
|||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
|
||||
onUpdated(() => summaryRef.value.fetch());
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import FormModel from 'src/components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
||||
const workersOptions = ref([]);
|
||||
const countriesOptions = ref([]);
|
||||
const educationLevelsOptions = ref([]);
|
||||
|
||||
const workerFilter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['name', 'emailVerified'],
|
||||
include: { relation: 'emailUser', scope: { fields: ['email'] } },
|
||||
},
|
||||
},
|
||||
{ relation: 'sip', scope: { fields: ['extension', 'secret'] } },
|
||||
{ relation: 'department', scope: { include: { relation: 'department' } } },
|
||||
],
|
||||
};
|
||||
const workersFilter = {
|
||||
fields: ['id', 'nickname'],
|
||||
order: 'nickname ASC',
|
||||
limit: 30,
|
||||
};
|
||||
const countriesFilter = {
|
||||
fields: ['id', 'country', 'code'],
|
||||
order: 'country ASC',
|
||||
limit: 30,
|
||||
};
|
||||
const educationLevelsFilter = { fields: ['id', 'name'], order: 'name ASC', limit: 30 };
|
||||
|
||||
const maritalStatus = [
|
||||
{ code: 'M', name: t('Married') },
|
||||
{ code: 'S', name: t('Single') },
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
:filter="workersFilter"
|
||||
@on-fetch="(data) => (workersOptions = data)"
|
||||
auto-load
|
||||
url="Workers/search"
|
||||
/>
|
||||
<FetchData
|
||||
:filter="countriesFilter"
|
||||
@on-fetch="(data) => (countriesOptions = data)"
|
||||
auto-load
|
||||
url="Countries"
|
||||
/>
|
||||
<FetchData
|
||||
:filter="educationLevelsFilter"
|
||||
@on-fetch="(data) => (educationLevelsOptions = data)"
|
||||
auto-load
|
||||
url="EducationLevels"
|
||||
/>
|
||||
|
||||
<FormModel
|
||||
:filter="workerFilter"
|
||||
:url="`Workers/${route.params.id}`"
|
||||
auto-load
|
||||
model="Worker"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput :label="t('Name')" clearable v-model="data.firstName" />
|
||||
<VnInput :label="t('Last name')" clearable v-model="data.lastName" />
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput v-model="data.phone" :label="t('Business phone')" clearable />
|
||||
<VnInput
|
||||
v-model="data.mobileExtension"
|
||||
:label="t('Mobile extension')"
|
||||
clearable
|
||||
/>
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
:label="t('Boss')"
|
||||
:options="workersOptions"
|
||||
hide-selected
|
||||
option-label="nickname"
|
||||
option-value="id"
|
||||
v-model="data.bossFk"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
<QItemSection>
|
||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ scope.opt?.nickname }},
|
||||
{{ scope.opt?.code }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</VnSelectFilter>
|
||||
<VnSelectFilter
|
||||
:label="t('Marital status')"
|
||||
:options="maritalStatus"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="code"
|
||||
v-model="data.maritalStatus"
|
||||
/>
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnSelectFilter
|
||||
:label="t('Origin country')"
|
||||
:options="countriesOptions"
|
||||
hide-selected
|
||||
option-label="country"
|
||||
option-value="id"
|
||||
v-model="data.originCountryFk"
|
||||
/>
|
||||
<VnSelectFilter
|
||||
:label="t('Education level')"
|
||||
:options="educationLevelsOptions"
|
||||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="data.educationLevelFk"
|
||||
/>
|
||||
</VnRow>
|
||||
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<VnInput v-model="data.SSN" :label="t('SSN')" clearable />
|
||||
<VnInput
|
||||
v-model="data.locker"
|
||||
type="number"
|
||||
:label="t('Locker')"
|
||||
clearable
|
||||
/>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModel>
|
||||
</template>
|
||||
|
||||
<i18n>
|
||||
es:
|
||||
Name: Nombre
|
||||
Last name: Apellidos
|
||||
Business phone: Teléfono de empresa
|
||||
Mobile extension: Extensión móvil
|
||||
Boss: Jefe
|
||||
Marital status: Estado civil
|
||||
Married: Casado/a
|
||||
Single: Soltero/a
|
||||
Origin country: País origen
|
||||
Education level: Nivel educación
|
||||
SSN: NSS
|
||||
Locker: Taquilla
|
||||
</i18n>
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
|
@ -7,6 +7,7 @@ import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
|||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -23,6 +24,7 @@ const $props = defineProps({
|
|||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const { getTokenMultimedia } = useSession();
|
||||
const state = useState();
|
||||
|
||||
const entityId = computed(() => {
|
||||
return $props.id || route.params.id;
|
||||
|
@ -53,7 +55,18 @@ const filter = {
|
|||
],
|
||||
};
|
||||
|
||||
const sip = computed(() => worker.value?.sip && worker.value.sip.extension);
|
||||
const sip = ref(null);
|
||||
|
||||
watch(
|
||||
() => [worker.value?.sip?.extension, state.get('extension')],
|
||||
([newWorkerSip, newStateExtension], [oldWorkerSip, oldStateExtension]) => {
|
||||
if (newStateExtension !== oldStateExtension || sip.value === oldStateExtension) {
|
||||
sip.value = newStateExtension;
|
||||
} else if (newWorkerSip !== oldWorkerSip && sip.value !== newStateExtension) {
|
||||
sip.value = newWorkerSip;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
function getWorkerAvatar() {
|
||||
const token = getTokenMultimedia();
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<script setup>
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const filter = {
|
||||
order: 'created DESC',
|
||||
where: { workerFk: route.params.id },
|
||||
include: {
|
||||
relation: 'worker',
|
||||
scope: {
|
||||
fields: ['id', 'firstName', 'lastName'],
|
||||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const body = {
|
||||
workerFk: route.params.id,
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnNotes
|
||||
style="overflow-y: auto"
|
||||
:add-note="{ type: Boolean, default: true }"
|
||||
url="WorkerObservations"
|
||||
:filter="filter"
|
||||
:body="body"
|
||||
/>
|
||||
</template>
|
|
@ -0,0 +1,70 @@
|
|||
<script setup>
|
||||
import { watch, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
import FormModel from 'src/components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const state = useState();
|
||||
const route = useRoute();
|
||||
const workerPBXForm = ref();
|
||||
const extension = ref(null);
|
||||
|
||||
const filter = {
|
||||
include: [
|
||||
{
|
||||
relation: 'sip',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
() => state.set('extension', null)
|
||||
);
|
||||
|
||||
const onFetch = (data) => {
|
||||
state.set('extension', data?.sip?.extension);
|
||||
extension.value = state.get('extension');
|
||||
};
|
||||
|
||||
const updateModelValue = (data) => {
|
||||
state.set('extension', data);
|
||||
workerPBXForm.value.hasChanges = true;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FormModel
|
||||
ref="workerPBXForm"
|
||||
:filter="filter"
|
||||
:url="`Workers/${route.params.id}`"
|
||||
url-update="Sips"
|
||||
auto-load
|
||||
:mapper="
|
||||
() => ({
|
||||
userFk: +route.params.id,
|
||||
extension,
|
||||
})
|
||||
"
|
||||
model="DeviceProductionUser"
|
||||
@on-fetch="onFetch"
|
||||
>
|
||||
<template #form="{}">
|
||||
<VnRow class="row q-gutter-md q-mb-md">
|
||||
<div class="col">
|
||||
<VnInput
|
||||
:label="t('worker.summary.sipExtension')"
|
||||
v-model="extension"
|
||||
@update:model-value="updateModelValue"
|
||||
/>
|
||||
</div>
|
||||
</VnRow>
|
||||
</template>
|
||||
</FormModel>
|
||||
</template>
|
|
@ -12,7 +12,15 @@ export default {
|
|||
redirect: { name: 'WorkerMain' },
|
||||
menus: {
|
||||
main: ['WorkerList', 'WorkerDepartment'],
|
||||
card: ['WorkerNotificationsManager', 'WorkerCalendar', 'WorkerPda', 'WorkerLog'],
|
||||
card: [
|
||||
'WorkerBasicData',
|
||||
'WorkerNotes',
|
||||
'WorkerPda',
|
||||
'WorkerNotificationsManager',
|
||||
'WorkerPBX',
|
||||
'WorkerLog',
|
||||
'WorkerCalendar'
|
||||
],
|
||||
departmentCard: ['BasicData'],
|
||||
},
|
||||
children: [
|
||||
|
@ -66,6 +74,41 @@ export default {
|
|||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerSummary.vue'),
|
||||
},
|
||||
{
|
||||
path: 'basic-data',
|
||||
name: 'WorkerBasicData',
|
||||
meta: {
|
||||
title: 'basicData',
|
||||
icon: 'vn:settings',
|
||||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'),
|
||||
},
|
||||
{
|
||||
path: 'notes',
|
||||
name: 'NotesCard',
|
||||
redirect: { name: 'WorkerNotes' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'WorkerNotes',
|
||||
meta: {
|
||||
title: 'notes',
|
||||
icon: 'vn:notes',
|
||||
},
|
||||
component: () =>
|
||||
import('src/pages/Worker/Card/WorkerNotes.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'WorkerPda',
|
||||
path: 'pda',
|
||||
meta: {
|
||||
title: 'pda',
|
||||
icon: 'phone_android',
|
||||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
|
||||
},
|
||||
{
|
||||
name: 'WorkerNotificationsManager',
|
||||
path: 'notifications',
|
||||
|
@ -77,6 +120,7 @@ export default {
|
|||
import('src/pages/Worker/Card/WorkerNotificationsManager.vue'),
|
||||
},
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
name: 'WorkerCalendar',
|
||||
path: 'calendar',
|
||||
meta: {
|
||||
|
@ -88,11 +132,15 @@ export default {
|
|||
{
|
||||
name: 'WorkerPda',
|
||||
path: 'pda',
|
||||
=======
|
||||
path: 'pbx',
|
||||
name: 'WorkerPBX',
|
||||
>>>>>>> be9dd8b2b721a19295af30ff538e636ef69e890a
|
||||
meta: {
|
||||
title: 'pda',
|
||||
icon: 'phone_android',
|
||||
title: 'pbx',
|
||||
icon: 'vn:pbx',
|
||||
},
|
||||
component: () => import('src/pages/Worker/Card/WorkerPda.vue'),
|
||||
component: () => import('src/pages/Worker/Card/WorkerPBX.vue'),
|
||||
},
|
||||
{
|
||||
name: 'WorkerLog',
|
||||
|
|
|
@ -8,41 +8,41 @@ describe('VnLocation', () => {
|
|||
cy.visit('/#/worker/create');
|
||||
cy.waitForElement('.q-card');
|
||||
});
|
||||
|
||||
it('Show all options', function() {
|
||||
cy.get(inputLocation).click();
|
||||
cy.get(locationOptions).should('have.length',5);
|
||||
it('Show all options', function() {
|
||||
cy.get(inputLocation).click();
|
||||
cy.get(locationOptions).should('have.length.at.least',5);
|
||||
});
|
||||
|
||||
it('input filter location as "al"', function() {
|
||||
it('input filter location as "al"', function() {
|
||||
cy.get(inputLocation).click();
|
||||
cy.get(inputLocation).clear();
|
||||
cy.get(inputLocation).type('al');
|
||||
cy.get(locationOptions).should('have.length',3);
|
||||
cy.get(locationOptions).should('have.length.at.least',3);
|
||||
});
|
||||
it('input filter location as "ecuador"', function() {
|
||||
cy.get(inputLocation).click();
|
||||
cy.get(inputLocation).clear();
|
||||
cy.get(inputLocation).type('ecuador');
|
||||
cy.get(locationOptions).should('have.length',1);
|
||||
cy.get(locationOptions).should('have.length.at.least',1);
|
||||
cy.get(`${locationOptions}:nth-child(1)`).click();
|
||||
cy.get(':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon').click();
|
||||
|
||||
});
|
||||
});
|
||||
describe('Fiscal-data',()=>{
|
||||
const inputLocation = ':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('developer');
|
||||
cy.visit('/#/supplier/567/fiscal-data', {timeout: 2000});
|
||||
cy.waitForElement('.q-card');
|
||||
});
|
||||
|
||||
it('Show locations options', function() {
|
||||
cy.get(inputLocation).click();
|
||||
cy.get(locationOptions).should('have.length', 5);
|
||||
it('Create postCode', function() {
|
||||
cy.get(':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(3) > .q-icon').click();
|
||||
cy.get(' .q-card > h1').should('have.text', 'New postcode');
|
||||
cy.get('.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input').clear('12');
|
||||
cy.get('.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input').type('1234453');
|
||||
cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'Valencia');
|
||||
cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control ', 'Province one');
|
||||
cy.selectOption('.q-dialog__inner > .column > #formModel > .q-card > :nth-child(5) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'España');
|
||||
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('Ticket descriptor', () => {
|
||||
const toCloneOpt = '.q-list > :nth-child(5)';
|
||||
const warehouseValue = '.summaryBody > :nth-child(2) > :nth-child(6) > .value > span';
|
||||
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
|
||||
const summaryHeader = '.summaryHeader > div';
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -38,10 +38,10 @@ describe('VnLog', () => {
|
|||
action: 'update',
|
||||
changedModel: 'Claim',
|
||||
oldInstance: {
|
||||
hasToPickUp: false,
|
||||
pickup: null,
|
||||
},
|
||||
newInstance: {
|
||||
hasToPickUp: true,
|
||||
pickup: 'agency',
|
||||
},
|
||||
creationDate: '2023-09-18T12:25:34.000Z',
|
||||
changedModelId: '1',
|
||||
|
|
Loading…
Reference in New Issue