-import { ref, computed } from 'vue';
+import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import CrudModel from 'components/CrudModel.vue';
import FetchData from 'components/FetchData.vue';
import VnSelectFilter from 'components/common/VnSelectFilter.vue';
+import { getUrl } from 'composables/getUrl';
+import { tMobile } from 'composables/tMobile';
const route = useRoute();
+
const { t } = useI18n();
const claimDevelopmentForm = ref();
@@ -16,6 +19,12 @@ const claimResponsibles = ref([]);
const claimRedeliveries = ref([]);
const workers = ref([]);
const selected = ref([]);
+const insertButtonRef = ref();
+let salixUrl;
+
+onMounted(async () => {
+ salixUrl = await getUrl(`claim/${route.params.id}`);
+});
const developmentsFilter = {
fields: [
@@ -43,6 +52,7 @@ const columns = computed(() => [
model: 'claimReasonFk',
optionValue: 'id',
optionLabel: 'description',
+ tabIndex: 1,
},
{
name: 'claimResult',
@@ -54,6 +64,7 @@ const columns = computed(() => [
model: 'claimResultFk',
optionValue: 'id',
optionLabel: 'description',
+ tabIndex: 2,
},
{
name: 'claimResponsible',
@@ -65,6 +76,7 @@ const columns = computed(() => [
model: 'claimResponsibleFk',
optionValue: 'id',
optionLabel: 'description',
+ tabIndex: 3,
},
{
name: 'worker',
@@ -75,6 +87,7 @@ const columns = computed(() => [
model: 'workerFk',
optionValue: 'id',
optionLabel: 'nickname',
+ tabIndex: 4,
},
{
name: 'claimRedelivery',
@@ -86,8 +99,13 @@ const columns = computed(() => [
model: 'claimRedeliveryFk',
optionValue: 'id',
optionLabel: 'description',
+ tabIndex: 5,
},
]);
+
+function goToAction() {
+ location.href = `${salixUrl}/action`;
+}
[
auto-load
/>
(workers = data)"
auto-load
/>
@@ -129,6 +148,8 @@ const columns = computed(() => [
:data-required="{ claimFk: route.params.id }"
v-model:selected="selected"
auto-load
+ @save-changes="goToAction"
+ :default-save="false"
>
[
:grid="$q.screen.lt.md"
>
-
+
+ :autofocus="col.tabIndex == 1"
+ input-debounce="0"
+ >
+
+
+
+ {{ scope.opt?.name }}
+
+ {{ scope.opt?.nickname }}
+ {{ scope.opt?.code }}
+
+
+
+
+
-
+
@@ -169,6 +211,8 @@ const columns = computed(() => [
:option-value="col.optionValue"
:option-label="col.optionLabel"
dense
+ input-debounce="0"
+ :autofocus="col.tabIndex == 1"
/>
@@ -178,9 +222,28 @@ const columns = computed(() => [
+
+
+
-
+
diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue
index 8680ff922..c03291b85 100644
--- a/src/pages/Claim/Card/ClaimLines.vue
+++ b/src/pages/Claim/Card/ClaimLines.vue
@@ -40,7 +40,6 @@ const claimLinesForm = ref();
const claim = ref(null);
async function onFetchClaim(data) {
claim.value = data;
-
fetchMana();
}
@@ -147,8 +146,11 @@ function showImportDialog() {
quasar
.dialog({
component: ClaimLinesImport,
+ componentProps: {
+ ticketId: claim.value.ticketFk,
+ },
})
- .onOk(() => arrayData.refresh());
+ .onOk(() => claimLinesForm.value.reload());
}
diff --git a/src/pages/Claim/Card/ClaimLinesImport.vue b/src/pages/Claim/Card/ClaimLinesImport.vue
index 26e59bbc0..be8914eec 100644
--- a/src/pages/Claim/Card/ClaimLinesImport.vue
+++ b/src/pages/Claim/Card/ClaimLinesImport.vue
@@ -14,6 +14,13 @@ const route = useRoute();
const quasar = useQuasar();
const { t } = useI18n();
+const $props = defineProps({
+ ticketId: {
+ type: Number,
+ required: true,
+ },
+});
+
const columns = computed(() => [
{
name: 'delivered',
@@ -99,7 +106,7 @@ function cancel() {
(claimableSales = data)"
auto-load
/>
diff --git a/test/cypress/integration/claimDevelopment.spec.js b/test/cypress/integration/claimDevelopment.spec.js
index 77ce2bb45..4ab4ee981 100755
--- a/test/cypress/integration/claimDevelopment.spec.js
+++ b/test/cypress/integration/claimDevelopment.spec.js
@@ -20,7 +20,8 @@ describe('ClaimDevelopment', () => {
cy.selectOption(firstLineReason, 'Novato');
cy.saveCard();
- cy.reload();
+ cy.login('developer');
+ cy.visit(`/#/claim/${claimId}/development`);
cy.getValue(firstLineReason).should('have.text', 'Novato');
//Restart data
@@ -29,13 +30,16 @@ describe('ClaimDevelopment', () => {
});
it('should add and remove new line', () => {
+ cy.login('developer');
+ cy.visit(`/#/claim/${claimId}/development`);
//add row
cy.addCard();
cy.get(thirdRow).should('exist');
const rowData = [false, 'Novato', 'Roces', 'Compradores', 'employeeNick', 'Tour'];
cy.fillRow(thirdRow, rowData);
- cy.saveCard();
+ cy.login('developer');
+ cy.visit(`/#/claim/${claimId}/development`);
cy.validateRow(thirdRow, rowData);
cy.reload();
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 2eb14e463..725aa0669 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -52,6 +52,13 @@ Cypress.Commands.add('getValue', (selector) => {
}
// Si es un QSelect
else if ($el.find('.q-select__dropdown-icon').length) {
+ cy.log(
+ selector,
+ cy.get(
+ selector +
+ '> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native'
+ )
+ );
return cy.get(
selector +
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > span'