diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index e0a60fadc..c5caf9778 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -91,6 +91,7 @@ defineExpose({ :title="t('globals.save')" type="submit" color="primary" + class="q-ml-sm" :disabled="isLoading" :loading="isLoading" /> diff --git a/src/composables/getDateQBadgeColor.js b/src/composables/getDateQBadgeColor.js new file mode 100644 index 000000000..be9ef41b5 --- /dev/null +++ b/src/composables/getDateQBadgeColor.js @@ -0,0 +1,11 @@ +export function getDateQBadgeColor(date) { + let today = Date.vnNew(); + today.setHours(0, 0, 0, 0); + let timeTicket = new Date(date); + timeTicket.setHours(0, 0, 0, 0); + + let comparation = today - timeTicket; + + if (comparation == 0) return 'warning'; + if (comparation < 0) return 'negative'; +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 04c278abe..828238215 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1120,6 +1120,8 @@ item: list: List diary: Diary tags: Tags + create: Create + buyRequest: Buy requests fixedPrice: Fixed prices wasteBreakdown: Waste breakdown itemCreate: New item @@ -1166,6 +1168,17 @@ item: 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' diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 6bb64c9f5..afb93a672 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -1120,6 +1120,7 @@ item: diary: Histórico tags: Etiquetas fixedPrice: Precios fijados + buyRequest: Peticiones de compra wasteBreakdown: Deglose de mermas itemCreate: Nuevo artículo basicData: 'Datos básicos' @@ -1199,6 +1200,17 @@ item: 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/Item/ItemRequest.vue b/src/pages/Item/ItemRequest.vue new file mode 100644 index 000000000..1872ad859 --- /dev/null +++ b/src/pages/Item/ItemRequest.vue @@ -0,0 +1,360 @@ + + + + + + + + + + + + + + {{ t('globals.collapseMenu') }} + + + + + + + + + + + + + + + {{ row.ticketFk }} + + + + + + + + {{ toDateFormat(row.shipped) }} + + {{ toDateFormat(row.shipped) }} + + + + + {{ row.requesterName }} + + + + + + {{ row.attenderName }} + + + + + + + + + + + + + + + + {{ row.itemDescription }} + + + + + + {{ getState(row.isOk) }} + + + + + + + {{ row.response }} + + + + + {{ t('Discard') }} + + + + + + + + + + + + +es: + Discard: Descartar + You can search by Id or alias: Buscar peticiones por identificador o alias + Denied: Denegada + Accepted: Aceptada + Pending: Pendiente + diff --git a/src/pages/Item/ItemRequestDenyForm.vue b/src/pages/Item/ItemRequestDenyForm.vue new file mode 100644 index 000000000..f26edb845 --- /dev/null +++ b/src/pages/Item/ItemRequestDenyForm.vue @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + +es: + Specify the reasons to deny this request: Especifica las razones para descartar la petición + diff --git a/src/pages/Item/ItemRequestFilter.vue b/src/pages/Item/ItemRequestFilter.vue new file mode 100644 index 000000000..8b0b34e62 --- /dev/null +++ b/src/pages/Item/ItemRequestFilter.vue @@ -0,0 +1,318 @@ + + + + (itemTypesOptions = data)" + auto-load + /> + (warehousesOptions = data)" + auto-load + /> + (workersOptions = data)" + auto-load + /> + + + + {{ t(`params.${tag.label}`) }}: + {{ formatFn(tag.value) }} + {{ t(`${tag.value}`) }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ scope.opt?.name }} + {{ scope.opt?.nickname }}, + {{ scope.opt?.code }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ t('dateFiltersTooltip') }} + + + + + + + + + + + + + + + + + + +en: + params: + search: General search + ticketFk: Ticket id + attenderFk: Atender + clientFk: Client id + warehouseFk: Warehouse + requesterFk: Salesperson + from: From + to: To + scopeDays: Days onward + mine: For me + state: State + dateFiltersTooltip: Cannot choose a range of dates and days onward at the same time + denied: Denied + accepted: Accepted + pending: Pending + +es: + params: + search: Búsqueda general + ticketFk: Id ticket + attenderFk: Comprador + clientFk: Id cliente + warehouseFk: Almacén + requesterFk: Comercial + from: Desde + to: Hasta + scopeDays: Días adelante + mine: Para mi + state: Estado + dateFiltersTooltip: No se puede seleccionar un rango de fechas y días en adelante a la vez + denied: Denegada + accepted: Aceptada + pending: Pendiente + diff --git a/src/pages/Travel/TravelList.vue b/src/pages/Travel/TravelList.vue index 9f624c224..d06d56f3a 100644 --- a/src/pages/Travel/TravelList.vue +++ b/src/pages/Travel/TravelList.vue @@ -13,6 +13,7 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import { useStateStore } from 'stores/useStateStore'; import { toDate } from 'src/filters/index'; import { useSummaryDialog } from 'src/composables/useSummaryDialog'; +import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; const router = useRouter(); const { t } = useI18n(); @@ -42,18 +43,6 @@ const getWarehouseName = (id) => { return warehouses.value.find((warehouse) => warehouse.id === id).name; }; -const getDateQBadgeColor = (date) => { - let today = Date.vnNew(); - today.setHours(0, 0, 0, 0); - - date = new Date(date); - date.setHours(0, 0, 0, 0); - - const timeDifference = today - date; - if (timeDifference == 0) return 'warning'; - if (timeDifference < 0) return 'success'; -}; - onMounted(async () => { stateStore.rightDrawer = true; }); diff --git a/src/router/modules/item.js b/src/router/modules/item.js index b1aee83e6..1a079f438 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -10,7 +10,7 @@ export default { component: RouterView, redirect: { name: 'ItemMain' }, menus: { - main: ['ItemList', 'WasteBreakdown', 'ItemFixedPrice'], + main: ['ItemList', 'WasteBreakdown', 'ItemFixedPrice', 'ItemRequest'], card: [ 'ItemBasicData', 'ItemDiary', @@ -66,6 +66,15 @@ export default { 'https://grafana.verdnatura.es/d/TTNXQAxVk'; }, }, + { + path: 'request', + name: 'ItemRequest', + meta: { + title: 'buyRequest', + icon: 'vn:buyrequest', + }, + component: () => import('src/pages/Item/ItemRequest.vue'), + }, ], }, {