diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 30bcac66b..a2eaa649a 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -247,6 +247,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { } function updateStateParams() { + if (!route) return; const newUrl = { path: route.path, query: { ...(route.query ?? {}) } }; newUrl.query[store.searchUrl] = JSON.stringify(store.currentFilter); diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index aa8df17e2..c1748c8ff 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1055,92 +1055,6 @@ travel: warehouse: Warehouse travelFileDescription: 'Travel id { travelId }' file: File -item: - descriptor: - item: Item - buyer: Buyer - color: Color - category: Category - stems: Stems - visible: Visible - available: Available - warehouseText: 'Calculated on the warehouse of { warehouseName }' - itemDiary: Item diary - producer: Producer - list: - id: Identifier - grouping: Grouping - packing: Packing - description: Description - stems: Stems - category: Category - typeName: Type - intrastat: Intrastat - isActive: Active - size: Size - origin: Origin - userName: Buyer - weightByPiece: Weight/Piece - stemMultiplier: Multiplier - producer: Producer - landed: Landed - fixedPrice: - itemFk: Item ID - groupingPrice: Grouping price - packingPrice: Packing price - hasMinPrice: Has min price - minPrice: Min price - started: Started - ended: Ended - warehouse: Warehouse - create: - name: Name - tag: Tag - priority: Priority - type: Type - intrastat: Intrastat - origin: Origin - buyRequest: - ticketId: 'Ticket ID' - shipped: 'Shipped' - requester: 'Requester' - requested: 'Requested' - price: 'Price' - attender: 'Atender' - item: 'Item' - achieved: 'Achieved' - concept: 'Concept' - state: 'State' - summary: - basicData: 'Basic data' - otherData: 'Other data' - description: 'Description' - tax: 'Tax' - tags: 'Tags' - botanical: 'Botanical' - barcode: 'Barcode' - name: 'Nombre' - completeName: 'Nombre completo' - family: 'Familia' - size: 'Medida' - origin: 'Origen' - stems: 'Tallos' - multiplier: 'Multiplicador' - buyer: 'Comprador' - doPhoto: 'Do photo' - intrastatCode: 'Código intrastat' - intrastat: 'Intrastat' - ref: 'Referencia' - relevance: 'Relevancia' - weight: 'Peso (gramos)/tallo' - units: 'Unidades/caja' - expense: 'Gasto' - generic: 'Genérico' - recycledPlastic: 'Plástico reciclado' - nonRecycledPlastic: 'Plástico no reciclado' - minSalesQuantity: 'Cantidad mínima de venta' - genus: 'Genus' - specie: 'Specie' components: topbar: {} itemsFilterPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 575e2c6c7..bd414a793 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1053,92 +1053,6 @@ travel: warehouse: Almacén travelFileDescription: 'Id envío { travelId }' file: Fichero -item: - descriptor: - item: Artículo - buyer: Comprador - color: Color - category: Categoría - stems: Tallos - visible: Visible - available: Disponible - warehouseText: 'Calculado sobre el almacén de { warehouseName }' - itemDiary: Registro de compra-venta - producer: Productor - list: - id: Identificador - grouping: Grouping - packing: Packing - description: Descripción - stems: Tallos - category: Reino - typeName: Tipo - intrastat: Intrastat - isActive: Activo - size: Medida - origin: Origen - weightByPiece: Peso (gramos)/tallo - userName: Comprador - stemMultiplier: Multiplicador - producer: Productor - landed: F. entrega - fixedPrice: - itemFk: ID Artículo - groupingPrice: Precio grouping - packingPrice: Precio packing - hasMinPrice: Tiene precio mínimo - minPrice: Precio min - started: Inicio - ended: Fin - warehouse: Almacén - create: - name: Nombre - tag: Etiqueta - priority: Prioridad - type: Tipo - intrastat: Intrastat - origin: Origen - summary: - basicData: 'Datos básicos' - otherData: 'Otros datos' - description: 'Descripción' - tax: 'IVA' - tags: 'Etiquetas' - botanical: 'Botánico' - barcode: 'Código de barras' - name: 'Nombre' - completeName: 'Nombre completo' - family: 'Familia' - size: 'Medida' - origin: 'Origen' - stems: 'Tallos' - multiplier: 'Multiplicador' - buyer: 'Comprador' - doPhoto: 'Hacer foto' - intrastatCode: 'Código intrastat' - intrastat: 'Intrastat' - ref: 'Referencia' - relevance: 'Relevancia' - weight: 'Peso (gramos)/tallo' - units: 'Unidades/caja' - expense: 'Gasto' - generic: 'Genérico' - recycledPlastic: 'Plástico reciclado' - nonRecycledPlastic: 'Plástico no reciclado' - minSalesQuantity: 'Cantidad mínima de venta' - genus: 'Genus' - specie: 'Specie' - buyRequest: - ticketId: 'ID Ticket' - shipped: 'F. envío' - requester: 'Solicitante' - requested: 'Solicitado' - price: 'Precio' - attender: 'Comprador' - item: 'Artículo' - achieved: 'Conseguido' - concept: 'Concepto' - state: 'Estado' components: topbar: {} itemsFilterPanel: diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue index 72c445fa9..9e7f1b10a 100644 --- a/src/pages/Account/AccountList.vue +++ b/src/pages/Account/AccountList.vue @@ -74,7 +74,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('View Summary'), + title: t('components.smartCard.viewSummary'), icon: 'preview', action: (row) => viewSummary(row.id, AccountSummary), isPrimary: true, diff --git a/src/pages/Account/Role/AccountRoles.vue b/src/pages/Account/Role/AccountRoles.vue index ea175d913..5398485e3 100644 --- a/src/pages/Account/Role/AccountRoles.vue +++ b/src/pages/Account/Role/AccountRoles.vue @@ -54,7 +54,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('View Summary'), + title: t('components.smartCard.viewSummary'), icon: 'preview', action: (row) => viewSummary(row.id, RoleSummary), isPrimary: true, diff --git a/src/pages/Item/Card/ItemBasicData.vue b/src/pages/Item/Card/ItemBasicData.vue index ae9e45983..1b0342668 100644 --- a/src/pages/Item/Card/ItemBasicData.vue +++ b/src/pages/Item/Card/ItemBasicData.vue @@ -63,7 +63,7 @@ const onIntrastatCreated = (response, formData) => { { - - - - - + + + + + { { { - - + + - {{ t('itemBasicData.isFragileTooltip') }} + {{ t('item.basicData.isFragileTooltip') }} - {{ t('itemBasicData.isPhotoRequestedTooltip') }} + {{ t('item.basicData.isPhotoRequestedTooltip') }} { return route.params.id; }); -onMounted(async () => { - itemBotanicalsForm.itemFk = entityId.value; - itemBotanicals.value = await itemBotanicalsRef.value.fetch(); - if (itemBotanicals.value.length > 0) - Object.assign(itemBotanicalsForm, itemBotanicals.value[0]); -}); { @on-fetch="(data) => (itemBotanicals = data)" /> (itemBotanicalsForm = data)" > diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue index ef844824f..243d4c7cb 100644 --- a/src/pages/Item/Card/ItemDescriptor.vue +++ b/src/pages/Item/Card/ItemDescriptor.vue @@ -1,18 +1,18 @@ @@ -151,7 +118,7 @@ const openCloneDialog = async () => { - + {{ t('globals.clone') }} @@ -160,8 +127,8 @@ const openCloneDialog = async () => { @@ -194,6 +161,18 @@ const openCloneDialog = async () => { :value="entity.value7" /> + + + + {{ t('Inactive article') }} + + + { es: Regularize stock: Regularizar stock - All its properties will be copied: Todas sus propiedades serán copiadas - Do you want to clone this item?: ¿Desea clonar este artículo? + Inactive article: Artículo inactivo es: New item: Nuevo artículo - All it's properties will be copied: Todas sus propiedades serán copiadas - Do you want to clone this item?: ¿Desea clonar este artículo? Preview: Vista previa + Regularize stock: Regularizar stock diff --git a/src/pages/Item/ItemRequest.vue b/src/pages/Item/ItemRequest.vue index 25082697d..450031a0e 100644 --- a/src/pages/Item/ItemRequest.vue +++ b/src/pages/Item/ItemRequest.vue @@ -1,23 +1,17 @@ - - - - + + + + {{ row.ticketFk }} + + + + + + + {{ toDate(row.shipped) }} + + + + + + {{ row.attenderName }} + + - - - - - - {{ row.ticketFk }} - - - - - - - {{ toDateFormat(row.shipped) }} - - {{ toDateFormat(row.shipped) }} - - - - - {{ row.requesterName }} - - - - - - - - - - {{ scope.opt?.name }} - {{ scope.opt?.nickname }}, - {{ scope.opt?.code }} - - - - - - - - - - - - - - - - - - - {{ row.itemDescription }} - - - - - - {{ getState(row.isOk) }} - - - - - - - {{ row.response }} - - - - - {{ t('Discard') }} - - - - - - - + + {{ row.requesterName }} + + + + + + + + + + + + + + + + + {{ row.itemDescription }} + + + + handleScopeDays(evt.target.value)" + @remove="handleScopeDays()" + class="q-px-xs q-pr-lg" + filled + dense /> - - + + + + + + {{ row.response }} + + + + + {{ t('Discard') }} + + + + + + + + diff --git a/src/pages/Item/ItemRequestDenyForm.vue b/src/pages/Item/ItemRequestDenyForm.vue index be70fb799..c9a4cbe9c 100644 --- a/src/pages/Item/ItemRequestDenyForm.vue +++ b/src/pages/Item/ItemRequestDenyForm.vue @@ -10,6 +10,7 @@ defineProps({ requestId: { type: Number, default: null, + required: true, }, }); @@ -43,6 +44,7 @@ onMounted(async () => { type="textarea" v-model="data.observation" fill-input + :required="true" autogrow /> diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index d874a5dcb..2c1153016 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -1,113 +1,128 @@ + (workerOptions = data)" + auto-load + /> + (ItemCategoriesOptions = data)" + auto-load + /> - - - - - - - - - - - - - - - - - - - - - - - - - {{ t('New item type') }} - - + + + + es: + id: Id + code: Código + name: Nombre + worker: Trabajador + ItemCategory: Reino + Temperature: Temperatura + Create ItemTypes: Crear familia + en: + code: Code + name: Name + worker: Worker + ItemCategory: ItemCategory + Temperature: Temperature + diff --git a/src/pages/Item/composables/cloneItem.js b/src/pages/Item/composables/cloneItem.js new file mode 100644 index 000000000..2421c0808 --- /dev/null +++ b/src/pages/Item/composables/cloneItem.js @@ -0,0 +1,36 @@ +import axios from 'axios'; +import { useRouter } from 'vue-router'; +import { useI18n } from 'vue-i18n'; +import { useQuasar } from 'quasar'; +import VnConfirm from 'components/ui/VnConfirm.vue'; + +export function cloneItem() { + const { t } = useI18n(); + + const quasar = useQuasar(); + const router = useRouter(); + const cloneItem = async (entityId) => { + const { id } = entityId; + try { + const { data } = await axios.post(`Items/${id ?? entityId}/clone`); + router.push({ name: 'ItemTags', params: { id: data.id } }); + } catch (err) { + console.error('Error cloning item'); + } + }; + + const openCloneDialog = async (entityId) => { + quasar + .dialog({ + component: VnConfirm, + componentProps: { + title: t('item.descriptor.clone.title'), + message: t('item.descriptor.clone.subTitle'), + }, + }) + .onOk(async () => { + await cloneItem(entityId); + }); + }; + return { openCloneDialog }; +} diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index c32ee493c..e99853760 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -88,3 +88,127 @@ itemType: worker: Worker category: Category temperature: Temperature +item: + params: + daysOnward: Days onward + search: General search + ticketFk: Ticket id + attenderFk: Atender + clientFk: Client id + warehouseFk: Warehouse + requesterFk: Salesperson + from: From + to: To + mine: For me + state: State + myTeam: My team + searchbar: + label: Search item + descriptor: + item: Item + buyer: Buyer + color: Color + category: Category + stems: Stems + visible: Visible + available: Available + warehouseText: 'Calculated on the warehouse of { warehouseName }' + itemDiary: Item diary + producer: Producer + clone: + title: All its properties will be copied + subTitle: Do you want to clone this item? + list: + id: Identifier + grouping: Grouping + packing: Packing + description: Description + stems: Stems + category: Category + typeName: Type + intrastat: Intrastat + isActive: Active + size: Size + origin: Origin + userName: Buyer + weightByPiece: Weight/Piece + stemMultiplier: Multiplier + producer: Producer + landed: Landed + basicData: + type: Type + reference: Reference + relevancy: Relevancy + stems: Stems + multiplier: Multiplier + generic: Generic + intrastat: Intrastat + expense: Expense + weightByPiece: Weight/Piece + boxUnits: Units/Box + recycledPlastic: Recycled Plastic + nonRecycledPlastic: Non recycled plastic + isActive: Active + hasKgPrice: Price in kg + isFragile: Fragile + isFragileTooltip: Is shown at website, app that this item cannot travel (wreath, palms, ...) + isPhotoRequested: Do photo + isPhotoRequestedTooltip: This item does need a photo + description: Description + fixedPrice: + itemFk: Item ID + groupingPrice: Grouping price + packingPrice: Packing price + hasMinPrice: Has min price + minPrice: Min price + started: Started + ended: Ended + warehouse: Warehouse + create: + name: Name + tag: Tag + priority: Priority + type: Type + intrastat: Intrastat + origin: Origin + buyRequest: + ticketId: 'Ticket ID' + shipped: 'Shipped' + requester: 'Requester' + requested: 'Requested' + price: 'Price' + attender: 'Attender' + item: 'Item' + achieved: 'Achieved' + concept: 'Concept' + state: 'State' + summary: + basicData: 'Basic data' + otherData: 'Other data' + description: 'Description' + tax: 'Tax' + tags: 'Tags' + botanical: 'Botanical' + barcode: 'Barcode' + name: 'Nombre' + completeName: 'Nombre completo' + family: 'Familia' + size: 'Medida' + origin: 'Origen' + stems: 'Tallos' + multiplier: 'Multiplicador' + buyer: 'Comprador' + doPhoto: 'Do photo' + intrastatCode: 'Código intrastat' + intrastat: 'Intrastat' + ref: 'Referencia' + relevance: 'Relevancia' + weight: 'Peso (gramos)/tallo' + units: 'Unidades/caja' + expense: 'Gasto' + generic: 'Genérico' + recycledPlastic: 'Plástico reciclado' + nonRecycledPlastic: 'Plástico no reciclado' + minSalesQuantity: 'Cantidad mínima de venta' + genus: 'Genus' + specie: 'Specie' diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index d32cb7885..56c6ec317 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -88,3 +88,129 @@ itemType: worker: Trabajador category: Reino temperature: Temperatura +params: + state: asfsdf +item: + params: + daysOnward: Días adelante + search: Búsqueda general + ticketFk: Id ticket + attenderFk: Comprador + clientFk: Id cliente + warehouseFk: Almacén + requesterFk: Comercial + from: Desde + to: Hasta + mine: Para mi + state: Estado + myTeam: Mi equipo + searchbar: + label: Buscar artículo + descriptor: + item: Artículo + buyer: Comprador + color: Color + category: Categoría + stems: Tallos + visible: Visible + available: Disponible + warehouseText: 'Calculado sobre el almacén de { warehouseName }' + itemDiary: Registro de compra-venta + producer: Productor + clone: + title: Todas sus propiedades serán copiadas + subTitle: ¿Desea clonar este artículo? + list: + id: Identificador + grouping: Grouping + packing: Packing + description: Descripción + stems: Tallos + category: Reino + typeName: Tipo + intrastat: Intrastat + isActive: Activo + size: Medida + origin: Origen + weightByPiece: Peso (gramos)/tallo + userName: Comprador + stemMultiplier: Multiplicador + producer: Productor + landed: F. entrega + basicData: + type: Tipo + reference: Referencia + relevancy: Relevancia + stems: Tallos + multiplier: Multiplicador + generic: Genérico + intrastat: Intrastat + expense: Gasto + weightByPiece: Peso (gramos)/tallo + boxUnits: Unidades/caja + recycledPlastic: Plastico reciclado + nonRecycledPlastic: Plático no reciclado + isActive: Activo + hasKgPrice: Precio en kg + isFragile: Frágil + isFragileTooltip: Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...) + isPhotoRequested: Hacer foto + isPhotoRequestedTooltip: Este artículo necesita una foto + description: Descripción + fixedPrice: + itemFk: ID Artículo + groupingPrice: Precio grouping + packingPrice: Precio packing + hasMinPrice: Tiene precio mínimo + minPrice: Precio min + started: Inicio + ended: Fin + warehouse: Almacén + create: + name: Nombre + tag: Etiqueta + priority: Prioridad + type: Tipo + intrastat: Intrastat + origin: Origen + summary: + basicData: 'Datos básicos' + otherData: 'Otros datos' + description: 'Descripción' + tax: 'IVA' + tags: 'Etiquetas' + botanical: 'Botánico' + barcode: 'Código de barras' + name: 'Nombre' + completeName: 'Nombre completo' + family: 'Familia' + size: 'Medida' + origin: 'Origen' + stems: 'Tallos' + multiplier: 'Multiplicador' + buyer: 'Comprador' + doPhoto: 'Hacer foto' + intrastatCode: 'Código intrastat' + intrastat: 'Intrastat' + ref: 'Referencia' + relevance: 'Relevancia' + weight: 'Peso (gramos)/tallo' + units: 'Unidades/caja' + expense: 'Gasto' + generic: 'Genérico' + recycledPlastic: 'Plástico reciclado' + nonRecycledPlastic: 'Plástico no reciclado' + minSalesQuantity: 'Cantidad mínima de venta' + genus: 'Genus' + specie: 'Specie' + buyRequest: + ticketId: 'ID Ticket' + shipped: 'F. envío' + requester: 'Solicitante' + requested: 'Solicitado' + price: 'Precio' + attender: 'Comprador' + item: 'Artículo' + achieved: 'Conseguido' + concept: 'Concepto' + state: 'Estado' diff --git a/src/pages/Route/RouteAutonomous.vue b/src/pages/Route/RouteAutonomous.vue index 5ad349942..4a691dbef 100644 --- a/src/pages/Route/RouteAutonomous.vue +++ b/src/pages/Route/RouteAutonomous.vue @@ -126,7 +126,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('Preview'), + title: t('components.smartCard.viewSummary'), icon: 'preview', isPrimary: true, action: (row) => viewSummary(row?.routeFk, RouteSummary), diff --git a/src/pages/Route/RouteExtendedList.vue b/src/pages/Route/RouteExtendedList.vue index 51da4ec12..dbf646935 100644 --- a/src/pages/Route/RouteExtendedList.vue +++ b/src/pages/Route/RouteExtendedList.vue @@ -204,7 +204,7 @@ const columns = computed(() => [ isPrimary: true, }, { - title: t('route.components.smartCard.viewSummary'), + title: t('components.smartCard.viewSummary'), icon: 'preview', action: (row) => viewSummary(row?.id, RouteSummary), isPrimary: true, diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue index c8687ed5f..dd1f2d69a 100644 --- a/src/pages/Ticket/TicketList.vue +++ b/src/pages/Ticket/TicketList.vue @@ -204,7 +204,7 @@ const columns = computed(() => [ action: (row) => redirectToLines(row.id), }, { - title: t('ticketList.summary'), + title: t('components.smartCard.viewSummary'), icon: 'preview', isPrimary: true, action: (row) => viewSummary(row.id, TicketSummary), diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue index d160ea6b5..89f2dd42c 100644 --- a/src/pages/Zone/ZoneList.vue +++ b/src/pages/Zone/ZoneList.vue @@ -103,7 +103,7 @@ const columns = computed(() => [ name: 'tableActions', actions: [ { - title: t('list.zoneSummary'), + title: t('components.smartCard.viewSummary'), icon: 'preview', action: (row) => viewSummary(row.id, ZoneSummary), isPrimary: true, diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 48e19dd54..2838c3be7 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -48,6 +48,28 @@ export default { }, component: () => import('src/pages/Item/ItemList.vue'), }, + { + path: 'request', + name: 'ItemRequest', + meta: { + title: 'buyRequest', + icon: 'vn:buyrequest', + }, + component: () => import('src/pages/Item/ItemRequest.vue'), + }, + { + path: 'waste-breakdown', + name: 'WasteBreakdown', + meta: { + title: 'wasteBreakdown', + icon: 'vn:claims', + }, + beforeEnter: (to, from, next) => { + next({ name: 'ItemList' }); + window.location.href = + 'https://grafana.verdnatura.es/d/TTNXQAxVk'; + }, + }, { path: 'fixed-price', name: 'ItemFixedPrice', @@ -65,19 +87,7 @@ export default { }, component: () => import('src/pages/Item/ItemCreate.vue'), }, - { - path: 'waste-breakdown', - name: 'WasteBreakdown', - meta: { - title: 'wasteBreakdown', - icon: 'vn:claims', - }, - beforeEnter: (to, from, next) => { - next({ name: 'ItemList' }); - window.location.href = - 'https://grafana.verdnatura.es/d/TTNXQAxVk'; - }, - }, + { path: 'item-type-list', name: 'ItemTypeList', @@ -95,15 +105,6 @@ export default { }, component: () => import('src/pages/Item/ItemTypeCreate.vue'), }, - { - path: 'request', - name: 'ItemRequest', - meta: { - title: 'buyRequest', - icon: 'vn:buyrequest', - }, - component: () => import('src/pages/Item/ItemRequest.vue'), - }, ], }, {