feat: refs #8225 use it in claim, item and order modules
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
95712728d6
commit
1b986f4b4c
|
@ -19,6 +19,7 @@ import ClaimNotes from 'src/pages/Claim/Card/ClaimNotes.vue';
|
|||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import ClaimDescriptorMenu from './ClaimDescriptorMenu.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
@ -228,6 +229,9 @@ function claimUrl(section) {
|
|||
</QList>
|
||||
</QBtnDropdown>
|
||||
</template>
|
||||
<template #menu="{ entity }">
|
||||
<ClaimDescriptorMenu :claim="entity.claim" />
|
||||
</template>
|
||||
<template #body="{ entity: { claim, salesClaimed, developments } }">
|
||||
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
|
||||
<VnTitle
|
||||
|
|
|
@ -6,17 +6,16 @@ import { useI18n } from 'vue-i18n';
|
|||
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
||||
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
||||
import useCardDescription from 'src/composables/useCardDescription';
|
||||
import axios from 'axios';
|
||||
import { dashIfEmpty } from 'src/filters';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
||||
import ItemDescriptorMenu from './ItemDescriptorMenu.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
type: [Number, String],
|
||||
type: Number,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
|
@ -29,7 +28,7 @@ const $props = defineProps({
|
|||
default: null,
|
||||
},
|
||||
saleFk: {
|
||||
type: [Number, String],
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
warehouseFk: {
|
||||
|
@ -38,7 +37,6 @@ const $props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const { openCloneDialog } = cloneItem();
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
const warehouseConfig = ref(null);
|
||||
|
@ -46,7 +44,6 @@ const entityId = computed(() => {
|
|||
return $props.id || route.params.id;
|
||||
});
|
||||
|
||||
const regularizeStockFormDialog = ref(null);
|
||||
const mounted = ref();
|
||||
|
||||
const arrayDataStock = useArrayData('descriptorStock', {
|
||||
|
@ -61,14 +58,14 @@ onMounted(async () => {
|
|||
const data = ref(useCardDescription());
|
||||
const setData = async (entity) => {
|
||||
if (!entity) return;
|
||||
data.value = useCardDescription(entity?.name, entity?.id);
|
||||
data.value = useCardDescription(entity.name, entity.id);
|
||||
await updateStock();
|
||||
};
|
||||
|
||||
const getItemConfigs = async () => {
|
||||
const { data } = await axios.get('ItemConfigs/findOne');
|
||||
if (!data) return;
|
||||
return (warehouseConfig.value = data.warehouseFk);
|
||||
warehouseConfig.value = data.warehouseFk;
|
||||
};
|
||||
const updateStock = async () => {
|
||||
if (!mounted.value) return;
|
||||
|
@ -89,10 +86,6 @@ const updateStock = async () => {
|
|||
if (storeData?.itemFk == entityId.value) return;
|
||||
await stock.fetch({});
|
||||
};
|
||||
|
||||
const openRegularizeStockForm = () => {
|
||||
regularizeStockFormDialog.value.show();
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -105,24 +98,12 @@ const openRegularizeStockForm = () => {
|
|||
:url="`Items/${entityId}/getCard`"
|
||||
@on-fetch="setData"
|
||||
>
|
||||
<template #menu="{}">
|
||||
<QItem v-ripple clickable @click="openRegularizeStockForm()">
|
||||
<QItemSection>
|
||||
{{ t('Regularize stock') }}
|
||||
<QDialog ref="regularizeStockFormDialog">
|
||||
<RegularizeStockForm
|
||||
:item-fk="entityId"
|
||||
:warehouse-fk="warehouseFk"
|
||||
@on-data-saved="updateStock()"
|
||||
/>
|
||||
</QDialog>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="openCloneDialog(entityId)">
|
||||
<QItemSection>
|
||||
{{ t('globals.clone') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<template #menu>
|
||||
<ItemDescriptorMenu
|
||||
:entity-id="entityId"
|
||||
:warehouse-fk="warehouseFk"
|
||||
@regularized="updateStock"
|
||||
/>
|
||||
</template>
|
||||
<template #before>
|
||||
<ItemDescriptorImage
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
<script setup>
|
||||
import RegularizeStockForm from 'components/RegularizeStockForm.vue';
|
||||
import { cloneItem } from 'src/pages/Item/composables/cloneItem';
|
||||
|
||||
const { openCloneDialog } = cloneItem();
|
||||
|
||||
defineProps({
|
||||
entityId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
warehouseFk: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
defineEmits(['regularized']);
|
||||
</script>
|
||||
<template>
|
||||
<QItem v-ripple clickable @click="$refs.regularizeStockFormDialog.show()">
|
||||
<QItemSection>
|
||||
{{ $t('Regularize stock') }}
|
||||
<QDialog ref="regularizeStockFormDialog">
|
||||
<RegularizeStockForm
|
||||
:item-fk="entityId"
|
||||
:warehouse-fk="warehouseFk"
|
||||
@on-data-saved="$emit('regularized')"
|
||||
/>
|
||||
</QDialog>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem v-ripple clickable @click="openCloneDialog(entityId)">
|
||||
<QItemSection>
|
||||
{{ $t('globals.clone') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.weekdaysBtn {
|
||||
margin: 1%;
|
||||
}
|
||||
</style>
|
||||
<i18n>
|
||||
en:
|
||||
addTurn: Add turn
|
||||
invoiceIds: "Invoices have been generated with the following ids: {invoiceIds}"
|
||||
|
||||
es:
|
||||
Show Delivery Note...: Ver albarán...
|
||||
Send Delivery Note...: Enviar albarán...
|
||||
as PDF: como PDF
|
||||
as PDF without prices: como PDF sin precios
|
||||
as CSV: Como CSV
|
||||
Send PDF: Enviar PDF
|
||||
Send PDF to tablet: Enviar PDF a tablet
|
||||
Send CSV: Enviar CSV
|
||||
Show Proforma: Ver proforma
|
||||
Delete ticket: Eliminar ticket
|
||||
Send SMS...: Enviar SMS...
|
||||
Pending payment: Pago pendiente
|
||||
Minimum import: Importe mínimo
|
||||
Notify changes: Notificar cambios
|
||||
Ticket deleted: Ticket eliminado
|
||||
You can undo this action within the first hour: Puedes deshacer esta acción dentro de la primera hora
|
||||
To clone ticket: Clonar ticket
|
||||
Ticket cloned: Ticked clonado
|
||||
It was not able to clone the ticket: No se pudo clonar el ticket
|
||||
Generate PDF invoice: Generar PDF factura
|
||||
Regenerate PDF invoice: Regenerar PDF factura
|
||||
The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado
|
||||
Transfer client: Transferir cliente
|
||||
Client: Cliente
|
||||
addTurn: Añadir a turno
|
||||
What is the day of receipt of the ticket?: ¿Cuál es el día de preparación del pedido?
|
||||
Current ticket deleted and added to shift: Ticket actual eliminado y añadido al turno
|
||||
Refund all...: Abonar todo...
|
||||
with warehouse: con almacén
|
||||
without warehouse: sin almacén
|
||||
Make invoice: Crear factura
|
||||
Change shipped hour: Cambiar hora de envío
|
||||
Shipped hour: Hora de envío
|
||||
Recalculate components: Recalcular componentes
|
||||
Are you sure you want to recalculate components?: ¿Seguro que quieres recalcular los componentes?
|
||||
Data saved: Datos guardados
|
||||
Are you sure you want to invoice this ticket?: ¿Seguro que quieres facturar este ticket?
|
||||
You are going to invoice this ticket: Vas a facturar este ticket
|
||||
Ticket invoiced: Ticket facturado
|
||||
Set weight: Establecer peso
|
||||
Weight set: Peso establecido
|
||||
This ticket may be invoiced, do you want to continue?: Es posible que se facture este ticket, desea continuar?
|
||||
invoiceIds: "Se han generado las facturas con los siguientes ids: {invoiceIds}"
|
||||
This ticket will be removed from current route! Continue anyway?: ¡Se eliminará el ticket de la ruta actual! ¿Continuar de todas formas?
|
||||
You are going to delete this ticket: Vas a eliminar este ticket
|
||||
as PDF signed: como PDF firmado
|
||||
Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán?
|
||||
</i18n>
|
|
@ -8,6 +8,7 @@ import VnLv from 'src/components/ui/VnLv.vue';
|
|||
import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import ItemDescriptorMenu from './ItemDescriptorMenu.vue';
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -43,10 +44,13 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
|
|||
<template #header="{ entity: { item } }">
|
||||
{{ item.id }} - {{ item.name }}
|
||||
</template>
|
||||
<template #menu>
|
||||
<ItemDescriptorMenu :entity-id="entityId" :warehouse-fk="warehouseFk" />
|
||||
</template>
|
||||
<template #body="{ entity: { item, tags, visible, available, botanical } }">
|
||||
<QCard class="vn-one photo">
|
||||
<ItemDescriptorImage
|
||||
:entity-id="Number(entityId)"
|
||||
:entity-id="entityId"
|
||||
:visible="visible"
|
||||
:available="available"
|
||||
:show-edit-button="false"
|
||||
|
@ -89,7 +93,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`;
|
|||
<QCard class="vn-one">
|
||||
<VnTitle
|
||||
:url="getUrl(entityId, 'basic-data')"
|
||||
:text="t('item.summary.basicData')"
|
||||
:text="t('item.summary.otherData')"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('item.summary.intrastatCode')"
|
||||
|
|
|
@ -9,7 +9,6 @@ import useCardDescription from 'src/composables/useCardDescription';
|
|||
import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
||||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue';
|
||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||
|
||||
const DEFAULT_ITEMS = 0;
|
||||
|
@ -94,9 +93,6 @@ const total = ref(0);
|
|||
@on-fetch="setData"
|
||||
data-key="orderData"
|
||||
>
|
||||
<template #menu="{ entity }">
|
||||
<OrderDescriptorMenu :order="entity" />
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<VnLv
|
||||
:label="t('globals.state')"
|
||||
|
|
|
@ -12,6 +12,7 @@ import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy
|
|||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||
import VnTitle from 'src/components/common/VnTitle.vue';
|
||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||
import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -91,6 +92,9 @@ async function handleConfirm() {
|
|||
<QTooltip>{{ t('order.summary.confirmLines') }}</QTooltip>
|
||||
</QBtn>
|
||||
</template>
|
||||
<template #menu="{ entity }">
|
||||
<OrderDescriptorMenu :order="entity" />
|
||||
</template>
|
||||
<template #body="{ entity }">
|
||||
<QCard class="vn-one">
|
||||
<VnTitle
|
||||
|
|
Loading…
Reference in New Issue