#7283 #7831 itemMigration #553

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

View File

@ -85,13 +85,19 @@ const onIntrastatCreated = (response, formData) => {
<VnInput :label="t('item.basicData.reference')" v-model="data.comment" /> <VnInput :label="t('item.basicData.reference')" v-model="data.comment" />
<VnInput <VnInput
:label="t('item.basicData.relevancy')" :label="t('item.basicData.relevancy')"
carlossa marked this conversation as resolved
Review

Debería aceptar solo números

Debería aceptar solo números
type="number"
v-model="data.relevancy" v-model="data.relevancy"
/> />
</VnRow> </VnRow>
<VnRow class="row q-gutter-md q-mb-md"> <VnRow class="row q-gutter-md q-mb-md">
<VnInput :label="t('item.basicData.stems')" v-model="data.stems" /> <VnInput
:label="t('item.basicData.stems')"
type="number"
v-model="data.stems"
/>
<VnInput <VnInput
:label="t('item.basicData.multiplier')" :label="t('item.basicData.multiplier')"
type="number"
v-model="data.stemMultiplier" v-model="data.stemMultiplier"
/> />
<VnSelectDialog <VnSelectDialog

View File

@ -20,15 +20,8 @@ let itemBotanicalsForm = reactive({ itemFk: null });
const entityId = computed(() => { const entityId = computed(() => {
return route.params.id; return route.params.id;
}); });
// onMounted(async () => {
// itemBotanicalsForm.itemFk = entityId.value;
// // itemBotanicals.value = await itemBotanicalsRef.value.fetch();
// if (itemBotanicals.value.length > 0)
// Object.assign(itemBotanicalsForm, itemBotanicals.value[0]);
// });
async function handleItemBotanical(data) { async function handleItemBotanical(data) {
itemBotanicalsForm = data; itemBotanicalsForm = data;
// if (data.length > 0) Object.assign(itemBotanicalsForm, itemBotanicals.value[0]);
} }
</script> </script>
<template> <template>

View File

@ -189,6 +189,18 @@ const openCloneDialog = async () => {
:value="entity.value7" :value="entity.value7"
/> />
</template> </template>
<template #icons="{ entity }">
<QCardActions v-if="entity" class="q-gutter-x-md">
<QIcon
v-if="!entity.isActive"
name="vn:unavailable"
color="primary"
size="xs"
>
<QTooltip>{{ t('Inactive article') }}</QTooltip>
</QIcon>
</QCardActions>
</template>
<template #actions="{}"> <template #actions="{}">
<QCardActions class="row justify-center"> <QCardActions class="row justify-center">
<QBtn <QBtn
@ -213,6 +225,7 @@ es:
Regularize stock: Regularizar stock Regularize stock: Regularizar stock
All its 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? Do you want to clone this item?: ¿Desea clonar este artículo?
Inactive article: Artículo inactivo
</i18n> </i18n>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -22,7 +22,7 @@ const taxesFilter = {
{ {
relation: 'country', relation: 'country',
scope: { scope: {
fields: ['country'], fields: ['name'],
}, },
}, },
], ],
@ -73,7 +73,7 @@ const submitTaxes = async (data) => {
> >
<VnInput <VnInput
:label="t('tax.country')" :label="t('tax.country')"
v-model="row.country.country" v-model="row.country.name"
disable disable
/> />
<VnSelect <VnSelect

View File

@ -5,7 +5,7 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'composables/useArrayData'; import { useArrayData } from 'composables/useArrayData';
import { toCurrency } from 'filters/index'; import { dashIfEmpty, toCurrency } from 'filters/index';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import axios from 'axios'; import axios from 'axios';
import ItemRequestDenyForm from './ItemRequestDenyForm.vue'; import ItemRequestDenyForm from './ItemRequestDenyForm.vue';
@ -134,6 +134,20 @@ const columns = computed(() => [
}, },
]); ]);
const getBadgeColor = (date) => {
const today = Date.vnNew();
today.setHours(0, 0, 0, 0);
const orderLanded = new Date(date);
orderLanded.setHours(0, 0, 0, 0);
const difference = today - orderLanded;
if (difference == 0) return 'warning';
if (difference < 0) return 'success';
if (difference > 0) return 'alert';
};
const changeQuantity = async (request) => { const changeQuantity = async (request) => {
try { try {
if (request.saleFk) { if (request.saleFk) {
@ -212,6 +226,24 @@ onMounted(async () => {
auto-load auto-load
:disable-option="{ card: true }" :disable-option="{ card: true }"
> >
<template #column-ticketFk="{ row }">
<span class="link">
{{ row.ticketFk }}
<TicketDescriptorProxy :id="row.ticketFk" />
</span>
</template>
<template #column-shipped="{ row }">
<QTd>
<QBadge
:color="getBadgeColor(row.shipped)"
text-color="black"
class="q-pa-sm"
style="font-size: 14px"
>
{{ toDate(row.shipped) }}
</QBadge>
</QTd>
</template>
<template #column-attenderName="{ row }"> <template #column-attenderName="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
{{ row.attenderName }} {{ row.attenderName }}

View File

@ -1,54 +1,14 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRoute } from 'vue-router';
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import ItemTypeSearchbar from '../ItemType/ItemTypeSearchbar.vue'; import ItemTypeSearchbar from '../ItemType/ItemTypeSearchbar.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
const router = useRouter(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const tableRef = ref(); const tableRef = ref();
const redirectToItemTypeSummary = (id) => { const entityId = computed(() => route.params.id);
router.push({ name: 'ItemTypeSummary', params: { id } });
};
const redirectToCreateView = () => {
router.push({ name: 'ItemTypeCreate' });
};
const exprBuilder = (param, value) => {
switch (param) {
case 'name':
return {
name: { like: `%${value}%` },
};
case 'code':
return {
code: { like: `%${value}%` },
};
case 'search':
if (value) {
if (!isNaN(value)) {
return { id: value };
} else {
return {
or: [
{
name: {
like: `%${value}%`,
},
},
{
code: {
like: `%${value}%`,
},
},
],
};
}
}
}
};
const columns = computed(() => [ const columns = computed(() => [
{ {
@ -75,20 +35,21 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'worker', name: 'workerFk',
label: t('worker'), label: t('worker'),
create: true, create: true,
component: 'select', component: 'select',
attrs: { attrs: {
url: 'Workers', url: 'Workers',
fields: ['id', 'firstName'], optionLabel: 'firstName',
optionValue: 'id',
}, },
cardVisible: true, cardVisible: false,
visible: false, visible: false,
}, },
{ {
align: 'left', align: 'left',
name: 'ItemCategory', name: 'categoryFk',
label: t('ItemCategory'), label: t('ItemCategory'),
create: true, create: true,
component: 'select', component: 'select',
@ -96,7 +57,7 @@ const columns = computed(() => [
url: 'ItemCategories', url: 'ItemCategories',
fields: ['id', 'name'], fields: ['id', 'name'],
}, },
cardVisible: true, cardVisible: false,
visible: false, visible: false,
}, },
{ {
@ -109,7 +70,7 @@ const columns = computed(() => [
url: 'Temperatures', url: 'Temperatures',
fields: ['id', 'name'], fields: ['id', 'name'],
}, },
cardVisible: true, cardVisible: false,
visible: false, visible: false,
}, },
]); ]);
@ -121,18 +82,13 @@ const columns = computed(() => [
ref="tableRef" ref="tableRef"
data-key="ItemTypeList" data-key="ItemTypeList"
:url="`ItemTypes`" :url="`ItemTypes`"
:url-create="`ItemTypes`"
save-url="ItemTypes/crud"
:filter="courseFilter"
:create="{ :create="{
urlCreate: 'ItemTypes', urlCreate: 'ItemTypes',
title: 'Create ItemTypes', title: 'Create ItemTypes',
onDataSaved: () => tableRef.reload(), onDataSaved: () => tableRef.reload(),
formInitialData: { formInitialData: {},
workerFk: entityId,
},
}" }"
order="id DESC" order="code ASC"
:columns="columns" :columns="columns"
auto-load auto-load
:right-search="false" :right-search="false"
@ -140,3 +96,20 @@ const columns = computed(() => [
:use-model="true" :use-model="true"
/> />
</template> </template>
<i18n>
es:
id: Id
code: Código
name: Nombre
worker: Encargado
ItemCategory: Categoría
Temperature: Temperatura
Create ItemTypes: Crear familia
en:
code: Code
name: Name
worker: Worker
ItemCategory: ItemCategory
Temperature: Temperature
</i18n>