feat: refs #8381 add initial and final temperature fields to entry forms and summaries #1202

Merged
jgallego merged 5 commits from 8381-entryTemperature into dev 2025-01-21 06:48:31 +00:00
9 changed files with 86 additions and 24 deletions

View File

@ -16,6 +16,7 @@ import getUpdatedValues from './getUpdatedValues';
import getParamWhere from './getParamWhere'; import getParamWhere from './getParamWhere';
import parsePhone from './parsePhone'; import parsePhone from './parsePhone';
import isDialogOpened from './isDialogOpened'; import isDialogOpened from './isDialogOpened';
import toCelsius from './toCelsius';
export { export {
getUpdatedValues, getUpdatedValues,
@ -36,4 +37,5 @@ export {
dashIfEmpty, dashIfEmpty,
dateRange, dateRange,
getParamWhere, getParamWhere,
toCelsius,
}; };

3
src/filters/toCelsius.js Normal file
View File

@ -0,0 +1,3 @@
export default function toCelsius(value) {
return value ? `${value}°C` : '';
}

View File

@ -3,7 +3,6 @@ import { ref } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRole } from 'src/composables/useRole'; import { useRole } from 'src/composables/useRole';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
@ -11,7 +10,7 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
import FilterTravelForm from 'src/components/FilterTravelForm.vue'; import FilterTravelForm from 'src/components/FilterTravelForm.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import { toDate } from 'src/filters'; import { toDate } from 'src/filters';
const route = useRoute(); const route = useRoute();
@ -26,6 +25,7 @@ const onFilterTravelSelected = (formData, id) => {
formData.travelFk = id; formData.travelFk = id;
}; };
</script> </script>
<template> <template>
<FetchData <FetchData
ref="companiesRef" ref="companiesRef"
@ -93,14 +93,13 @@ const onFilterTravelSelected = (formData, id) => {
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel <QItemLabel>
>{{ scope.opt?.agencyModeName }} - {{ scope.opt?.agencyModeName }} -
{{ scope.opt?.warehouseInName }} ({{ {{ scope.opt?.warehouseInName }}
toDate(scope.opt?.shipped) ({{ toDate(scope.opt?.shipped) }})
}}) &#x2192; {{ scope.opt?.warehouseOutName }} ({{ {{ scope.opt?.warehouseOutName }}
toDate(scope.opt?.landed) ({{ toDate(scope.opt?.landed) }})
}})</QItemLabel </QItemLabel>
>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
@ -126,6 +125,13 @@ const onFilterTravelSelected = (formData, id) => {
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>
<VnInputNumber
:label="t('entry.summary.commission')"
v-model="data.commission"
step="1"
autofocus
:positive="false"
/>
<VnSelect <VnSelect
:label="t('entry.summary.currency')" :label="t('entry.summary.currency')"
v-model="data.currencyFk" v-model="data.currencyFk"
@ -133,12 +139,23 @@ const onFilterTravelSelected = (formData, id) => {
option-value="id" option-value="id"
option-label="code" option-label="code"
/> />
<QInput </VnRow>
:label="t('entry.summary.commission')" <VnRow>
v-model="data.commission" <VnInputNumber
type="number" v-model="data.initialTemperature"
Review

Gastar VnInputNumber

Gastar VnInputNumber
autofocus name="initialTemperature"
min="0" :label="t('entry.basicData.initialTemperature')"
:step="0.5"
:decimal-places="2"
:positive="false"
/>
<VnInputNumber
v-model="data.finalTemperature"
name="finalTemperature"
:label="t('entry.basicData.finalTemperature')"
:step="0.5"
:decimal-places="2"
:positive="false"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>

View File

@ -7,7 +7,7 @@ import CardSummary from 'components/ui/CardSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue'; import VnLv from 'src/components/ui/VnLv.vue';
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue'; import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
import { toDate, toCurrency } from 'src/filters'; import { toDate, toCurrency, toCelsius } from 'src/filters';
import { getUrl } from 'src/composables/getUrl'; import { getUrl } from 'src/composables/getUrl';
import axios from 'axios'; import axios from 'axios';
import FetchedTags from 'src/components/ui/FetchedTags.vue'; import FetchedTags from 'src/components/ui/FetchedTags.vue';
@ -193,6 +193,14 @@ const fetchEntryBuys = async () => {
:label="t('entry.summary.invoiceNumber')" :label="t('entry.summary.invoiceNumber')"
:value="entry.invoiceNumber" :value="entry.invoiceNumber"
/> />
<VnLv
:label="t('entry.basicData.initialTemperature')"
:value="toCelsius(entry.initialTemperature)"
/>
<VnLv
:label="t('entry.basicData.finalTemperature')"
:value="toCelsius(entry.finalTemperature)"
/>
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle

View File

@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import EntryFilter from './EntryFilter.vue'; import EntryFilter from './EntryFilter.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { toDate } from 'src/filters'; import { toCelsius, toDate } from 'src/filters';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import EntrySummary from './Card/EntrySummary.vue'; import EntrySummary from './Card/EntrySummary.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue'; import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
@ -157,6 +157,20 @@ const columns = computed(() => [
name: 'invoiceAmount', name: 'invoiceAmount',
cardVisible: true, cardVisible: true,
}, },
{
align: 'left',
name: 'initialTemperature',
label: t('entry.basicData.initialTemperature'),
field: 'initialTemperature',
format: (row) => toCelsius(row.initialTemperature),
Outdated
Review

Jo crearia una funcio en src/filters de toDegrees(value)
I que te fasa return value && value + 'º'
Aixina quan se vuiga fer q se veja com temperatures se gasta.

Jo crearia una funcio en src/filters de toDegrees(value) I que te fasa return value && value + 'º' Aixina quan se vuiga fer q se veja com temperatures se gasta.
},
{
align: 'left',
name: 'finalTemperature',
label: t('entry.basicData.finalTemperature'),
field: 'finalTemperature',
format: (row) => toCelsius(row.finalTemperature),
},
{ {
label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'), label: t('entry.list.tableVisibleColumns.isExcludedFromAvailable'),
name: 'isExcludedFromAvailable', name: 'isExcludedFromAvailable',

View File

@ -40,6 +40,8 @@ entry:
observation: Observation observation: Observation
booked: Booked booked: Booked
excludedFromAvailable: Inventory excludedFromAvailable: Inventory
initialTemperature: Ini °C
finalTemperature: Fin °C
buys: buys:
observations: Observations observations: Observations
packagingFk: Box packagingFk: Box

View File

@ -41,6 +41,8 @@ entry:
commission: Comisión commission: Comisión
booked: Asentado booked: Asentado
excludedFromAvailable: Inventario excludedFromAvailable: Inventario
initialTemperature: Ini °C
finalTemperature: Fin °C
buys: buys:
observations: Observaciónes observations: Observaciónes
packagingFk: Embalaje packagingFk: Embalaje

View File

@ -9,7 +9,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue'; import EntryDescriptorProxy from 'src/pages/Entry/Card/EntryDescriptorProxy.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import { toDate, toCurrency } from 'src/filters'; import { toDate, toCurrency, toCelsius } from 'src/filters';
import axios from 'axios'; import axios from 'axios';
import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue'; import TravelDescriptorMenuItems from './TravelDescriptorMenuItems.vue';
@ -97,6 +97,20 @@ const entriesTableColumns = computed(() => {
showValue: true, showValue: true,
}, },
{ label: 'm³', field: 'm3', name: 'm3', align: 'left', showValue: true }, { label: 'm³', field: 'm3', name: 'm3', align: 'left', showValue: true },
{
label: t('entry.basicData.initialTemperature'),
field: 'initialTemperature',
name: 'initialTemperature',
align: 'left',
format: (val) => toCelsius(val),
},
{
label: t('entry.basicData.finalTemperature'),
field: 'finalTemperature',
name: 'finalTemperature',
align: 'left',
format: (val) => toCelsius(val),
},
{ {
label: '', label: '',
field: 'observation', field: 'observation',
@ -127,14 +141,14 @@ const thermographsTableColumns = computed(() => {
field: 'maxTemperature', field: 'maxTemperature',
name: 'maxTemperature', name: 'maxTemperature',
align: 'left', align: 'left',
format: (val) => (val ? `${val}°` : ''), format: (val) => toCelsius(val),
}, },
{ {
label: t('globals.minTemperature'), label: t('globals.minTemperature'),
field: 'minTemperature', field: 'minTemperature',
name: 'minTemperature', name: 'minTemperature',
align: 'left', align: 'left',
format: (val) => (val ? `${val}°` : ''), format: (val) => toCelsius(val),
}, },
{ {
label: t('globals.state'), label: t('globals.state'),

View File

@ -10,7 +10,7 @@ import FetchData from 'src/components/FetchData.vue';
import axios from 'axios'; import axios from 'axios';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import { toDate } from 'src/filters'; import { toDate, toCelsius } from 'src/filters';
import { downloadFile } from 'src/composables/downloadFile'; import { downloadFile } from 'src/composables/downloadFile';
const route = useRoute(); const route = useRoute();
@ -52,14 +52,14 @@ const TableColumns = computed(() => {
field: 'maxTemperature', field: 'maxTemperature',
name: 'maxTemperature', name: 'maxTemperature',
align: 'left', align: 'left',
format: (val) => (val ? `${val}°` : ''), format: (val) => toCelsius(val),
}, },
{ {
label: t('globals.minTemperature'), label: t('globals.minTemperature'),
field: 'minTemperature', field: 'minTemperature',
name: 'minTemperature', name: 'minTemperature',
align: 'left', align: 'left',
format: (val) => (val ? `${val}°` : ''), format: (val) => toCelsius(val),
}, },
{ {
label: t('globals.state'), label: t('globals.state'),