#7283 - fixItemDescriptor #680
|
@ -135,6 +135,7 @@ const columns = computed(() => [
|
||||||
field: 'hasFile',
|
field: 'hasFile',
|
||||||
label: t('globals.original'),
|
label: t('globals.original'),
|
||||||
name: 'hasFile',
|
name: 'hasFile',
|
||||||
|
toolTip: t('The documentation is available in paper form'),
|
||||||
component: QCheckbox,
|
component: QCheckbox,
|
||||||
props: (prop) => ({
|
props: (prop) => ({
|
||||||
disable: true,
|
disable: true,
|
||||||
|
@ -297,6 +298,14 @@ defineExpose({
|
||||||
row-key="clientFk"
|
row-key="clientFk"
|
||||||
:grid="$q.screen.lt.sm"
|
:grid="$q.screen.lt.sm"
|
||||||
>
|
>
|
||||||
|
<template #header="props">
|
||||||
|
<QTr :props="props" class="bg">
|
||||||
|
<QTh v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
<QTooltip v-if="col.toolTip">{{ col.toolTip }}</QTooltip
|
||||||
|
>{{ col.label }}
|
||||||
|
</QTh>
|
||||||
|
</QTr>
|
||||||
|
</template>
|
||||||
<template #body-cell="props">
|
<template #body-cell="props">
|
||||||
<QTd :props="props">
|
<QTd :props="props">
|
||||||
<QTr :props="props">
|
<QTr :props="props">
|
||||||
|
@ -397,8 +406,10 @@ defineExpose({
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
contentTypesInfo: Allowed file types {allowedContentTypes}
|
contentTypesInfo: Allowed file types {allowedContentTypes}
|
||||||
|
The documentation is available in paper form: The documentation is available in paper form
|
||||||
es:
|
es:
|
||||||
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
|
contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
|
||||||
Generate identifier for original file: Generar identificador para archivo original
|
Generate identifier for original file: Generar identificador para archivo original
|
||||||
Upload file: Subir fichero
|
Upload file: Subir fichero
|
||||||
carlossa marked this conversation as resolved
Outdated
|
|||||||
|
the documentation is available in paper form: Se tiene la documentación en papel
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -84,7 +84,7 @@ globals:
|
||||||
description: Description
|
description: Description
|
||||||
id: Id
|
id: Id
|
||||||
order: Order
|
order: Order
|
||||||
original: Original
|
original: Phys. Doc
|
||||||
file: File
|
file: File
|
||||||
selectFile: Select a file
|
selectFile: Select a file
|
||||||
copyClipboard: Copy on clipboard
|
copyClipboard: Copy on clipboard
|
||||||
|
|
|
@ -86,7 +86,7 @@ globals:
|
||||||
description: Descripción
|
description: Descripción
|
||||||
id: Id
|
id: Id
|
||||||
order: Orden
|
order: Orden
|
||||||
original: Original
|
original: Doc. física
|
||||||
carlossa marked this conversation as resolved
jsegarra
commented
No tiene traducción en inglés? No tiene traducción en inglés?
|
|||||||
file: Fichero
|
file: Fichero
|
||||||
selectFile: Seleccione un fichero
|
selectFile: Seleccione un fichero
|
||||||
copyClipboard: Copiar en portapapeles
|
copyClipboard: Copiar en portapapeles
|
||||||
|
|
|
@ -10,8 +10,6 @@ import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.v
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
||||||
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
||||||
|
|
||||||
import { useState } from 'src/composables/useState';
|
|
||||||
import useCardDescription from 'src/composables/useCardDescription';
|
import useCardDescription from 'src/composables/useCardDescription';
|
||||||
import { getUrl } from 'src/composables/getUrl';
|
import { getUrl } from 'src/composables/getUrl';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -35,58 +33,69 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
warehouseFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const state = useState();
|
const warehouseConfig = ref(null);
|
||||||
const user = state.getUser();
|
|
||||||
|
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
});
|
});
|
||||||
carlossa marked this conversation as resolved
jsegarra
commented
Esto no se usa y salta warning Esto no se usa y salta warning
|
|||||||
|
|
||||||
const regularizeStockFormDialog = ref(null);
|
const regularizeStockFormDialog = ref(null);
|
||||||
const available = ref(null);
|
const available = ref(null);
|
||||||
carlossa marked this conversation as resolved
jsegarra
commented
He visto que se hace en muchos sitios asi, pero si quieres un tip He visto que se hace en muchos sitios asi, pero si quieres un tip
`const entityId = computed(() => $props.id || route.params.id);`
|
|||||||
const visible = ref(null);
|
const visible = ref(null);
|
||||||
const _warehouseFk = ref(null);
|
|
||||||
const salixUrl = ref();
|
const salixUrl = ref();
|
||||||
const warehouseFk = computed({
|
|
||||||
get() {
|
|
||||||
return _warehouseFk.value;
|
|
||||||
},
|
|
||||||
set(val) {
|
|
||||||
_warehouseFk.value = val;
|
|
||||||
if (val) updateStock();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
warehouseFk.value = user.value.warehouseFk;
|
|
||||||
salixUrl.value = await getUrl('');
|
salixUrl.value = await getUrl('');
|
||||||
|
await getItemConfigs();
|
||||||
|
await updateStock();
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
const setData = (entity) => {
|
const setData = async (entity) => {
|
||||||
|
try {
|
||||||
if (!entity) return;
|
if (!entity) return;
|
||||||
data.value = useCardDescription(entity.name, entity.id);
|
data.value = useCardDescription(entity.name, entity.id);
|
||||||
|
await updateStock();
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Error item');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getItemConfigs = async () => {
|
||||||
|
try {
|
||||||
|
const { data } = await axios.get('ItemConfigs/findOne');
|
||||||
|
if (!data) return;
|
||||||
|
return (warehouseConfig.value = data.warehouseFk);
|
||||||
carlossa marked this conversation as resolved
Outdated
jsegarra
commented
Has puesto un condicional mas abajo, no seria lo mismo que poner Has puesto un condicional mas abajo, no seria lo mismo que poner
`$props.warehouseFk ?? user.value.warehouseFk`
|
|||||||
|
} catch (err) {
|
||||||
|
console.error('Error item');
|
||||||
|
}
|
||||||
|
};
|
||||||
const updateStock = async () => {
|
const updateStock = async () => {
|
||||||
try {
|
try {
|
||||||
available.value = null;
|
available.value = null;
|
||||||
visible.value = null;
|
visible.value = null;
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
warehouseFk: warehouseFk.value,
|
warehouseFk: $props.warehouseFk,
|
||||||
dated: $props.dated,
|
dated: $props.dated,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
await getItemConfigs();
|
||||||
|
if (!params.warehouseFk) {
|
||||||
|
params.warehouseFk = warehouseConfig.value;
|
||||||
|
}
|
||||||
const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, {
|
const { data } = await axios.get(`Items/${entityId.value}/getVisibleAvailable`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
|
||||||
available.value = data.available;
|
available.value = data.available;
|
||||||
visible.value = data.visible;
|
visible.value = data.visible;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -47,8 +47,11 @@ const getWarehouseName = async (warehouseFk) => {
|
||||||
const filter = {
|
const filter = {
|
||||||
where: { id: warehouseFk },
|
where: { id: warehouseFk },
|
||||||
};
|
};
|
||||||
|
const { data } = await axios.get('Warehouses/findOne', {
|
||||||
const { data } = await axios.get('Warehouses/findOne', { filter });
|
params: {
|
||||||
carlossa marked this conversation as resolved
jsegarra
commented
Y si falla? Y si falla?
Poner try/catch
|
|||||||
|
filter: JSON.stringify(filter),
|
||||||
|
},
|
||||||
|
});
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
warehouseName.value = data.name;
|
warehouseName.value = data.name;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,6 +15,10 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
warehouseFk: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -26,6 +30,7 @@ const $props = defineProps({
|
||||||
:summary="ItemSummary"
|
:summary="ItemSummary"
|
||||||
:dated="dated"
|
:dated="dated"
|
||||||
:sale-fk="saleFk"
|
:sale-fk="saleFk"
|
||||||
|
:warehouse-fk="warehouseFk"
|
||||||
/>
|
/>
|
||||||
</QPopupProxy>
|
</QPopupProxy>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -383,7 +383,11 @@ async function changeState(value) {
|
||||||
<QTd>
|
<QTd>
|
||||||
<QBtn class="link" flat>
|
<QBtn class="link" flat>
|
||||||
{{ props.row.itemFk }}
|
{{ props.row.itemFk }}
|
||||||
<ItemDescriptorProxy :id="props.row.itemFk" />
|
<ItemDescriptorProxy
|
||||||
|
:id="props.row.itemFk"
|
||||||
|
:sale-fk="props.row.id"
|
||||||
|
:warehouse-fk="ticket.warehouseFk"
|
||||||
|
/>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
</QTd>
|
</QTd>
|
||||||
<QTd>{{ props.row.visible }}</QTd>
|
<QTd>{{ props.row.visible }}</QTd>
|
||||||
|
|
Loading…
Reference in New Issue
The