Compare commits
32 Commits
dev
...
6683-creat
Author | SHA1 | Date |
---|---|---|
|
d943529f75 | |
|
601b8d8d64 | |
|
5527a7fea8 | |
|
49218511d9 | |
|
80d56a5468 | |
|
db3d17179e | |
|
36fa2c72e0 | |
|
0ea9381287 | |
|
a2fdd6820c | |
|
561b607163 | |
|
bcf5750619 | |
|
46826b6b95 | |
|
5690ab7ce1 | |
|
1fc0e4d958 | |
|
2bfa8368ab | |
|
56c1373b8e | |
|
c4b76b465e | |
|
105e95e68a | |
|
223890a1bc | |
|
bf6d4f0c5f | |
|
c34af4d888 | |
|
a4be25c24e | |
|
c4a95c8d4e | |
|
23c42ba33c | |
|
37cf083b7a | |
|
56ce26223f | |
|
c0c8500063 | |
|
c6b9b3646f | |
|
5847734ef7 | |
|
5619e9c2ca | |
|
70298cb96a | |
|
3c467c8c0e |
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "25.18.0",
|
"version": "25.16.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
@ -89,4 +89,4 @@
|
||||||
"vite": "^6.0.11",
|
"vite": "^6.0.11",
|
||||||
"vitest": "^0.31.1"
|
"vitest": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { onMounted } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
import { useQuasar, Dark } from 'quasar';
|
import { useQuasar, Dark } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import VnScroll from './components/common/VnScroll.vue';
|
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const { availableLocales, locale, fallbackLocale } = useI18n();
|
const { availableLocales, locale, fallbackLocale } = useI18n();
|
||||||
|
@ -39,7 +38,6 @@ quasar.iconMapFn = (iconName) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RouterView />
|
<RouterView />
|
||||||
<VnScroll/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
@ -406,7 +406,6 @@ defineExpose({
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
<QBtn
|
<QBtn
|
||||||
v-else
|
v-else
|
||||||
data-cy="saveDefaultBtn"
|
|
||||||
:label="tMobile('globals.save')"
|
:label="tMobile('globals.save')"
|
||||||
color="primary"
|
color="primary"
|
||||||
icon="save"
|
icon="save"
|
||||||
|
|
|
@ -69,7 +69,7 @@ const refresh = () => window.location.reload();
|
||||||
'no-visible': !stateQuery.isLoading().value,
|
'no-visible': !stateQuery.isLoading().value,
|
||||||
}"
|
}"
|
||||||
size="sm"
|
size="sm"
|
||||||
data-cy="navBar-spinner"
|
data-cy="loading-spinner"
|
||||||
/>
|
/>
|
||||||
<QSpace />
|
<QSpace />
|
||||||
<div id="searchbar" class="searchbar"></div>
|
<div id="searchbar" class="searchbar"></div>
|
||||||
|
|
|
@ -33,7 +33,6 @@ import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
||||||
import VnTableFilter from './VnTableFilter.vue';
|
import VnTableFilter from './VnTableFilter.vue';
|
||||||
import { getColAlign } from 'src/composables/getColAlign';
|
import { getColAlign } from 'src/composables/getColAlign';
|
||||||
import RightMenu from '../common/RightMenu.vue';
|
import RightMenu from '../common/RightMenu.vue';
|
||||||
import VnScroll from '../common/VnScroll.vue'
|
|
||||||
|
|
||||||
const arrayData = useArrayData(useAttrs()['data-key']);
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -169,7 +168,6 @@ const params = ref(useFilterParams($attrs['data-key']).params);
|
||||||
const orders = ref(useFilterParams($attrs['data-key']).orders);
|
const orders = ref(useFilterParams($attrs['data-key']).orders);
|
||||||
const app = inject('app');
|
const app = inject('app');
|
||||||
const tableHeight = useTableHeight();
|
const tableHeight = useTableHeight();
|
||||||
const vnScrollRef = ref(null);
|
|
||||||
|
|
||||||
const editingRow = ref(null);
|
const editingRow = ref(null);
|
||||||
const editingField = ref(null);
|
const editingField = ref(null);
|
||||||
|
@ -191,17 +189,6 @@ const tableModes = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const onVirtualScroll = ({ to }) => {
|
|
||||||
handleScroll();
|
|
||||||
const virtualScrollContainer = tableRef.value?.$el?.querySelector('.q-table__middle');
|
|
||||||
if (virtualScrollContainer) {
|
|
||||||
virtualScrollContainer.dispatchEvent(new CustomEvent('scroll'));
|
|
||||||
if (vnScrollRef.value) {
|
|
||||||
vnScrollRef.value.updateScrollContainer(virtualScrollContainer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
const urlParams = route.query[$props.searchUrl];
|
const urlParams = route.query[$props.searchUrl];
|
||||||
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
hasParams.value = urlParams && Object.keys(urlParams).length !== 0;
|
||||||
|
@ -340,13 +327,16 @@ function handleOnDataSaved(_) {
|
||||||
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
|
||||||
else $props.create.onDataSaved(_);
|
else $props.create.onDataSaved(_);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
if ($props.crudModel.disableInfiniteScroll) return;
|
if ($props.crudModel.disableInfiniteScroll) return;
|
||||||
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
|
|
||||||
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
|
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
|
||||||
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
|
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
|
||||||
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
|
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
|
||||||
|
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
if (evt?.shiftKey && added) {
|
if (evt?.shiftKey && added) {
|
||||||
const rowIndex = selectedRows[0].$index;
|
const rowIndex = selectedRows[0].$index;
|
||||||
|
@ -679,9 +669,9 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
v-bind="table"
|
v-bind="table"
|
||||||
:class="[
|
:class="[
|
||||||
'vnTable',
|
'vnTable',
|
||||||
table ? 'selection-cell' : '',
|
table ? 'selection-cell' : '',
|
||||||
$props.footer ? 'last-row-sticky' : '',
|
$props.footer ? 'last-row-sticky' : '',
|
||||||
]"
|
]"
|
||||||
wrap-cells
|
wrap-cells
|
||||||
:columns="splittedColumns.columns"
|
:columns="splittedColumns.columns"
|
||||||
|
@ -693,7 +683,7 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
flat
|
flat
|
||||||
:style="isTableMode && `max-height: ${$props.tableHeight || tableHeight}`"
|
:style="isTableMode && `max-height: ${$props.tableHeight || tableHeight}`"
|
||||||
:virtual-scroll="isTableMode"
|
:virtual-scroll="isTableMode"
|
||||||
@virtual-scroll="onVirtualScroll"
|
@virtual-scroll="handleScroll"
|
||||||
@row-click="(event, row) => handleRowClick(event, row)"
|
@row-click="(event, row) => handleRowClick(event, row)"
|
||||||
@update:selected="emit('update:selected', $event)"
|
@update:selected="emit('update:selected', $event)"
|
||||||
@selection="(details) => handleSelection(details, rows)"
|
@selection="(details) => handleSelection(details, rows)"
|
||||||
|
@ -751,7 +741,6 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
withFilters
|
withFilters
|
||||||
"
|
"
|
||||||
:column="col"
|
:column="col"
|
||||||
:data-cy="`column-filter-${col.name}`"
|
|
||||||
:show-title="true"
|
:show-title="true"
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
v-model="params[columnName(col)]"
|
v-model="params[columnName(col)]"
|
||||||
|
@ -1098,11 +1087,6 @@ const rowCtrlClickFunction = computed(() => {
|
||||||
</template>
|
</template>
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
</QDialog>
|
</QDialog>
|
||||||
<VnScroll
|
|
||||||
ref="vnScrollRef"
|
|
||||||
v-if="isTableMode"
|
|
||||||
:scroll-target="tableRef?.$el?.querySelector('.q-table__middle')"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
|
|
|
@ -13,6 +13,7 @@ import VnDms from 'src/components/common/VnDms.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import { useSession } from 'src/composables/useSession';
|
import { useSession } from 'src/composables/useSession';
|
||||||
|
import { toDate } from 'src/filters/index';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -118,7 +119,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
field: 'type',
|
field: 'dmsType',
|
||||||
label: t('globals.type'),
|
label: t('globals.type'),
|
||||||
name: 'type',
|
name: 'type',
|
||||||
component: QInput,
|
component: QInput,
|
||||||
|
@ -127,6 +128,7 @@ const columns = computed(() => [
|
||||||
borderless: true,
|
borderless: true,
|
||||||
'model-value': prop.row.dmsType?.name,
|
'model-value': prop.row.dmsType?.name,
|
||||||
}),
|
}),
|
||||||
|
format: (row) => row.name,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -172,6 +174,7 @@ const columns = computed(() => [
|
||||||
name: prop.row.worker?.user?.name.toLowerCase(),
|
name: prop.row.worker?.user?.name.toLowerCase(),
|
||||||
workerId: prop.row.worker?.id,
|
workerId: prop.row.worker?.id,
|
||||||
}),
|
}),
|
||||||
|
format: (row) => row?.user?.name,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -183,6 +186,7 @@ const columns = computed(() => [
|
||||||
disable: true,
|
disable: true,
|
||||||
'model-value': prop.row.created,
|
'model-value': prop.row.created,
|
||||||
}),
|
}),
|
||||||
|
format: (row) => toDate(row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'options',
|
field: 'options',
|
||||||
|
@ -298,6 +302,7 @@ defineExpose({
|
||||||
:data-key="$props.model"
|
:data-key="$props.model"
|
||||||
:url="$props.model"
|
:url="$props.model"
|
||||||
:user-filter="dmsFilter"
|
:user-filter="dmsFilter"
|
||||||
|
search-url="dmsFilter"
|
||||||
:order="['dmsFk DESC']"
|
:order="['dmsFk DESC']"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="setData"
|
@on-fetch="setData"
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import { ref, onMounted, onUnmounted, watch, nextTick } from 'vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
scrollTarget: { type: [String, Object], default: 'window' }
|
|
||||||
});
|
|
||||||
|
|
||||||
const scrollPosition = ref(0);
|
|
||||||
const showButton = ref(false);
|
|
||||||
let scrollContainer = null;
|
|
||||||
|
|
||||||
const onScroll = () => {
|
|
||||||
if (!scrollContainer) return;
|
|
||||||
scrollPosition.value =
|
|
||||||
typeof props.scrollTarget === 'object'
|
|
||||||
? scrollContainer.scrollTop
|
|
||||||
: window.scrollY;
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(scrollPosition, (newValue) => {
|
|
||||||
showButton.value = newValue > 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
const scrollToTop = () => {
|
|
||||||
if (scrollContainer) {
|
|
||||||
scrollContainer.scrollTo({ top: 0, behavior: 'smooth' });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const updateScrollContainer = (container) => {
|
|
||||||
if (container) {
|
|
||||||
if (scrollContainer) {
|
|
||||||
scrollContainer.removeEventListener('scroll', onScroll);
|
|
||||||
}
|
|
||||||
scrollContainer = container;
|
|
||||||
scrollContainer.addEventListener('scroll', onScroll);
|
|
||||||
onScroll();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
updateScrollContainer
|
|
||||||
});
|
|
||||||
|
|
||||||
const initScrollContainer = async () => {
|
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
if (typeof props.scrollTarget === 'object') {
|
|
||||||
scrollContainer = props.scrollTarget;
|
|
||||||
} else {
|
|
||||||
scrollContainer = window;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!scrollContainer) return
|
|
||||||
scrollContainer.addEventListener('scroll', onScroll);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
initScrollContainer();
|
|
||||||
});
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
if (scrollContainer) {
|
|
||||||
scrollContainer.removeEventListener('scroll', onScroll);
|
|
||||||
scrollContainer = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<QIcon
|
|
||||||
v-if="showButton"
|
|
||||||
color="primary"
|
|
||||||
name="keyboard_arrow_up"
|
|
||||||
class="scroll-to-top"
|
|
||||||
@click="scrollToTop"
|
|
||||||
>
|
|
||||||
<QTooltip>{{ $t('globals.scrollToTop') }}</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.scroll-to-top {
|
|
||||||
position: fixed;
|
|
||||||
top: 70px;
|
|
||||||
font-size: 65px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
z-index: 1000;
|
|
||||||
transition: transform 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scroll-to-top:hover {
|
|
||||||
transform: translateX(-50%) scale(1.2);
|
|
||||||
cursor: pointer;
|
|
||||||
filter: brightness(0.8);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ fr:
|
||||||
pt: Portugais
|
pt: Portugais
|
||||||
pt:
|
pt:
|
||||||
Send SMS: Enviar SMS
|
Send SMS: Enviar SMS
|
||||||
CustomerDefaultLanguage: Este cliente utiliza o {locale} como seu idioma padrão
|
CustomerDefaultLanguage: Este cliente utiliza o <strong>{locale}</strong> como seu idioma padrão
|
||||||
Language: Linguagem
|
Language: Linguagem
|
||||||
Phone: Móvel
|
Phone: Móvel
|
||||||
Subject: Assunto
|
Subject: Assunto
|
||||||
|
|
|
@ -212,7 +212,6 @@ const getLocale = (label) => {
|
||||||
color="primary"
|
color="primary"
|
||||||
style="position: fixed; z-index: 1; right: 0; bottom: 0"
|
style="position: fixed; z-index: 1; right: 0; bottom: 0"
|
||||||
icon="search"
|
icon="search"
|
||||||
data-cy="vnFilterPanel_search"
|
|
||||||
@click="search()"
|
@click="search()"
|
||||||
>
|
>
|
||||||
<QTooltip bottom anchor="bottom right">
|
<QTooltip bottom anchor="bottom right">
|
||||||
|
@ -230,7 +229,6 @@ const getLocale = (label) => {
|
||||||
<QItemSection top side>
|
<QItemSection top side>
|
||||||
<QBtn
|
<QBtn
|
||||||
@click="clearFilters"
|
@click="clearFilters"
|
||||||
data-cy="clearFilters"
|
|
||||||
color="primary"
|
color="primary"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
|
@ -294,7 +292,6 @@ const getLocale = (label) => {
|
||||||
</QList>
|
</QList>
|
||||||
</QForm>
|
</QForm>
|
||||||
<QInnerLoading
|
<QInnerLoading
|
||||||
data-cy="filterPanel-spinner"
|
|
||||||
:label="t('globals.pleaseWait')"
|
:label="t('globals.pleaseWait')"
|
||||||
:showing="isLoading"
|
:showing="isLoading"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -6,7 +6,6 @@ globals:
|
||||||
quantity: Quantity
|
quantity: Quantity
|
||||||
entity: Entity
|
entity: Entity
|
||||||
preview: Preview
|
preview: Preview
|
||||||
scrollToTop: Go up
|
|
||||||
user: User
|
user: User
|
||||||
details: Details
|
details: Details
|
||||||
collapseMenu: Collapse lateral menu
|
collapseMenu: Collapse lateral menu
|
||||||
|
@ -161,6 +160,9 @@ globals:
|
||||||
department: Department
|
department: Department
|
||||||
noData: No data available
|
noData: No data available
|
||||||
vehicle: Vehicle
|
vehicle: Vehicle
|
||||||
|
selectDocumentId: Select document id
|
||||||
|
import: Import from existing
|
||||||
|
document: Document
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Login
|
logIn: Login
|
||||||
addressEdit: Update address
|
addressEdit: Update address
|
||||||
|
@ -342,6 +344,7 @@ globals:
|
||||||
parking: Parking
|
parking: Parking
|
||||||
vehicleList: Vehicles
|
vehicleList: Vehicles
|
||||||
vehicle: Vehicle
|
vehicle: Vehicle
|
||||||
|
properties: Properties
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Unsaved changes will be lost
|
title: Unsaved changes will be lost
|
||||||
subtitle: Are you sure exit without saving?
|
subtitle: Are you sure exit without saving?
|
||||||
|
@ -390,6 +393,7 @@ errors:
|
||||||
updateUserConfig: Error updating user config
|
updateUserConfig: Error updating user config
|
||||||
tokenConfig: Error fetching token config
|
tokenConfig: Error fetching token config
|
||||||
writeRequest: The requested operation could not be completed
|
writeRequest: The requested operation could not be completed
|
||||||
|
documentIdEmpty: The document identifier can't be empty
|
||||||
login:
|
login:
|
||||||
title: Login
|
title: Login
|
||||||
username: Username
|
username: Username
|
||||||
|
|
|
@ -6,7 +6,6 @@ globals:
|
||||||
quantity: Cantidad
|
quantity: Cantidad
|
||||||
entity: Entidad
|
entity: Entidad
|
||||||
preview: Vista previa
|
preview: Vista previa
|
||||||
scrollToTop: Ir arriba
|
|
||||||
user: Usuario
|
user: Usuario
|
||||||
details: Detalles
|
details: Detalles
|
||||||
collapseMenu: Contraer menú lateral
|
collapseMenu: Contraer menú lateral
|
||||||
|
@ -165,6 +164,9 @@ globals:
|
||||||
noData: Datos no disponibles
|
noData: Datos no disponibles
|
||||||
department: Departamento
|
department: Departamento
|
||||||
vehicle: Vehículo
|
vehicle: Vehículo
|
||||||
|
selectDocumentId: Introduzca id de gestión documental
|
||||||
|
import: Importar desde existente
|
||||||
|
document: Documento
|
||||||
pageTitles:
|
pageTitles:
|
||||||
logIn: Inicio de sesión
|
logIn: Inicio de sesión
|
||||||
addressEdit: Modificar consignatario
|
addressEdit: Modificar consignatario
|
||||||
|
@ -345,6 +347,7 @@ globals:
|
||||||
parking: Parking
|
parking: Parking
|
||||||
vehicleList: Vehículos
|
vehicleList: Vehículos
|
||||||
vehicle: Vehículo
|
vehicle: Vehículo
|
||||||
|
properties: Propiedades
|
||||||
unsavedPopup:
|
unsavedPopup:
|
||||||
title: Los cambios que no haya guardado se perderán
|
title: Los cambios que no haya guardado se perderán
|
||||||
subtitle: ¿Seguro que quiere salir sin guardar?
|
subtitle: ¿Seguro que quiere salir sin guardar?
|
||||||
|
@ -386,6 +389,7 @@ errors:
|
||||||
updateUserConfig: Error al actualizar la configuración de usuario
|
updateUserConfig: Error al actualizar la configuración de usuario
|
||||||
tokenConfig: Error al obtener configuración de token
|
tokenConfig: Error al obtener configuración de token
|
||||||
writeRequest: No se pudo completar la operación solicitada
|
writeRequest: No se pudo completar la operación solicitada
|
||||||
|
documentIdEmpty: El número de documento no puede estar vacío
|
||||||
login:
|
login:
|
||||||
title: Inicio de sesión
|
title: Inicio de sesión
|
||||||
username: Nombre de usuario
|
username: Nombre de usuario
|
||||||
|
|
|
@ -11,7 +11,7 @@ const $props = defineProps({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy data-cy="CustomerDescriptor">
|
<QPopupProxy>
|
||||||
<CustomerDescriptor v-if="$props.id" :id="$props.id" :summary="CustomerSummary" />
|
<CustomerDescriptor v-if="$props.id" :id="$props.id" :summary="CustomerSummary" />
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { QBtn, useQuasar } from 'quasar';
|
import { QBtn, useQuasar } from 'quasar';
|
||||||
|
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
@ -73,11 +74,12 @@ const tableRef = ref();
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="CustomerSamples"
|
data-key="ClientSamples"
|
||||||
auto-load
|
auto-load
|
||||||
:user-filter="filter"
|
:filter="filter"
|
||||||
url="ClientSamples"
|
url="ClientSamples"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
:pagination="{ rowsPerPage: 12 }"
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
|
|
@ -228,15 +228,11 @@ async function handleTicketConfig(data) {
|
||||||
url="TicketConfigs"
|
url="TicketConfigs"
|
||||||
:filter="{ fields: ['lackAlertPrice'] }"
|
:filter="{ fields: ['lackAlertPrice'] }"
|
||||||
@on-fetch="handleTicketConfig"
|
@on-fetch="handleTicketConfig"
|
||||||
></FetchData>
|
auto-load
|
||||||
<QInnerLoading
|
|
||||||
:showing="isLoading"
|
|
||||||
:label="t && t('globals.pleaseWait')"
|
|
||||||
color="primary"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<VnTable
|
<VnTable
|
||||||
v-if="!isLoading"
|
v-if="ticketConfig"
|
||||||
auto-load
|
auto-load
|
||||||
data-cy="proposalTable"
|
data-cy="proposalTable"
|
||||||
ref="proposalTableRef"
|
ref="proposalTableRef"
|
||||||
|
|
|
@ -8,14 +8,14 @@ import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
class="q-pa-md"
|
class="q-pa-md"
|
||||||
:style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }"
|
:style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }"
|
||||||
>
|
>
|
||||||
<div style="flex: 0.3" data-cy="clientsOnWebsite">
|
<div style="flex: 0.3">
|
||||||
<span
|
<span
|
||||||
class="q-ml-md text-body1"
|
class="q-ml-md text-body1"
|
||||||
v-text="$t('salesMonitor.clientsOnWebsite')"
|
v-text="$t('salesMonitor.clientsOnWebsite')"
|
||||||
/>
|
/>
|
||||||
<SalesClientTable />
|
<SalesClientTable />
|
||||||
</div>
|
</div>
|
||||||
<div style="flex: 0.7" data-cy="recentOrderActions">
|
<div style="flex: 0.7">
|
||||||
<span
|
<span
|
||||||
class="q-ml-md text-body1"
|
class="q-ml-md text-body1"
|
||||||
v-text="$t('salesMonitor.recentOrderActions')"
|
v-text="$t('salesMonitor.recentOrderActions')"
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
import { useVnConfirm } from 'composables/useVnConfirm';
|
import { useVnConfirm } from 'composables/useVnConfirm';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
|
|
||||||
import useOpenURL from 'src/composables/useOpenURL';
|
import useOpenURL from 'src/composables/useOpenURL';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -166,7 +165,16 @@ const openTab = (id) => useOpenURL(`#/order/${id}/summary`);
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #column-dateSend="{ row }">
|
<template #column-dateSend="{ row }">
|
||||||
<VnDateBadge :date="row.date_send" />
|
<QTd>
|
||||||
|
<QBadge
|
||||||
|
:color="getBadgeColor(row.date_send)"
|
||||||
|
text-color="black"
|
||||||
|
class="q-pa-sm"
|
||||||
|
style="font-size: 14px"
|
||||||
|
>
|
||||||
|
{{ toDateFormat(row.date_send) }}
|
||||||
|
</QBadge>
|
||||||
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-clientFk="{ row }">
|
<template #column-clientFk="{ row }">
|
||||||
|
|
|
@ -9,7 +9,6 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
import { dateRange } from 'src/filters';
|
import { dateRange } from 'src/filters';
|
||||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
|
||||||
|
|
||||||
defineProps({ dataKey: { type: String, required: true } });
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
const { t, te } = useI18n();
|
const { t, te } = useI18n();
|
||||||
|
@ -210,7 +209,7 @@ const getLocale = (label) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnCheckbox
|
<QCheckbox
|
||||||
:label="t('params.myTeam')"
|
:label="t('params.myTeam')"
|
||||||
v-model="params.myTeam"
|
v-model="params.myTeam"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
|
@ -219,7 +218,7 @@ const getLocale = (label) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnCheckbox
|
<QCheckbox
|
||||||
:label="t('params.problems')"
|
:label="t('params.problems')"
|
||||||
v-model="params.problems"
|
v-model="params.problems"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
|
@ -228,7 +227,7 @@ const getLocale = (label) => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnCheckbox
|
<QCheckbox
|
||||||
:label="t('params.pending')"
|
:label="t('params.pending')"
|
||||||
v-model="params.pending"
|
v-model="params.pending"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
|
||||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||||
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
|
||||||
|
@ -167,11 +168,9 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
name: 'provinceFk',
|
name: 'provinceFk',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Provinces',
|
options: provinceOpts.value,
|
||||||
fields: ['id', 'name'],
|
'option-value': 'id',
|
||||||
sortBy: ['name ASC'],
|
'option-label': 'name',
|
||||||
optionValue: 'id',
|
|
||||||
optionLabel: 'name',
|
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -184,11 +183,9 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
name: 'stateFk',
|
name: 'stateFk',
|
||||||
attrs: {
|
attrs: {
|
||||||
sortBy: ['name ASC'],
|
options: stateOpts.value,
|
||||||
url: 'States',
|
'option-value': 'id',
|
||||||
fields: ['id', 'name'],
|
'option-label': 'name',
|
||||||
optionValue: 'id',
|
|
||||||
optionLabel: 'name',
|
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -215,12 +212,9 @@ const columns = computed(() => [
|
||||||
component: 'select',
|
component: 'select',
|
||||||
name: 'zoneFk',
|
name: 'zoneFk',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Zones',
|
options: zoneOpts.value,
|
||||||
fields: ['id', 'name'],
|
'option-value': 'id',
|
||||||
sortBy: ['name ASC'],
|
'option-label': 'name',
|
||||||
|
|
||||||
optionValue: 'id',
|
|
||||||
optionLabel: 'name',
|
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -231,12 +225,11 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'select',
|
component: 'select',
|
||||||
|
url: 'PayMethods',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'PayMethods',
|
options: PayMethodOpts.value,
|
||||||
fields: ['id', 'name'],
|
|
||||||
sortBy: ['id ASC'],
|
|
||||||
optionLabel: 'name',
|
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
|
optionLabel: 'name',
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -261,9 +254,7 @@ const columns = computed(() => [
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'Departments',
|
options: DepartmentOpts.value,
|
||||||
fields: ['id', 'name'],
|
|
||||||
sortBy: ['id ASC'],
|
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -274,12 +265,11 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
columnFilter: {
|
columnFilter: {
|
||||||
component: 'select',
|
component: 'select',
|
||||||
|
url: 'ItemPackingTypes',
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'ItemPackingTypes',
|
options: ItemPackingTypeOpts.value,
|
||||||
fields: ['code'],
|
'option-value': 'code',
|
||||||
sortBy: ['code ASC'],
|
'option-label': 'code',
|
||||||
optionValue: 'code',
|
|
||||||
optionCode: 'code',
|
|
||||||
dense: true,
|
dense: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -334,6 +324,60 @@ const totalPriceColor = (ticket) => {
|
||||||
const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
|
const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="Provinces"
|
||||||
|
:filter="{
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
order: 'name ASC',
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (provinceOpts = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="States"
|
||||||
|
:filter="{
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
order: 'name ASC',
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (stateOpts = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Zones"
|
||||||
|
:filter="{
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
order: 'name ASC',
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (zoneOpts = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="ItemPackingTypes"
|
||||||
|
:filter="{
|
||||||
|
fields: ['code'],
|
||||||
|
order: 'code ASC',
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (ItemPackingTypeOpts = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="Departments"
|
||||||
|
:filter="{
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
order: 'id ASC',
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (DepartmentOpts = data)"
|
||||||
|
/>
|
||||||
|
<FetchData
|
||||||
|
url="PayMethods"
|
||||||
|
:filter="{
|
||||||
|
fields: ['id', 'name'],
|
||||||
|
order: 'id ASC',
|
||||||
|
}"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (PayMethodOpts = data)"
|
||||||
|
/>
|
||||||
<MonitorTicketSearchbar />
|
<MonitorTicketSearchbar />
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
|
|
@ -0,0 +1,191 @@
|
||||||
|
<script setup>
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import FormModel from 'components/FormModel.vue';
|
||||||
|
import VnRow from 'components/ui/VnRow.vue';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const isNew = Boolean(!route.params.id);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSubToolbar v-if="isNew" />
|
||||||
|
<div class="q-pa-md">
|
||||||
|
<FormModel
|
||||||
|
:url-update="`Properties/${route.params.id}`"
|
||||||
|
model="Property"
|
||||||
|
auto-load
|
||||||
|
>
|
||||||
|
<template #form="{ data }">
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.name')"
|
||||||
|
v-model="data.name"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.cadaster')"
|
||||||
|
v-model="data.cadaster"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
url="propertyGroups"
|
||||||
|
:label="t('property.group')"
|
||||||
|
v-model="data.propertyGroupFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
hide-selected
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ `${scope.opt.id}: ${scope.opt.description}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnSelect
|
||||||
|
url="Companies"
|
||||||
|
:label="t('property.owner')"
|
||||||
|
v-model="data.companyFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
hide-selected
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ `${scope.opt.id}: ${scope.opt.code}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.map')"
|
||||||
|
v-model="data.url"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInputDate
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:label="t('property.purchased')"
|
||||||
|
v-model="data.purchased"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.value')"
|
||||||
|
v-model="data.value"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.protocol')"
|
||||||
|
v-model="data.protocol"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.smallHolding')"
|
||||||
|
v-model="data.smallHolding"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.area')"
|
||||||
|
v-model="data.area"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.allocation')"
|
||||||
|
v-model="data.allocation"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
url="Towns"
|
||||||
|
:label="t('property.town')"
|
||||||
|
v-model="data.townFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ `${scope.opt.id}: ${scope.opt.name}` }}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.m2')"
|
||||||
|
v-model="data.m2"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.registry')"
|
||||||
|
v-model="data.registry"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.tome')"
|
||||||
|
v-model="data.tome"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.book')"
|
||||||
|
v-model="data.book"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.page')"
|
||||||
|
v-model="data.page"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.farm')"
|
||||||
|
v-model="data.farm"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.registration')"
|
||||||
|
v-model="data.registration"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInputDate
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:label="t('property.booked')"
|
||||||
|
v-model="data.booked"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
:label="t('property.volume')"
|
||||||
|
v-model="data.volume"
|
||||||
|
fill-input
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
</template>
|
||||||
|
</FormModel>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<script setup>
|
||||||
|
import VnCard from 'components/common/VnCard.vue';
|
||||||
|
import PropertyDescriptor from 'pages/Property/Card/PropertyDescriptor.vue';
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnCard
|
||||||
|
data-key="Property"
|
||||||
|
url="Properties"
|
||||||
|
:descriptor="PropertyDescriptor"
|
||||||
|
:filter="{ where: { id: $route.params.id } }"
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -0,0 +1,60 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||||
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import PropertyCard from './PropertyCard.vue';
|
||||||
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
|
||||||
|
const { notify } = useNotify();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const entityId = computed(() => {
|
||||||
|
return Number(props.id || route.params.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
summary: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<CardDescriptor
|
||||||
|
v-bind="$attrs"
|
||||||
|
:id="entityId"
|
||||||
|
:card="PropertyCard"
|
||||||
|
title="name"
|
||||||
|
module="Property"
|
||||||
|
>
|
||||||
|
<template #body="{ entity }">
|
||||||
|
<VnLv :label="$t('property.owner')" :value="entity.company.code" />
|
||||||
|
<VnLv
|
||||||
|
:label="$t('property.group')"
|
||||||
|
:value="entity.propertyGroup.description"
|
||||||
|
/>
|
||||||
|
<VnLv :label="$t('property.notary')">
|
||||||
|
<template #value>
|
||||||
|
<span class="link">
|
||||||
|
{{ entity?.supplier?.name || '-' }}
|
||||||
|
<SupplierDescriptorProxy :id="entity?.supplierFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
|
<VnLv :label="$t('property.protocol')" :value="entity.protocol" copy />
|
||||||
|
<VnLv :label="$t('property.cadaster')" :value="entity.cadaster" copy />
|
||||||
|
<VnLv :label="$t('property.farm')" :value="entity.farm" />
|
||||||
|
<VnLv :label="$t('property.area')" :value="entity.area" />
|
||||||
|
</template>
|
||||||
|
</CardDescriptor>
|
||||||
|
</template>
|
|
@ -0,0 +1,42 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import VnDmsList from 'src/components/common/VnDmsList.vue';
|
||||||
|
import PropertyDmsImportForm from 'src/pages/Property/Card/PropertyDmsImportForm.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const dmsListRef = ref(null);
|
||||||
|
const showImportDialog = ref(false);
|
||||||
|
|
||||||
|
const onDataSaved = () => dmsListRef.value.dmsRef.fetch();
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnDmsList
|
||||||
|
ref="dmsListRef"
|
||||||
|
model="PropertyDms"
|
||||||
|
update-model="PropertyDms"
|
||||||
|
delete-model="PropertyDms"
|
||||||
|
download-model="dms"
|
||||||
|
default-dms-code="property"
|
||||||
|
filter="propertyFk"
|
||||||
|
/>
|
||||||
|
<QDialog v-model="showImportDialog">
|
||||||
|
<PropertyDmsImportForm @on-data-saved="onDataSaved()" />
|
||||||
|
</QDialog>
|
||||||
|
<QPageSticky position="bottom-right" :offset="[25, 90]">
|
||||||
|
<QBtn
|
||||||
|
fab
|
||||||
|
color="primary"
|
||||||
|
icon="file_copy"
|
||||||
|
@click="showImportDialog = true"
|
||||||
|
class="fill-icon"
|
||||||
|
data-cy="importBtn"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('globals.import') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QBtn>
|
||||||
|
</QPageSticky>
|
||||||
|
</template>
|
|
@ -0,0 +1,65 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import FormModelPopup from 'components/FormModelPopup.vue';
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const emit = defineEmits(['onDataSaved']);
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const dmsOptions = ref([]);
|
||||||
|
const dmsId = ref(null);
|
||||||
|
|
||||||
|
const importDms = async () => {
|
||||||
|
try {
|
||||||
|
if (!dmsId.value) throw new Error(t(`globals.errors.documentIdEmpty`));
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
propertyFk: route.params.id,
|
||||||
|
dmsFk: dmsId.value,
|
||||||
|
};
|
||||||
|
|
||||||
|
await axios.post('propertyDms', data);
|
||||||
|
notify(t('globals.dataSaved'), 'positive');
|
||||||
|
dmsId.value = null;
|
||||||
|
emit('onDataSaved');
|
||||||
|
} catch (e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
url="Dms"
|
||||||
|
:filter="{ fields: ['id'], order: 'id ASC' }"
|
||||||
|
auto-load
|
||||||
|
@on-fetch="(data) => (dmsOptions = data)"
|
||||||
|
/>
|
||||||
|
<FormModelPopup
|
||||||
|
model="DmsImport"
|
||||||
|
:title="t('globals.selectDocumentId')"
|
||||||
|
:form-initial-data="{}"
|
||||||
|
:save-fn="importDms"
|
||||||
|
>
|
||||||
|
<template #form-inputs>
|
||||||
|
<VnSelect
|
||||||
|
:label="t('globals.document')"
|
||||||
|
:options="dmsOptions"
|
||||||
|
hide-selected
|
||||||
|
option-label="id"
|
||||||
|
option-value="id"
|
||||||
|
v-model="dmsId"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</FormModelPopup>
|
||||||
|
</template>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<script setup>
|
||||||
|
import VnLog from 'src/components/common/VnLog.vue';
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VnLog model="Property" url="/PropertyLogs" />
|
||||||
|
</template>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
|
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const state = useState();
|
||||||
|
const user = state.getUser();
|
||||||
|
const propertyId = computed(() => route.params.id);
|
||||||
|
|
||||||
|
const noteFilter = computed(() => {
|
||||||
|
return {
|
||||||
|
order: 'created DESC',
|
||||||
|
where: { propertyFk: propertyId.value },
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
propertyFk: propertyId.value,
|
||||||
|
workerFk: user.value.id,
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnNotes
|
||||||
|
url="propertyObservations"
|
||||||
|
:add-note="true"
|
||||||
|
:filter="noteFilter"
|
||||||
|
:body="body"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</template>
|
|
@ -0,0 +1,349 @@
|
||||||
|
<script setup>
|
||||||
|
import { onMounted, ref, computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
|
||||||
|
import CardSummary from 'components/ui/CardSummary.vue';
|
||||||
|
import VnLv from 'src/components/ui/VnLv.vue';
|
||||||
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
|
import useNotify from 'src/composables/useNotify.js';
|
||||||
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
|
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
|
import VnToSummary from 'src/components/ui/VnToSummary.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||||
|
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||||
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
|
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const { notify } = useNotify();
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const dmsColumns = ref([
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.id'),
|
||||||
|
name: 'id',
|
||||||
|
field: ({ id }) => id,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.type'),
|
||||||
|
name: 'type',
|
||||||
|
field: ({ type }) => type?.name,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.order'),
|
||||||
|
name: 'order',
|
||||||
|
field: ({ hardCopyNumber }) => dashIfEmpty(hardCopyNumber),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.reference'),
|
||||||
|
name: 'reference',
|
||||||
|
field: ({ reference }) => dashIfEmpty(reference),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.description'),
|
||||||
|
name: 'description',
|
||||||
|
field: ({ description }) => dashIfEmpty(description),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.original'),
|
||||||
|
name: 'hasFile',
|
||||||
|
toolTip: t('The documentation is available in paper form'),
|
||||||
|
component: 'checkbox',
|
||||||
|
field: ({ hasFile }) => hasFile,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.worker'),
|
||||||
|
name: 'worker',
|
||||||
|
field: ({ worker }) => worker?.name,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
label: t('globals.created'),
|
||||||
|
name: 'created',
|
||||||
|
field: ({ created }) => toDate(created),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const entityId = computed(() => $props.id || route.params.id);
|
||||||
|
|
||||||
|
const summary = ref();
|
||||||
|
const property = computed(() => summary.value?.entity);
|
||||||
|
const propertyUrl = ref();
|
||||||
|
const propertyDms = ref(null);
|
||||||
|
|
||||||
|
const descriptorData = useArrayData('Property');
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
propertyUrl.value = (await getUrl('property/')) + entityId.value + '/';
|
||||||
|
});
|
||||||
|
|
||||||
|
function toPropertyUrl(section) {
|
||||||
|
return '#/property/' + entityId.value + '/' + section;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<FetchData
|
||||||
|
ref="propertyDms"
|
||||||
|
:url="`Properties/${entityId}/dms`"
|
||||||
|
@on-fetch="
|
||||||
|
(data) => {
|
||||||
|
propertyDms.value = data;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<CardSummary
|
||||||
|
ref="summary"
|
||||||
|
:url="`Properties/${entityId}/summary`"
|
||||||
|
data-key="PropertySummary"
|
||||||
|
v-bind="$attrs.width"
|
||||||
|
>
|
||||||
|
<template #header-left>
|
||||||
|
<VnToSummary
|
||||||
|
v-if="route?.name !== 'PropertySummary'"
|
||||||
|
:route-name="'PropertySummary'"
|
||||||
|
:entity-id="entityId"
|
||||||
|
:url="PropertyUrl"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #header="{ entity }">
|
||||||
|
<div>Property #{{ entity.id }} - {{ entity.name }}</div>
|
||||||
|
</template>
|
||||||
|
<template #menu="{ entity }">
|
||||||
|
<!-- <PropertyDescriptorMenu :ticket="entity" /> -->
|
||||||
|
</template>
|
||||||
|
<template #body="{ entity }">
|
||||||
|
<QCard class="vn-one">
|
||||||
|
<VnTitle
|
||||||
|
:url="toPropertyUrl('basic-data')"
|
||||||
|
:text="t('globals.summary.basicData')"
|
||||||
|
data-cy="titleBasicDataBlock1"
|
||||||
|
/>
|
||||||
|
<div class="vn-card-group">
|
||||||
|
<div class="vn-card-content">
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.owner')"
|
||||||
|
:value="dashIfEmpty(entity.company.code)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.map')"
|
||||||
|
:value="dashIfEmpty(entity.url)"
|
||||||
|
copy
|
||||||
|
>
|
||||||
|
<template #value>
|
||||||
|
<a
|
||||||
|
v-if="entity?.url"
|
||||||
|
:href="`${entity?.url}`"
|
||||||
|
target="_blank"
|
||||||
|
class="grafana"
|
||||||
|
data-cy="propertyMapLink"
|
||||||
|
>
|
||||||
|
{{ t('property.goToMap') }}
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.value')"
|
||||||
|
:value="toCurrency(entity.value)"
|
||||||
|
/>
|
||||||
|
<VnLv :label="$t('property.notary')">
|
||||||
|
<template #value>
|
||||||
|
<span class="link">
|
||||||
|
{{ entity?.supplier?.name || '-' }}
|
||||||
|
<SupplierDescriptorProxy :id="entity?.supplierFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</VnLv>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.protocol')"
|
||||||
|
:value="dashIfEmpty(entity.protocol)"
|
||||||
|
copy
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.purchased')"
|
||||||
|
:value="toDate(entity.purchased)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.booked')"
|
||||||
|
:value="toDate(entity.booked)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</QCard>
|
||||||
|
<QCard class="vn-one">
|
||||||
|
<VnTitle
|
||||||
|
:url="toPropertyUrl('basic-data')"
|
||||||
|
:text="t('globals.summary.basicData')"
|
||||||
|
data-cy="titleBasicDataBlock2"
|
||||||
|
/>
|
||||||
|
<div class="vn-card-content">
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.cadaster')"
|
||||||
|
:value="dashIfEmpty(entity.cadaster)"
|
||||||
|
copy
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.smallHolding')"
|
||||||
|
:value="dashIfEmpty(entity.smallHolding)"
|
||||||
|
/>
|
||||||
|
<VnLv :label="t('property.area')" :value="dashIfEmpty(entity.area)" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.allocation')"
|
||||||
|
:value="dashIfEmpty(entity.allocation)"
|
||||||
|
/>
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.town')"
|
||||||
|
:value="dashIfEmpty(entity.town.name)"
|
||||||
|
/>
|
||||||
|
<VnLv :label="t('property.m2')" :value="dashIfEmpty(entity.m2)" />
|
||||||
|
</div>
|
||||||
|
</QCard>
|
||||||
|
<QCard class="vn-one">
|
||||||
|
<VnTitle
|
||||||
|
:url="toPropertyUrl('basic-data')"
|
||||||
|
:text="t('globals.summary.basicData')"
|
||||||
|
data-cy="titleBasicDataBlock3"
|
||||||
|
/>
|
||||||
|
<div class="vn-card-content">
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.registry')"
|
||||||
|
:value="dashIfEmpty(entity.registry)"
|
||||||
|
/>
|
||||||
|
<VnLv :label="t('property.tome')" :value="dashIfEmpty(entity.tome)" />
|
||||||
|
<VnLv :label="t('property.book')" :value="dashIfEmpty(entity.book)" />
|
||||||
|
<VnLv :label="t('property.page')" :value="dashIfEmpty(entity.page)" />
|
||||||
|
<VnLv :label="t('property.farm')" :value="dashIfEmpty(entity.farm)" />
|
||||||
|
<VnLv
|
||||||
|
:label="t('property.registration')"
|
||||||
|
:value="dashIfEmpty(entity.registration)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</QCard>
|
||||||
|
<QCard v-if="entity?.propertyDms.length > 0" class="vn-max">
|
||||||
|
<VnTitle
|
||||||
|
:url="toPropertyUrl('dms')"
|
||||||
|
:text="t('globals.pageTitles.dms')"
|
||||||
|
data-cy="titleDmsBlock"
|
||||||
|
/>
|
||||||
|
<QTable :columns="dmsColumns" :rows="entity?.propertyDms" flat>
|
||||||
|
<template #header="props">
|
||||||
|
<QTr :props="props">
|
||||||
|
<QTh auto-width class="text-left">{{ t('globals.id') }}</QTh>
|
||||||
|
<QTh auto-width class="text-left">{{
|
||||||
|
t('globals.type')
|
||||||
|
}}</QTh>
|
||||||
|
<QTh auto-width class="text-left">{{
|
||||||
|
t('globals.order')
|
||||||
|
}}</QTh>
|
||||||
|
<QTh auto-width class="text-left">{{
|
||||||
|
t('globals.reference')
|
||||||
|
}}</QTh>
|
||||||
|
<QTh auto-width class="text-left">{{
|
||||||
|
t('globals.description')
|
||||||
|
}}</QTh>
|
||||||
|
<QTh auto-width class="text-center">{{
|
||||||
|
t('globals.original')
|
||||||
|
}}</QTh>
|
||||||
|
<QTh auto-width class="text-left">{{
|
||||||
|
t('globals.worker')
|
||||||
|
}}</QTh>
|
||||||
|
<QTh auto-width class="text-center">{{
|
||||||
|
t('globals.created')
|
||||||
|
}}</QTh>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
|
<template #body="props">
|
||||||
|
<QTr :props="props">
|
||||||
|
<QTd class="text-left">{{ props.row.dms.id }}</QTd>
|
||||||
|
<QTd class="text-left">{{ props.row.dms.dmsType.name }}</QTd>
|
||||||
|
<QTd class="text-left">{{
|
||||||
|
props.row.dms.hardCopyNumber
|
||||||
|
}}</QTd>
|
||||||
|
<QTd class="text-left">{{ props.row.dms.reference }}</QTd>
|
||||||
|
<QTd class="text-left">{{ props.row.dms.description }}</QTd>
|
||||||
|
<QTd class="text-center"
|
||||||
|
><VnCheckbox
|
||||||
|
:disable="true"
|
||||||
|
v-model="props.row.dms.hasFile"
|
||||||
|
/></QTd>
|
||||||
|
<QTd class="text-left"
|
||||||
|
><span class="link" @click.stop
|
||||||
|
>{{ props.row.dms.worker.firstName
|
||||||
|
}}<WorkerDescriptorProxy
|
||||||
|
:id="props.row.dms.worker.id" /></span
|
||||||
|
></QTd>
|
||||||
|
<QTd class="text-center">{{
|
||||||
|
toDate(props.row.dms.created)
|
||||||
|
}}</QTd>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
|
</QTable>
|
||||||
|
</QCard>
|
||||||
|
<QCard v-if="entity?.notes.length > 0" class="vn-max">
|
||||||
|
<VnTitle
|
||||||
|
:url="toPropertyUrl('notes')"
|
||||||
|
:text="t('globals.notes')"
|
||||||
|
data-cy="titleNotesBlock"
|
||||||
|
/>
|
||||||
|
<QCardSection
|
||||||
|
v-if="entity?.notes"
|
||||||
|
v-for="note in entity?.notes"
|
||||||
|
horizontal
|
||||||
|
class="q-pb-sm"
|
||||||
|
>
|
||||||
|
<VnAvatar
|
||||||
|
:descriptor="false"
|
||||||
|
:worker-id="note.workerFk"
|
||||||
|
size="md"
|
||||||
|
:title="note.worker?.user.nickname"
|
||||||
|
class="q-pr-xs"
|
||||||
|
/>
|
||||||
|
<VnUserLink
|
||||||
|
:name="`${note.worker.user.name}`"
|
||||||
|
:worker-id="note.worker.id"
|
||||||
|
/>
|
||||||
|
<span class="q-pr-xs">{{ ':' }}</span>
|
||||||
|
<span class="no-margin">
|
||||||
|
{{ note.text }}
|
||||||
|
</span>
|
||||||
|
</QCardSection>
|
||||||
|
</QCard>
|
||||||
|
</template>
|
||||||
|
</CardSummary>
|
||||||
|
</template>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.q-card.q-card--dark.q-dark.vn-one {
|
||||||
|
& > .bodyCard {
|
||||||
|
padding: 1%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-table {
|
||||||
|
tr,
|
||||||
|
th,
|
||||||
|
.q-td {
|
||||||
|
border-bottom: 1px solid black;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.grafana {
|
||||||
|
color: $primary-light;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,182 @@
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const props = defineProps({
|
||||||
|
dataKey: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
|
<template #tags="{ tag, formatFn }">
|
||||||
|
<div class="q-gutter-x-xs">
|
||||||
|
<strong>{{ t(`property.params.${tag.label}`) }}: </strong>
|
||||||
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #body="{ params, searchFn }">
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.id"
|
||||||
|
:label="t('property.id')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="idInput"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.name"
|
||||||
|
:label="t('property.name')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="nameInput"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
url="PropertyGroups"
|
||||||
|
:label="t('property.group')"
|
||||||
|
v-model="params.propertyGroupFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="propertyGroupSelect"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
url="Suppliers"
|
||||||
|
:label="t('property.notary')"
|
||||||
|
v-model="params.supplierFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="notarySelect"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.protocol"
|
||||||
|
:label="t('property.protocol')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="protocolInput"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInput
|
||||||
|
v-model="params.cadaster"
|
||||||
|
:label="t('property.cadaster')"
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
data-cy="cadasterInput"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
url="Companies"
|
||||||
|
:label="t('property.owner')"
|
||||||
|
v-model="params.companyFk"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="ownerSelect"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
v-model="params.purchased"
|
||||||
|
:label="t('property.purchased')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="purchasedDateInput"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
<QItemSection>
|
||||||
|
<VnInputDate
|
||||||
|
v-model="params.booked"
|
||||||
|
:label="t('property.booked')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="bookedDateInput"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnCheckbox
|
||||||
|
v-model="params.hasFormalization"
|
||||||
|
:label="t('property.hasFormalization')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="hasFormalizationCheckbox"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnCheckbox
|
||||||
|
v-model="params.hasSimpleCopy"
|
||||||
|
:label="t('property.hasSimpleCopy')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="hasSimpleCopyCheckbox"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnCheckbox
|
||||||
|
v-model="params.hasOriginalPropertyDeed"
|
||||||
|
:label="t('property.hasOriginalPropertyDeed')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="hasOriginalPropertyDeedCheckbox"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnCheckbox
|
||||||
|
v-model="params.hasFundProvision"
|
||||||
|
:label="t('property.hasFundProvision')"
|
||||||
|
dense
|
||||||
|
filled
|
||||||
|
data-cy="hasFundProvisionCheckbox"
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnFilterPanel>
|
||||||
|
</template>
|
|
@ -0,0 +1,307 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { toDate } from 'src/filters/index';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
|
import PropertyFilter from './PropertyFilter.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
|
import SupplierDescriptorProxy from '../Supplier/Card/SupplierDescriptorProxy.vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const tableRef = ref();
|
||||||
|
|
||||||
|
const dataKey = 'PropertyList';
|
||||||
|
|
||||||
|
const columns = computed(() => [
|
||||||
|
{
|
||||||
|
align: 'right',
|
||||||
|
name: 'id',
|
||||||
|
label: t('property.id'),
|
||||||
|
width: '35px',
|
||||||
|
chip: {
|
||||||
|
condition: () => true,
|
||||||
|
},
|
||||||
|
isId: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'name',
|
||||||
|
label: t('property.name'),
|
||||||
|
isTitle: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'propertyGroupFk',
|
||||||
|
label: t('property.group'),
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'propertyGroups',
|
||||||
|
fields: ['id', 'description'],
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'description',
|
||||||
|
hideSelected: true,
|
||||||
|
},
|
||||||
|
format: ({ propertyGroup }) => propertyGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('property.group'),
|
||||||
|
name: 'propertyGroup',
|
||||||
|
cardVisible: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'notary',
|
||||||
|
label: t('property.notary'),
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'protocol',
|
||||||
|
label: t('property.protocol'),
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'cadaster',
|
||||||
|
label: t('property.cadaster'),
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'companyFk',
|
||||||
|
label: t('property.owner'),
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Companies',
|
||||||
|
fields: ['id', 'code'],
|
||||||
|
optionValue: 'id',
|
||||||
|
optionLabel: 'code',
|
||||||
|
hideSelected: true,
|
||||||
|
},
|
||||||
|
format: ({ companyCode }) => companyCode,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('property.owner'),
|
||||||
|
name: 'companyCode',
|
||||||
|
cardVisible: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'purchased',
|
||||||
|
label: t('property.purchased'),
|
||||||
|
component: 'date',
|
||||||
|
format: ({ purchased }) => toDate(purchased),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('property.purchased'),
|
||||||
|
name: 'purchased',
|
||||||
|
format: ({ purchased }) => toDate(purchased),
|
||||||
|
cardVisible: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
align: 'left',
|
||||||
|
name: 'booked',
|
||||||
|
label: t('property.booked'),
|
||||||
|
component: 'date',
|
||||||
|
format: ({ booked }) => toDate(booked),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('property.booked'),
|
||||||
|
name: 'booked',
|
||||||
|
format: ({ booked }) => toDate(booked),
|
||||||
|
cardVisible: true,
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
labelAbbreviation: 'Fo',
|
||||||
|
label: t('property.hasFormalization'),
|
||||||
|
toolTip: t('property.hasFormalization'),
|
||||||
|
name: 'hasFormalization',
|
||||||
|
component: 'checkbox',
|
||||||
|
width: '35px',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
labelAbbreviation: 'SC',
|
||||||
|
label: t('property.hasSimpleCopy'),
|
||||||
|
toolTip: t('property.hasSimpleCopy'),
|
||||||
|
name: 'hasSimpleCopy',
|
||||||
|
component: 'checkbox',
|
||||||
|
width: '35px',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
labelAbbreviation: 'OP',
|
||||||
|
label: t('property.hasOriginalPropertyDeed'),
|
||||||
|
toolTip: t('property.hasOriginalPropertyDeed'),
|
||||||
|
name: 'hasOriginalPropertyDeed',
|
||||||
|
component: 'checkbox',
|
||||||
|
width: '35px',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
labelAbbreviation: 'FP',
|
||||||
|
label: t('property.hasFundProvision'),
|
||||||
|
toolTip: t('property.hasFundProvision'),
|
||||||
|
name: 'hasFundProvision',
|
||||||
|
component: 'checkbox',
|
||||||
|
width: '35px',
|
||||||
|
cardVisible: true,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSection
|
||||||
|
:data-key="dataKey"
|
||||||
|
:columns="columns"
|
||||||
|
prefix="property"
|
||||||
|
:array-data-props="{
|
||||||
|
url: 'Properties/filter',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #advanced-menu>
|
||||||
|
<PropertyFilter :data-key="dataKey" />
|
||||||
|
</template>
|
||||||
|
<template #body>
|
||||||
|
<VnTable
|
||||||
|
ref="tableRef"
|
||||||
|
:data-key="dataKey"
|
||||||
|
:columns="columns"
|
||||||
|
redirect="property"
|
||||||
|
search-url="PropertyList"
|
||||||
|
:create="{
|
||||||
|
urlCreate: 'Properties',
|
||||||
|
title: t('property.createProperty'),
|
||||||
|
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||||
|
formInitialData: {},
|
||||||
|
}"
|
||||||
|
:with-filters="false"
|
||||||
|
:right-search="false"
|
||||||
|
>
|
||||||
|
<template #column-name="{ row }">
|
||||||
|
<span>
|
||||||
|
{{ row.name }}
|
||||||
|
<QTooltip>
|
||||||
|
{{ row.name }}
|
||||||
|
</QTooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #column-notary="{ row }">
|
||||||
|
<span class="link" @click.stop>
|
||||||
|
{{ row.notary }}
|
||||||
|
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #more-create-dialog="{ data }">
|
||||||
|
<div class="col-span-2">
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.name" :label="$t('property.name')" />
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
url="Suppliers"
|
||||||
|
v-model="data.supplierFk"
|
||||||
|
:label="$t('property.notary')"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
hide-selected
|
||||||
|
/>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.protocol"
|
||||||
|
:label="$t('property.protocol')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
url="Companies"
|
||||||
|
:fields="['id', 'code']"
|
||||||
|
v-model="data.companyFk"
|
||||||
|
:label="$t('property.owner')"
|
||||||
|
option-value="id"
|
||||||
|
option-label="code"
|
||||||
|
hide-selected
|
||||||
|
/>
|
||||||
|
<VnSelect
|
||||||
|
url="PropertyGroups"
|
||||||
|
:fields="['id', 'description']"
|
||||||
|
v-model="data.propertyGroupFk"
|
||||||
|
:label="$t('property.group')"
|
||||||
|
option-value="id"
|
||||||
|
option-label="description"
|
||||||
|
hide-selected
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.url" :label="$t('property.map')" />
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.value" :label="$t('property.value')" />
|
||||||
|
<VnInputDate
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:label="$t('property.purchased')"
|
||||||
|
v-model="data.purchased"
|
||||||
|
/>
|
||||||
|
<VnInputDate
|
||||||
|
placeholder="dd-mm-aaa"
|
||||||
|
:label="$t('property.booked')"
|
||||||
|
v-model="data.booked"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.cadaster"
|
||||||
|
:label="$t('property.cadaster')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.smallHolding"
|
||||||
|
:label="$t('property.smallHolding')"
|
||||||
|
/>
|
||||||
|
<VnInput v-model="data.area" :label="$t('property.area')" />
|
||||||
|
<VnInput
|
||||||
|
v-model="data.allocation"
|
||||||
|
:label="$t('property.allocation')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnSelect
|
||||||
|
url="Towns"
|
||||||
|
v-model="data.townFk"
|
||||||
|
:label="$t('property.town')"
|
||||||
|
:fields="['id', 'name']"
|
||||||
|
:options="towns"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
hide-selected
|
||||||
|
/>
|
||||||
|
<VnInput v-model="data.m2" :label="$t('property.m2')" />
|
||||||
|
<VnInput
|
||||||
|
v-model="data.registry"
|
||||||
|
:label="$t('property.registry')"
|
||||||
|
/>
|
||||||
|
</VnRow>
|
||||||
|
<VnRow>
|
||||||
|
<VnInput v-model="data.tome" :label="$t('property.tome')" />
|
||||||
|
<VnInput v-model="data.book" :label="$t('property.book')" />
|
||||||
|
<VnInput v-model="data.page" :label="$t('property.page')" />
|
||||||
|
<VnInput v-model="data.farm" :label="$t('property.farm')" />
|
||||||
|
</VnRow>
|
||||||
|
<VnInput
|
||||||
|
v-model="data.registration"
|
||||||
|
:label="$t('property.registration')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</VnTable>
|
||||||
|
</template>
|
||||||
|
</VnSection>
|
||||||
|
</template>
|
|
@ -0,0 +1,47 @@
|
||||||
|
property:
|
||||||
|
search: Search property
|
||||||
|
searchInfo: Search property by id or name
|
||||||
|
id: Id
|
||||||
|
name: Name
|
||||||
|
cadaster: Cadaster
|
||||||
|
smallHolding: Small holding
|
||||||
|
area: Area
|
||||||
|
town: Town
|
||||||
|
registry: Registry
|
||||||
|
volume: Volume
|
||||||
|
book: Book
|
||||||
|
page: Page
|
||||||
|
farm: Farm
|
||||||
|
registration: Registration
|
||||||
|
value: Value
|
||||||
|
group: Group
|
||||||
|
m2: m2
|
||||||
|
owner: Owner
|
||||||
|
allocation: Allocation
|
||||||
|
tome: Tome
|
||||||
|
map: Map
|
||||||
|
notary: Notary
|
||||||
|
protocol: Notarial protocol
|
||||||
|
purchased: Purchased date
|
||||||
|
booked: Booked date
|
||||||
|
createProperty: Create property
|
||||||
|
goToMap: Link to map
|
||||||
|
hasFormalization: Formalization
|
||||||
|
hasSimpleCopy: Simple copy
|
||||||
|
hasOriginalPropertyDeed: Original property deed
|
||||||
|
hasFundProvision: Fund provision
|
||||||
|
params:
|
||||||
|
search: General search
|
||||||
|
id: Id
|
||||||
|
name: Name
|
||||||
|
supplierFk: Notary
|
||||||
|
propertyGroupFk: Group
|
||||||
|
protocol: Notarial protocol
|
||||||
|
companyFk: Owner
|
||||||
|
purchased: Purchased date
|
||||||
|
booked: Booked date
|
||||||
|
cadaster: Cadaster
|
||||||
|
hasFormalization: Formalization
|
||||||
|
hasSimpleCopy: Simple copy
|
||||||
|
hasOriginalPropertyDeed: Original property deed
|
||||||
|
hasFundProvision: Fund provision
|
|
@ -0,0 +1,47 @@
|
||||||
|
property:
|
||||||
|
search: Buscar propiedad
|
||||||
|
searchInfo: Buscar propiedad por id o nombre
|
||||||
|
id: Id
|
||||||
|
name: Nombre
|
||||||
|
cadaster: Ref. catastral
|
||||||
|
smallHolding: Parcela
|
||||||
|
area: Polígono
|
||||||
|
town: Municipio
|
||||||
|
registry: Registro urbanístico
|
||||||
|
volume: Volumen
|
||||||
|
book: Libro
|
||||||
|
page: Folio
|
||||||
|
farm: Finca
|
||||||
|
registration: Inscripción
|
||||||
|
value: Valor
|
||||||
|
group: Grupo
|
||||||
|
m2: m2
|
||||||
|
owner: Propietario
|
||||||
|
allocation: Partida
|
||||||
|
tome: Volumen
|
||||||
|
map: Mapa
|
||||||
|
notary: Notario
|
||||||
|
protocol: Prot. notarial
|
||||||
|
purchased: F. compra
|
||||||
|
booked: F. finalización
|
||||||
|
createProperty: Nueva propiedad
|
||||||
|
goToMap: Ir al mapa
|
||||||
|
hasFormalization: Formalización
|
||||||
|
hasSimpleCopy: Copia simple
|
||||||
|
hasOriginalPropertyDeed: Escritura original
|
||||||
|
hasFundProvision: Provisión de fondos
|
||||||
|
params:
|
||||||
|
search: Búsqueda general
|
||||||
|
id: Id
|
||||||
|
name: Nombre
|
||||||
|
supplierFk: Notario
|
||||||
|
propertyGroupFk: Grupo
|
||||||
|
protocol: Prot. notarial
|
||||||
|
companyFk: Propietario
|
||||||
|
purchased: F. compra
|
||||||
|
booked: F. finalización
|
||||||
|
cadaster: Ref. catastral
|
||||||
|
hasFormalization: Formalización
|
||||||
|
hasSimpleCopy: Copia simple
|
||||||
|
hasOriginalPropertyDeed: Escritura original
|
||||||
|
hasFundProvision: Provisión de fondos
|
|
@ -28,7 +28,6 @@ const body = {
|
||||||
:add-note="true"
|
:add-note="true"
|
||||||
:filter="noteFilter"
|
:filter="noteFilter"
|
||||||
:body="body"
|
:body="body"
|
||||||
style="overflow-y: auto"
|
|
||||||
required
|
required
|
||||||
deletable
|
deletable
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -10,7 +10,7 @@ const $props = defineProps({
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy data-cy="TicketDescriptor">
|
<QPopupProxy>
|
||||||
<TicketDescriptor v-if="$props.id" :id="$props.id" :summary="TicketSummary" />
|
<TicketDescriptor v-if="$props.id" :id="$props.id" :summary="TicketSummary" />
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -35,13 +35,8 @@ const onDataSaved = () => dmsListRef.value.dmsRef.fetch();
|
||||||
class="fill-icon"
|
class="fill-icon"
|
||||||
>
|
>
|
||||||
<QTooltip>
|
<QTooltip>
|
||||||
{{ t('Import from existing') }}
|
{{ t('globals.import') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QPageSticky>
|
</QPageSticky>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Import from existing: Importar desde existente
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ const dmsId = ref(null);
|
||||||
|
|
||||||
const importDms = async () => {
|
const importDms = async () => {
|
||||||
try {
|
try {
|
||||||
if (!dmsId.value) throw new Error(t(`The document identifier can't be empty`));
|
if (!dmsId.value) throw new Error(t(`globals.errors.documentIdEmpty`));
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
ticketFk: route.params.id,
|
ticketFk: route.params.id,
|
||||||
|
@ -34,7 +34,7 @@ const importDms = async () => {
|
||||||
dmsId.value = null;
|
dmsId.value = null;
|
||||||
emit('onDataSaved');
|
emit('onDataSaved');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(e.message);
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -49,14 +49,14 @@ const importDms = async () => {
|
||||||
<FormModelPopup
|
<FormModelPopup
|
||||||
url-create="genera"
|
url-create="genera"
|
||||||
model="DmsImport"
|
model="DmsImport"
|
||||||
:title="t('Select document id')"
|
:title="t('globals.selectDocumentId')"
|
||||||
:form-initial-data="{}"
|
:form-initial-data="{}"
|
||||||
:save-fn="importDms"
|
:save-fn="importDms"
|
||||||
>
|
>
|
||||||
<template #form-inputs>
|
<template #form-inputs>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Document')"
|
:label="t('globals.document')"
|
||||||
:options="dmsOptions"
|
:options="dmsOptions"
|
||||||
hide-selected
|
hide-selected
|
||||||
option-label="id"
|
option-label="id"
|
||||||
|
@ -67,10 +67,3 @@ const importDms = async () => {
|
||||||
</template>
|
</template>
|
||||||
</FormModelPopup>
|
</FormModelPopup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
|
||||||
es:
|
|
||||||
Select document id: Introduzca id de gestion documental
|
|
||||||
Document: Documento
|
|
||||||
The document indentifier can't be empty: El número de documento no puede estar vacío
|
|
||||||
</i18n>
|
|
||||||
|
|
|
@ -42,11 +42,7 @@ const groupedStates = ref([]);
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||||
<VnFilterPanel
|
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||||
:data-key="props.dataKey"
|
|
||||||
:search-button="true"
|
|
||||||
:unremovableParams="['from', 'to']"
|
|
||||||
>
|
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
|
|
@ -11,7 +11,7 @@ const $props = defineProps({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy data-cy="DepartmentDescriptor">
|
<QPopupProxy>
|
||||||
<DepartmentDescriptor
|
<DepartmentDescriptor
|
||||||
v-if="$props.id"
|
v-if="$props.id"
|
||||||
:id="$props.id"
|
:id="$props.id"
|
||||||
|
|
|
@ -68,7 +68,7 @@ const arrayData = useArrayData('ZoneEvents');
|
||||||
const exclusionGeoCreate = async () => {
|
const exclusionGeoCreate = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
zoneFk: parseInt(route.params.id),
|
zoneFk: parseInt(route.params.id),
|
||||||
date: dated.value,
|
date: dated,
|
||||||
geoIds: tickedNodes.value,
|
geoIds: tickedNodes.value,
|
||||||
};
|
};
|
||||||
await axios.post('Zones/exclusionGeo', params);
|
await axios.post('Zones/exclusionGeo', params);
|
||||||
|
@ -101,17 +101,9 @@ const exclusionCreate = async () => {
|
||||||
const existsEvent = data.events.find(
|
const existsEvent = data.events.find(
|
||||||
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
||||||
);
|
);
|
||||||
const existsGeoEvent = data.geoExclusions.find(
|
|
||||||
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
|
||||||
);
|
|
||||||
if (existsEvent) {
|
if (existsEvent) {
|
||||||
await axios.delete(`Zones/${existsEvent?.zoneFk}/events/${existsEvent?.id}`);
|
await axios.delete(`Zones/${existsEvent?.zoneFk}/events/${existsEvent?.id}`);
|
||||||
}
|
}
|
||||||
if (existsGeoEvent) {
|
|
||||||
await axios.delete(
|
|
||||||
`Zones/${existsGeoEvent?.zoneFk}/exclusions/${existsGeoEvent?.zoneExclusionFk}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
|
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
|
||||||
else await axios.put(`${url}/${props.event?.id}`, body);
|
else await axios.put(`${url}/${props.event?.id}`, body);
|
||||||
|
@ -130,21 +122,8 @@ const onSubmit = async () => {
|
||||||
|
|
||||||
const deleteEvent = async () => {
|
const deleteEvent = async () => {
|
||||||
if (!props.event) return;
|
if (!props.event) return;
|
||||||
if (!props.event.created) {
|
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
|
||||||
const filter = {
|
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
|
||||||
where: {
|
|
||||||
dated: dated.value,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const params = { filter: JSON.stringify(filter) };
|
|
||||||
const { data: res } = await axios.get(`Zones/${route.params.id}/exclusions`, {
|
|
||||||
params,
|
|
||||||
});
|
|
||||||
if (res) await axios.delete(`Zones/${route.params.id}/exclusions/${res[0].id}`);
|
|
||||||
} else {
|
|
||||||
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
|
|
||||||
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
|
|
||||||
}
|
|
||||||
await refetchEvents();
|
await refetchEvents();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -156,7 +135,7 @@ const refetchEvents = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.event && props.event.dated) {
|
if (props.event) {
|
||||||
dated.value = props.event?.dated;
|
dated.value = props.event?.dated;
|
||||||
excludeType.value =
|
excludeType.value =
|
||||||
props.eventType === 'geoExclusion' ? 'specificLocations' : 'all';
|
props.eventType === 'geoExclusion' ? 'specificLocations' : 'all';
|
||||||
|
|
|
@ -56,7 +56,6 @@ const isNew = computed(() => props.isNewMode);
|
||||||
const eventInclusionFormData = ref({ wdays: [] });
|
const eventInclusionFormData = ref({ wdays: [] });
|
||||||
const dated = ref(props.date || Date.vnNew());
|
const dated = ref(props.date || Date.vnNew());
|
||||||
const _inclusionType = ref('indefinitely');
|
const _inclusionType = ref('indefinitely');
|
||||||
const hasDeletedEvent = ref(false);
|
|
||||||
const inclusionType = computed({
|
const inclusionType = computed({
|
||||||
get: () => _inclusionType.value,
|
get: () => _inclusionType.value,
|
||||||
set: (val) => {
|
set: (val) => {
|
||||||
|
@ -85,7 +84,7 @@ const createEvent = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const zoneIds = props.zoneIds?.length ? props.zoneIds : [route.params.id];
|
const zoneIds = props.zoneIds?.length ? props.zoneIds : [route.params.id];
|
||||||
for (const zoneId of zoneIds) {
|
for (const id of zoneIds) {
|
||||||
let today = eventInclusionFormData.value.dated
|
let today = eventInclusionFormData.value.dated
|
||||||
? moment(eventInclusionFormData.value.dated)
|
? moment(eventInclusionFormData.value.dated)
|
||||||
: moment(dated.value);
|
: moment(dated.value);
|
||||||
|
@ -93,7 +92,7 @@ const createEvent = async () => {
|
||||||
|
|
||||||
const { data } = await axios.get(`Zones/getEventsFiltered`, {
|
const { data } = await axios.get(`Zones/getEventsFiltered`, {
|
||||||
params: {
|
params: {
|
||||||
zoneFk: zoneId,
|
zoneFk: id,
|
||||||
started: today,
|
started: today,
|
||||||
ended: lastDay,
|
ended: lastDay,
|
||||||
},
|
},
|
||||||
|
@ -107,19 +106,15 @@ const createEvent = async () => {
|
||||||
await axios.delete(
|
await axios.delete(
|
||||||
`Zones/${existsExclusion?.zoneFk}/exclusions/${existsExclusion?.id}`,
|
`Zones/${existsExclusion?.zoneFk}/exclusions/${existsExclusion?.id}`,
|
||||||
);
|
);
|
||||||
await refetchEvents();
|
|
||||||
hasDeletedEvent.value = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete eventInclusionFormData.value.id;
|
if (isNew.value)
|
||||||
if (isNew.value || hasDeletedEvent.value)
|
await axios.post(`Zones/${id}/events`, eventInclusionFormData.value);
|
||||||
await axios.post(`Zones/${zoneId}/events`, eventInclusionFormData.value);
|
|
||||||
else
|
else
|
||||||
await axios.put(
|
await axios.put(
|
||||||
`Zones/${zoneId}/events/${props.event?.id}`,
|
`Zones/${id}/events/${props.event?.id}`,
|
||||||
eventInclusionFormData.value,
|
eventInclusionFormData.value,
|
||||||
);
|
);
|
||||||
hasDeletedEvent.value = false;
|
|
||||||
}
|
}
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataSaved'),
|
message: t('globals.dataSaved'),
|
||||||
|
|
|
@ -15,6 +15,7 @@ import Entry from './entry';
|
||||||
import Zone from './zone';
|
import Zone from './zone';
|
||||||
import Account from './account';
|
import Account from './account';
|
||||||
import Monitor from './monitor';
|
import Monitor from './monitor';
|
||||||
|
import Property from './property';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
Item,
|
Item,
|
||||||
|
@ -34,4 +35,5 @@ export default [
|
||||||
Zone,
|
Zone,
|
||||||
Account,
|
Account,
|
||||||
Monitor,
|
Monitor,
|
||||||
|
Property,
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,100 @@
|
||||||
|
import { RouterView } from 'vue-router';
|
||||||
|
|
||||||
|
const propertyCard = {
|
||||||
|
name: 'PropertyCard',
|
||||||
|
path: ':id',
|
||||||
|
component: () => import('src/pages/Property/Card/PropertyCard.vue'),
|
||||||
|
redirect: { name: 'PropertySummary' },
|
||||||
|
meta: {
|
||||||
|
menu: ['PropertyBasicData', 'PropertyDms', 'PropertyNotes', 'PropertyLog'],
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'PropertySummary',
|
||||||
|
path: 'summary',
|
||||||
|
meta: {
|
||||||
|
title: 'summary',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Property/Card/PropertySummary.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'PropertyBasicData',
|
||||||
|
path: 'basic-data',
|
||||||
|
meta: {
|
||||||
|
title: 'basicData',
|
||||||
|
icon: 'vn:settings',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Property/Card/PropertyBasicData.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'PropertyDms',
|
||||||
|
path: 'dms',
|
||||||
|
meta: {
|
||||||
|
title: 'dms',
|
||||||
|
icon: 'cloud_upload',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Property/Card/PropertyDms.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'PropertyNotes',
|
||||||
|
path: 'notes',
|
||||||
|
meta: {
|
||||||
|
title: 'notes',
|
||||||
|
icon: 'note',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Property/Card/PropertyNotes.vue'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'PropertyLog',
|
||||||
|
path: 'history',
|
||||||
|
meta: {
|
||||||
|
title: 'history',
|
||||||
|
icon: 'history',
|
||||||
|
},
|
||||||
|
component: () => import('pages/Property/Card/PropertyLog.vue'),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Property',
|
||||||
|
path: '/property',
|
||||||
|
meta: {
|
||||||
|
title: 'properties',
|
||||||
|
icon: 'apartment',
|
||||||
|
moduleName: 'Property',
|
||||||
|
menu: ['PropertyList'],
|
||||||
|
},
|
||||||
|
component: RouterView,
|
||||||
|
redirect: { name: 'PropertyMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'PropertyMain',
|
||||||
|
path: '',
|
||||||
|
component: () => import('src/components/common/VnModule.vue'),
|
||||||
|
redirect: { name: 'PropertyIndexMain' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'PropertyIndexMain',
|
||||||
|
component: () => import('src/pages/Property/PropertyList.vue'),
|
||||||
|
redirect: { name: 'PropertyList' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
name: 'PropertyList',
|
||||||
|
path: 'list',
|
||||||
|
meta: {
|
||||||
|
title: 'list',
|
||||||
|
icon: 'view_list',
|
||||||
|
},
|
||||||
|
component: () =>
|
||||||
|
import('src/pages/Property/PropertyList.vue'),
|
||||||
|
},
|
||||||
|
propertyCard,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
|
@ -15,6 +15,7 @@ import entry from 'src/router/modules/entry';
|
||||||
import zone from 'src/router/modules/zone';
|
import zone from 'src/router/modules/zone';
|
||||||
import account from './modules/account';
|
import account from './modules/account';
|
||||||
import monitor from 'src/router/modules/monitor';
|
import monitor from 'src/router/modules/monitor';
|
||||||
|
import property from 'src/router/modules/property';
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
|
@ -83,6 +84,7 @@ const routes = [
|
||||||
entry,
|
entry,
|
||||||
zone,
|
zone,
|
||||||
account,
|
account,
|
||||||
|
property,
|
||||||
{
|
{
|
||||||
path: '/:catchAll(.*)*',
|
path: '/:catchAll(.*)*',
|
||||||
name: 'NotFound',
|
name: 'NotFound',
|
||||||
|
|
|
@ -18,6 +18,7 @@ export const useNavigationStore = defineStore('navigationStore', () => {
|
||||||
'monitor',
|
'monitor',
|
||||||
'supplier',
|
'supplier',
|
||||||
'claim',
|
'claim',
|
||||||
|
'property',
|
||||||
'route',
|
'route',
|
||||||
'ticket',
|
'ticket',
|
||||||
'worker',
|
'worker',
|
||||||
|
|
|
@ -53,7 +53,7 @@ describe('invoiceInCorrective', () => {
|
||||||
it('should show/hide the section if it is a corrective invoice', () => {
|
it('should show/hide the section if it is a corrective invoice', () => {
|
||||||
cy.visit('/#/invoice-in/1/summary');
|
cy.visit('/#/invoice-in/1/summary');
|
||||||
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('not.exist');
|
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('not.exist');
|
||||||
cy.clickDescriptorAction(4);
|
cy.clicDescriptorAction(4);
|
||||||
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('exist');
|
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -64,17 +64,17 @@ describe('InvoiceInDescriptor', () => {
|
||||||
beforeEach(() => cy.visit('/#/invoice-in/1/summary'));
|
beforeEach(() => cy.visit('/#/invoice-in/1/summary'));
|
||||||
|
|
||||||
it('should navigate to the supplier summary', () => {
|
it('should navigate to the supplier summary', () => {
|
||||||
cy.clickDescriptorAction(1);
|
cy.clicDescriptorAction(1);
|
||||||
cy.url().should('to.match', /supplier\/\d+\/summary/);
|
cy.url().should('to.match', /supplier\/\d+\/summary/);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate to the entry summary', () => {
|
it('should navigate to the entry summary', () => {
|
||||||
cy.clickDescriptorAction(2);
|
cy.clicDescriptorAction(2);
|
||||||
cy.url().should('to.match', /entry\/\d+\/summary/);
|
cy.url().should('to.match', /entry\/\d+\/summary/);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should navigate to the invoiceIn list', () => {
|
it('should navigate to the invoiceIn list', () => {
|
||||||
cy.clickDescriptorAction(3);
|
cy.clicDescriptorAction(3);
|
||||||
cy.url().should('to.match', /invoice-in\/list\?table=\{.*supplierFk.+\}/);
|
cy.url().should('to.match', /invoice-in\/list\?table=\{.*supplierFk.+\}/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -93,7 +93,7 @@ describe('InvoiceInDescriptor', () => {
|
||||||
createCorrective();
|
createCorrective();
|
||||||
redirect(originalId);
|
redirect(originalId);
|
||||||
|
|
||||||
cy.clickDescriptorAction(4);
|
cy.clicDescriptorAction(4);
|
||||||
cy.validateVnTableRows({
|
cy.validateVnTableRows({
|
||||||
cols: [
|
cols: [
|
||||||
{
|
{
|
||||||
|
@ -141,7 +141,7 @@ function createCorrective() {
|
||||||
function redirect(subtitle) {
|
function redirect(subtitle) {
|
||||||
const regex = new RegExp(`InvoiceIns/${subtitle}\\?filter=.*`);
|
const regex = new RegExp(`InvoiceIns/${subtitle}\\?filter=.*`);
|
||||||
cy.intercept('GET', regex).as('getOriginal');
|
cy.intercept('GET', regex).as('getOriginal');
|
||||||
cy.clickDescriptorAction(4);
|
cy.clicDescriptorAction(4);
|
||||||
cy.wait('@getOriginal');
|
cy.wait('@getOriginal');
|
||||||
cy.validateDescriptor({ subtitle });
|
cy.validateDescriptor({ subtitle });
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ describe('InvoiceOut list', () => {
|
||||||
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('should open the invoice descriptor from table icon', () => {
|
it('should open the invoice descriptor from table icon', () => {
|
||||||
cy.get(firstSummaryIcon).click();
|
cy.get(firstSummaryIcon).click();
|
||||||
cy.get('.cardSummary').should('be.visible');
|
cy.get('.cardSummary').should('be.visible');
|
||||||
cy.get('.summaryHeader > div').should('include.text', 'A1111111');
|
cy.get('.summaryHeader > div').should('include.text', 'A1111111');
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/invoice-out/1/summary`);
|
cy.visit(`/#/invoice-out/1/summary`);
|
||||||
});
|
});
|
||||||
it.skip('open the descriptors', () => {
|
it('open the descriptors', () => {
|
||||||
cy.get(firstRowDescriptors(1)).click();
|
cy.get(firstRowDescriptors(1)).click();
|
||||||
cy.get('.descriptor').should('be.visible');
|
cy.get('.descriptor').should('be.visible');
|
||||||
cy.get('.q-item > .q-item__label').should('include.text', '1');
|
cy.get('.q-item > .q-item__label').should('include.text', '1');
|
||||||
|
@ -30,7 +30,7 @@ describe('InvoiceOut summary', () => {
|
||||||
cy.get('.q-item > .q-item__label').should('include.text', '1101');
|
cy.get('.q-item > .q-item__label').should('include.text', '1101');
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('should open the ticket list', () => {
|
it('should open the ticket list', () => {
|
||||||
cy.get(toTicketList).click();
|
cy.get(toTicketList).click();
|
||||||
cy.get('[data-col-field="stateFk"]').each(($el) => {
|
cy.get('[data-col-field="stateFk"]').each(($el) => {
|
||||||
cy.wrap($el).contains('T1111111');
|
cy.wrap($el).contains('T1111111');
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
|
|
||||||
describe('Monitor Clients actions', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('salesPerson');
|
|
||||||
cy.intercept('GET', '**/Departments**').as('departments');
|
|
||||||
cy.visit('/#/monitor/clients-actions');
|
|
||||||
cy.waitForElement('.q-page');
|
|
||||||
cy.wait('@departments').then((xhr) => {
|
|
||||||
cy.window().then((win) => {
|
|
||||||
const user = JSON.parse(win.sessionStorage.getItem('user'));
|
|
||||||
const { where } = JSON.parse(xhr.request.query.filter);
|
|
||||||
expect(where.id.like).to.include(user.departmentFk.toString());
|
|
||||||
});
|
|
||||||
});
|
|
||||||
cy.intercept('GET', '**/SalesMonitors/ordersFilter*').as('ordersFilter');
|
|
||||||
cy.intercept('GET', '**/SalesMonitors/clientsFilter*').as('clientsFilter');
|
|
||||||
});
|
|
||||||
it('Should filter by field', () => {
|
|
||||||
cy.get('.q-page').should('be.visible');
|
|
||||||
cy.dataCy('clientsOnWebsite')
|
|
||||||
.find('[data-cy="column-filter-departmentFk"] [data-cy="_select"]')
|
|
||||||
.click();
|
|
||||||
cy.dataCy('recentOrderActions').within(() => {
|
|
||||||
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
|
|
||||||
});
|
|
||||||
cy.checkVisibleDescriptor('Customer');
|
|
||||||
|
|
||||||
cy.dataCy('recentOrderActions').within(() => {
|
|
||||||
cy.getRowCol('departmentFk', 2)
|
|
||||||
.find('span')
|
|
||||||
.should('have.class', 'link')
|
|
||||||
.click();
|
|
||||||
});
|
|
||||||
|
|
||||||
cy.checkVisibleDescriptor('Department');
|
|
||||||
|
|
||||||
cy.dataCy('clientsOnWebsite')
|
|
||||||
.find('.q-ml-md')
|
|
||||||
.should('have.text', 'Clients on website');
|
|
||||||
cy.dataCy('recentOrderActions')
|
|
||||||
.find('.q-ml-md')
|
|
||||||
.should('have.text', 'Recent order actions');
|
|
||||||
cy.dataCy('From_inputDate').should('have.value', '01/01/2001');
|
|
||||||
cy.dataCy('To_inputDate').should('have.value', '01/01/2001');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,69 +0,0 @@
|
||||||
/// <reference types="cypress" />
|
|
||||||
describe('Monitor Tickets Table', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.login('salesPerson');
|
|
||||||
cy.visit('/#/monitor/tickets');
|
|
||||||
cy.waitForElement('.q-page');
|
|
||||||
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
|
|
||||||
cy.openRightMenu();
|
|
||||||
});
|
|
||||||
it('should open new tab when ctrl+click on client link', () => {
|
|
||||||
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
|
|
||||||
|
|
||||||
cy.window().then((win) => {
|
|
||||||
cy.stub(win, 'open').as('windowOpen');
|
|
||||||
});
|
|
||||||
|
|
||||||
cy.getRowCol('provinceFk').click({ ctrlKey: true });
|
|
||||||
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
|
||||||
});
|
|
||||||
it('should open the descriptorProxy and SummaryPopup', () => {
|
|
||||||
cy.getRowCol('totalProblems');
|
|
||||||
|
|
||||||
cy.getRowCol('id').find('span').should('have.class', 'link').click();
|
|
||||||
cy.checkVisibleDescriptor('Ticket');
|
|
||||||
|
|
||||||
cy.getRowCol('zoneFk').find('span').should('have.class', 'link').click();
|
|
||||||
cy.checkVisibleDescriptor('Zone');
|
|
||||||
|
|
||||||
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
|
|
||||||
cy.checkVisibleDescriptor('Customer');
|
|
||||||
|
|
||||||
cy.getRowCol('departmentFk').find('span').should('have.class', 'link').click();
|
|
||||||
cy.checkVisibleDescriptor('Department');
|
|
||||||
|
|
||||||
cy.getRowCol('shippedDate').find('.q-badge');
|
|
||||||
cy.tableActions().click({ ctrlKey: true });
|
|
||||||
cy.tableActions(1).click();
|
|
||||||
cy.get('.summaryHeader').should('exist');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('clear scopeDays', () => {
|
|
||||||
cy.get('[data-cy="Days onward_input"]').clear().type('2');
|
|
||||||
cy.searchInFilterPanel();
|
|
||||||
cy.get('.q-chip__content > span').should('have.text', '"2"');
|
|
||||||
cy.waitSpinner();
|
|
||||||
checkScopeDays(2);
|
|
||||||
cy.get('[data-cy="Days onward_input"]').clear();
|
|
||||||
cy.searchInFilterPanel();
|
|
||||||
cy.get('.q-chip__content > span').should('have.text', '"0"');
|
|
||||||
cy.waitSpinner();
|
|
||||||
checkScopeDays(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function checkScopeDays(scopeDays) {
|
|
||||||
cy.url().then((url) => {
|
|
||||||
const urlParams = new URLSearchParams(url.split('?')[1]);
|
|
||||||
const saleMonitorTickets = JSON.parse(
|
|
||||||
decodeURIComponent(urlParams.get('saleMonitorTickets')),
|
|
||||||
);
|
|
||||||
expect(saleMonitorTickets.scopeDays).to.equal(scopeDays);
|
|
||||||
const fromDate = new Date(saleMonitorTickets.from);
|
|
||||||
const toDate = new Date(saleMonitorTickets.to);
|
|
||||||
expect(toDate.getDate() - fromDate.getDate()).to.equal(
|
|
||||||
saleMonitorTickets.scopeDays,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@
|
||||||
describe('OrderCatalog', () => {
|
describe('OrderCatalog', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 720);
|
||||||
cy.visit('/#/order/8/catalog');
|
cy.visit('/#/order/8/catalog');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,14 @@ describe('OrderList', () => {
|
||||||
|
|
||||||
it('create order', () => {
|
it('create order', () => {
|
||||||
cy.get('[data-cy="vnTableCreateBtn"]').click();
|
cy.get('[data-cy="vnTableCreateBtn"]').click();
|
||||||
cy.selectOption('[data-cy="Client_select"]', 1101);
|
cy.selectOption(clientCreateSelect, 1101);
|
||||||
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
cy.get(addressCreateSelect).click();
|
||||||
cy.get('[data-cy="Address_select"]').click();
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'.q-menu > div> div.q-item:nth-child(1) >div.q-item__section--avatar > i',
|
'.q-menu > div> div.q-item:nth-child(1) >div.q-item__section--avatar > i',
|
||||||
).should('have.text', 'star');
|
).should('have.text', 'star');
|
||||||
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
|
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
||||||
cy.get('.q-card [data-cy="Agency_select"]').click();
|
cy.selectOption(agencyCreateSelect, 1);
|
||||||
cy.get('.q-menu > div> .q-item:nth-child(1)').click();
|
|
||||||
cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
|
cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
|
||||||
cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
|
cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
|
||||||
cy.wait('@orderSale');
|
cy.wait('@orderSale');
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
describe('Property basic data', () => {
|
||||||
|
const selectors = {
|
||||||
|
resetBtn: '#st-actions > .q-btn-group > .q-btn[title="Reset"]',
|
||||||
|
saveBtn: '#st-actions > .q-btn-group > .q-btn[title="Save"]',
|
||||||
|
labelName: '[data-cy="Name_input"]',
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateData = {
|
||||||
|
Name: { val: 'Palacio de Asgard' },
|
||||||
|
Cadaster: { val: 'REF-123-456' },
|
||||||
|
Owner: { val: 'VNL', type: 'select' },
|
||||||
|
Map: { val: 'http://www.google.com' },
|
||||||
|
'Purchase date': { val: '01-01-2001', type: 'date' },
|
||||||
|
Value: { val: 500000 },
|
||||||
|
'Notarial protocol': { val: '1291/2025' },
|
||||||
|
'Small holding': { val: 195 },
|
||||||
|
Area: { val: 5 },
|
||||||
|
Allocation: { val: 'COTES' },
|
||||||
|
Town: { val: 'Alzira', type: 'select' },
|
||||||
|
m2: { val: 5000 },
|
||||||
|
Registry: { val: 'Asgard' },
|
||||||
|
Tome: { val: 1 },
|
||||||
|
Book: { val: 1 },
|
||||||
|
Page: { val: 1 },
|
||||||
|
Farm: { val: 1 },
|
||||||
|
Registration: { val: 5 },
|
||||||
|
'Booked date': { val: '02-02-2002', type: 'date' },
|
||||||
|
Volume: { val: 1 },
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/property/2/basic-data');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should reset property basic data', () => {
|
||||||
|
cy.get(selectors.labelName)
|
||||||
|
.should('be.visible')
|
||||||
|
.click().invoke('text').then((name) => {
|
||||||
|
name= name.trim();
|
||||||
|
cy.get(selectors.labelName).click().type(`{selectall}{backspace}Tony Stark`);
|
||||||
|
cy.get(selectors.resetBtn).click();
|
||||||
|
cy.containContent(selectors.labelName, name);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should edit property basic data', () => {
|
||||||
|
cy.fillInForm(updateData);
|
||||||
|
cy.get(selectors.saveBtn).click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,45 @@
|
||||||
|
describe('Property descriptor', () => {
|
||||||
|
const selectors = {
|
||||||
|
notaryLink: '.descriptor [data-cy="vnLvNotario"] .link',
|
||||||
|
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
|
||||||
|
descriptorGoToSummaryBtn: '.q-menu > .descriptor [data-cy="goToSummaryBtn"]',
|
||||||
|
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
|
||||||
|
descriptorTitle: '[data-cy="vnDescriptor_description"]',
|
||||||
|
};
|
||||||
|
|
||||||
|
const notarySummaryUrlRegex = /supplier\/\d+\/summary/;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/property/1/summary');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the notary summary from notary descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.notaryLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((notaryName) => {
|
||||||
|
notaryName = notaryName.trim();
|
||||||
|
cy.log('Notary name: ', notaryName);
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', notarySummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, notaryName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the notary summary from summary pop-up from the notary descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.notaryLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((notaryName) => {
|
||||||
|
notaryName = notaryName.trim();
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', notarySummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, notaryName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,135 @@
|
||||||
|
describe('Property DMS', () => {
|
||||||
|
const getBtnSelector = (trPosition, btnPosition) =>
|
||||||
|
`tr:${trPosition}-child > .text-right > .no-wrap > :nth-child(${btnPosition}) > .q-btn > .q-btn__content > .q-icon`;
|
||||||
|
|
||||||
|
const selectors = {
|
||||||
|
lastRowDownloadBtn: getBtnSelector('last', 1),
|
||||||
|
firstRowEditBtn: getBtnSelector('first', 2),
|
||||||
|
lastRowDeleteBtn: getBtnSelector('last', 3),
|
||||||
|
firstRowDeleteBtn: getBtnSelector('first', 3),
|
||||||
|
lastRowReference: 'tr:last-child > :nth-child(5) > .q-tr > :nth-child(1) > span',
|
||||||
|
firstRowReference:
|
||||||
|
'tr:first-child > :nth-child(5) > .q-tr > :nth-child(1) > span',
|
||||||
|
firstRowId: 'tr:first-child > :nth-child(2) > .q-tr > :nth-child(1) > span',
|
||||||
|
lastRowWorkerLink: 'tr:last-child > :nth-child(8) > .q-tr > .link',
|
||||||
|
descriptorTitle: '.descriptor .title',
|
||||||
|
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
|
||||||
|
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
|
||||||
|
descriptorGoToSummaryBtn: '.q-menu .descriptor [data-cy="goToSummaryBtn"]',
|
||||||
|
summaryTitle: '.summaryHeader',
|
||||||
|
referenceInput: 'Reference_input',
|
||||||
|
companySelect: 'Company_select',
|
||||||
|
warehouseSelect: 'Warehouse_select',
|
||||||
|
typeSelect: 'Type_select',
|
||||||
|
fileInput: 'VnDms_inputFile',
|
||||||
|
importBtn: 'importBtn',
|
||||||
|
addBtn: 'addButton',
|
||||||
|
saveFormBtn: 'FormModelPopup_save',
|
||||||
|
};
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
Reference: { val: 'Property:Peter Parker' },
|
||||||
|
Company: { val: 'VNL', type: 'select' },
|
||||||
|
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||||
|
Type: { val: 'Copia simple', type: 'select' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateData = {
|
||||||
|
Reference: { val: 'Property:Peter Parker House' },
|
||||||
|
Company: { val: 'CCs', type: 'select' },
|
||||||
|
Warehouse: { val: 'Warehouse Two', type: 'select' },
|
||||||
|
Type: { val: 'Escritura original', type: 'select' },
|
||||||
|
};
|
||||||
|
|
||||||
|
const workerSummaryUrlRegex = /worker\/\d+\/summary/;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(`/#/property/1/dms`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should display vehicle DMS', () => {
|
||||||
|
cy.get('.q-table')
|
||||||
|
.children()
|
||||||
|
.should('be.visible')
|
||||||
|
.should('have.length.greaterThan', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should create new DMS', () => {
|
||||||
|
cy.dataCy(selectors.addBtn).click();
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy(selectors.fileInput).selectFile('test/cypress/fixtures/image.jpg', {
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
cy.dataCy(selectors.saveFormBtn).click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should edit DMS', () => {
|
||||||
|
cy.get(selectors.firstRowEditBtn).click();
|
||||||
|
cy.fillInForm(updateData);
|
||||||
|
cy.dataCy(selectors.saveFormBtn).click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
cy.validateContent(selectors.firstRowReference, updateData.Reference.val);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should delete DMS', () => {
|
||||||
|
cy.get(selectors.firstRowDeleteBtn).click();
|
||||||
|
cy.clickConfirm();
|
||||||
|
cy.checkNotification('Data deleted');
|
||||||
|
cy.validateContent(selectors.firstRowReference, '1');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should import DMS', () => {
|
||||||
|
const data = {
|
||||||
|
Document: { val: '10', type: 'select' },
|
||||||
|
};
|
||||||
|
cy.dataCy(selectors.importBtn).click();
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy(selectors.saveFormBtn).click();
|
||||||
|
cy.checkNotification('Data saved');
|
||||||
|
cy.validateContent(selectors.lastRowReference, '1');
|
||||||
|
|
||||||
|
cy.get(selectors.lastRowDeleteBtn).click();
|
||||||
|
cy.clickConfirm();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should download DMS', () => {
|
||||||
|
const downloadsFolder = Cypress.config('downloadsFolder');
|
||||||
|
cy.get(selectors.lastRowDownloadBtn).click();
|
||||||
|
cy.wait(3000);
|
||||||
|
|
||||||
|
const fileName = '1.txt';
|
||||||
|
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Worker pop-ups', () => {
|
||||||
|
it('Should redirect to the worker summary from worker descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.lastRowWorkerLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((workerName) => {
|
||||||
|
workerName = workerName.trim();
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', workerSummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, workerName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the worker summary from summary pop-up from the worker descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.lastRowWorkerLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((workerName) => {
|
||||||
|
workerName = workerName.trim();
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', workerSummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, workerName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,102 @@
|
||||||
|
describe('Property list', () => {
|
||||||
|
const selectors = {
|
||||||
|
firstRow: 'tr:first-child > [data-col-field="name"]',
|
||||||
|
firstRowNotaryLink: 'tr:first-child > [data-col-field="notary"] > .no-padding > .link',
|
||||||
|
descriptorTitle: '[data-cy="vnDescriptor_title"]',
|
||||||
|
notaryDescriptorTitle: '[data-cy="vnDescriptor_description"]',
|
||||||
|
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
|
||||||
|
descriptorGoToSummaryBtn: '.q-menu > .descriptor [data-cy="goToSummaryBtn"]',
|
||||||
|
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
|
||||||
|
};
|
||||||
|
|
||||||
|
const summaryUrlRegex = /property\/\d+\/summary/;
|
||||||
|
const notarySummaryUrlRegex = /supplier\/\d+\/summary/;
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
Name: { val: 'Palacio de Asgard' },
|
||||||
|
Notary: { val: 'VNL', type: 'select' },
|
||||||
|
'Notarial protocol': { val: '1291/2025' },
|
||||||
|
Owner: { val: 'VNL', type: 'select' },
|
||||||
|
Group: { val: 'Cotes', type: 'select' },
|
||||||
|
Map: { val: 'http://www.google.com' },
|
||||||
|
Value: { val: 150000 },
|
||||||
|
'Purchase date': { val: '01-01-2001', type: 'date' },
|
||||||
|
'Booked date': { val: '01-01-2002', type: 'date' },
|
||||||
|
Cadaster: { val: 'REF-123-456' },
|
||||||
|
'Small holding': { val: 195 },
|
||||||
|
Area: { val: 3 },
|
||||||
|
Allocation: { val: 'COTES' },
|
||||||
|
Town: { val: 'Alzira', type: 'select' },
|
||||||
|
m2: { val: 120000 },
|
||||||
|
Registry: { val: 'Asgard' },
|
||||||
|
Tome: { val: 1 },
|
||||||
|
Book: { val: 1 },
|
||||||
|
Page: { val: 1 },
|
||||||
|
Farm: { val: 1 },
|
||||||
|
Registration: { val: 2 },
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('/#/property/list');
|
||||||
|
cy.typeSearchbar('{enter}');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should list properties', () => {
|
||||||
|
cy.get('.q-table')
|
||||||
|
.children()
|
||||||
|
.should('be.visible')
|
||||||
|
.should('have.length.greaterThan', 0);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the property summary when clicking the row', () => {
|
||||||
|
cy.get(selectors.firstRow)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((name) => {
|
||||||
|
name = name.trim();
|
||||||
|
cy.location().should('match', summaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, name);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should create new property', () => {
|
||||||
|
cy.addBtnClick();
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.dataCy('FormModelPopup_save').should('be.visible').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.location().should('match', summaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, data.Name.val);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Notary pop-ups', () => {
|
||||||
|
it('Should redirect to the notary summary from notary descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.firstRowNotaryLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((notaryName) => {
|
||||||
|
notaryName = notaryName.trim();
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', notarySummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the notary summary from summary pop-up from the notary descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.firstRowNotaryLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((notaryName) => {
|
||||||
|
notaryName = notaryName.trim();
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', notarySummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,26 @@
|
||||||
|
describe('Property notes', () => {
|
||||||
|
const selectors = {
|
||||||
|
addNoteInput: 'Add note here..._input',
|
||||||
|
saveNoteBtn: 'saveNote',
|
||||||
|
noteCard: '.column.full-width > :nth-child(1) > .q-card__section--vert',
|
||||||
|
};
|
||||||
|
|
||||||
|
const newNoteText = 'Cristal ventana salon roto';
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1280, 720);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit('#/property/1/notes');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should show the property notes', () => {
|
||||||
|
cy.get(selectors.noteCard)
|
||||||
|
.first()
|
||||||
|
.should('contain', 'Golpe en la puerta de entrada');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should add a new note', () => {
|
||||||
|
cy.dataCy(selectors.addNoteInput).should('be.visible').type(newNoteText);
|
||||||
|
cy.dataCy(selectors.saveNoteBtn).click();
|
||||||
|
cy.get(selectors.noteCard).last().should('contain', newNoteText);
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,146 @@
|
||||||
|
describe('Property summary', () => {
|
||||||
|
const selectors = {
|
||||||
|
summaryTitle: '.summaryHeader',
|
||||||
|
descriptorTitle: '[data-cy="vnDescriptor_title"]',
|
||||||
|
notaryDescriptorTitle: '[data-cy="vnDescriptor_description"]',
|
||||||
|
descriptorOpenSummaryBtn: '.q-menu > .descriptor [data-cy="openSummaryBtn"]',
|
||||||
|
descriptorGoToSummaryBtn: '.q-menu > .descriptor [data-cy="goToSummaryBtn"]',
|
||||||
|
summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
|
||||||
|
summaryBasicDataBlock1Link: 'a.link[data-cy="titleBasicDataBlock1"]',
|
||||||
|
summaryBasicDataBlock2Link: 'a.link[data-cy="titleBasicDataBlock2"]',
|
||||||
|
summaryBasicDataBlock3Link: 'a.link[data-cy="titleBasicDataBlock3"]',
|
||||||
|
summaryDmsBlockLink: 'a.link[data-cy="titleDmsBlock"]',
|
||||||
|
summaryNotesBlockLink: 'a.link[data-cy="titleNotesBlock"]',
|
||||||
|
summaryPropertyMapLink: 'a.grafana[data-cy="propertyMapLink"]',
|
||||||
|
dmsFirstRowWorkerLink: '.summaryBody :nth-child(1) > :nth-child(7) .link',
|
||||||
|
basicDataIcon: 'PropertyBasicData-menu-item',
|
||||||
|
dmsIcon: 'PropertyDms-menu-item',
|
||||||
|
notesIcon: 'PropertyNotes-menu-item',
|
||||||
|
logIcon: 'PropertyLog-menu-item',
|
||||||
|
notaryLink: '.summaryBody [data-cy="vnLvNotario"] .link',
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = '/#/property/1/summary';
|
||||||
|
const basicDataUrlRegex = /property\/1\/basic-data/;
|
||||||
|
const dmsUrlRegex = /property\/1\/dms/;
|
||||||
|
const notesUrlRegex = /property\/1\/notes/;
|
||||||
|
const logUrlRegex = /property\/1\/history/;
|
||||||
|
const workerSummaryUrlRegex = /worker\/\d+\/summary/;
|
||||||
|
const notarySummaryUrlRegex = /supplier\/\d+\/summary/;
|
||||||
|
const propertyName = 'Stark Tower';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.login('developer');
|
||||||
|
cy.visit(url);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should load summary', () => {
|
||||||
|
cy.containContent(selectors.summaryTitle, propertyName);
|
||||||
|
cy.containContent(selectors.descriptorTitle, propertyName);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the corresponding section when clicking on the icons in the left menu', () => {
|
||||||
|
cy.dataCy(selectors.basicDataIcon).click();
|
||||||
|
cy.location().should('match', basicDataUrlRegex);
|
||||||
|
|
||||||
|
cy.visit(url);
|
||||||
|
cy.dataCy(selectors.dmsIcon).click();
|
||||||
|
cy.location().should('match', dmsUrlRegex);
|
||||||
|
|
||||||
|
cy.visit(url);
|
||||||
|
cy.dataCy(selectors.notesIcon).click();
|
||||||
|
cy.location().should('match', notesUrlRegex);
|
||||||
|
|
||||||
|
cy.visit(url);
|
||||||
|
cy.dataCy(selectors.logIcon).click();
|
||||||
|
cy.location().should('match', logUrlRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to property basic-data when clicking on basic-data title links', () => {
|
||||||
|
cy.get(selectors.summaryBasicDataBlock1Link).click();
|
||||||
|
cy.location().should('match', basicDataUrlRegex);
|
||||||
|
cy.visit(url);
|
||||||
|
cy.get(selectors.summaryBasicDataBlock2Link).click();
|
||||||
|
cy.location().should('match', basicDataUrlRegex);
|
||||||
|
cy.visit(url);
|
||||||
|
cy.get(selectors.summaryBasicDataBlock3Link).click();
|
||||||
|
cy.location().should('match', basicDataUrlRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to property DMS when clicking on DMS title', () => {
|
||||||
|
cy.get(selectors.summaryDmsBlockLink).click();
|
||||||
|
cy.location().should('match', dmsUrlRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to property notes when clicking on notes title', () => {
|
||||||
|
cy.get(selectors.summaryNotesBlockLink).click();
|
||||||
|
cy.location().should('match', notesUrlRegex);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to property map', () => {
|
||||||
|
cy.get(selectors.summaryPropertyMapLink).invoke('removeAttr', 'target').click();
|
||||||
|
cy.origin('https://www1.sedecatastro.gob.es', () => {
|
||||||
|
cy.location().should('match', /sedecatastro.gob.es/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Notary pop-ups', () => {
|
||||||
|
it('Should redirect to the notary summary from notary descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.notaryLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((notaryName) => {
|
||||||
|
notaryName = notaryName.trim();
|
||||||
|
cy.log('Notary name: ', notaryName);
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', notarySummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the notary summary from summary pop-up from the notary descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.notaryLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((notaryName) => {
|
||||||
|
notaryName = notaryName.trim();
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', notarySummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.notaryDescriptorTitle, notaryName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Worker pop-ups', () => {
|
||||||
|
it('Should redirect to the worker summary from worker descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.dmsFirstRowWorkerLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((workerName) => {
|
||||||
|
workerName = workerName.trim();
|
||||||
|
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', workerSummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, workerName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Should redirect to the worker summary from summary pop-up from the worker descriptor pop-up', () => {
|
||||||
|
cy.get(selectors.dmsFirstRowWorkerLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.invoke('text')
|
||||||
|
.then((workerName) => {
|
||||||
|
workerName = workerName.trim();
|
||||||
|
cy.get(selectors.descriptorOpenSummaryBtn).click();
|
||||||
|
cy.get(selectors.summaryGoToSummaryBtn).click();
|
||||||
|
cy.location().should('match', workerSummaryUrlRegex);
|
||||||
|
cy.containContent(selectors.descriptorTitle, workerName);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -114,7 +114,7 @@ describe.skip('Route extended list', () => {
|
||||||
fillField(selector, type, value);
|
fillField(selector, type, value);
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.get('[title="Reset"]').click();
|
cy.get(selectors.resetBtn).click();
|
||||||
|
|
||||||
originalFields.forEach(({ selector, value }) => {
|
originalFields.forEach(({ selector, value }) => {
|
||||||
cy.validateContent(selector, value);
|
cy.validateContent(selector, value);
|
||||||
|
|
|
@ -6,7 +6,9 @@ describe('ParkingBasicData', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/shelving/parking/1/basic-data`);
|
cy.visit(`/#/shelving/parking/1/basic-data`);
|
||||||
cy.get('[data-cy="navBar-spinner"]', { timeout: 10000 }).should('not.be.visible');
|
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should(
|
||||||
|
'not.be.visible',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should give an error if the code aldready exists', () => {
|
it('should give an error if the code aldready exists', () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const firstRow = 'tbody > :nth-child(1)';
|
const firstRow = 'tbody > :nth-child(1)';
|
||||||
|
|
||||||
describe('TicketSale', () => {
|
describe('TicketSale', () => {
|
||||||
describe.skip('Ticket #23', () => {
|
describe('#23', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('claimManager');
|
cy.login('claimManager');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
Cypress.Commands.add('checkVisibleDescriptor', (alias) =>
|
|
||||||
cy
|
|
||||||
.get(`[data-cy="${alias}Descriptor"] [data-cy="vnDescriptor"] > .header`)
|
|
||||||
.should('exist')
|
|
||||||
.and('be.visible'),
|
|
||||||
);
|
|
|
@ -2,7 +2,9 @@ Cypress.Commands.add('getRow', (index = 1) =>
|
||||||
cy.get(`.vnTable .q-virtual-scroll__content tr:nth-child(${index})`),
|
cy.get(`.vnTable .q-virtual-scroll__content tr:nth-child(${index})`),
|
||||||
);
|
);
|
||||||
Cypress.Commands.add('getRowCol', (field, index = 1) =>
|
Cypress.Commands.add('getRowCol', (field, index = 1) =>
|
||||||
cy.getRow(index).find(`[data-col-field="${field}"]`),
|
cy.get(
|
||||||
|
`.vnTable .q-virtual-scroll__content > :nth-child(${index}) > [data-col-field="${field}"]`,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Cypress.Commands.add('vnTableCreateBtn', () =>
|
Cypress.Commands.add('vnTableCreateBtn', () =>
|
||||||
|
@ -12,9 +14,3 @@ Cypress.Commands.add('vnTableCreateBtn', () =>
|
||||||
Cypress.Commands.add('waitTableScrollLoad', () =>
|
Cypress.Commands.add('waitTableScrollLoad', () =>
|
||||||
cy.waitForElement('[data-q-vs-anchor]'),
|
cy.waitForElement('[data-q-vs-anchor]'),
|
||||||
);
|
);
|
||||||
|
|
||||||
Cypress.Commands.add('tableActions', (n = 0, child = 1) =>
|
|
||||||
cy.get(
|
|
||||||
`:nth-child(${child}) > .q-table--col-auto-width > [data-cy="tableAction-${n}"] > .q-btn__content > .q-icon`,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('WagonTypeEdit', () => {
|
||||||
cy.get('.q-card');
|
cy.get('.q-card');
|
||||||
cy.get('input').first().type(' changed');
|
cy.get('input').first().type(' changed');
|
||||||
cy.get('div.q-checkbox__bg').first().click();
|
cy.get('div.q-checkbox__bg').first().click();
|
||||||
cy.dataCy('saveDefaultBtn').click();
|
cy.get('.q-btn--standard').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should delete a tray', () => {
|
it('should delete a tray', () => {
|
||||||
|
|
|
@ -78,21 +78,20 @@ Cypress.Commands.add('waitForElement', (element) => {
|
||||||
Cypress.Commands.add('getValue', (selector) => {
|
Cypress.Commands.add('getValue', (selector) => {
|
||||||
cy.get(selector).then(($el) => {
|
cy.get(selector).then(($el) => {
|
||||||
if ($el.find('.q-checkbox__inner').length > 0) {
|
if ($el.find('.q-checkbox__inner').length > 0) {
|
||||||
return cy.get(`${selector}.q-checkbox__inner`);
|
return cy.get(selector + '.q-checkbox__inner');
|
||||||
}
|
}
|
||||||
// Si es un QSelect
|
// Si es un QSelect
|
||||||
if ($el.find('.q-select__dropdown-icon').length) {
|
if ($el.find('.q-select__dropdown-icon').length) {
|
||||||
return cy
|
return cy
|
||||||
.get(
|
.get(
|
||||||
`${
|
selector +
|
||||||
selector
|
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input',
|
||||||
}> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input`,
|
|
||||||
)
|
)
|
||||||
.invoke('val');
|
.invoke('val');
|
||||||
}
|
}
|
||||||
// Si es un QSelect
|
// Si es un QSelect
|
||||||
if ($el.find('span').length) {
|
if ($el.find('span').length) {
|
||||||
return cy.get(`${selector} span`).then(($span) => {
|
return cy.get(selector + ' span').then(($span) => {
|
||||||
return $span[0].innerText;
|
return $span[0].innerText;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -101,15 +100,10 @@ Cypress.Commands.add('getValue', (selector) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('waitSpinner', (_spinner = 'navBar') => {
|
Cypress.Commands.add('waitSpinner', () => {
|
||||||
const spinners = {
|
|
||||||
navBar: '[data-cy="navBar-spinner"]',
|
|
||||||
filterPanel: '[data-cy="filterPanel-spinner"]',
|
|
||||||
};
|
|
||||||
const spinner = spinners[_spinner];
|
|
||||||
cy.get('body').then(($body) => {
|
cy.get('body').then(($body) => {
|
||||||
if ($body.find(spinner).length) {
|
if ($body.find('[data-cy="loading-spinner"]').length) {
|
||||||
cy.get(spinner).should('not.be.visible');
|
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -148,7 +142,7 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
|
||||||
function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
|
function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
|
||||||
// Se intenta obtener la lista de opciones del desplegable de manera recursiva
|
// Se intenta obtener la lista de opciones del desplegable de manera recursiva
|
||||||
return cy
|
return cy
|
||||||
.get(`#${ariaControl}`, { timeout })
|
.get('#' + ariaControl, { timeout })
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.find('.q-item')
|
.find('.q-item')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
|
@ -358,21 +352,11 @@ Cypress.Commands.add('openListSummary', (row) => {
|
||||||
cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(row).click();
|
cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(row).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('openRightMenu', (element = 'toggle-right-drawer') => {
|
Cypress.Commands.add('openRightMenu', (element) => {
|
||||||
if (element) cy.waitForElement(`[data-cy="${element}"]`);
|
if (element) cy.waitForElement(element);
|
||||||
cy.dataCy(element).click();
|
cy.get('[data-cy="toggle-right-drawer"]').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('cleanFilterPanel', (element = 'clearFilters') => {
|
|
||||||
cy.get('#filterPanelForm').scrollIntoView();
|
|
||||||
if (element) cy.waitForElement(`[data-cy="${element}"]`);
|
|
||||||
cy.dataCy(element).click();
|
|
||||||
});
|
|
||||||
|
|
||||||
Cypress.Commands.add('searchInFilterPanel', (element = 'vnFilterPanel_search') => {
|
|
||||||
if (element) cy.waitForElement(`[data-cy="${element}"]`);
|
|
||||||
cy.dataCy(element).click();
|
|
||||||
});
|
|
||||||
Cypress.Commands.add('openLeftMenu', (element) => {
|
Cypress.Commands.add('openLeftMenu', (element) => {
|
||||||
if (element) cy.waitForElement(element);
|
if (element) cy.waitForElement(element);
|
||||||
cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
|
cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
|
||||||
|
@ -470,9 +454,9 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
|
||||||
|
|
||||||
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
|
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
|
||||||
cy.waitForElement('[data-cy="descriptor_actions"]');
|
cy.waitForElement('[data-cy="descriptor_actions"]');
|
||||||
cy.waitSpinner();
|
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
|
||||||
cy.get('.q-btn')
|
cy.get('.q-btn')
|
||||||
.filter((index, el) => Cypress.$(el).find(`.q-icon.${iconClass}`).length > 0)
|
.filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
|
||||||
.then(($btn) => {
|
.then(($btn) => {
|
||||||
cy.wrap($btn).click();
|
cy.wrap($btn).click();
|
||||||
});
|
});
|
||||||
|
@ -607,7 +591,7 @@ Cypress.Commands.add('validatePdfDownload', (match, trigger) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('clickDescriptorAction', (index = 1) => {
|
Cypress.Commands.add('clicDescriptorAction', (index = 1) => {
|
||||||
cy.get(`[data-cy="descriptor_actions"] .q-btn:nth-of-type(${index})`).click();
|
cy.get(`[data-cy="descriptor_actions"] .q-btn:nth-of-type(${index})`).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,6 @@ const waitForApiReady = (url, maxRetries = 20, delay = 1000) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
waitForApiReady('/api/Applications/status');
|
waitForApiReady('/api/Applications/status');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue