diff --git a/CHANGELOG.md b/CHANGELOG.md index 555b4f0ba..43bd6da77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2418.01] + ## [2416.01] - 2024-04-18 ### Added +### Fixed + +- (General) => Se vuelven a mostrar los parámetros en la url al aplicar un filtro + ## [2414.01] - 2024-04-04 ### Added @@ -16,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Tickets) => Se añade la opción de clonar ticket. #6951 - (Parking) => Se añade la sección Parking. #5186 +- (Rutas) => Se añade el campo "servida" a la tabla y se añade también a los filtros. #7130 + ### Changed ### Fixed diff --git a/package.json b/package.json index 82f21efe6..8398eb3f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.16.0", + "version": "24.18.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -32,6 +32,7 @@ "@intlify/unplugin-vue-i18n": "^0.8.1", "@pinia/testing": "^0.1.2", "@quasar/app-vite": "^1.7.3", + "@quasar/quasar-app-extension-qcalendar": "4.0.0-beta.15", "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0", "@vue/test-utils": "^2.4.4", "autoprefixer": "^10.4.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3fe7df55..bdff559cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,6 +49,9 @@ devDependencies: '@quasar/app-vite': specifier: ^1.7.3 version: 1.7.3(eslint@8.56.0)(pinia@2.1.7)(quasar@2.14.5)(vue-router@4.2.5)(vue@3.4.19) + '@quasar/quasar-app-extension-qcalendar': + specifier: 4.0.0-beta.15 + version: 4.0.0-beta.15 '@quasar/quasar-app-extension-testing-unit-vitest': specifier: ^0.4.0 version: 0.4.0(@vue/test-utils@2.4.4)(quasar@2.14.5)(vite@5.1.4)(vitest@0.31.4)(vue@3.4.19) @@ -912,6 +915,13 @@ packages: resolution: {integrity: sha512-SlOhwzXyPQHWgQIS2ncyDdYdksCJvUYNtgsDQqzAKEG3r3d/ejOxvThle79HTK3Q6HB+gQWFG21Ux00Osr5XSw==} dev: false + /@quasar/quasar-app-extension-qcalendar@4.0.0-beta.15: + resolution: {integrity: sha512-i6hQkcP70LXLfVMPZMKQjSg3681gjZmASV3vq6ULzc0LhtBiPneLdVNNtH2itkWxAmaUj+1heQDI5Pa0F7VKLQ==} + engines: {node: '>= 10.0.0', npm: '>= 5.6.0', yarn: '>= 1.6.0'} + dependencies: + '@quasar/quasar-ui-qcalendar': 4.0.0-beta.19 + dev: true + /@quasar/quasar-app-extension-testing-unit-vitest@0.4.0(@vue/test-utils@2.4.4)(quasar@2.14.5)(vite@5.1.4)(vitest@0.31.4)(vue@3.4.19): resolution: {integrity: sha512-eyzdUdmZiCueNS+5nedjMmzdbpCetSrtdGIwW6KplW1dTzRbLiNvYUjpBOxQGmJCgEhWy9zuswJ7MZ/bTql24Q==} engines: {node: '>= 12.22.1', npm: '>= 6.14.12', yarn: '>= 1.17.3'} @@ -939,6 +949,10 @@ packages: - vite dev: true + /@quasar/quasar-ui-qcalendar@4.0.0-beta.19: + resolution: {integrity: sha512-BT0G2JjgKl1bqNrY5utcYeoy8gK+U9k3Pz1YDi1OB265W/jHU6nFoWMEUdY3JdvMccwkXTL2DLVyl3eqAUyLyg==} + dev: true + /@quasar/render-ssr-error@1.0.3: resolution: {integrity: sha512-A8RF99q6/sOSe1Ighnh5syEIbliD3qUYEJd2HyfFyBPSMF+WYGXon5dmzg4nUoK662NgOggInevkDyBDJcZugg==} engines: {node: '>= 16'} diff --git a/quasar.config.js b/quasar.config.js index 5ce46667c..dd7a91002 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -93,13 +93,11 @@ module.exports = configure(function (/* ctx */) { [ VueI18nPlugin({ runtimeOnly: false, + include: [ + path.resolve(__dirname, './src/i18n/locale/**'), + path.resolve(__dirname, './src/pages/**/locale/**'), + ], }), - { - // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` - // compositionOnly: false, - // you need to set i18n resource including paths ! - include: path.resolve(__dirname, './src/i18n/**'), - }, ], ], }, diff --git a/quasar.extensions.json b/quasar.extensions.json index e5c5cbfaa..867769090 100644 --- a/quasar.extensions.json +++ b/quasar.extensions.json @@ -1,7 +1,6 @@ { - "@quasar/testing-unit-vitest": { - "options": [ - "scripts" - ] - } -} \ No newline at end of file + "@quasar/testing-unit-vitest": { + "options": ["scripts"] + }, + "@quasar/qcalendar": {} +} diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 8787371bc..a7af0044b 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -101,16 +101,16 @@ onMounted(async () => { }); onBeforeRouteLeave((to, from, next) => { - if (!hasChanges.value) next(); - - quasar.dialog({ - component: VnConfirm, - componentProps: { - title: t('Unsaved changes will be lost'), - message: t('Are you sure exit without saving?'), - promise: () => next(), - }, - }); + if (hasChanges.value) + quasar.dialog({ + component: VnConfirm, + componentProps: { + title: t('Unsaved changes will be lost'), + message: t('Are you sure exit without saving?'), + promise: () => next(), + }, + }); + else next(); }); onUnmounted(() => { diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index 2d8886610..718d087fe 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -78,6 +78,7 @@ defineExpose({
diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 23e00f5d9..f70146c58 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -5,9 +5,11 @@ import { useRoute } from 'vue-router'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; import axios from 'axios'; -import FetchData from 'components/FetchData.vue'; +import VnPaginate from 'components/ui/VnPaginate.vue'; import VnDms from 'src/components/common/VnDms.vue'; import VnConfirm from 'components/ui/VnConfirm.vue'; +import VnInputDate from 'components/common/VnInputDate.vue'; +import VnUserLink from '../ui/VnUserLink.vue'; import { downloadFile } from 'src/composables/downloadFile'; const route = useRoute(); @@ -26,6 +28,15 @@ const $props = defineProps({ type: String, default: null, }, + deleteModel: { + type: String, + default: null, + }, + downloadModel: { + type: String, + required: false, + default: null, + }, defaultDmsCode: { type: String, required: true, @@ -74,7 +85,7 @@ const dmsFilter = { ], }, }, - order: ['dmsFk DESC'], + where: { [$props.filter]: route.params.id }, }; const columns = computed(() => [ @@ -94,12 +105,12 @@ const columns = computed(() => [ props: (prop) => ({ readonly: true, borderless: true, - 'model-value': prop.row.dmsType.name, + 'model-value': prop.row.dmsType?.name, }), }, { align: 'left', - field: 'order', + field: 'hardCopyNumber', label: t('globals.order'), name: 'order', component: 'span', @@ -117,6 +128,7 @@ const columns = computed(() => [ label: t('globals.description'), name: 'description', component: 'span', + props: (prop) => ({ value: prop.value?.toUpperCase() }), }, { align: 'left', @@ -136,21 +148,53 @@ const columns = computed(() => [ name: 'file', component: 'span', }, + { + align: 'left', + field: 'worker', + label: t('globals.worker'), + name: 'worker', + component: VnUserLink, + props: (prop) => ({ + name: prop.row.worker?.user?.name.toLowerCase(), + workerId: prop.row.worker?.id, + }), + }, + { + align: 'left', + field: 'created', + label: t('globals.created'), + name: 'created', + component: VnInputDate, + props: (prop) => ({ + disable: true, + 'model-value': prop.row.created, + }), + }, { field: 'options', name: 'options', components: [ { component: QBtn, + name: 'download', + isDocuware: true, props: () => ({ icon: 'cloud_download', flat: true, color: 'primary', }), - click: (prop) => downloadFile(prop.row.id), + click: (prop) => + downloadFile( + prop.row.id, + $props.downloadModel, + null, + prop.row.download + ), }, { component: QBtn, + name: 'edit', + external: false, props: () => ({ icon: 'edit', flat: true, @@ -160,6 +204,8 @@ const columns = computed(() => [ }, { component: QBtn, + name: 'delete', + external: false, props: () => ({ icon: 'delete', flat: true, @@ -167,12 +213,24 @@ const columns = computed(() => [ }), click: (prop) => deleteDms(prop.row.id), }, + { + component: QBtn, + name: 'open', + external: true, + props: () => ({ + icon: 'open_in_new', + flat: true, + color: 'primary', + }), + click: (prop) => open(prop.row.url), + }, ], }, ]); function setData(data) { - const newData = data.map((value) => value.dms); + const newData = data.map((value) => value.dms || value); + newData.sort((a, b) => new Date(b.created) - new Date(a.created)); rows.value = newData; } @@ -186,7 +244,7 @@ function deleteDms(dmsFk) { }, }) .onOk(async () => { - await axios.post(`${$props.model}/${dmsFk}/removeFile`); + await axios.post(`${$props.deleteModel ?? $props.model}/${dmsFk}/removeFile`); const index = rows.value.findIndex((row) => row.id == dmsFk); rows.value.splice(index, 1); }); @@ -206,84 +264,106 @@ function parseDms(data) { } return data; } + +async function open(url) { + window.open(url).focus(); +} + +function shouldRenderButton(button, isExternal = false) { + if (button.name == 'download') return true; + return button.external === isExternal; +} @@ -212,6 +221,7 @@ en: workerFk: Worker from: From to: To + Served: Served es: params: warehouseFk: Almacén @@ -229,4 +239,5 @@ es: Worker: Trabajador From: Desde To: Hasta + Served: Servida diff --git a/src/pages/Route/Card/RouteForm.vue b/src/pages/Route/Card/RouteForm.vue index 60693cbf1..7087037b0 100644 --- a/src/pages/Route/Card/RouteForm.vue +++ b/src/pages/Route/Card/RouteForm.vue @@ -11,8 +11,8 @@ import VnInputDate from 'components/common/VnInputDate.vue'; import VnInput from 'components/common/VnInput.vue'; import axios from 'axios'; import VnInputTime from 'components/common/VnInputTime.vue'; -import RouteSearchbar from "pages/Route/Card/RouteSearchbar.vue"; -import {useStateStore} from "stores/useStateStore"; +import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; +import { useStateStore } from 'stores/useStateStore'; const { t } = useI18n(); const route = useRoute(); @@ -26,6 +26,7 @@ const defaultInitialData = { description: '', vehicleFk: null, workerFk: null, + isOk: false, }; const workerList = ref([]); @@ -211,6 +212,7 @@ const onSave = (data, response) => { size="sm" v-model="data.isOk" :label="t('Is served')" + clearable />
diff --git a/src/pages/Route/Card/RouteSummary.vue b/src/pages/Route/Card/RouteSummary.vue index 34b0dfebd..220f93f30 100644 --- a/src/pages/Route/Card/RouteSummary.vue +++ b/src/pages/Route/Card/RouteSummary.vue @@ -73,9 +73,9 @@ const ticketColumns = ref([ align: 'left', }, { - name: 'warehouse', - label: t('route.summary.warehouse'), - field: (row) => row?.warehouseName, + name: 'state', + label: t('route.summary.state'), + field: (row) => row?.ticketStateName, sortable: false, align: 'left', }, @@ -187,6 +187,15 @@ const ticketColumns = ref([ :label="t('route.summary.packages')" :value="getTotalPackages(entity.tickets)" /> +
@@ -274,10 +283,14 @@ en: city: City pc: PC client: Client - warehouse: Warehouse + state: State m3: m³ packaging: Packaging ticket: Ticket + closed: Closed + open: Open + yes: Yes + no: No es: route: summary: @@ -299,6 +312,10 @@ es: city: Población pc: CP client: Cliente - warehouse: Almacén + state: Estado packaging: Encajado + closed: Cerrada + open: Abierta + yes: Sí + no: No diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 94c05ad54..773b4f773 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -95,6 +95,13 @@ const columns = computed(() => [ sortable: true, align: 'left', }, + { + name: 'isServed', + label: t('Served'), + field: (row) => Boolean(row.isOk), + sortable: true, + align: 'left', + }, { name: 'actions', label: '', @@ -265,7 +272,7 @@ const openTicketsDialog = (id) => { auto-load >