-
+
+
-
diff --git a/src/css/app.scss b/src/css/app.scss
index 504718ff5..43ec730b9 100644
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -233,27 +233,23 @@ input::-webkit-inner-spin-button {
}
.q-table {
- thead,
- tbody {
- th {
- .q-select {
- max-width: 120px;
- }
- }
- td {
- padding: 1px 10px 1px 10px;
- max-width: 100px;
- div span {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
+ th,
+ td {
+ padding: 1px 10px 1px 10px;
+ max-width: 100px;
+ div span {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
- .expand {
- max-width: 400px;
- }
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+ .shrink {
+ min-width: 65px;
+ }
+ .expand {
+ max-width: 200px;
}
}
diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml
index 6943252c9..5ea072d49 100644
--- a/src/i18n/locale/en.yml
+++ b/src/i18n/locale/en.yml
@@ -1271,6 +1271,7 @@ components:
active: Is active
visible: Is visible
floramondo: Is floramondo
+ showBadDates: Show future items
userPanel:
copyToken: Token copied to clipboard
settings: Settings
diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml
index f32562313..306a86d13 100644
--- a/src/i18n/locale/es.yml
+++ b/src/i18n/locale/es.yml
@@ -1252,6 +1252,7 @@ components:
active: Activo
visible: Visible
floramondo: Floramondo
+ showBadDates: Ver items a futuro
userPanel:
copyToken: Token copiado al portapapeles
settings: Configuración
diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index 758594082..948cd1f23 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -9,13 +9,14 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue';
import ItemFixedPriceFilter from './ItemFixedPriceFilter.vue';
+import { useQuasar } from 'quasar';
import ItemDescriptorProxy from './Card/ItemDescriptorProxy.vue';
+import { tMobile } from 'src/composables/tMobile';
import { useStateStore } from 'stores/useStateStore';
-import { dashIfEmpty, toDate } from 'src/filters';
+import { toDate } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm';
import { useState } from 'src/composables/useState';
-import { toCurrency } from 'filters/index';
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
import { isLower, isBigger } from 'src/filters/date.js';
@@ -23,7 +24,6 @@ import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'src/components/VnTable/VnTable.vue';
import { QCheckbox } from 'quasar';
-const checked = ref(false);
const stateStore = useStateStore();
const { t } = useI18n();
const { openConfirmationModal } = useVnConfirm();
@@ -54,61 +54,6 @@ const exprBuilder = (param, value) => {
};
const params = reactive({});
-// const arrayData = useArrayData('ItemFixedPrices', {
-// url: 'FixedPrices/filter',
-// userParams: params,
-// order: ['name ASC', 'itemFk'],
-// exprBuilder: exprBuilder,
-// });
-// const store = arrayData.store;
-
-// const fetchFixedPrices = async () => {
-// await arrayData.fetch({ append: false });
-// };
-
-// const onFixedPricesFetched = (data) => {
-// data.forEach((item) => {
-// console.log(item.hasMinPrice);
-// item.hasMinPrice = `${item.hasMinPrice !== 0}`;
-// });
-// fixedPrices.value = data;
-// // el objetivo de guardar una copia de las rows es evitar guardar cambios si la data no cambió al disparar los eventos
-// fixedPricesOriginalData.value = JSON.parse(JSON.stringify(data));
-// };
-
-// watch(
-// () => store.data,
-// (data) => onFixedPricesFetched(data)
-// );
-
-// const applyColumnFilter = async (col) => {
-// try {
-// const paramKey = col.columnFilter?.filterParamKey || col.field;
-// params[paramKey] = col.columnFilter.filterValue;
-// await arrayData.addFilter({ params });
-// } catch (err) {
-// console.error('Error applying column filter', err);
-// }
-// };
-
-// const getColumnInputEvents = (col) => {
-// return col.columnFilter.type === 'select'
-// ? { 'update:modelValue': () => applyColumnFilter(col) }
-// : {
-// 'keyup.enter': () => applyColumnFilter(col),
-// };
-// };
-
-// const defaultColumnFilter = {
-// component: VnInput,
-// type: 'text',
-// filterValue: null,
-// event: getColumnInputEvents,
-// attrs: {
-// dense: true,
-// },
-// };
-
const defaultColumnAttrs = {
align: 'left',
sortable: true,
@@ -123,6 +68,7 @@ const columns = computed(() => [
...defaultColumnAttrs,
isId: true,
cardVisible: true,
+ columnClass: 'shrink',
columnField: {
component: 'input',
type: 'number',
@@ -131,6 +77,7 @@ const columns = computed(() => [
{
label: t('globals.name'),
field: 'name',
+ columnClass: 'shrink',
name: 'description',
...defaultColumnAttrs,
create: true,
@@ -142,9 +89,6 @@ const columns = computed(() => [
name: 'rate2',
...defaultColumnAttrs,
cardVisible: true,
- class: 'expand',
-
- style: 'max-width: 80px',
},
{
label: t('item.fixedPrice.packingPrice'),
@@ -152,12 +96,11 @@ const columns = computed(() => [
name: 'rate3',
...defaultColumnAttrs,
cardVisible: true,
- class: 'expand',
- style: 'max-width: 80px',
},
{
label: t('item.fixedPrice.minPrice'),
+ class: 'expand',
field: 'minPrice',
name: 'minPrice',
...defaultColumnAttrs,
@@ -172,16 +115,17 @@ const columns = computed(() => [
label: t('item.fixedPrice.started'),
field: 'started',
name: 'started',
- ...defaultColumnAttrs,
+ format: ({ started }) => toDate(started),
cardVisible: true,
+ ...defaultColumnAttrs,
component: 'date',
- format: (row) => toDate(row.started),
},
{
label: t('item.fixedPrice.ended'),
field: 'ended',
name: 'ended',
...defaultColumnAttrs,
+ columnClass: 'expand',
cardVisible: true,
component: 'date',
format: (row) => toDate(row.ended),
@@ -270,29 +214,7 @@ async function saveOnRowChange(row) {
else if (rowsSelected.value.length === 1)
await upsertFixedPrice(rowsSelected.value[0]);
rowsSelected.value = [row];
- // if (rowsSelected.value.length > 0) {
- // disableUnselectedRows();
- // } else {
- // resetRowStates();
- // }
- // if (lastRow.value && lastRow.value !== row.id) {
- // console.log('update');
- // // await upsertPrice(row);
- // }
- // lastRow.value = row.id;
}
-// function disableUnselectedRows() {
-// fixedPrices.value.forEach((row) => {
-// row.disabled = !rowsSelected.value.includes(row.id);
-// });
-// }
-// function resetRowStates() {
-// fixedPrices.value.forEach((row) => {
-// row.disable = false;
-// });
-// // Aquí puedes guardar los cambios si es necesario
-// console.log('Guardando cambios...');
-// }
const tableRef = ref();
function checkLastVisibleRow() {
const rows = document
@@ -367,25 +289,6 @@ const openEditTableCellDialog = () => {
const onEditCellDataSaved = async () => {
rowsSelected.value = [];
};
-/*const lastRow = ref(null);
-async function saveOnRowChange(row) {
- if (lastRow.value && lastRow.value !== row.id) {
- console.log('update');
- await upsertPrice(row);
- return;
- }
- lastRow.value = row.id;
-}*/
-
-// const onWarehousesFetched = (data) => {
-// warehousesOptions.value = data;
-// // Actualiza las 'options' del elemento con field 'warehouseFk' en 'editTableFieldsOptions'.
-// const warehouseField = editTableFieldsOptions.find(
-// (field) => field.field === 'warehouseFk'
-// );
-// warehouseField.attrs.options = data;
-// };
-import { useQuasar } from 'quasar';
const removeFuturePrice = async () => {
try {
rowsSelected.value.forEach(({ id }) => {
@@ -405,11 +308,21 @@ function confirmRemove(item) {
component: VnConfirm,
componentProps: {
title: t('This row will be removed'),
- message: t('Do you want to clone this item?'),
+ message: t('Do you want to remove?'),
promise: async () => removePrice(item.id),
},
});
}
+function confirmRemoveFuturePrice(item) {
+ quasar.dialog({
+ component: VnConfirm,
+ componentProps: {
+ title: t('This row will be removed'),
+ message: t('Do you want to remove?'),
+ promise: async () => removeFuturePrice(item.id),
+ },
+ });
+}
const removePrice = async (id) => {
try {
@@ -433,7 +346,6 @@ function handleOnDataSave(CrudModelRef) {
nextTick(() => {
highlightNewRow(checkLastVisibleRow());
});
- // CrudModelRef.value.insert(lastItem);
}
onUnmounted(() => (stateStore.rightDrawer = false));
@@ -465,12 +377,20 @@ onUnmounted(() => (stateStore.rightDrawer = false));
{{ t('Edit fixed price(s)') }}
+
- {{ lastRow }}
- {{ rowsSelected }}
(stateStore.rightDrawer = false));
{{ scope }}
-
-
+
@@ -538,13 +451,16 @@ onUnmounted(() => (stateStore.rightDrawer = false));
{{ row.name }}
-
+
(stateStore.rightDrawer = false));
(stateStore.rightDrawer = false));
- €{{ props.row.hasMinPrice }}
+ €