#7283 #7831 itemMigration #553

Merged
carlossa merged 77 commits from 7283-itemMigration into dev 2024-10-25 07:09:13 +00:00
2 changed files with 46 additions and 13 deletions
Showing only changes of commit f3a6209189 - Show all commits

View File

@ -134,10 +134,10 @@ es:
Regularize stock: Regularizar stock
All it's properties will be copied: Todas sus propiedades serán copiadas
Do you want to clone this item?: ¿Desea clonar este artículo?
warehouseText: Calculated on the warehouse of { warehouseName }
warehouseText: Calculado sobre el almacén de { warehouseName }
en:
warehouseText: Calculado sobre el almacén de { warehouseName }
warehouseText: Calculated on the warehouse of { warehouseName }
</i18n>
<style lang="scss" scoped>

View File

@ -11,6 +11,9 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import ItemSummary from '../Item/Card/ItemSummary.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import ItemDescriptorProxy from './Card/ItemDescriptorProxy.vue';
import VnConfirm from 'src/components/ui/VnConfirm.vue';
import { useQuasar } from 'quasar';
const entityId = computed(() => route.params.id);
const { viewSummary } = useSummaryDialog();
@ -18,6 +21,7 @@ const router = useRouter();
const { t } = useI18n();
const tableRef = ref();
const route = useRoute();
const quasar = useQuasar();
const itemFilter = {
include: [
@ -53,10 +57,12 @@ const columns = computed(() => [
id: row?.id,
zoomResolution: '1600x900',
zoom: true,
class: 'rounded',
};
},
},
columnFilter: false,
cardVisible: true,
jsegarra marked this conversation as resolved Outdated

En esta columna hecho en falta el descriptor

En esta columna hecho en falta el descriptor
},
{
label: t('item.list.id'),
@ -66,6 +72,7 @@ const columns = computed(() => [
chip: {
condition: () => true,
},
cardVisible: true,
},
{
label: t('item.list.grouping'),
@ -93,6 +100,7 @@ const columns = computed(() => [
columnFilter: {
name: 'search',
},
cardVisible: true,
},
{
label: t('item.list.stems'),
@ -102,6 +110,7 @@ const columns = computed(() => [
component: 'number',
inWhere: true,
},
cardVisible: true,
},
{
label: t('item.list.size'),
@ -111,6 +120,7 @@ const columns = computed(() => [
component: 'number',
inWhere: true,
},
cardVisible: true,
},
{
label: t('item.list.typeName'),
@ -172,6 +182,7 @@ const columns = computed(() => [
component: null,
},
create: true,
cardVisible: true,
},
{
label: t('item.list.origin'),
@ -197,6 +208,7 @@ const columns = computed(() => [
component: null,
},
create: true,
cardVisible: true,
},
{
label: t('item.list.userName'),
@ -270,13 +282,14 @@ const columns = computed(() => [
name: 'tableActions',
actions: [
{
title: t('Clone item'),
title: t('globals.clone'),
icon: 'vn:clone',
action: cloneItem,
action: openCloneDialog,
isPrimary: true,
},
jsegarra marked this conversation as resolved Outdated

No tenemos VnConfirm? En Salix si que habia

No tenemos VnConfirm? En Salix si que habia

Se ha copiado y pegado la misma funcionalidad que hay en ItemDescriptor. Para que esté del todo fino hay que hacer un composable para unificar la lógica

Se ha copiado y pegado la misma funcionalidad que hay en ItemDescriptor. Para que esté del todo fino hay que hacer un composable para unificar la lógica
{
title: t('view Summary'),
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ItemSummary),
isPrimary: true,
@ -285,21 +298,34 @@ const columns = computed(() => [
},
]);
jsegarra marked this conversation as resolved Outdated

Uff...me lo anoto porque esta clase está declarada también en una PR de Jon

Uff...me lo anoto porque esta clase está declarada también en una PR de Jon
const cloneItem = async (itemFk) => {
const cloneItem = async () => {
try {
const { data } = await axios.post(`Items/${itemFk.id}/clone`);
if (!data) return;
const { data } = await axios.post(`Items/${entityId.value}/clone`);
router.push({ name: 'ItemTags', params: { id: data.id } });
} catch (err) {
jsegarra marked this conversation as resolved Outdated

Revisar como se muestra cuando es card

Revisar como se muestra cuando es card
console.error('Error cloning item', err);
console.error('Error cloning item');
}
};
const openCloneDialog = async () => {
quasar
.dialog({
jsegarra marked this conversation as resolved Outdated

Añadir traducción al title

Añadir traducción al title
component: VnConfirm,
componentProps: {
title: t('All its properties will be copied'),
message: t('Do you want to clone this item?'),
},
})
jsegarra marked this conversation as resolved Outdated

Revisar order-by

Revisar order-by
.onOk(async () => {
await cloneItem();
});
};
</script>
<template>
<VnSearchbar
data-key="ItemList"
:label="t('Search Item')"
:label="t('item.searchbar.label')"
:info="t('You can search by id')"
/>
<VnTable
@ -309,19 +335,25 @@ const cloneItem = async (itemFk) => {
url-create="Items"
:create="{
urlCreate: 'Items',
title: 'Create Item',
title: t('Create Item'),
onDataSaved: () => tableRef.redirect(),
formInitialData: {
editorFk: entityId,
},
}"
order="id ASC"
:order="['isActive DESC', 'name', 'id']"
:columns="columns"
auto-load
redirect="Item"
:is-editable="false"
:filer="itemFilter"
>
<template #column-id="{ row }">
<span class="link" @click.stop>
{{ row.id }}
<ItemDescriptorProxy :id="row.id" />
</span>
</template>
<template #column-userName="{ row }">
<span class="link" @click.stop>
{{ row.userName }}
@ -349,7 +381,8 @@ const cloneItem = async (itemFk) => {
<i18n>
es:
New item: Nuevo artículo
All it's properties will be copied: Todas sus propiedades serán copiadas
All its properties will be copied: Todas sus propiedades serán copiadas
Do you want to clone this item?: ¿Desea clonar este artículo?
Preview: Vista previa
Regularize stock: Regularizar stock
</i18n>