diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e1d4c433..f1d10b26e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,184 @@ +# Version 24.38 - 2024-09-17 + +### Added 🆕 + +- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep +- chore: refs #7323 worker changes by:jorgep +- chore: refs #7353 fix warnings by:jorgep +- chore: refs #7353 use Vue component nomenclature by:jorgep +- chore: refs #7356 fix type by:jorgep +- feat(AccountConnections): use VnToken by:alexm +- feat: add key to routerView by:Javier Segarra +- feat: add plus shortcut in VnTable by:Javier Segarra +- feat: add row by:Javier Segarra +- feat: addRow withour dialog by:Javier Segarra +- feat: apply mixin by:Javier Segarra +- feat by:Javier Segarra +- feat: change navBar buttons by:Javier Segarra +- feat: dense rows by:Javier Segarra +- feat: fields with wrong name by:jgallego +- feat: fix bugs and filters by:Javier Segarra +- feat: fix refund parameters by:jgallego +- feat: handle create row by:Javier Segarra +- feat: handle dates by:Javier Segarra +- feat: handle qCheckbox 3rd state by:Javier Segarra +- feat: imrpove VnInputTime to set cursor at start by:Javier Segarra +- feat: keyShortcut directive by:Javier Segarra +- feat: minor fixes by:jgallego +- feat: only filter by isDestiny by:Javier Segarra +- feat: refs #211153 businessDataLinkGrafana by:robert +- feat: refs #7129 add km start and end on create form by:pablone +- feat: refs #7353 add filter & fix customTags by:jorgep +- feat: refs #7353 add locale by:jorgep +- feat: refs #7353 add no one opt by:jorgep +- feat: refs #7353 add right icons by:jorgep +- feat: refs #7353 imporve toDateFormat by:jorgep +- feat: refs #7353 salesPerson nickname & id by:jorgep +- feat: refs #7353 split sections by:jorgep +- feat: refs #7847 remove reload btn by:jorgep +- feat: refs #7847 remove reload fn by:jorgep +- feat: refs #7889 added shortcuts to modules by:Jon +- feat: refs #7911 added shortcut to modules by:Jon +- feat: refuncInvoiceForm component by:jgallego +- feat: remove duplicity by:Javier Segarra +- feat: remove future itemFixedPrices by:Javier Segarra +- feat: replace stickyButtons by subtoolbar by:Javier Segarra +- feat: required validation by:Javier Segarra +- feat: show bad dates by:Javier Segarra +- feat: showdate icons by:Javier Segarra +- feat: solve ItemFixedFilterPanel by:Javier Segarra +- feat: transfer an invoice by:jgallego +- feat: try to fix ItemFixedFilterPanel by:Javier Segarra +- feat: unnecessary changes by:Javier Segarra +- feat: update changelog (origin/7896_down_devToTest_2436) by:Javier Segarra +- feat: updates by:Javier Segarra +- feat: update version and changelog by:Javier Segarra +- feat: vnInput\* by:Javier Segarra +- feat: with VnTable by:Javier Segarra +- refs #6772 feat: fix approach by:Javier Segarra +- refs #6772 feat: refresh shelving.basic-data by:Javier Segarra +- style: show subName value by:Javier Segarra + +### Changed 📦 + +- perf: add v-shortcut in VnCard by:Javier Segarra +- perf: approach by:Javier Segarra +- perf: change directive location by:Javier Segarra +- perf: change slots order by:Javier Segarra +- perf: examples by:Javier Segarra +- perf: hide icon for VnInputDate by:Javier Segarra +- perf: improve ItemFixedPricefilterPanel by:Javier Segarra +- perf: improve mainShrotcutMixin by:Javier Segarra +- perf: minor clean code by:Javier Segarra +- perf: onRowchange by:Javier Segarra +- perf: order by by:Javier Segarra +- perf: order components by:Javier Segarra +- perf: refs #7889 perf shortcut test by:Jon +- perf: remove console.log by:Javier Segarra +- perf: remove icons in header slot by:Javier Segarra +- perf: remove print variables by:Javier Segarra +- perf: restore CustomerBasicData by:Javier Segarra +- refactor: deleted useless prop by:Jon +- refactor: deleted useless prop in FetchedTags by:Jon +- refactor: refs #7323 drop useless code by:jorgep +- refactor: refs #7353 clients correction by:jorgep +- refactor: refs #7353 clients correction wip by:jorgep +- refactor: refs #7353 ease logic by:jorgep +- refactor: refs #7353 order correction by:jorgep +- refactor: refs #7353 simplify code by:jorgep +- refactor: refs #7353 tickets correction by:jorgep +- refactor: refs #7353 use global locales by:jorgep +- refactor: refs #7354 changed descriptor menu options by:Jon +- refactor: refs #7354 changed icon color in table and notification when deleting a zone by:Jon +- refactor: refs #7354 fix tableFilters by:Jon +- refactor: refs #7354 modified VnInputTime by:Jon +- refactor: refs #7354 refactor deliveryPanel by:Jon +- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon +- refactor: refs #7354 requested changes by:Jon +- refactor: refs #7354 reverse deliveryPanel changes by:Jon +- refactor: refs #7354 Zone migration changes by:Jon +- refactor: refs #7889 deleted subtitle attr and use keyBinding instead by:Jon +- refactor: refs #7889 modified shortcut and dashboard, and added tootlip in LeftMenu by:Jon +- refs #6722 perf: not fetch when id not exists by:Javier Segarra +- refs #6772 perf: change variable name by:JAVIER SEGARRA MARTINEZ +- refs #6772 perf: use ArrayData (6772_reload_sections) by:Javier Segarra +- refs #7283 refactor fix ItemDescriptor by:carlossa +- refs #7283 refactor ItexDescriptor by:carlossa + +### Fixed 🛠️ + +- chore: refs #6772 fix e2e (origin/6772-warmfix-fixE2e) by:jorgep +- chore: refs #7353 fix warnings by:jorgep +- chore: refs #7356 fix type by:jorgep +- feat: fix bugs and filters by:Javier Segarra +- feat: fix refund parameters by:jgallego +- feat: minor fixes by:jgallego +- feat: refs #7353 add filter & fix customTags by:jorgep +- feat: try to fix ItemFixedFilterPanel by:Javier Segarra +- fix: add border-top by:Javier Segarra +- fix: added missing descriptors and small details by:Jon +- fix branch by:carlossa +- fix: call upsert when crudModel haschanges by:Javier Segarra +- fix(ClaimList): fix summary by:alexm +- fix: cli warnings by:Javier Segarra +- fix: editTableOptions by:Javier Segarra +- fix events and descriptor menu by:Jon +- fix: InvoiceIn sections (origin/6772_reload_sections) by:Javier Segarra +- fix: minor changes by:Javier Segarra +- fix: minor error whit dates by:Javier Segarra +- fix: module icon by:Javier Segarra +- fix: options QDate by:Javier Segarra +- fix: refs #6900 e2e error by:jorgep +- fix: refs #6900 rollback by:jorgep +- fix: refs #7353 css by:jorgep +- fix: refs #7353 hide search param (origin/7353-warmfix-fixSearchbar) by:jorgep +- fix: refs #7353 iron out filter by:jorgep +- fix: refs #7353 iron out ticket table by:jorgep +- fix: refs #7353 padding by:jorgep +- fix: refs #7353 salesClientTable by:jorgep +- fix: refs #7353 salesorderTable by:jorgep +- fix: refs #7353 saleTicketMonitors by:jorgep +- fix: refs #7353 use same datakey by:jorgep +- fix: refs #7353 vnTable colors by:jorgep +- fix: refs #7354 e2e tests by:Jon +- fix: refs #7354 fix delivery days by:Jon +- fix: refs #7354 fix list searchbar and filters by:Jon +- fix: refs #7354 fix VnSearchbar search for zone section & finished basic tests by:Jon +- fix: refs #7354 fix VnTable filters and agency field by:Jon +- fix: refs #7354 fix zoneSearchbar by:Jon +- fix: refs #7354 requested changes by:Jon +- fix: refs #7356 colors by:jorgep +- fix: refs #7356 create claim dialog by:jorgep +- fix: refs #7889 fixed shortcut test by:Jon +- fix: refs #7903 fixed ticket's search bar and keybinding tooltip by:Jon +- fix: refs #7911 fixed shortcut and related files by:Jon +- fix: remove condition duplicated by:Javier Segarra +- fix: remove property by:Javier Segarra +- fix tootltip by:carlossa +- fix traduction by:carlossa +- fix(VnSectionMain): add QPage by:alexm +- fix(zone): zoneLocation and the others searchbar by:alexm +- refactor: refs #7354 fix tableFilters by:Jon +- refactor: refs #7354 refactor zones section and fixed e2e tests by:Jon +- refs #6772 feat: fix approach by:Javier Segarra +- refs #6772 fix: claimPhoto reload by:Javier Segarra +- refs #6896 fix searchbar by:carlossa +- refs #6897 fix entry by:carlossa +- refs #6899 fix invoiceFix by:carlossa +- refs #6899 fix order by:carlossa +- refs #7283 fix by:carlossa +- refs #7283 fix ItemDescriptor warehouse by:carlossa +- refs #7283 refactor fix ItemDescriptor by:carlossa +- refs #7355 #7366 fix account, summary, list, travelList, tooltip by:carlossa +- refs #7355 fix accountPrivileges by:carlossa +- refs #7355 fix accounts, vnTable by:carlossa +- refs #7355 fix privileges by:carlossa +- refs #7355 fix roles filters by:carlossa +- refs #7355 fix total by:carlossa +- refs #7355 fix views summarys, entryList, travelList refact by:carlossa +- refs #7366 fix travel hours by:carlossa +- test: fix e2e by:Javier Segarra + # Version 24.36 - 2024-08-27 ### Added 🆕 diff --git a/package.json b/package.json index eaffd8d85..ead0193c9 100644 --- a/package.json +++ b/package.json @@ -62,4 +62,4 @@ "vite": "^5.1.4", "vitest": "^0.31.1" } -} \ No newline at end of file +} diff --git a/src/boot/axios.js b/src/boot/axios.js index 9b32275bd..99a163cca 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -5,8 +5,10 @@ import useNotify from 'src/composables/useNotify.js'; const session = useSession(); const { notify } = useNotify(); +const baseUrl = '/api/'; -axios.defaults.baseURL = '/api/'; +axios.defaults.baseURL = baseUrl; +const axiosNoError = axios.create({ baseURL: baseUrl }); const onRequest = (config) => { const token = session.getToken(); @@ -79,5 +81,7 @@ const onResponseError = (error) => { axios.interceptors.request.use(onRequest, onRequestError); axios.interceptors.response.use(onResponse, onResponseError); +axiosNoError.interceptors.request.use(onRequest); +axiosNoError.interceptors.response.use(onResponse); -export { onRequest, onResponseError }; +export { onRequest, onResponseError, axiosNoError }; diff --git a/src/components/VnTable/VnOrder.vue b/src/components/VnTable/VnOrder.vue index 98c7ab392..7fdd23b78 100644 --- a/src/components/VnTable/VnOrder.vue +++ b/src/components/VnTable/VnOrder.vue @@ -4,7 +4,7 @@ import { useArrayData } from 'composables/useArrayData'; const model = defineModel({ type: Object }); const $props = defineProps({ name: { - type: String, + type: [String, Boolean], default: '', }, label: { diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 7929fda6d..a2efc3ae9 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -105,6 +105,10 @@ const $props = defineProps({ type: String, default: '90vh', }, + footer: { + type: Boolean, + default: false, + }, }); const { t } = useI18n(); const stateStore = useStateStore(); @@ -200,7 +204,7 @@ function setUserParams(watchedParams, watchedOrder) { function sanitizer(params) { for (const [key, value] of Object.entries(params)) { - if (typeof value == 'object') { + if (value && typeof value == 'object') { const param = Object.values(value)[0]; if (typeof param == 'string') params[key] = param.replaceAll('%', ''); } @@ -394,7 +398,7 @@ function handleOnDataSaved(_) { card-container-class="grid-three" flat :style="isTableMode && `max-height: ${tableHeight}`" - virtual-scroll + :virtual-scroll="!isTableMode" @virtual-scroll=" (event) => event.index > rows.length - 2 && @@ -663,6 +667,28 @@ function handleOnDataSaved(_) { + + + + + {{ + rows.reduce( + (sum, currentRow) => sum + currentRow[col.name], + 0 + ) + }} + + + + @@ -730,7 +756,7 @@ es: } .bg-header { - background-color: var(--vn-header-color); + background-color: var(--vn-accent-color); color: var(--vn-text-color); } @@ -740,9 +766,7 @@ es: .q-table--dark .q-table__bottom, .q-table--dark thead, -.q-table--dark tr, -.q-table--dark th, -.q-table--dark td { +.q-table--dark tr { border-color: var(--vn-section-color); } diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 7d29da232..0d80f43ce 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -24,7 +24,9 @@ const stateStore = useStateStore(); const route = useRoute(); const router = useRouter(); const url = computed(() => { - if (props.baseUrl) return `${props.baseUrl}/${route.params.id}`; + if (props.baseUrl) { + return `${props.baseUrl}/${route.params.id}`; + } return props.customUrl; }); const searchRightDataKey = computed(() => { @@ -40,8 +42,10 @@ onBeforeMount(async () => { try { if (!props.baseUrl) arrayData.store.filter.where = { id: route.params.id }; await arrayData.fetch({ append: false, updateRouter: false }); - } catch (e) { - router.push({ name: 'WorkerList' }); + } catch { + const { matched: matches } = router.currentRoute.value; + const { path } = matches.at(-1); + router.push({ path: path.replace(/:id.*/, '') }); } }); diff --git a/src/components/common/VnComponent.vue b/src/components/common/VnComponent.vue index fa99f9892..bd25c787c 100644 --- a/src/components/common/VnComponent.vue +++ b/src/components/common/VnComponent.vue @@ -17,17 +17,15 @@ const $props = defineProps({ }, }); -let mixed; const componentArray = computed(() => { if (typeof $props.prop === 'object') return [$props.prop]; return $props.prop; }); function mix(toComponent) { - if (mixed) return mixed; const { component, attrs, event } = toComponent; const customComponent = $props.components[component]; - mixed = { + return { component: customComponent?.component ?? component, attrs: { ...toValueAttrs(attrs), @@ -37,7 +35,6 @@ function mix(toComponent) { }, event: { ...customComponent?.event, ...event }, }; - return mixed; } function toValueAttrs(attrs) { diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 570d0cbfe..26160929c 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -67,9 +67,13 @@ const mixinRules = [ requiredFieldRule, ...($attrs.rules ?? []), (val) => { - const { min } = vnInputRef.value.$attrs; + const { min, max } = vnInputRef.value.$attrs; if (!min) return null; if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min }); + if (!max) return null; + if (max > 0) { + if (Math.floor(val) > max) return t('inputMax', { value: max }); + } }, ]; @@ -116,8 +120,10 @@ const mixinRules = [ en: inputMin: Must be more than {value} + inputMax: Must be less than {value} es: inputMin: Debe ser mayor a {value} + inputMax: Debe ser menor a {value} + + en: + Buyer: Buyer + Reserve: Reserve + Bought: Bought + More: More + Date: Date + This buyer has already made a reservation for this date: This buyer has already made a reservation for this date + es: + Edit travel: Editar envĂo + Travel: EnvĂos + Booked trucks: Camiones reservados + Buyer: Comprador + Reserve: Reservado + Bought: Comprado + More: Más + Date: Fecha + Reserve some space: Reservar espacio + This buyer has already made a reservation for this date: Este comprador ya ha hecho una reserva para esta fecha + diff --git a/src/pages/Entry/EntryStockBoughtDetail.vue b/src/pages/Entry/EntryStockBoughtDetail.vue new file mode 100644 index 000000000..744b9d3fe --- /dev/null +++ b/src/pages/Entry/EntryStockBoughtDetail.vue @@ -0,0 +1,113 @@ + + + + + + + + {{ row?.entryFk }} + + + + + + {{ row?.itemName }} + + + + + + + + + + es: + Buyer: Comprador + Reserve: Reservado + Bought: Comprado + More: Más + Date: Fecha + diff --git a/src/pages/Entry/EntryStockBoughtFilter.vue b/src/pages/Entry/EntryStockBoughtFilter.vue new file mode 100644 index 000000000..7694cfe6c --- /dev/null +++ b/src/pages/Entry/EntryStockBoughtFilter.vue @@ -0,0 +1,63 @@ + + + + + + + {{ t(`params.${tag.label}`) }}: + {{ formatFn(tag.value) }} + + + + + + + + + + + + + en: + params: + dated: Date + workerFk: Worker + es: + Date: Fecha + params: + dated: Date + workerFk: Trabajador + diff --git a/src/pages/Entry/locale/en.yml b/src/pages/Entry/locale/en.yml index f0965b097..a9faa814b 100644 --- a/src/pages/Entry/locale/en.yml +++ b/src/pages/Entry/locale/en.yml @@ -11,4 +11,4 @@ shipped: Shipped fromShipped: Shipped(from) toShipped: Shipped(to) printLabels: Print stickers -printLabel: Print sticker +viewLabel: View sticker diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml index aba04571e..eb1e3f88a 100644 --- a/src/pages/Entry/locale/es.yml +++ b/src/pages/Entry/locale/es.yml @@ -15,4 +15,4 @@ shipped: F. salida fromShipped: F. salida(desde) toShipped: F. salida(hasta) printLabels: Imprimir etiquetas -printLabel: Imprimir etiqueta +viewLabel: Ver etiqueta diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index 915b58b15..5157d957b 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -177,7 +177,7 @@ watchEffect(selectedRows); diff --git a/src/pages/Item/Card/ItemCard.vue b/src/pages/Item/Card/ItemCard.vue index 1162327c1..2412f2bf9 100644 --- a/src/pages/Item/Card/ItemCard.vue +++ b/src/pages/Item/Card/ItemCard.vue @@ -12,7 +12,7 @@ import ItemListFilter from '../ItemListFilter.vue'; search-data-key="ItemList" :searchbar-props="{ url: 'Items/filter', - label: 'searchbar.labelr', + label: 'searchbar.label', info: 'searchbar.info', }" /> diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue index baac0c608..ef844824f 100644 --- a/src/pages/Item/Card/ItemDescriptor.vue +++ b/src/pages/Item/Card/ItemDescriptor.vue @@ -11,7 +11,6 @@ import VnConfirm from 'components/ui/VnConfirm.vue'; import RegularizeStockForm from 'components/RegularizeStockForm.vue'; import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue'; import useCardDescription from 'src/composables/useCardDescription'; -import { getUrl } from 'src/composables/getUrl'; import axios from 'axios'; import { dashIfEmpty } from 'src/filters'; @@ -51,10 +50,8 @@ const entityId = computed(() => { const regularizeStockFormDialog = ref(null); const available = ref(null); const visible = ref(null); -const salixUrl = ref(); onMounted(async () => { - salixUrl.value = await getUrl(''); await getItemConfigs(); await updateStock(); }); @@ -200,16 +197,11 @@ const openCloneDialog = async () => { [ name: 'rate2', ...defaultColumnAttrs, cardVisible: true, - columnField: { - class: 'expand', - component: 'input', - type: 'number', - }, - columnFilter: { - class: 'expand', - component: 'input', - type: 'number', - }, + component: 'input', + type: 'number', }, { label: t('item.fixedPrice.packingPrice'), @@ -93,35 +85,18 @@ const columns = computed(() => [ name: 'rate3', ...defaultColumnAttrs, cardVisible: true, - columnField: { - class: 'expand', - component: 'input', - type: 'number', - }, - columnFilter: { - class: 'expand', - component: 'input', - type: 'number', - }, + component: 'input', + type: 'number', }, { label: t('item.fixedPrice.minPrice'), field: 'minPrice', - columnClass: 'shrink', name: 'minPrice', ...defaultColumnAttrs, cardVisible: true, - columnField: { - class: 'expand', - component: 'input', - type: 'number', - }, - columnFilter: { - class: 'expand', - component: 'input', - type: 'number', - }, + component: 'input', + type: 'number', }, { label: t('item.fixedPrice.started'), @@ -162,16 +137,9 @@ const columns = computed(() => [ name: 'warehouseFk', ...defaultColumnAttrs, columnClass: 'shrink', - columnFilter: { - component: 'select', - }, - columnField: { - component: 'select', - class: 'expand', - }, - attrs: { - options: warehousesOptions, - }, + component: 'select', + + options: warehousesOptions, }, { align: 'right', @@ -518,29 +486,35 @@ function handleOnDataSave({ CrudModelRef }) { {{ row.subName }} - + - - € - + + + € + + - - € - + + + € + + - + - + + + { @@ -64,7 +64,7 @@ const handleScopeDays = (params, days, callback) => { @@ -105,7 +105,7 @@ const handleScopeDays = (params, days, callback) => { outlined dense rounded - :label="t('params.salesPersonFk')" + :label="t('globals.params.salesPersonFk')" v-model="params.salesPersonFk" url="Workers/search" :params="{ departmentCodes: ['VT'] }" @@ -158,7 +158,7 @@ const handleScopeDays = (params, days, callback) => { outlined dense rounded - :label="t('params.stateFk')" + :label="t('globals.params.stateFk')" v-model="params.stateFk" url="States" is-outlined @@ -184,7 +184,7 @@ const handleScopeDays = (params, days, callback) => { outlined dense rounded - :label="t('params.warehouseFk')" + :label="t('globals.params.warehouseFk')" v-model="params.warehouseFk" :options="warehouses" /> @@ -196,7 +196,7 @@ const handleScopeDays = (params, days, callback) => { outlined dense rounded - :label="t('params.provinceFk')" + :label="t('globals.params.provinceFk')" v-model="params.provinceFk" url="Provinces" /> @@ -235,22 +235,15 @@ const handleScopeDays = (params, days, callback) => { en: params: - clientFk: Client id orderFk: Order id scopeDays: Days onward nickname: Nickname - salesPersonFk: Sales person refFk: Invoice agencyModeFk: Agency - stateFk: State groupedStates: Grouped State - warehouseFk: Warehouse - provinceFk: Province myTeam: My team problems: With problems pending: Pending - from: From - to: To alertLevel: Grouped State FREE: Free DELIVERED: Delivered @@ -261,22 +254,15 @@ en: es: params: - clientFk: Id cliente orderFk: Id cesta scopeDays: DĂas en adelante nickname: Nombre mostrado - salesPersonFk: Comercial refFk: Factura agencyModeFk: Agencia - stateFk: Estado groupedStates: Estado agrupado - warehouseFk: AlmacĂ©n - provinceFk: Provincia myTeam: Mi equipo problems: Con problemas pending: Pendiente - from: Desde - To: Hasta alertLevel: Estado agrupado FREE: Libre DELIVERED: Servido diff --git a/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue b/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue index 4950ab381..f1c347588 100644 --- a/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue +++ b/src/pages/Monitor/Ticket/MonitorTicketSearchbar.vue @@ -3,7 +3,7 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue'; - { @@ -84,7 +85,16 @@ function handleLocation(data, location) { handleLocation(data, location)" > diff --git a/src/pages/Supplier/Card/SupplierFiscalData.vue b/src/pages/Supplier/Card/SupplierFiscalData.vue index 65c34c4ed..60cd6770b 100644 --- a/src/pages/Supplier/Card/SupplierFiscalData.vue +++ b/src/pages/Supplier/Card/SupplierFiscalData.vue @@ -19,8 +19,8 @@ const sageTransactionTypesOptions = ref([]); const supplierActivitiesOptions = ref([]); function handleLocation(data, location) { - const { town, code, provinceFk, countryFk } = location ?? {}; - data.postCode = code; + const { town, label, provinceFk, countryFk } = location ?? {}; + data.postCode = label; data.city = town; data.provinceFk = provinceFk; data.countryFk = countryFk; @@ -51,6 +51,23 @@ function handleLocation(data, location) { :url="`Suppliers/${route.params.id}`" :url-update="`Suppliers/${route.params.id}/updateFiscalData`" model="supplier" + :filter="{ + fields: ['id', 'name', 'city', 'postCode', 'countryFk', 'provinceFk'], + include: [ + { + relation: 'province', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'country', + scope: { + fields: ['id', 'name'], + }, + }, + ], + }" auto-load :clear-store-on-unmount="false" > @@ -130,7 +147,12 @@ function handleLocation(data, location) { handleLocation(data, location)" > diff --git a/src/pages/Travel/Card/TravelBasicData.vue b/src/pages/Travel/Card/TravelBasicData.vue index 8a369a0dd..a3620a6ba 100644 --- a/src/pages/Travel/Card/TravelBasicData.vue +++ b/src/pages/Travel/Card/TravelBasicData.vue @@ -70,6 +70,9 @@ const agenciesOptions = ref([]); hide-selected /> + + + { return { @@ -25,10 +24,46 @@ const initialData = computed(() => { }; }); -function reloadData() { - initialData.value.name = null; - paginate.value.fetch(); -} +const columns = computed(() => [ + { + align: 'left', + name: 'id', + label: t('ID'), + isId: true, + cardVisible: true, + }, + { + align: 'left', + name: 'name', + label: t('Name'), + isTitle: true, + }, + { + align: 'left', + name: 'divisible', + label: t('Divisible'), + cardVisible: true, + component: 'checkbox', + }, + { + align: 'right', + name: 'tableActions', + actions: [ + { + title: t('components.smartCard.openCard'), + icon: 'arrow_forward', + isPrimary: true, + action: (row) => navigate(row.id, row.name), + }, + { + title: t('wagon.list.remove'), + icon: 'delete', + isPrimary: true, + action: (row) => remove(row), + }, + ], + }, +]); function navigate(id, name) { push({ path: `/wagon/type/${id}/edit`, query: { name } }); @@ -41,51 +76,25 @@ async function remove(row) { type: 'positive', }); store.data.splice(store.data.indexOf(row), 1); + window.location.reload(); } - - - - - - - - - - - - - - - + + @@ -94,7 +103,7 @@ async function remove(row) { url-create="WagonTypes" model="WagonType" :form-initial-data="initialData" - @on-data-saved="reloadData()" + @on-data-saved="window.location.reload()" auto-load > diff --git a/src/pages/Wagon/WagonList.vue b/src/pages/Wagon/WagonList.vue index c4824b861..129e803f5 100644 --- a/src/pages/Wagon/WagonList.vue +++ b/src/pages/Wagon/WagonList.vue @@ -1,12 +1,13 @@