diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index 1bab5c7c2..948ec2389 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -35,6 +35,7 @@ const editTableCellDialogRef = ref(null);
const user = state.getUser();
const fixedPrices = ref([]);
const warehousesOptions = ref([]);
+const hasSelectedRows = computed(() => rowsSelected.value.length > 0);
const rowsSelected = ref([]);
const itemFixedPriceFilterRef = ref();
@@ -53,7 +54,6 @@ const columns = computed(() => [
name: 'itemFk',
...defaultColumnAttrs,
isId: true,
- cardVisible: true,
columnField: {
component: 'input',
type: 'number',
@@ -65,14 +65,12 @@ const columns = computed(() => [
name: 'name',
...defaultColumnAttrs,
create: true,
- cardVisible: true,
},
{
label: t('item.fixedPrice.groupingPrice'),
field: 'rate2',
name: 'rate2',
...defaultColumnAttrs,
- cardVisible: true,
component: 'input',
type: 'number',
},
@@ -81,7 +79,6 @@ const columns = computed(() => [
field: 'rate3',
name: 'rate3',
...defaultColumnAttrs,
- cardVisible: true,
component: 'input',
type: 'number',
},
@@ -91,7 +88,6 @@ const columns = computed(() => [
field: 'minPrice',
name: 'minPrice',
...defaultColumnAttrs,
- cardVisible: true,
component: 'input',
type: 'number',
},
@@ -100,7 +96,6 @@ const columns = computed(() => [
field: 'started',
name: 'started',
format: ({ started }) => toDate(started),
- cardVisible: true,
...defaultColumnAttrs,
columnField: {
component: 'date',
@@ -116,7 +111,6 @@ const columns = computed(() => [
field: 'ended',
name: 'ended',
...defaultColumnAttrs,
- cardVisible: true,
columnField: {
component: 'date',
class: 'shrink',
@@ -235,7 +229,7 @@ const validations = ({ row }) => {
'warehouseFk',
];
const isValid = requiredFields.every(
- (field) => row[field] !== null && row[field] !== undefined
+ (field) => row[field] !== null && row[field] !== undefined,
);
return isValid;
};
@@ -251,11 +245,14 @@ const upsertPrice = async (props, resetMinPrice = false) => {
}
if (!changes.updates && !changes.creates) return;
const data = await upsertFixedPrice(row);
- tableRef.value.CrudModelRef.formData[props.rowIndex] = data;
+ Object.assign(tableRef.value.CrudModelRef.formData[props.rowIndex], data);
+ notify(t('globals.dataSaved'), 'positive');
+ tableRef.value.reload();
};
async function upsertFixedPrice(row) {
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
+ data.hasMinPrice = data.hasMinPrice ? 1 : 0;
return data;
}
@@ -372,9 +369,9 @@ function handleOnDataSave({ CrudModelRef }) {
-
+
confirmRemove(row, true)"
:title="t('globals.remove')"
- v-if="rowsSelected.length"
/>
- data.forEach((item) => {
- item.hasMinPrice = `${item.hasMinPrice !== 0}`;
- })
- "
:default-remove="false"
:default-reset="false"
:default-save="false"
@@ -424,6 +415,9 @@ function handleOnDataSave({ CrudModelRef }) {
'row-key': 'id',
selection: 'multiple',
}"
+ :crud-model="{
+ disableInfiniteScroll: true,
+ }"
:use-model="true"
v-model:selected="rowsSelected"
:create-as-dialog="false"
@@ -467,7 +461,7 @@ function handleOnDataSave({ CrudModelRef }) {
{{ row.subName }}
-
+
@@ -499,14 +493,15 @@ function handleOnDataSave({ CrudModelRef }) {
@@ -556,7 +551,7 @@ function handleOnDataSave({ CrudModelRef }) {
openConfirmationModal(
t('globals.rowWillBeRemoved'),
t('Do you want to clone this item?'),
- () => removePrice(row.id, rowIndex)
+ () => removePrice(row.id, rowIndex),
)
"
>
diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js
index b3ba89525..d09d9ce32 100644
--- a/test/cypress/integration/item/ItemFixedPrice.spec.js
+++ b/test/cypress/integration/item/ItemFixedPrice.spec.js
@@ -25,11 +25,11 @@ describe('Handle Items FixedPrice', () => {
it('Create and delete ', function () {
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content').click();
- cy.get('.bottomButton > .q-btn > .q-btn__content > .q-icon').click();
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.get(`${secondRow} > :nth-child(5) > .q-td`).type("2{enter}");
cy.get(`${secondRow} > :nth-child(2)`).type('11');
cy.get('.q-menu .q-item').contains('#11').click();
- cy.get(`${secondRow} > :nth-child(4)`).find('input').type(1);
- cy.get(`${secondRow} > :nth-child(5)`).find('input').type(2);
+ cy.get(`${secondRow} > :nth-child(4) > .q-td`).type("1{enter}");
cy.get(`${secondRow} > :nth-child(9)`).type('Warehouse One');
cy.get('.q-menu .q-item').contains('Warehouse One').click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
@@ -38,13 +38,13 @@ describe('Handle Items FixedPrice', () => {
});
it.skip('Massive edit', function () {
+ //Falla debido a que hay una peticiĆ³n doble
cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
cy.get('#subToolbar > .q-btn--standard').click();
cy.selectOption("[data-cy='field-to-edit']", 'Min price');
cy.dataCy('value-to-edit').find('input').type('1');
cy.get('.countLines').invoke('text').then(parseFloat).should('be.gte', 1);
cy.get('.q-mt-lg > .q-btn--standard').click();
- //Falla debido a que hay una peticiĆ³n doble
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('Massive remove', function () {