From c03875838f29a2144ee9fe7a05f32d0871cc15ce Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 2 May 2024 15:18:14 +0200 Subject: [PATCH] feat: minor updates --- src/pages/Item/components/ItemProposal.vue | 41 ++++++++++++---------- src/pages/Item/locale/en.yml | 13 ++++--- src/pages/Item/locale/es.yml | 13 ++++--- 3 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/pages/Item/components/ItemProposal.vue b/src/pages/Item/components/ItemProposal.vue index a644661e5..1ca7f435f 100644 --- a/src/pages/Item/components/ItemProposal.vue +++ b/src/pages/Item/components/ItemProposal.vue @@ -5,7 +5,7 @@ import { ref, reactive, computed } from 'vue'; import { useI18n } from 'vue-i18n'; // import { useDialogPluginComponent } from 'quasar'; -import VnInput from 'src/components/common/VnInput.vue'; +// import VnInput from 'src/components/common/VnInput.vue'; import { useArrayData } from 'composables/useArrayData'; const { t } = useI18n(); @@ -39,13 +39,13 @@ const defaultColumnAttrs = { align: 'left', sortable: true, }; -const getColumnInputEvents = (col) => { - return col.columnFilter.type === 'select' - ? { 'update:modelValue': () => applyColumnFilter(col) } - : { - 'keyup.enter': () => applyColumnFilter(col), - }; -}; +// const getColumnInputEvents = (col) => { +// return col.columnFilter.type === 'select' +// ? { 'update:modelValue': () => applyColumnFilter(col) } +// : { +// 'keyup.enter': () => applyColumnFilter(col), +// }; +// }; const applyColumnFilter = async (col) => { try { const paramKey = col.columnFilter?.filterParamKey || col.field; @@ -68,10 +68,12 @@ const statusConditionalValue = (row) => { const total = [5, 6, 7, 8].reduce((acc, i) => acc + row[`match${i}`], 0); const STATUS_VALUES = { 2: '$secondary', 3: 'positive', 4: 'warning' }; const status = STATUS_VALUES[total - 2]; - if (!status) return 'not-match'; + if (!status) return 'white'; return status; }; const conditionalValue = (tag) => (tag === 1 ? 'match' : 'not-match'); +const conditionalValuePrice = ({ price2, priceOld }) => + price2 > priceOld * 1.3 ? 'match' : 'not-match'; const columns = computed(() => [ { ...defaultColumnAttrs, @@ -89,8 +91,7 @@ const columns = computed(() => [ ...defaultColumnAttrs, label: t('proposal.status'), name: 'status', - field: 'status', - classes: statusConditionalValue, + field: statusConditionalValue, }, { ...defaultColumnAttrs, @@ -149,6 +150,7 @@ const columns = computed(() => [ label: t('proposal.price2'), name: 'price2', field: 'price2', + classes: ({ match8 }) => conditionalValuePrice(match8), }, { ...defaultColumnAttrs, @@ -180,8 +182,7 @@ const columns = computed(() => [ }, }" auto-load - @on-fetch="(data) => (itemsProposal = data)" - /> + @on-fetch="(data) => (itemsProposal = data)" /> [ - - + diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index 1c0d28345..8a3caba6b 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -12,14 +12,17 @@ itemDiary: since: Since warehouse: Warehouse proposal: - itemFk: itemFk - longName: longName - subName: subName + itemFk: Item + longName: Name + subName: Producer value5: value5 value6: value6 value7: value7 value8: value8 - available: available + available: Available minQuantity: minQuantity price2: price2 - located: located + located: Located + counter: Counter + groupingPrice: Grouping Price + itemOldPrice: itemOld Price diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index ac6d2c624..c6a6606bc 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -12,14 +12,17 @@ itemDiary: since: Desde warehouse: Almacén proposal: - itemFk: itemFk - longName: longName - subName: subName + itemFk: Item + longName: Nombre + subName: Productor value5: value5 value6: value6 value7: value7 value8: value8 - available: available + available: Dispnible minQuantity: minQuantity price2: price2 - located: located + located: Ubicado + counter: Contador + groupingPrice: Precio Grouping + itemOldPrice: Precio itemOld