diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index 53d300a3b..93395702b 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -35,7 +35,6 @@ 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();
@@ -54,6 +53,7 @@ const columns = computed(() => [
name: 'itemFk',
...defaultColumnAttrs,
isId: true,
+ cardVisible: true,
columnField: {
component: 'input',
type: 'number',
@@ -65,12 +65,14 @@ 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',
},
@@ -79,6 +81,7 @@ const columns = computed(() => [
field: 'rate3',
name: 'rate3',
...defaultColumnAttrs,
+ cardVisible: true,
component: 'input',
type: 'number',
},
@@ -88,6 +91,7 @@ const columns = computed(() => [
field: 'minPrice',
name: 'minPrice',
...defaultColumnAttrs,
+ cardVisible: true,
component: 'input',
type: 'number',
},
@@ -96,6 +100,7 @@ const columns = computed(() => [
field: 'started',
name: 'started',
format: ({ started }) => toDate(started),
+ cardVisible: true,
...defaultColumnAttrs,
columnField: {
component: 'date',
@@ -111,6 +116,7 @@ const columns = computed(() => [
field: 'ended',
name: 'ended',
...defaultColumnAttrs,
+ cardVisible: true,
columnField: {
component: 'date',
class: 'shrink',
@@ -245,14 +251,11 @@ const upsertPrice = async (props, resetMinPrice = false) => {
}
if (!changes.updates && !changes.creates) return;
const data = await upsertFixedPrice(row);
- Object.assign(tableRef.value.CrudModelRef.formData[props.rowIndex], data);
- notify(t('globals.dataSaved'), 'positive');
- tableRef.value.reload();
+ tableRef.value.CrudModelRef.formData[props.rowIndex] = data;
};
async function upsertFixedPrice(row) {
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
- data.hasMinPrice = data.hasMinPrice ? 1 : 0;
return data;
}
@@ -369,9 +372,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"
@@ -422,6 +431,11 @@ function handleOnDataSave({ CrudModelRef }) {
onDataSaved: handleOnDataSave,
}"
:disable-option="{ card: true }"
+ :bottom="true"
+ :crud-model="{
+ disableInfiniteScroll: true,
+ }"
+ :disabled-attr="true"
>
@@ -457,7 +471,7 @@ function handleOnDataSave({ CrudModelRef }) {
{{ row.subName }}
-
+
@@ -489,15 +503,14 @@ function handleOnDataSave({ CrudModelRef }) {
diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js
index edb6a63fe..b3ba89525 100644
--- a/test/cypress/integration/item/ItemFixedPrice.spec.js
+++ b/test/cypress/integration/item/ItemFixedPrice.spec.js
@@ -3,7 +3,9 @@ function goTo(n = 1) {
return `.q-virtual-scroll__content > :nth-child(${n})`;
}
const firstRow = goTo();
-`.q-virtual-scroll__content > :nth-child(2)`;
+const secondRow = goTo(2);
+`.q-virtual-scroll__content > :nth-child(1)`;
+
describe('Handle Items FixedPrice', () => {
beforeEach(() => {
cy.viewport(1280, 720);
@@ -14,33 +16,25 @@ describe('Handle Items FixedPrice', () => {
'.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon'
).click();
});
- it.skip('filter', function () {
- cy.get('.category-filter > :nth-child(1) > .q-btn__content > .q-icon').click();
- cy.selectOption('.list > :nth-child(2)', 'Alstroemeria');
+ it('filter', function () {
+ cy.get('.category-filter > :nth-child(2) > .q-btn__content > .q-icon').click();
+ cy.selectOption('.list > :nth-child(2)', 'Crisantemo');
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
-
- cy.addBtnClick();
- cy.selectOption(`${firstRow} > :nth-child(2)`, '#13');
- cy.get(`${firstRow} > :nth-child(4)`).find('input').type(1);
- cy.get(`${firstRow} > :nth-child(5)`).find('input').type('2');
- cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One');
- cy.get('.q-notification__message').should('have.text', 'Data saved');
/* ==== End Cypress Studio ==== */
});
- it.skip('Create and delete ', function () {
- cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
- cy.addBtnClick();
- cy.selectOption(`${firstRow} > :nth-child(2)`, '#11');
- cy.get(`${firstRow} > :nth-child(4)`).type('1');
- cy.get(`${firstRow} > :nth-child(5)`).type('2');
- cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One');
- cy.get('.q-notification__message').should('have.text', 'Data saved');
- cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(`${firstRow} > .text-right > .q-btn > .q-btn__content > .q-icon`).click();
- cy.get(
- '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
- ).click();
+
+ 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.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(9)`).type('Warehouse One');
+ cy.get('.q-menu .q-item').contains('Warehouse One').click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
+ cy.get(':nth-child(3) > .text-right > .q-btn').click();
+ cy.dataCy('VnConfirm_confirm').click();
});
it.skip('Massive edit', function () {
@@ -48,11 +42,12 @@ describe('Handle Items FixedPrice', () => {
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').should('have.text', ' 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.skip('Massive remove', function () {
+ it('Massive remove', function () {
cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
cy.get('#subToolbar > .q-btn--flat').click();
cy.get(