8381-thermographTravel #1244
|
@ -725,6 +725,7 @@ travel:
|
|||
destination: Destination
|
||||
thermograph: Thermograph
|
||||
travelFileDescription: 'Travel id { travelId }'
|
||||
carrier: Carrier
|
||||
item:
|
||||
descriptor:
|
||||
buyer: Buyer
|
||||
|
|
|
@ -721,6 +721,7 @@ travel:
|
|||
destination: Destino
|
||||
thermograph: Termógrafo
|
||||
travelFileDescription: 'Id envío { travelId }'
|
||||
carrier: Transportista
|
||||
item:
|
||||
descriptor:
|
||||
buyer: Comprador
|
||||
|
|
|
@ -122,6 +122,12 @@ const thermographsTableColumns = computed(() => {
|
|||
name: 'temperatureFk',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
label: t('travel.thermographs.carrier'),
|
||||
field: (row) => row.agencyMode?.name,
|
||||
name: 'agencyModeFk',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
label: t('globals.maxTemperature'),
|
||||
field: 'maxTemperature',
|
||||
|
@ -200,17 +206,25 @@ const getTravelEntries = async (id) => {
|
|||
|
||||
const getTravelThermographs = async (id) => {
|
||||
const filter = {
|
||||
include: {
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
include: [
|
||||
{
|
||||
relation: 'agencyMode',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
],
|
||||
where: { travelFk: id },
|
||||
};
|
||||
|
||||
const { data } = await axios.get('TravelThermographs', {
|
||||
params: { filter: JSON.parse(JSON.stringify(filter)) },
|
||||
params: { filter },
|
||||
});
|
||||
thermographs.value = data;
|
||||
};
|
||||
|
|
|
@ -12,6 +12,7 @@ import axios from 'axios';
|
|||
import useNotify from 'src/composables/useNotify.js';
|
||||
import { toDate } from 'src/filters';
|
||||
import { downloadFile } from 'src/composables/downloadFile';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const route = useRoute();
|
||||
const quasar = useQuasar();
|
||||
|
@ -19,16 +20,25 @@ const router = useRouter();
|
|||
const { t } = useI18n();
|
||||
const { notify } = useNotify();
|
||||
|
||||
const travel = computed(() => useArrayData('Travel').store.data);
|
||||
const thermographPaginateRef = ref();
|
||||
const warehouses = ref([]);
|
||||
|
||||
const thermographFilter = {
|
||||
include: {
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
include: [
|
||||
{
|
||||
relation: 'agencyMode',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
},
|
||||
],
|
||||
where: { travelFk: route.params.id },
|
||||
order: ['created'],
|
||||
};
|
||||
|
@ -47,6 +57,12 @@ const TableColumns = computed(() => {
|
|||
name: 'temperatureFk',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
label: t('travel.thermographs.carrier'),
|
||||
field: (row) => row.agencyMode?.name,
|
||||
name: 'agencyModeFk',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
label: t('globals.maxTemperature'),
|
||||
field: 'maxTemperature',
|
||||
|
@ -117,6 +133,8 @@ const redirectToThermographForm = (action, id) => {
|
|||
|
||||
if (action === 'edit' && id) {
|
||||
routeDetails.query = { travelThermographFk: id };
|
||||
} else if (action === 'create') {
|
||||
routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk };
|
||||
}
|
||||
router.push(routeDetails);
|
||||
};
|
||||
|
|
|
@ -39,6 +39,7 @@ const warehousesOptions = ref([]);
|
|||
const temperaturesOptions = ref([]);
|
||||
const thermographForm = ref({});
|
||||
const inputFileRef = ref(null);
|
||||
const agencyModeOptions = ref([]);
|
||||
|
||||
onBeforeMount(async () => {
|
||||
if (props.viewAction === 'create') {
|
||||
|
@ -49,8 +50,8 @@ onBeforeMount(async () => {
|
|||
|
||||
if (route.query.thermographData) {
|
||||
const thermographData = JSON.parse(route.query.thermographData);
|
||||
for (let key in thermographForm) {
|
||||
thermographForm[key] = thermographData[key];
|
||||
for (let key in thermographForm.value) {
|
||||
thermographForm.value[key] = thermographData[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -72,6 +73,7 @@ const setCreateDefaultParams = async () => {
|
|||
thermographForm.value.reference = route.params.id;
|
||||
thermographForm.value.dmsTypeId = dataResponse.id;
|
||||
thermographForm.value.state = 'Ok';
|
||||
thermographForm.value.agencyModeFk = +route.query.agencyModeFk;
|
||||
thermographForm.value.description = t('travel.thermographs.travelFileDescription', {
|
||||
travelId: route.params.id,
|
||||
}).toUpperCase();
|
||||
|
@ -98,6 +100,7 @@ const setEditDefaultParams = async () => {
|
|||
thermographForm.value.minTemperature = data.minTemperature;
|
||||
thermographForm.value.temperatureFk = data.temperatureFk;
|
||||
thermographForm.value.travelThermographFk = data.id;
|
||||
thermographForm.value.agencyModeFk = data.agencyModeFk;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -159,6 +162,12 @@ const onThermographCreated = async (data) => {
|
|||
auto-load
|
||||
url="Temperatures"
|
||||
/>
|
||||
<FetchData
|
||||
@on-fetch="(data) => (agencyModeOptions = data)"
|
||||
auto-load
|
||||
url="AgencyModeIncomings"
|
||||
/>
|
||||
|
||||
<QPage class="column items-center full-width">
|
||||
<QForm
|
||||
model="travel"
|
||||
|
@ -218,10 +227,20 @@ const onThermographCreated = async (data) => {
|
|||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('travel.thermographs.carrier')"
|
||||
v-model="thermographForm.agencyModeFk"
|
||||
:options="agencyModeOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
|
||||
<VnInput
|
||||
v-model="thermographForm.reference"
|
||||
:label="t('globals.reference')"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('globals.type')"
|
||||
v-model="thermographForm.dmsTypeId"
|
||||
|
@ -229,8 +248,6 @@ const onThermographCreated = async (data) => {
|
|||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('globals.company')"
|
||||
v-model="thermographForm.companyId"
|
||||
|
@ -238,6 +255,8 @@ const onThermographCreated = async (data) => {
|
|||
option-value="id"
|
||||
option-label="code"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('globals.warehouse')"
|
||||
v-model="thermographForm.warehouseId"
|
||||
|
@ -245,8 +264,6 @@ const onThermographCreated = async (data) => {
|
|||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnSelect
|
||||
:label="t('travel.thermographs.temperature')"
|
||||
:options="temperaturesOptions"
|
||||
|
@ -256,6 +273,8 @@ const onThermographCreated = async (data) => {
|
|||
v-model="thermographForm.temperatureFk"
|
||||
:required="true"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<VnInputNumber
|
||||
v-model="thermographForm.maxTemperature"
|
||||
:label="t('globals.maxTemperature')"
|
||||
|
|
Loading…
Reference in New Issue