diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue
index dd2cefd89..065023a6f 100644
--- a/src/components/VnTable/VnTable.vue
+++ b/src/components/VnTable/VnTable.vue
@@ -771,7 +771,7 @@ const rowCtrlClickFunction = computed(() => {
:data-col-field="col?.name"
>
diff --git a/src/pages/Item/Card/ItemDescriptorProxy.vue b/src/pages/Item/Card/ItemDescriptorProxy.vue
index f686e8221..19ac15919 100644
--- a/src/pages/Item/Card/ItemDescriptorProxy.vue
+++ b/src/pages/Item/Card/ItemDescriptorProxy.vue
@@ -22,7 +22,7 @@ const $props = defineProps({
});
-
+
$props.sales[0]);
const saleFk = computed(() => sale.value.saleFk);
const filter = computed(() => ({
@@ -77,7 +81,7 @@ const columns = computed(() => [
},
{
- align: 'left',
+ align: 'center',
sortable: true,
label: t('proposal.longName'),
name: 'longName',
@@ -85,7 +89,7 @@ const columns = computed(() => [
columnClass: 'expand',
},
{
- align: 'left',
+ align: 'center',
sortable: true,
label: t('item.list.color'),
name: 'tag5',
@@ -93,7 +97,7 @@ const columns = computed(() => [
columnClass: 'expand',
},
{
- align: 'left',
+ align: 'center',
sortable: true,
label: t('item.list.stems'),
name: 'tag6',
@@ -101,7 +105,7 @@ const columns = computed(() => [
columnClass: 'expand',
},
{
- align: 'left',
+ align: 'center',
sortable: true,
label: t('item.list.producer'),
name: 'tag7',
@@ -197,9 +201,10 @@ const isSelectionAvailable = (itemProposal) => {
async function change({ itemFk: substitutionFk }) {
try {
- const promises = $props.sales.map(({ saleFk, quantity }) => {
+ const promises = $props.sales.map(({ saleFk, quantity, ticketFk }) => {
const params = {
saleFk,
+ ticketFk,
substitutionFk,
quantity,
};
@@ -207,10 +212,9 @@ async function change({ itemFk: substitutionFk }) {
});
const results = await Promise.allSettled(promises);
- notifyResults(results, 'saleFk');
+ openTable(HandleSplitDialog, results, 'ticketFk', 'changeItem');
emit('itemReplaced', {
type: 'refresh',
- quantity: quantity.value,
itemProposal: proposalSelected.value[0],
});
proposalSelected.value = [];
@@ -221,18 +225,20 @@ async function change({ itemFk: substitutionFk }) {
async function handleTicketConfig(data) {
ticketConfig.value = data[0];
+ isLoading.value = false;
}
+ @on-fetch="handleTicketConfig"
+ >
+
{{ statusConditionalValue(row) }}%
-
- {{ row.longName }}
-
-
+
+ {{ row.longName }}
+
+
diff --git a/src/pages/Item/components/ItemProposalProxy.vue b/src/pages/Item/components/ItemProposalProxy.vue
index 7da0ce398..fafd50cef 100644
--- a/src/pages/Item/components/ItemProposalProxy.vue
+++ b/src/pages/Item/components/ItemProposalProxy.vue
@@ -19,16 +19,18 @@ const $props = defineProps({
default: () => [],
},
});
-const { dialogRef } = useDialogPluginComponent();
-const emit = defineEmits([
- 'onDialogClosed',
- 'itemReplaced',
- ...useDialogPluginComponent.emits,
-]);
+const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
+ useDialogPluginComponent();
+const emit = defineEmits(['onDialogClosed', ...useDialogPluginComponent.emits]);
defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.hide() });
-
+
{{ $t('Item proposal') }}
@@ -39,8 +41,8 @@ defineExpose({ show: () => dialogRef.value.show(), hide: () => dialogRef.value.h
{
- emit('itemReplaced', data);
+ () => {
+ emit('onDialogClosed', true);
dialogRef.hide();
}
"
diff --git a/src/pages/Ticket/Card/TicketDescriptor.vue b/src/pages/Ticket/Card/TicketDescriptor.vue
index c5f3233b1..b8be964da 100644
--- a/src/pages/Ticket/Card/TicketDescriptor.vue
+++ b/src/pages/Ticket/Card/TicketDescriptor.vue
@@ -44,6 +44,7 @@ function ticketFilter(ticket) {
@on-fetch="(data) => ([problems] = data)"
/>
-
+
diff --git a/src/pages/Ticket/Card/TicketSplit.vue b/src/pages/Ticket/Card/TicketSplit.vue
index e79057266..66ba3e9a6 100644
--- a/src/pages/Ticket/Card/TicketSplit.vue
+++ b/src/pages/Ticket/Card/TicketSplit.vue
@@ -2,7 +2,7 @@
import { ref } from 'vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
-import split from './components/split';
+import { splitTicket } from './components/split';
const emit = defineEmits(['ticketTransfered']);
const $props = defineProps({
@@ -12,6 +12,8 @@ const $props = defineProps({
},
});
+const { split } = splitTicket();
+
const splitDate = ref(Date.vnNew());
const splitSelectedRows = async () => {
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index 5838efa88..63e3c8da0 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -6,7 +6,6 @@ import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
import CardSummary from 'components/ui/CardSummary.vue';
-import FetchedTags from 'components/ui/FetchedTags.vue';
import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
@@ -20,8 +19,7 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnToSummary from 'src/components/ui/VnToSummary.vue';
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
-import TicketProblems from 'src/components/TicketProblems.vue';
-
+import TicketSaleTable from './components/TicketSaleTable.vue';
const route = useRoute();
const { notify } = useNotify();
const { t } = useI18n();
@@ -300,95 +298,7 @@ onMounted(async () => {
:url="toTicketUrl('sale')"
:text="t('ticket.summary.saleLines')"
/>
-
-
- {{ value }}
-
-
-
-
-
-
-
-
-
-
-
- {{ props.row.itemFk }}
-
-
-
-
-
- {{ props.row.visible }}
-
-
- {{ props.row.visible }}
-
-
-
-
- {{ props.row.available }}
-
-
- {{ props.row.available }}
-
-
- {{ props.row.quantity }}
-
-
- {{ props.row.concept }}
-
- {{ props.row.item.subName.toUpperCase() }}
-
-
-
-
- {{ props.row.price }} €
- {{ props.row.discount }} %
- {{
- toCurrency(
- props.row.quantity *
- props.row.price *
- ((100 - props.row.discount) / 100),
- )
- }}
-
- {{ dashIfEmpty(props.row.item.itemPackingTypeFk) }}
-
-
-
+
diff --git a/src/pages/Ticket/Card/components/TicketSaleTable.vue b/src/pages/Ticket/Card/components/TicketSaleTable.vue
new file mode 100644
index 000000000..136ac4e46
--- /dev/null
+++ b/src/pages/Ticket/Card/components/TicketSaleTable.vue
@@ -0,0 +1,112 @@
+
+
+
+
+
+ {{ value }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.row.itemFk }}
+
+
+
+
+
+ {{ props.row.visible }}
+
+
+ {{ props.row.visible }}
+
+
+
+
+ {{ props.row.available }}
+
+
+ {{ props.row.available }}
+
+
+ {{ props.row.quantity }}
+
+
+ {{ props.row.concept }}
+
+ {{ props.row.item.subName.toUpperCase() }}
+
+
+
+
+ {{ props.row.price }} €
+ {{ props.row.discount }} %
+ {{
+ toCurrency(
+ props.row.quantity *
+ props.row.price *
+ ((100 - props.row.discount) / 100),
+ )
+ }}
+
+ {{ dashIfEmpty(props.row.item.itemPackingTypeFk) }}
+
+
+
+
diff --git a/src/pages/Ticket/Card/components/TicketSaleTableDialog.vue b/src/pages/Ticket/Card/components/TicketSaleTableDialog.vue
new file mode 100644
index 000000000..e7b7aeccd
--- /dev/null
+++ b/src/pages/Ticket/Card/components/TicketSaleTableDialog.vue
@@ -0,0 +1,42 @@
+
+
+
+
+ (sales = data)"
+ auto-load
+ >
+
+
+ {{
+ $t('ticket.summary.saleLines')
+ }}
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Ticket/Card/components/split.js b/src/pages/Ticket/Card/components/split.js
index afa1d5cd6..7d3cd9ed8 100644
--- a/src/pages/Ticket/Card/components/split.js
+++ b/src/pages/Ticket/Card/components/split.js
@@ -1,22 +1,24 @@
import axios from 'axios';
-import notifyResults from 'src/utils/notifyResults';
+import { showResultsAsTable } from 'src/composables/showResultsTable';
+import HandleSplitDialog from 'src/pages/Ticket/Negative/components/HandleSplitDialog.vue';
+export function splitTicket() {
+ const { openTable } = showResultsAsTable();
-export default async function (data, date) {
- const reducedData = data.reduce((acc, item) => {
- const existing = acc.find(({ ticketFk }) => ticketFk === item.id);
- if (existing) {
- existing.sales.push(item.saleFk);
- } else {
- acc.push({ ticketFk: item.id, sales: [item.saleFk], date });
- }
- return acc;
- }, []);
+ async function split(data, date) {
+ const reducedData = data.reduce((acc, item) => {
+ const existing = acc.find(({ ticketFk }) => ticketFk === item.ticketFk);
+ if (existing) {
+ existing.sales.push(item.saleFk);
+ } else {
+ acc.push({ ticketFk: item.ticketFk, sales: [item.saleFk], landed: date });
+ }
+ return acc;
+ }, []);
- const promises = reducedData.map((params) => axios.post(`Tickets/split`, params));
+ const promises = reducedData.map((params) => axios.post(`Tickets/split`, params));
- const results = await Promise.allSettled(promises);
-
- notifyResults(results, 'ticketFk');
-
- return results;
+ const result = await Promise.allSettled(promises);
+ openTable(HandleSplitDialog, result, 'ticket', 'split');
+ }
+ return { split };
}
diff --git a/src/pages/Ticket/Negative/TicketLackDetail.vue b/src/pages/Ticket/Negative/TicketLackDetail.vue
index dcf835d03..9a1bf3921 100644
--- a/src/pages/Ticket/Negative/TicketLackDetail.vue
+++ b/src/pages/Ticket/Negative/TicketLackDetail.vue
@@ -68,7 +68,8 @@ const showItemProposal = () => {
sales: selectedRows.value,
},
})
- .onOk(itemProposalEvt);
+ .onOk(reload)
+ .onCancel(reload);
};
@@ -146,7 +147,12 @@ const showItemProposal = () => {
{
+ popup.hide();
+ reload();
+ }
+ "
:selected-rows="selectedRows"
/>
@@ -160,7 +166,12 @@ const showItemProposal = () => {
{
+ popup.hide();
+ reload();
+ }
+ "
:selected-rows="selectedRows"
/>
@@ -175,7 +186,12 @@ const showItemProposal = () => {
{
+ popup.hide();
+ reload();
+ }
+ "
:selected-rows="selectedRows"
/>
{
{
-
-
-
-
-
-
-
-
[
columnFilter: {
component: 'input',
type: 'number',
- columnClass: 'shrink',
+ inWhere: false,
},
},
{
name: 'longName',
- align: 'center',
+ align: 'left',
label: t('negative.longName'),
field: ({ longName }) => longName,
-
+ columnFilter: {
+ component: 'input',
+ inWhere: false,
+ useLike: true,
+ },
sortable: true,
headerStyle: 'width: 350px',
cardVisible: true,
@@ -94,6 +98,11 @@ const columns = computed(() => [
field: ({ inkFk }) => inkFk,
sortable: true,
cardVisible: true,
+ columnFilter: {
+ component: 'input',
+ columnClass: 'shrink',
+ inWhere: false,
+ },
},
{
name: 'size',
@@ -155,7 +164,6 @@ const setUserParams = (params) => {
- {{ filterRef }}
$props.filter,
- (v) => {
- filterLack.value.where = v;
- tableRef.value.reload(filterLack);
- },
-);
-
const filterLack = ref({
include: [
{
@@ -90,6 +82,7 @@ const columns = computed(() => [
},
{
name: 'alertLevelCode',
+ field: 'alertLevelCode',
label: t('negative.detail.state'),
columnFilter: {
name: 'alertLevelCode',
@@ -108,14 +101,14 @@ const columns = computed(() => [
name: 'zoneName',
label: t('negative.detail.zoneName'),
field: 'zoneName',
- align: 'center',
+ align: 'left',
sortable: true,
},
{
name: 'nickname',
label: t('negative.detail.nickname'),
field: 'nickname',
- align: 'center',
+ align: 'left',
sortable: true,
},
{
@@ -139,27 +132,22 @@ const getInputEvents = ({ col, ...rows }) => ({
'keyup.enter': () => saveChange(col.name, rows),
});
const saveChange = async (field, { row }) => {
- try {
- switch (field) {
- case 'alertLevelCode':
- await axios.post(`Tickets/state`, {
- ticketFk: row.ticketFk,
- code: row[field],
- });
- break;
+ switch (field) {
+ case 'alertLevelCode':
+ await axios.post(`Tickets/state`, {
+ ticketFk: row.ticketFk,
+ code: row[field],
+ });
+ break;
- case 'quantity':
- await axios.post(`Sales/${row.saleFk}/updateQuantity`, {
- quantity: +row.quantity,
- });
- break;
- }
- notify('globals.dataSaved', 'positive');
- fetchItemLack.value.fetch();
- } catch (err) {
- console.error('Error saving changes', err);
- f;
+ case 'quantity':
+ await axios.post(`Sales/${row.saleFk}/updateQuantity`, {
+ quantity: +row.quantity,
+ });
+ break;
}
+ notify('globals.dataSaved', 'positive');
+ fetchItemLack.value.fetch();
};
function onBuysFetched(data) {
@@ -171,7 +159,7 @@ function onBuysFetched(data) {
(itemLack = data[0])"
auto-load
/>
@@ -238,65 +226,59 @@ function onBuysFetched(data) {
-
-
-
- {{ t('negative.detail.isBasket') }}
-
-
- {{ t('negative.detail.hasToIgnore') }}
-
-
- {{
- t('negative.detail.hasObservation')
- }}
- {{ t('negative.detail.isRookie') }}
-
-
- {{ t('negative.detail.peticionCompra') }}
-
-
- {{ t('negative.detail.turno') }}
-
-
+ {{ t('negative.detail.isBasket') }}
+
+
+ {{ t('negative.detail.hasToIgnore') }}
+
+
+ {{ t('negative.detail.hasObservation') }}
+ {{ t('negative.detail.isRookie') }}
+
+
+ {{ t('negative.detail.peticionCompra') }}
+
+
+ {{ t('negative.detail.turno') }}
+
@@ -305,9 +287,9 @@ function onBuysFetched(data) {
-
- {{ row.id }}
-
+
+ {{ row.ticketFk }}
+
@@ -335,15 +317,6 @@ function onBuysFetched(data) {