#6321 - Negative ticket #158
|
@ -5,6 +5,8 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import { toCurrency } from 'filters/index';
|
import { toCurrency } from 'filters/index';
|
||||||
import VnStockValueDisplay from 'src/components/ui/VnStockValueDisplay.vue';
|
import VnStockValueDisplay from 'src/components/ui/VnStockValueDisplay.vue';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
import notifyResults from 'src/utils/notifyResults';
|
||||||
|
|
||||||
const MATCH_VALUES = [5, 6, 7, 8];
|
const MATCH_VALUES = [5, 6, 7, 8];
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -12,8 +14,6 @@ const extractNumericValue = (percentageString) => {
|
||||||
const match = percentageString.match(/(\d+(\.\d+)?)/);
|
const match = percentageString.match(/(\d+(\.\d+)?)/);
|
||||||
return match ? parseFloat(match[0]) : null;
|
return match ? parseFloat(match[0]) : null;
|
||||||
};
|
};
|
||||||
const primaryColor = '#f5b351';
|
|
||||||
const colorSpacer = '#ecf0f1';
|
|
||||||
const compatibilityItem = (value) => `${100 * (value / MATCH_VALUES.length)}%`;
|
const compatibilityItem = (value) => `${100 * (value / MATCH_VALUES.length)}%`;
|
||||||
const gradientStyle = (value) => {
|
const gradientStyle = (value) => {
|
||||||
let color = 'white';
|
let color = 'white';
|
||||||
|
@ -157,7 +157,8 @@ const columns = computed(() => [
|
||||||
field: 'located',
|
field: 'located',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const isSelected = (row) => proposalSelected.value.some((item) => row.id === item.id);
|
const isSelected = (row) =>
|
||||||
|
proposalSelected.value.some((item) => row.itemFk === item.itemFk);
|
||||||
function change(row) {
|
function change(row) {
|
||||||
if (isSelected(row)) {
|
if (isSelected(row)) {
|
||||||
confirm(row);
|
confirm(row);
|
||||||
|
@ -165,29 +166,24 @@ function change(row) {
|
||||||
}
|
}
|
||||||
proposalSelected.value = [row];
|
proposalSelected.value = [row];
|
||||||
}
|
}
|
||||||
async function confirm(row) {
|
async function confirm() {
|
||||||
try {
|
try {
|
||||||
// const params = {
|
const substitutionFk = proposalSelected.value[0].itemFk;
|
||||||
// saleFk: saleFk.value,
|
const promises = $props.sales.map(({ saleFk, quantity }) => {
|
||||||
// substitutionFk: proposalSelected.value[0].id,
|
const params = {
|
||||||
// quantity: quantity.value,
|
saleFk,
|
||||||
// };
|
substitutionFk,
|
||||||
// const { data } = await axios.post('Sales/replaceItem', params);
|
quantity,
|
||||||
const params = [
|
};
|
||||||
saleFk.value,
|
return axios.post('Sales/replaceItem', params);
|
||||||
row ?? proposalSelected.value[0].id,
|
});
|
||||||
quantity.value,
|
const results = await Promise.allSettled(promises);
|
||||||
];
|
|
||||||
// const { data } = await axios.post('Applications/sale_replaceItem/execute-proc', {
|
notifyResults(results, 'saleFk');
|
||||||
// schema: 'vn',
|
|
||||||
// params,
|
|
||||||
// });
|
|
||||||
// proposalTableRef.value.reload();
|
|
||||||
emit('itemReplaced', {
|
emit('itemReplaced', {
|
||||||
type: 'refresh',
|
type: 'refresh',
|
||||||
quantity: quantity.value,
|
quantity: quantity.value,
|
||||||
itemProposal: proposalSelected.value[0],
|
itemProposal: proposalSelected.value[0],
|
||||||
...params,
|
|
||||||
});
|
});
|
||||||
proposalSelected.value = [];
|
proposalSelected.value = [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -198,13 +194,9 @@ const filter = computed(() => ({
|
||||||
itemFk: $props.itemLack.itemFk,
|
itemFk: $props.itemLack.itemFk,
|
||||||
sales: saleFk.value,
|
sales: saleFk.value,
|
||||||
}));
|
}));
|
||||||
function handleSelection(value, _) {
|
|
||||||
quantity.value = value.available;
|
|
||||||
}
|
|
||||||
const isSelectionAvailable = (itemProposal) => {
|
const isSelectionAvailable = (itemProposal) => {
|
||||||
const { price2 } = itemProposal;
|
const { price2 } = itemProposal;
|
||||||
const salePrice = sale.value.price;
|
const salePrice = sale.value.price;
|
||||||
// debugger;
|
|
||||||
const byPrice = (100 * price2) / salePrice > 30;
|
const byPrice = (100 * price2) / salePrice > 30;
|
||||||
if (byPrice) {
|
if (byPrice) {
|
||||||
return byPrice;
|
return byPrice;
|
||||||
|
@ -213,8 +205,6 @@ const isSelectionAvailable = (itemProposal) => {
|
||||||
(100 * itemProposal.available) / Math.abs($props.itemLack.lack) < 30;
|
(100 * itemProposal.available) / Math.abs($props.itemLack.lack) < 30;
|
||||||
return byQuantity;
|
return byQuantity;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isDisabled = (row) => !isSelectionAvailable(row);
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import ItemProposal from './ItemProposal.vue';
|
import ItemProposal from './ItemProposal.vue';
|
||||||
import { ref } from 'vue';
|
|
||||||
const popupProxyRef = ref(null);
|
|
||||||
import { useDialogPluginComponent } from 'quasar';
|
import { useDialogPluginComponent } from 'quasar';
|
||||||
const emit = defineEmits([
|
const emit = defineEmits([
|
||||||
'onDialogClosed',
|
'onDialogClosed',
|
||||||
|
@ -12,8 +10,7 @@ const emit = defineEmits([
|
||||||
]);
|
]);
|
||||||
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
|
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
|
||||||
|
|
||||||
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
|
const { dialogRef } = useDialogPluginComponent();
|
||||||
useDialogPluginComponent();
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
itemLack: {
|
itemLack: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -41,21 +38,12 @@ const $props = defineProps({
|
||||||
<QBtn icon="close" flat round dense v-close-popup />
|
<QBtn icon="close" flat round dense v-close-popup />
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection>
|
<QCardSection>
|
||||||
<!-- <VnImg :id="itemLack.id" class="rounded image-wrapper"></VnImg>
|
|
||||||
<QBtn flat class="link text-blue">
|
|
||||||
{{ itemLack.longName }}
|
|
||||||
<ItemDescriptorProxy :id="itemLack.id" />
|
|
||||||
</QBtn>
|
|
||||||
<FetchedTags :item="itemLack" />
|
|
||||||
|
|
||||||
</QCardSection>
|
|
||||||
<QCardSection class="q-pt-none"> -->
|
|
||||||
<ItemProposal
|
<ItemProposal
|
||||||
v-bind="$props"
|
v-bind="$props"
|
||||||
@item-replaced="
|
@item-replaced="
|
||||||
(data) => {
|
(data) => {
|
||||||
emit('itemReplaced', data);
|
emit('itemReplaced', data);
|
||||||
popupProxyRef.value.hide();
|
dialogRef.hide();
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
></ItemProposal
|
></ItemProposal
|
||||||
|
|
|
@ -8,6 +8,7 @@ import TicketTransferForm from './TicketTransferForm.vue';
|
||||||
import { toDateFormat } from 'src/filters/date.js';
|
import { toDateFormat } from 'src/filters/date.js';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import split from './components/split';
|
import split from './components/split';
|
||||||
|
const emit = defineEmits(['ticketTransfered']);
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
mana: {
|
mana: {
|
||||||
|
@ -94,7 +95,8 @@ const handleRowClick = (row) => {
|
||||||
};
|
};
|
||||||
const splitSelectedRows = async () => {
|
const splitSelectedRows = async () => {
|
||||||
const tickets = Array.isArray($props.ticket) ? $props.ticket : [$props.ticket];
|
const tickets = Array.isArray($props.ticket) ? $props.ticket : [$props.ticket];
|
||||||
await split(tickets);
|
await split(tickets, splitDate.value);
|
||||||
|
emit('ticketTransfered', tickets);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import notifyResults from 'src/utils/notifyResults';
|
import notifyResults from 'src/utils/notifyResults';
|
||||||
|
|
||||||
export default async function (data) {
|
export default async function (data, date) {
|
||||||
const reducedData = data.reduce((acc, item) => {
|
const reducedData = data.reduce((acc, item) => {
|
||||||
const existing = acc.find(({ ticketFk }) => ticketFk === item.id);
|
const existing = acc.find(({ ticketFk }) => ticketFk === item.id);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
existing.sales.push(item.saleFk);
|
existing.sales.push(item.saleFk);
|
||||||
} else {
|
} else {
|
||||||
acc.push({ ticketFk: item.id, sales: [item.saleFk] });
|
acc.push({ ticketFk: item.id, sales: [item.saleFk], date });
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
@ -13,9 +13,6 @@ import { useRoute } from 'vue-router';
|
||||||
import TicketLackTable from './TicketLackTable.vue';
|
import TicketLackTable from './TicketLackTable.vue';
|
||||||
import VnPopupProxy from 'src/components/common/VnPopupProxy.vue';
|
import VnPopupProxy from 'src/components/common/VnPopupProxy.vue';
|
||||||
import ItemProposalProxy from 'src/pages/Item/components/ItemProposalProxy.vue';
|
import ItemProposalProxy from 'src/pages/Item/components/ItemProposalProxy.vue';
|
||||||
import FetchedTags from 'components/ui/FetchedTags.vue';
|
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
|
||||||
import VnImg from 'src/components/ui/VnImg.vue';
|
|
||||||
|
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -41,76 +38,27 @@ onUnmounted(() => {
|
||||||
const entityId = computed(() => route.params.id);
|
const entityId = computed(() => route.params.id);
|
||||||
const item = ref({});
|
const item = ref({});
|
||||||
|
|
||||||
const itemLackForm = ref();
|
const itemProposalSelected = ref(null);
|
||||||
|
|
||||||
const reload = async () => {
|
const reload = async () => {
|
||||||
itemLackForm.value.fetch();
|
tableRef.value.tableRef.reload();
|
||||||
};
|
};
|
||||||
defineExpose({ reload });
|
defineExpose({ reload });
|
||||||
|
|
||||||
// Función de comparación
|
|
||||||
// function freeFirst({ alertLevel: a }, { alertLevel: b }) {
|
|
||||||
// const DEFAULT = 0;
|
|
||||||
// // Si el estado de 'a' es 'free' y el de 'b' no lo es, 'a' viene primero
|
|
||||||
// if (a === DEFAULT && b !== DEFAULT) {
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// // Si el estado de 'b' es 'free' y el de 'a' no lo es, 'b' viene primero
|
|
||||||
// if (b === DEFAULT && a !== DEFAULT) {
|
|
||||||
// return 1;
|
|
||||||
// }
|
|
||||||
// // En cualquier otro caso, no se cambia el orden
|
|
||||||
// return 0;
|
|
||||||
// }
|
|
||||||
// const { store } = useArrayData(URL_KEY);
|
|
||||||
// const handleRows = (rows) => {
|
|
||||||
// // rows.forEach((row) => (row.concept = item.value.name));
|
|
||||||
// rows = rows.sort(freeFirst);
|
|
||||||
// if (showFree.value) return rows.filter(({ alertLevel }) => alertLevel === 0);
|
|
||||||
// return rows;
|
|
||||||
// };
|
|
||||||
const someBasket = computed(() => selectedRows.value.some((row) => row.isBasket === 1));
|
|
||||||
const itemProposalEvt = (data) => {
|
const itemProposalEvt = (data) => {
|
||||||
const { itemProposal, quantity } = data;
|
const { itemProposal, quantity } = data;
|
||||||
itemProposalSelected.value = itemProposal;
|
itemProposalSelected.value = itemProposal;
|
||||||
// badgeLackRef.value.reload();
|
reload();
|
||||||
itemLack.value.lack += +quantity;
|
|
||||||
tableRef.value.reload();
|
|
||||||
// replaceItem();
|
|
||||||
};
|
};
|
||||||
const itemProposalSelected = ref(null);
|
|
||||||
// const replaceItem = () => {
|
|
||||||
// const rows = handleRows(originalRowDataCopy.value).sort((row) => row.quantity);
|
|
||||||
// for (const ticket of rows) {
|
|
||||||
// if (ticket.quantity > itemProposalSelected.value.available) continue;
|
|
||||||
// originalRowDataCopy.value.splice(originalRowDataCopy.value.indexOf(ticket));
|
|
||||||
// ticket.itemFk = itemProposalSelected.value.id;
|
|
||||||
// selectedRows.value.push({ ticketFk: ticket.ticketFk });
|
|
||||||
// itemProposalSelected.value.available -= ticket.quantity;
|
|
||||||
// itemLack.value.lack += ticket.quantity;
|
|
||||||
// const index = store.data.findIndex((t) => t.ticketFk === ticket.ticketFk);
|
|
||||||
// store.data.splice(index, 1);
|
|
||||||
// console.log(ticket);
|
|
||||||
// useArrayData('ItemsGetSimilar').store.data[1].available =
|
|
||||||
// itemProposalSelected.value.available;
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
function onBuysFetched(data) {
|
function onBuysFetched(data) {
|
||||||
Object.assign(item.value, data[0]);
|
Object.assign(item.value, data[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeDialogs = (refs, evt) => {
|
|
||||||
changeItemDialogRef.value.hide();
|
|
||||||
changeQuantityDialogRef.value.hide();
|
|
||||||
changeStateDialogRef.value.hide();
|
|
||||||
};
|
|
||||||
|
|
||||||
const showItemProposal = () => {
|
const showItemProposal = () => {
|
||||||
quasar
|
quasar
|
||||||
.dialog({
|
.dialog({
|
||||||
component: ItemProposalProxy,
|
component: ItemProposalProxy,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
itemLack: itemLack.value,
|
itemLack: tableRef.value.itemLack,
|
||||||
replaceAction: true,
|
replaceAction: true,
|
||||||
sales: selectedRows.value,
|
sales: selectedRows.value,
|
||||||
},
|
},
|
||||||
|
@ -139,16 +87,7 @@ const filterTable = { stateFk: 0, warehouseFk: useState().getUser().value.wareho
|
||||||
@on-fetch="onBuysFetched"
|
@on-fetch="onBuysFetched"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
:url="`Tickets/itemLack`"
|
|
||||||
:params="{ itemFk: entityId }"
|
|
||||||
@on-fetch="(data) => (itemLack = data[0])"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<!-- <VnSubToolbar>
|
|
||||||
<template #st-data> </template>
|
|
||||||
<template #st-actions> </template>
|
|
||||||
</VnSubToolbar> -->
|
|
||||||
<TicketLackTable
|
<TicketLackTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:filter="filterTable"
|
:filter="filterTable"
|
||||||
|
@ -171,6 +110,7 @@ const filterTable = { stateFk: 0, warehouseFk: useState().getUser().value.wareho
|
||||||
sales: selectedRows,
|
sales: selectedRows,
|
||||||
lastActiveTickets: selectedRows.map((row) => row.id),
|
lastActiveTickets: selectedRows.map((row) => row.id),
|
||||||
}"
|
}"
|
||||||
|
@ticket-transfered="reload"
|
||||||
></TicketTransfer>
|
></TicketTransfer>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<QBtn
|
<QBtn
|
||||||
|
@ -183,13 +123,6 @@ const filterTable = { stateFk: 0, warehouseFk: useState().getUser().value.wareho
|
||||||
class="rotate-90"
|
class="rotate-90"
|
||||||
@click="showItemProposal"
|
@click="showItemProposal"
|
||||||
></QIcon>
|
></QIcon>
|
||||||
<!-- <ItemProposalProxy
|
|
||||||
ref="proposalDialogRef"
|
|
||||||
:item-lack="itemLack"
|
|
||||||
:replace-action="true"
|
|
||||||
:sales="selectedRows"
|
|
||||||
@item-replaced="itemProposalEvt"
|
|
||||||
></ItemProposalProxy> -->
|
|
||||||
<QTooltip bottom anchor="bottom right">
|
<QTooltip bottom anchor="bottom right">
|
||||||
{{ t('itemProposal') }}
|
{{ t('itemProposal') }}
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
|
@ -238,27 +171,6 @@ const filterTable = { stateFk: 0, warehouseFk: useState().getUser().value.wareho
|
||||||
/></template>
|
/></template>
|
||||||
</VnPopupProxy> </QBtnGroup
|
</VnPopupProxy> </QBtnGroup
|
||||||
></template>
|
></template>
|
||||||
<template #top-left>
|
|
||||||
<div style="display: flex; align-items: center" v-if="itemLack">
|
|
||||||
<VnImg :id="itemLack.itemFk" class="rounded image-wrapper"></VnImg>
|
|
||||||
<div class="flex column" style="align-items: center">
|
|
||||||
<QBadge
|
|
||||||
ref="badgeLackRef"
|
|
||||||
class="q-ml-xs"
|
|
||||||
text-color="white"
|
|
||||||
:color="itemLack.lack === 0 ? 'green' : 'red'"
|
|
||||||
:label="itemLack.lack"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="flex column left" style="align-items: flex-start">
|
|
||||||
<QBtn flat class="link text-blue">
|
|
||||||
{{ item?.longName ?? item.name }}
|
|
||||||
<ItemDescriptorProxy :id="entityId" />
|
|
||||||
</QBtn>
|
|
||||||
<FetchedTags class="q-ml-md" :item="item" :columns="7" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</TicketLackTable>
|
</TicketLackTable>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import FetchedTags from 'components/ui/FetchedTags.vue';
|
||||||
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
|
import VnImg from 'src/components/ui/VnImg.vue';
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
@ -70,6 +73,7 @@ const saveChange = async (field, { rowIndex, row }) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
|
fetchItemLack.value.fetch();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error saving changes', err);
|
console.error('Error saving changes', err);
|
||||||
f;
|
f;
|
||||||
|
@ -82,34 +86,7 @@ const rowColor = (row) => {
|
||||||
if (hasToIgnore(row)) return 'transparent';
|
if (hasToIgnore(row)) return 'transparent';
|
||||||
return 'negative';
|
return 'negative';
|
||||||
};
|
};
|
||||||
// const textRowColor = (row) => {
|
|
||||||
// if (row.hasToIgnore) return 'black';
|
|
||||||
// return 'white';
|
|
||||||
// };
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
// {
|
|
||||||
// align: 'left',
|
|
||||||
// label: t('negative.detail.isBasket'),
|
|
||||||
// name: 'isBasket',
|
|
||||||
// cardVisible: true,
|
|
||||||
// create: true,
|
|
||||||
// component: 'checkbox',
|
|
||||||
// attrs: ({ row }) => {
|
|
||||||
// return {
|
|
||||||
// 'toggle-indeterminate': true,
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
// columnClass: 'shrink',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// align: 'left',
|
|
||||||
// label: t('negative.detail.hasSubstitution'),
|
|
||||||
// name: 'hasSubstitution',
|
|
||||||
// cardVisible: true,
|
|
||||||
// create: true,
|
|
||||||
// component: 'checkbox',
|
|
||||||
// columnClass: 'shrink',
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
name: 'status',
|
name: 'status',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -206,15 +183,24 @@ const columns = computed(() => [
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const emit = defineEmits(['update:selection']);
|
const emit = defineEmits(['update:selection']);
|
||||||
|
const itemLack = ref(null);
|
||||||
|
const fetchItemLack = ref(null);
|
||||||
const tableRef = ref(null);
|
const tableRef = ref(null);
|
||||||
watch(selectedRows, () => emit('update:selection', selectedRows));
|
watch(selectedRows, () => emit('update:selection', selectedRows));
|
||||||
function onBuysFetched(data) {
|
function onBuysFetched(data) {
|
||||||
Object.assign(item.value, data[0]);
|
Object.assign(item.value, data[0]);
|
||||||
}
|
}
|
||||||
|
defineExpose({ tableRef, itemLack });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<FetchData
|
||||||
|
ref="fetchItemLack"
|
||||||
|
:url="`Tickets/itemLack`"
|
||||||
|
:params="{ itemFk: entityId }"
|
||||||
|
@on-fetch="(data) => (itemLack = data[0])"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
:url="`Items/${entityId}/getCard`"
|
:url="`Items/${entityId}/getCard`"
|
||||||
:fields="['longName']"
|
:fields="['longName']"
|
||||||
|
@ -253,7 +239,25 @@ function onBuysFetched(data) {
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
>
|
>
|
||||||
<template #top-left>
|
<template #top-left>
|
||||||
<slot name="top-left" />
|
<div style="display: flex; align-items: center" v-if="itemLack">
|
||||||
|
<VnImg :id="itemLack.itemFk" class="rounded image-wrapper"></VnImg>
|
||||||
|
<div class="flex column" style="align-items: center">
|
||||||
|
<QBadge
|
||||||
|
ref="badgeLackRef"
|
||||||
|
class="q-ml-xs"
|
||||||
|
text-color="white"
|
||||||
|
:color="itemLack.lack === 0 ? 'green' : 'red'"
|
||||||
|
:label="itemLack.lack"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex column left" style="align-items: flex-start">
|
||||||
|
<QBtn flat class="link text-blue">
|
||||||
|
{{ item?.longName ?? item.name }}
|
||||||
|
<ItemDescriptorProxy :id="entityId" />
|
||||||
|
</QBtn>
|
||||||
|
<FetchedTags class="q-ml-md" :item="item" :columns="7" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #top-right>
|
<template #top-right>
|
||||||
<slot name="top-right" />
|
<slot name="top-right" />
|
||||||
|
@ -263,6 +267,7 @@ function onBuysFetched(data) {
|
||||||
<QTd style="width: 150px">
|
<QTd style="width: 150px">
|
||||||
<div class="icon-container">
|
<div class="icon-container">
|
||||||
<QIcon
|
<QIcon
|
||||||
|
v-if="row.isBasket"
|
||||||
name="vn:basket"
|
name="vn:basket"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
@ -271,6 +276,7 @@ function onBuysFetched(data) {
|
||||||
<QTooltip>{{ t('negative.detail.isBasket') }}</QTooltip>
|
<QTooltip>{{ t('negative.detail.isBasket') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
v-if="row.hasToIgnore"
|
||||||
name="star"
|
name="star"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="cursor-pointer fill-icon"
|
class="cursor-pointer fill-icon"
|
||||||
|
@ -279,6 +285,7 @@ function onBuysFetched(data) {
|
||||||
<QTooltip>{{ t('negative.detail.hasToIgnore') }}</QTooltip>
|
<QTooltip>{{ t('negative.detail.hasToIgnore') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
v-if="row.hasSubstitution"
|
||||||
name="change_circle"
|
name="change_circle"
|
||||||
color="primary"
|
color="primary"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
@ -288,6 +295,7 @@ function onBuysFetched(data) {
|
||||||
t('negative.detail.hasSubstitution')
|
t('negative.detail.hasSubstitution')
|
||||||
}}</QTooltip> </QIcon
|
}}</QTooltip> </QIcon
|
||||||
><QIcon
|
><QIcon
|
||||||
|
v-if="row.isRookie"
|
||||||
name="vn:Person"
|
name="vn:Person"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -296,6 +304,7 @@ function onBuysFetched(data) {
|
||||||
<QTooltip>{{ t('negative.detail.isRookie') }}</QTooltip>
|
<QTooltip>{{ t('negative.detail.isRookie') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
v-if="row.peticionCompra"
|
||||||
name="vn:buyrequest"
|
name="vn:buyrequest"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -304,6 +313,7 @@ function onBuysFetched(data) {
|
||||||
<QTooltip>{{ t('negative.detail.peticionCompra') }}</QTooltip>
|
<QTooltip>{{ t('negative.detail.peticionCompra') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
v-if="row.turno"
|
||||||
name="vn:calendar"
|
name="vn:calendar"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
Loading…
Reference in New Issue