forked from verdnatura/salix-front
fix: refs #7283 fix pr
This commit is contained in:
parent
84dae53d66
commit
b40af0ce7b
|
@ -85,13 +85,19 @@ const onIntrastatCreated = (response, formData) => {
|
|||
<VnInput :label="t('item.basicData.reference')" v-model="data.comment" />
|
||||
<VnInput
|
||||
:label="t('item.basicData.relevancy')"
|
||||
type="number"
|
||||
v-model="data.relevancy"
|
||||
/>
|
||||
</VnRow>
|
||||
<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
|
||||
:label="t('item.basicData.multiplier')"
|
||||
type="number"
|
||||
v-model="data.stemMultiplier"
|
||||
/>
|
||||
<VnSelectDialog
|
||||
|
|
|
@ -20,15 +20,8 @@ let itemBotanicalsForm = reactive({ itemFk: null });
|
|||
const entityId = computed(() => {
|
||||
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) {
|
||||
itemBotanicalsForm = data;
|
||||
// if (data.length > 0) Object.assign(itemBotanicalsForm, itemBotanicals.value[0]);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -189,6 +189,18 @@ const openCloneDialog = async () => {
|
|||
:value="entity.value7"
|
||||
/>
|
||||
</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="{}">
|
||||
<QCardActions class="row justify-center">
|
||||
<QBtn
|
||||
|
@ -213,6 +225,7 @@ es:
|
|||
Regularize stock: Regularizar stock
|
||||
All its properties will be copied: Todas sus propiedades serán copiadas
|
||||
Do you want to clone this item?: ¿Desea clonar este artículo?
|
||||
Inactive article: Artículo inactivo
|
||||
</i18n>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -22,7 +22,7 @@ const taxesFilter = {
|
|||
{
|
||||
relation: 'country',
|
||||
scope: {
|
||||
fields: ['country'],
|
||||
fields: ['name'],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -73,7 +73,7 @@ const submitTaxes = async (data) => {
|
|||
>
|
||||
<VnInput
|
||||
:label="t('tax.country')"
|
||||
v-model="row.country.country"
|
||||
v-model="row.country.name"
|
||||
disable
|
||||
/>
|
||||
<VnSelect
|
||||
|
|
|
@ -5,7 +5,7 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v
|
|||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import { toCurrency } from 'filters/index';
|
||||
import { dashIfEmpty, toCurrency } from 'filters/index';
|
||||
import useNotify from 'src/composables/useNotify.js';
|
||||
import axios from 'axios';
|
||||
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) => {
|
||||
try {
|
||||
if (request.saleFk) {
|
||||
|
@ -212,6 +226,24 @@ onMounted(async () => {
|
|||
auto-load
|
||||
: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 }">
|
||||
<span class="link" @click.stop>
|
||||
{{ row.attenderName }}
|
||||
|
|
|
@ -1,54 +1,14 @@
|
|||
<script setup>
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ref, computed } from 'vue';
|
||||
import ItemTypeSearchbar from '../ItemType/ItemTypeSearchbar.vue';
|
||||
import VnTable from 'components/VnTable/VnTable.vue';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const tableRef = ref();
|
||||
const redirectToItemTypeSummary = (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 entityId = computed(() => route.params.id);
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -75,20 +35,21 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'worker',
|
||||
name: 'workerFk',
|
||||
label: t('worker'),
|
||||
create: true,
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Workers',
|
||||
fields: ['id', 'firstName'],
|
||||
optionLabel: 'firstName',
|
||||
optionValue: 'id',
|
||||
},
|
||||
cardVisible: true,
|
||||
cardVisible: false,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'ItemCategory',
|
||||
name: 'categoryFk',
|
||||
label: t('ItemCategory'),
|
||||
create: true,
|
||||
component: 'select',
|
||||
|
@ -96,7 +57,7 @@ const columns = computed(() => [
|
|||
url: 'ItemCategories',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
cardVisible: true,
|
||||
cardVisible: false,
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
|
@ -109,7 +70,7 @@ const columns = computed(() => [
|
|||
url: 'Temperatures',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
cardVisible: true,
|
||||
cardVisible: false,
|
||||
visible: false,
|
||||
},
|
||||
]);
|
||||
|
@ -121,18 +82,13 @@ const columns = computed(() => [
|
|||
ref="tableRef"
|
||||
data-key="ItemTypeList"
|
||||
:url="`ItemTypes`"
|
||||
:url-create="`ItemTypes`"
|
||||
save-url="ItemTypes/crud"
|
||||
:filter="courseFilter"
|
||||
:create="{
|
||||
urlCreate: 'ItemTypes',
|
||||
title: 'Create ItemTypes',
|
||||
onDataSaved: () => tableRef.reload(),
|
||||
formInitialData: {
|
||||
workerFk: entityId,
|
||||
},
|
||||
formInitialData: {},
|
||||
}"
|
||||
order="id DESC"
|
||||
order="code ASC"
|
||||
:columns="columns"
|
||||
auto-load
|
||||
:right-search="false"
|
||||
|
@ -140,3 +96,20 @@ const columns = computed(() => [
|
|||
:use-model="true"
|
||||
/>
|
||||
</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>
|
||||
|
|
Loading…
Reference in New Issue