refs #6321 perf: move dialogs to new files

This commit is contained in:
Javier Segarra 2024-03-27 10:07:27 +01:00
parent 6b564bb648
commit 1e09e9e4bb
19 changed files with 3350 additions and 6 deletions

46
7014.patch Normal file
View File

@ -0,0 +1,46 @@
diff --git a/src/layouts/ViewLayout.vue b/src/layouts/ViewLayout.vue
new file mode 100644
index 00000000..4812e7a8
--- /dev/null
+++ b/src/layouts/ViewLayout.vue
@@ -0,0 +1,16 @@
+<script setup>
+import { useStateStore } from 'stores/useStateStore';
+import LeftMenu from 'components/LeftMenu.vue';
+
+const stateStore = useStateStore();
+</script>
+<template>
+ <QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
+ <QScrollArea class="fit text-grey-8">
+ <LeftMenu />
+ </QScrollArea>
+ </QDrawer>
+ <QPageContainer>
+ <RouterView></RouterView>
+ </QPageContainer>
+</template>
diff --git a/src/pages/Claim/ClaimMain.vue b/src/pages/Claim/ClaimMain.vue
index f0dc2e50..6a294fe8 100644
--- a/src/pages/Claim/ClaimMain.vue
+++ b/src/pages/Claim/ClaimMain.vue
@@ -1,17 +1,7 @@
<script setup>
-import { useStateStore } from 'stores/useStateStore';
-import LeftMenu from 'components/LeftMenu.vue';
-
-const stateStore = useStateStore();
+import ViewLayout from 'src/layouts/ViewLayout.vue';
</script>
<template>
- <QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256">
- <QScrollArea class="fit text-grey-8">
- <LeftMenu />
- </QScrollArea>
- </QDrawer>
- <QPageContainer>
- <RouterView></RouterView>
- </QPageContainer>
+ <ViewLayout></ViewLayout>
</template>

72
autofocus.patch Normal file
View File

@ -0,0 +1,72 @@
diff --git a/quasar.config.js b/quasar.config.js
index 2d828950..80ddc375 100644
--- a/quasar.config.js
+++ b/quasar.config.js
@@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files
- boot: ['i18n', 'axios', 'vnDate', 'validations'],
+ boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'],
diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js
new file mode 100644
index 00000000..7130b071
--- /dev/null
+++ b/src/boot/qformMixin.js
@@ -0,0 +1,28 @@
+import { QForm } from 'quasar';
+import { getCurrentInstance } from 'vue';
+
+export default {
+ inject: { QForm },
+ component: { QForm },
+ components: { QForm },
+ extends: { QForm },
+ mounted: function () {
+ const vm = getCurrentInstance();
+ if (vm.type.name === 'QForm')
+ if (![ 'searchbarForm'].includes(this.$el?.id)) {
+ let that = this;
+ const elementsArray = Array.from(this.$el.elements);
+ const index = elementsArray.findIndex(element => element.classList.contains('q-field__native'));
+
+ if (index !== -1) {
+ const firstInputElement = elementsArray[index];
+ firstInputElement.focus();
+ }
+ document.addEventListener('keyup', function (evt) {
+ if (evt.keyCode === 13) {
+ that.onSubmit();
+ }
+ });
+ }
+ },
+};
diff --git a/src/boot/quasar.js b/src/boot/quasar.js
new file mode 100644
index 00000000..a8d9b7ad
--- /dev/null
+++ b/src/boot/quasar.js
@@ -0,0 +1,6 @@
+import { boot } from 'quasar/wrappers';
+import qFormMixin from './qformMixin';
+
+export default boot(({ app }) => {
+ app.mixin(qFormMixin);
+});
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index baab4829..a8065948 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -108,7 +108,7 @@ async function search() {
</script>
<template>
- <QForm @submit="search">
+ <QForm @submit="search" id="searchbarForm">
<VnInput
id="searchbar"
v-model="searchText"

View File

@ -0,0 +1,33 @@
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index f075d500..515e9d81 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -28,7 +28,7 @@
// Imports Quasar Cypress AE predefined commands
// import { registerCommands } from '@quasar/quasar-app-extension-testing-e2e-cypress';
Cypress.Commands.add('login', (user) => {
- //cy.visit('/#/login');
+ cy.visit('/#/login');
cy.request({
method: 'POST',
url: '/api/accounts/login',
@@ -38,7 +38,18 @@ Cypress.Commands.add('login', (user) => {
},
}).then((response) => {
window.localStorage.setItem('token', response.body.token);
- });
+
+ cy.request({
+ method: 'GET',
+ url: '/api/VnUsers/ShareToken',
+ headers:{
+ Authorization: window.localStorage.getItem('token')
+ }
+ }).then(({body}) => {
+ console.log();
+ window.localStorage.setItem('tokenMultimedia', body.multimediaToken.id);
+ })
+});
});
Cypress.Commands.add('waitForElement', (element) => {

View File

@ -32,6 +32,7 @@
"@intlify/unplugin-vue-i18n": "^0.8.1", "@intlify/unplugin-vue-i18n": "^0.8.1",
"@pinia/testing": "^0.1.2", "@pinia/testing": "^0.1.2",
"@quasar/app-vite": "^1.7.3", "@quasar/app-vite": "^1.7.3",
"@quasar/quasar-app-extension-qcalendar": "4.0.0-beta.15",
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0", "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
"@vue/test-utils": "^2.4.4", "@vue/test-utils": "^2.4.4",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",

245
patch/6336.patch Normal file
View File

@ -0,0 +1,245 @@
diff --git a/src/composables/useCardSize.js b/src/composables/useCardSize.js
new file mode 100644
index 00000000..7f562106
--- /dev/null
+++ b/src/composables/useCardSize.js
@@ -0,0 +1,8 @@
+import { useQuasar } from 'quasar';
+
+export default function() {
+ const quasar = useQuasar();
+ if (quasar.screen.gt.xs) return 'q-pa-md'
+ else return 'q-pa-xs';
+
+}
diff --git a/src/pages/Claim/Card/ClaimCard.vue b/src/pages/Claim/Card/ClaimCard.vue
index 249337c4..78eec9e8 100644
--- a/src/pages/Claim/Card/ClaimCard.vue
+++ b/src/pages/Claim/Card/ClaimCard.vue
@@ -5,6 +5,7 @@ import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n';
import ClaimDescriptor from './ClaimDescriptor.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const { t } = useI18n();
@@ -28,7 +29,7 @@ const { t } = useI18n();
<QPageContainer>
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Customer/Card/CustomerCard.vue b/src/pages/Customer/Card/CustomerCard.vue
index a3503628..9da9eb21 100644
--- a/src/pages/Customer/Card/CustomerCard.vue
+++ b/src/pages/Customer/Card/CustomerCard.vue
@@ -6,6 +6,7 @@ import CustomerDescriptor from './CustomerDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const route = useRoute();
@@ -30,7 +31,7 @@ const { t } = useI18n();
<QPageContainer>
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Entry/Card/EntryCard.vue b/src/pages/Entry/Card/EntryCard.vue
index eea0b3b6..5a2bef18 100644
--- a/src/pages/Entry/Card/EntryCard.vue
+++ b/src/pages/Entry/Card/EntryCard.vue
@@ -7,6 +7,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import EntryDescriptor from './EntryDescriptor.vue';
import { useStateStore } from 'stores/useStateStore';
+import useCardSize from 'src/composables/useCardSize';
const { t } = useI18n();
const stateStore = useStateStore();
@@ -33,7 +34,7 @@ const stateStore = useStateStore();
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/InvoiceIn/Card/InvoiceInCard.vue b/src/pages/InvoiceIn/Card/InvoiceInCard.vue
index c0e36e58..0de31c18 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInCard.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInCard.vue
@@ -8,6 +8,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useArrayData } from 'src/composables/useArrayData';
import { onMounted, watch } from 'vue';
import { useRoute } from 'vue-router';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const { t } = useI18n();
@@ -74,7 +75,7 @@ watch(
<QPageContainer>
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
index fe6649fb..6844df2d 100644
--- a/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
+++ b/src/pages/InvoiceOut/Card/InvoiceOutCard.vue
@@ -5,6 +5,7 @@ import InvoiceOutDescriptor from './InvoiceOutDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const { t } = useI18n();
@@ -28,7 +29,7 @@ const { t } = useI18n();
<QPageContainer>
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Item/Card/ItemCard.vue b/src/pages/Item/Card/ItemCard.vue
index 5ca20d6f..3b3750b2 100644
--- a/src/pages/Item/Card/ItemCard.vue
+++ b/src/pages/Item/Card/ItemCard.vue
@@ -4,6 +4,7 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import ItemDescriptor from './ItemDescriptor.vue';
import { useStateStore } from 'stores/useStateStore';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
</script>
@@ -19,7 +20,7 @@ const stateStore = useStateStore();
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Supplier/Card/SupplierCard.vue b/src/pages/Supplier/Card/SupplierCard.vue
index 74b2dfb4..fdf1d785 100644
--- a/src/pages/Supplier/Card/SupplierCard.vue
+++ b/src/pages/Supplier/Card/SupplierCard.vue
@@ -5,6 +5,7 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import LeftMenu from 'components/LeftMenu.vue';
import SupplierDescriptor from './SupplierDescriptor.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const { t } = useI18n();
@@ -30,7 +31,7 @@ const { t } = useI18n();
<QPageContainer>
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Ticket/Card/TicketCard.vue b/src/pages/Ticket/Card/TicketCard.vue
index 568cf644..0d5d3803 100644
--- a/src/pages/Ticket/Card/TicketCard.vue
+++ b/src/pages/Ticket/Card/TicketCard.vue
@@ -5,6 +5,7 @@ import TicketDescriptor from './TicketDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const { t } = useI18n();
@@ -29,7 +30,7 @@ const { t } = useI18n();
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Travel/Card/TravelCard.vue b/src/pages/Travel/Card/TravelCard.vue
index 76bf74c6..e6c7b7e2 100644
--- a/src/pages/Travel/Card/TravelCard.vue
+++ b/src/pages/Travel/Card/TravelCard.vue
@@ -3,6 +3,7 @@ import { useStateStore } from 'stores/useStateStore';
import TravelDescriptor from './TravelDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
</script>
@@ -17,7 +18,7 @@ const stateStore = useStateStore();
<QPageContainer>
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Wagon/Card/WagonCard.vue b/src/pages/Wagon/Card/WagonCard.vue
index ba451777..5ac18fb4 100644
--- a/src/pages/Wagon/Card/WagonCard.vue
+++ b/src/pages/Wagon/Card/WagonCard.vue
@@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import { useRoute } from 'vue-router';
import LeftMenu from 'components/LeftMenu.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const route = useRoute();
@@ -17,7 +18,7 @@ const { t } = useI18n();
</QDrawer>
<QPageContainer>
<QPage>
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>
diff --git a/src/pages/Worker/Card/WorkerCard.vue b/src/pages/Worker/Card/WorkerCard.vue
index 3b31f906..0d62dcfc 100644
--- a/src/pages/Worker/Card/WorkerCard.vue
+++ b/src/pages/Worker/Card/WorkerCard.vue
@@ -5,6 +5,7 @@ import WorkerDescriptor from './WorkerDescriptor.vue';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import useCardSize from 'src/composables/useCardSize';
const stateStore = useStateStore();
const { t } = useI18n();
@@ -29,7 +30,7 @@ const { t } = useI18n();
<QPage>
<VnSubToolbar />
- <div :class="$q.screen.gt.xs ? 'q-pa-md' : 'q-pa-xs'">
+ <div :class="useCardSize()">
<RouterView></RouterView>
</div>
</QPage>

30
patch/7017.patch Normal file
View File

@ -0,0 +1,30 @@
diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue
index 04b4b201..70c9369f 100644
--- a/src/components/FormModel.vue
+++ b/src/components/FormModel.vue
@@ -113,6 +113,8 @@ onUnmounted(() => {
state.unset($props.model);
});
+const formRef = ref();
+
const isLoading = ref(false);
// Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas
const isResetting = ref(false);
@@ -152,6 +154,8 @@ async function fetch() {
}
async function save() {
+ const isValid = await formRef.value.validate();
+ if (!isValid) return;
if ($props.observeFormChanges && !hasChanges.value) {
notify('globals.noChanges', 'negative');
return;
@@ -214,6 +218,7 @@ watch(formUrl, async () => {
<template>
<div class="column items-center full-width">
<QForm
+ ref="formRef"
v-if="formData"
@submit="save"
@reset="reset"

13
patch/777.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue
index 021ee685..8ff625d5 100644
--- a/src/layouts/MainLayout.vue
+++ b/src/layouts/MainLayout.vue
@@ -5,7 +5,7 @@ const quasar = useQuasar();
</script>
<template>
- <QLayout view="hHh LpR fFf">
+ <QLayout view="hHh LspR fFf">
<Navbar />
<RouterView></RouterView>
<QFooter v-if="quasar.platform.is.mobile"></QFooter>

232
patch/changes.patch Normal file
View File

@ -0,0 +1,232 @@
diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue
index 0ad35490..20550255 100644
--- a/src/components/CreateBankEntityForm.vue
+++ b/src/components/CreateBankEntityForm.vue
@@ -60,6 +60,7 @@ const onDataSaved = (formData, requestResponse) => {
v-model="data.name"
:required="true"
:rules="validate('bankEntity.name')"
+ autofocus
/>
</div>
<div class="col">
diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue
index f2d2b55d..a2f89ff3 100644
--- a/src/components/ui/VnRow.vue
+++ b/src/components/ui/VnRow.vue
@@ -1,17 +1,17 @@
<template>
- <div id="row" class="q-gutter-md q-mb-md">
+ <div class="vn-row q-gutter-md q-mb-md">
<slot></slot>
</div>
</template>
<style lang="scss" scopped>
-#row {
+.vn-row {
display: flex;
> * {
flex: 1;
}
}
@media screen and (max-width: 800px) {
- #row {
+ .vn-row {
flex-direction: column;
}
}
diff --git a/src/css/app.scss b/src/css/app.scss
index 4fec9db0..35a36797 100644
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -89,3 +89,6 @@ input::-webkit-inner-spin-button {
-webkit-appearance: none;
-moz-appearance: none;
}
+.vn-row > .flex-0 {
+ flex: 0;
+}
diff --git a/src/pages/Supplier/Card/SupplierAccounts.vue b/src/pages/Supplier/Card/SupplierAccounts.vue
index 41df6adb..8600d421 100644
--- a/src/pages/Supplier/Card/SupplierAccounts.vue
+++ b/src/pages/Supplier/Card/SupplierAccounts.vue
@@ -102,64 +102,58 @@ onMounted(() => {
:key="index"
class="row q-gutter-md q-mb-md"
>
- <div class="col">
- <VnInput :label="t('supplier.accounts.iban')" v-model="row.iban">
- <template #append>
- <QIcon name="info" class="cursor-info">
- <QTooltip>{{
- t('components.iban_tooltip')
- }}</QTooltip>
- </QIcon>
- </template>
- </VnInput>
- </div>
- <div class="col">
- <VnSelectDialog
- :label="t('worker.create.bankEntity')"
- v-model="row.bankEntityFk"
- :options="bankEntitiesOptions"
- option-label="bic"
- option-value="id"
- hide-selected
- >
- <template #form>
- <CreateBankEntityForm
- @on-data-saved="
- (_, requestResponse) =>
- onBankEntityCreated(requestResponse, row)
- "
- :show-entity-field="false"
- />
- </template>
- <template #option="scope">
- <QItem v-bind="scope.itemProps">
- <QItemSection v-if="scope.opt">
- <QItemLabel
- >{{ scope.opt.bic }}
- {{ scope.opt.name }}</QItemLabel
- >
- </QItemSection>
- </QItem>
- </template>
- </VnSelectDialog>
- </div>
- <div class="col">
- <VnInput
- :label="t('supplier.accounts.beneficiary')"
- v-model="row.beneficiary"
- >
- <template #append>
- <QIcon name="info" class="cursor-pointer">
- <QTooltip>{{
- t(
- 'Name of the bank account holder if different from the provider'
- )
- }}</QTooltip>
- </QIcon>
- </template>
- </VnInput>
- </div>
- <div class="col-1 row justify-center items-center">
+ <VnInput :label="t('supplier.accounts.iban')" v-model="row.iban">
+ <template #append>
+ <QIcon name="info" class="cursor-info">
+ <QTooltip>{{ t('components.iban_tooltip') }}</QTooltip>
+ </QIcon>
+ </template>
+ </VnInput>
+
+ <VnSelectDialog
+ :label="t('worker.create.bankEntity')"
+ v-model="row.bankEntityFk"
+ :options="bankEntitiesOptions"
+ option-label="bic"
+ option-value="id"
+ hide-selected
+ >
+ <template #form>
+ <CreateBankEntityForm
+ @on-data-saved="
+ (_, requestResponse) =>
+ onBankEntityCreated(requestResponse, row)
+ "
+ :show-entity-field="false"
+ />
+ </template>
+ <template #option="scope">
+ <QItem v-bind="scope.itemProps">
+ <QItemSection v-if="scope.opt">
+ <QItemLabel
+ >{{ scope.opt.bic }}
+ {{ scope.opt.name }}</QItemLabel
+ >
+ </QItemSection>
+ </QItem>
+ </template>
+ </VnSelectDialog>
+
+ <VnInput
+ :label="t('supplier.accounts.beneficiary')"
+ v-model="row.beneficiary"
+ >
+ <template #append>
+ <QIcon name="info" class="cursor-pointer">
+ <QTooltip>{{
+ t(
+ 'Name of the bank account holder if different from the provider'
+ )
+ }}</QTooltip>
+ </QIcon>
+ </template>
+ </VnInput>
+ <div class="row justify-end items-center flex-0">
<QIcon
name="delete"
size="sm"
@@ -174,23 +168,24 @@ onMounted(() => {
</div>
</VnRow>
<VnRow>
- <QIcon
- name="add"
- size="sm"
- class="cursor-pointer"
- color="primary"
- @click="supplierAccountRef.insert()"
- >
- <QTooltip>
- {{ t('Add account') }}
- </QTooltip>
- </QIcon>
+ <div class="row items-center">
+ <QIcon
+ name="add"
+ size="sm"
+ class="cursor-pointer"
+ color="primary"
+ @click="supplierAccountRef.insert()"
+ >
+ <QTooltip>
+ {{ t('Add account') }}
+ </QTooltip>
+ </QIcon>
+ </div>
</VnRow>
</QCard>
</template>
</CrudModel>
</template>
-
<i18n>
es:
Do you want to change the pay method to wire transfer?: ¿Quieres modificar la forma de pago a transferencia?
diff --git a/src/pages/Supplier/Card/SupplierAgencyTerm.vue b/src/pages/Supplier/Card/SupplierAgencyTerm.vue
index 769ff4da..b53ace0a 100644
--- a/src/pages/Supplier/Card/SupplierAgencyTerm.vue
+++ b/src/pages/Supplier/Card/SupplierAgencyTerm.vue
@@ -108,7 +108,7 @@ onMounted(() => {
type="number"
/>
</div>
- <div class="col-1 row justify-center items-center">
+ <div class="flex-0 row justify-center items-center">
<QIcon
name="delete"
size="sm"
diff --git a/src/pages/Supplier/Card/SupplierContacts.vue b/src/pages/Supplier/Card/SupplierContacts.vue
index 3abe5a9c..5f1ecd83 100644
--- a/src/pages/Supplier/Card/SupplierContacts.vue
+++ b/src/pages/Supplier/Card/SupplierContacts.vue
@@ -81,7 +81,7 @@ onMounted(() => {
autogrow
/>
</div>
- <div class="col-1 row justify-center items-center">
+ <div class="flex-0 row justify-center items-center">
<QIcon
name="delete"
size="sm"

230
patch/entryLatestBuys.patch Normal file
View File

@ -0,0 +1,230 @@
diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue
index 8a01e0be..06654081 100644
--- a/src/components/common/VnInput.vue
+++ b/src/components/common/VnInput.vue
@@ -1,5 +1,5 @@
<script setup>
-import { computed } from 'vue';
+import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
const emit = defineEmits(['update:modelValue', 'update:options', 'keyup.enter']);
@@ -26,7 +26,7 @@ const value = computed({
emit('update:modelValue', value);
},
});
-
+const focus = ref(false);
const styleAttrs = computed(() => {
return $props.isOutlined
? {
@@ -43,20 +43,32 @@ const onEnterPress = () => {
</script>
<template>
- <QInput
- ref="vnInputRef"
- v-model="value"
- v-bind="{ ...$attrs, ...styleAttrs }"
- type="text"
- :class="{ required: $attrs.required }"
- @keyup.enter="onEnterPress()"
+ <div
+ @mouseover="focus = true"
+ @mouseleave="focus = false"
:rules="$attrs.required ? [requiredFieldRule] : null"
>
- <template v-if="$slots.prepend" #prepend>
- <slot name="prepend" />
- </template>
- <template v-if="$slots.append" #append>
- <slot name="append" />
- </template>
- </QInput>
+ <QInput
+ ref="vnInputRef"
+ v-model="value"
+ v-bind="{ ...$attrs, ...styleAttrs }"
+ :type="$attrs.type"
+ :class="{ required: $attrs.required }"
+ @keyup.enter="onEnterPress()"
+ >
+ <template v-if="$slots.prepend" #prepend>
+ <slot name="prepend" />
+ </template>
+
+ <template #append>
+ <slot name="append" v-if="$slots.append" />
+ <QIcon
+ name="close"
+ size="xs"
+ v-if="focus && value"
+ @click="value = null"
+ ></QIcon>
+ </template>
+ </QInput>
+ </div>
</template>
diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue
index 8e0ef289..2f0863d0 100644
--- a/src/components/common/VnInputDate.vue
+++ b/src/components/common/VnInputDate.vue
@@ -16,6 +16,8 @@ const props = defineProps({
default: false,
},
});
+const focus = ref(false);
+
const emit = defineEmits(['update:modelValue']);
const value = computed({
get() {
@@ -53,30 +55,41 @@ const styleAttrs = computed(() => {
</script>
<template>
- <QInput
- class="vn-input-date"
- rounded
- readonly
- :model-value="toDate(value)"
- v-bind="{ ...$attrs, ...styleAttrs }"
- >
- <template #append>
- <QIcon name="event" class="cursor-pointer">
- <QPopupProxy
- v-model="isPopupOpen"
- cover
- transition-show="scale"
- transition-hide="scale"
- :no-parent-event="props.readonly"
- >
- <QDate
- :model-value="formatDate(value)"
- @update:model-value="onDateUpdate"
- />
- </QPopupProxy>
- </QIcon>
- </template>
- </QInput>
+ <div @mouseover="focus = true" @mouseleave="focus = false">
+ <QInput
+ class="vn-input-date"
+ rounded
+ readonly
+ :model-value="toDate(value)"
+ v-bind="{ ...$attrs, ...styleAttrs }"
+ @click="isPopupOpen = true"
+ >
+ <template #append>
+ <QIcon
+ name="close"
+ size="xs"
+ v-if="focus && value"
+ @click="onDateUpdate(null)"
+ ></QIcon>
+ <QIcon name="event" class="cursor-pointer">
+ <QPopupProxy
+ v-model="isPopupOpen"
+ cover
+ transition-show="scale"
+ transition-hide="scale"
+ :no-parent-event="props.readonly"
+ >
+ <QDate
+ :today-btn="true"
+ mask="YYYY-MM-DD"
+ :model-value="value"
+ @update:model-value="onDateUpdate"
+ />
+ </QPopupProxy>
+ </QIcon>
+ </template>
+ </QInput>
+ </div>
</template>
<style lang="scss">
diff --git a/test/cypress/integration/VnLocation.spec.js b/test/cypress/integration/VnLocation.spec.js
index 02b924e4..ab58395f 100644
--- a/test/cypress/integration/VnLocation.spec.js
+++ b/test/cypress/integration/VnLocation.spec.js
@@ -1,7 +1,7 @@
const locationOptions ='[role="listbox"] > div.q-virtual-scroll__content > .q-item'
describe('VnLocation', () => {
describe('Create',()=>{
- const inputLocation = ':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
+ const inputLocation = '.q-form .q-card> :nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -26,7 +26,7 @@ describe('VnLocation', () => {
cy.get(inputLocation).type('ecuador');
cy.get(locationOptions).should('have.length',1);
cy.get(`${locationOptions}:nth-child(1)`).click();
- cy.get(':nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .q-icon').click();
+ cy.get(inputLocation+'> :nth-child(2) > .q-icon').click();
});
});
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index 26c7ee19..903f58d4 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -8,6 +8,7 @@ describe('ClaimDevelopment', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
+ cy.waitForElement('tbody');
});
it('should reset line', () => {
diff --git a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js
index 20f137ae..fc989d6c 100644
--- a/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInBasicData.spec.js
@@ -1,6 +1,6 @@
/// <reference types="cypress" />
describe('InvoiceInBasicData', () => {
- const selects = ':nth-child(1) > :nth-child(1) > .q-field';
+ const selects = '.q-form .q-card>:nth-child(1) > :nth-child(1) > .q-field';
const appendBtns = 'label button';
const dialogAppendBtns = '.q-dialog label button';
const dialogInputs = '.q-dialog input';
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index f075d500..70c6068e 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -70,6 +70,7 @@ Cypress.Commands.add('getValue', (selector) => {
// Fill Inputs
Cypress.Commands.add('selectOption', (selector, option) => {
+ cy.waitForElement(selector);
cy.get(selector).find('.q-select__dropdown-icon').click();
cy.get('.q-menu .q-item').contains(option).click();
});
@@ -181,11 +182,11 @@ Cypress.Commands.add('closeLeftMenu', (element) => {
Cypress.Commands.add('clearSearchbar', (element) => {
if (element) cy.waitForElement(element);
- cy.get('#searchbar > form > label > div:nth-child(1) input').clear();
+ cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').clear();
});
Cypress.Commands.add('writeSearchbar', (value) => {
- cy.get('#searchbar > form > label > div:nth-child(1) input').type(value);
+ cy.get('#searchbar > form > div:nth-child(1) > label > div:nth-child(1) input').type(value);
});
Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index 217a2587..438873a7 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -88,6 +88,7 @@ const getInputEvents = (col) => {
return col.columnFilter.type === 'select'
? { 'update:modelValue': () => applyColumnFilter(col) }
: {
+ 'update:modelValue': () => applyColumnFilter(col),
'keyup.enter': () => applyColumnFilter(col),
};
};

View File

@ -0,0 +1,43 @@
diff --git a/quasar.config.js b/quasar.config.js
index 755e96bd..7afe7da1 100644
--- a/quasar.config.js
+++ b/quasar.config.js
@@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files
- boot: ['i18n', 'axios', 'vnDate', 'validations'],
+ boot: ['i18n', 'axios', 'vnDate', 'vn-custom', 'validations'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'],
@@ -67,7 +67,7 @@ module.exports = configure(function (/* ctx */) {
// analyze: true,
// env: {},
rawDefine: {
- 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
},
// ignorePublicFolder: true,
// minify: false,
@@ -92,7 +92,7 @@ module.exports = configure(function (/* ctx */) {
vitePlugins: [
[
VueI18nPlugin({
- runtimeOnly: false
+ runtimeOnly: false,
}),
{
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 9186eb6a..c6266afb 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -70,6 +70,7 @@ function viewSummary(id) {
</template>
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256">
<QScrollArea class="fit text-grey-8">
+ <my-input-number label="Measure" :step="0.001" v-model.number="measure" />
<TicketFilter data-key="TicketList" />
</QScrollArea>
</QDrawer>

0
patch/test.patch Normal file
View File

View File

@ -49,6 +49,9 @@ devDependencies:
'@quasar/app-vite': '@quasar/app-vite':
specifier: ^1.7.3 specifier: ^1.7.3
version: 1.7.3(eslint@8.56.0)(pinia@2.1.7)(quasar@2.14.5)(vue-router@4.2.5)(vue@3.4.19) version: 1.7.3(eslint@8.56.0)(pinia@2.1.7)(quasar@2.14.5)(vue-router@4.2.5)(vue@3.4.19)
'@quasar/quasar-app-extension-qcalendar':
specifier: 4.0.0-beta.15
version: 4.0.0-beta.15
'@quasar/quasar-app-extension-testing-unit-vitest': '@quasar/quasar-app-extension-testing-unit-vitest':
specifier: ^0.4.0 specifier: ^0.4.0
version: 0.4.0(@vue/test-utils@2.4.4)(quasar@2.14.5)(vite@5.1.4)(vitest@0.31.4)(vue@3.4.19) version: 0.4.0(@vue/test-utils@2.4.4)(quasar@2.14.5)(vite@5.1.4)(vitest@0.31.4)(vue@3.4.19)
@ -912,6 +915,13 @@ packages:
resolution: {integrity: sha512-SlOhwzXyPQHWgQIS2ncyDdYdksCJvUYNtgsDQqzAKEG3r3d/ejOxvThle79HTK3Q6HB+gQWFG21Ux00Osr5XSw==} resolution: {integrity: sha512-SlOhwzXyPQHWgQIS2ncyDdYdksCJvUYNtgsDQqzAKEG3r3d/ejOxvThle79HTK3Q6HB+gQWFG21Ux00Osr5XSw==}
dev: false dev: false
/@quasar/quasar-app-extension-qcalendar@4.0.0-beta.15:
resolution: {integrity: sha512-i6hQkcP70LXLfVMPZMKQjSg3681gjZmASV3vq6ULzc0LhtBiPneLdVNNtH2itkWxAmaUj+1heQDI5Pa0F7VKLQ==}
engines: {node: '>= 10.0.0', npm: '>= 5.6.0', yarn: '>= 1.6.0'}
dependencies:
'@quasar/quasar-ui-qcalendar': 4.0.0-beta.16
dev: true
/@quasar/quasar-app-extension-testing-unit-vitest@0.4.0(@vue/test-utils@2.4.4)(quasar@2.14.5)(vite@5.1.4)(vitest@0.31.4)(vue@3.4.19): /@quasar/quasar-app-extension-testing-unit-vitest@0.4.0(@vue/test-utils@2.4.4)(quasar@2.14.5)(vite@5.1.4)(vitest@0.31.4)(vue@3.4.19):
resolution: {integrity: sha512-eyzdUdmZiCueNS+5nedjMmzdbpCetSrtdGIwW6KplW1dTzRbLiNvYUjpBOxQGmJCgEhWy9zuswJ7MZ/bTql24Q==} resolution: {integrity: sha512-eyzdUdmZiCueNS+5nedjMmzdbpCetSrtdGIwW6KplW1dTzRbLiNvYUjpBOxQGmJCgEhWy9zuswJ7MZ/bTql24Q==}
engines: {node: '>= 12.22.1', npm: '>= 6.14.12', yarn: '>= 1.17.3'} engines: {node: '>= 12.22.1', npm: '>= 6.14.12', yarn: '>= 1.17.3'}
@ -939,6 +949,10 @@ packages:
- vite - vite
dev: true dev: true
/@quasar/quasar-ui-qcalendar@4.0.0-beta.16:
resolution: {integrity: sha512-KVbFJD1HQp91tiklv+6XsG7bq8FKK6mhhnoVzmjgoyhUAEb9csfbDPbpegy1/FzXy3o0wITe6mmRZ8nbaiMEZg==}
dev: true
/@quasar/render-ssr-error@1.0.3: /@quasar/render-ssr-error@1.0.3:
resolution: {integrity: sha512-A8RF99q6/sOSe1Ighnh5syEIbliD3qUYEJd2HyfFyBPSMF+WYGXon5dmzg4nUoK662NgOggInevkDyBDJcZugg==} resolution: {integrity: sha512-A8RF99q6/sOSe1Ighnh5syEIbliD3qUYEJd2HyfFyBPSMF+WYGXon5dmzg4nUoK662NgOggInevkDyBDJcZugg==}
engines: {node: '>= 16'} engines: {node: '>= 16'}

View File

@ -3,5 +3,6 @@
"options": [ "options": [
"scripts" "scripts"
] ]
} },
"@quasar/qcalendar": {}
} }

2013
quasar.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,92 @@
<script setup>
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n();
const selectedRows = ref([]);
const showNegativeOriginDialog = ref(false);
const reasonegativeOriginDialog = ref(null);
const { dialogRef, onDialogHide } = useDialogPluginComponent();
const updateNegativeOrigin = async () => {
showNegativeOriginDialog.value = true;
const negativeOrigins = selectedRows.value.map(({ itemFk, lack }) => ({
itemFk,
negativeType: reasonegativeOriginDialog.value,
lack,
}));
try {
await axios.post(`Tickets/itemLack`, negativeOrigins);
dialogRef.value.hide();
} catch (err) {
return err;
}
};
</script>
<template>
<QDialog ref="dialogRef" @hide="onDialogHide" v-model="showNegativeOriginDialog">
<QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none">
<QAvatar
:icon="icon"
color="primary"
text-color="white"
size="xl"
v-if="icon"
/>
<span class="text-h6 text-grey">{{
t('ticket.negative.modalOrigin.title')
}}</span>
<QSpace />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="row items-center justify-center column items-stretch">
<span>{{ t('ticket.negative.modalOrigin.question') }}</span>
<QSelect
:label="t('globals.reason')"
v-model="reasonegativeOriginDialog"
:options="['FALTAS', 'CONTENEDOR', 'ENTRADAS', 'OVERBOOKING']"
/>
</QCardSection>
<QCardActions align="right">
<QBtn :label="t('globals.cancel')" color="primary" flat v-close-popup />
<QBtn
:label="t('globals.confirm')"
color="primary"
:disable="!reasonegativeOriginDialog"
@click="updateNegativeOrigin()"
unelevated
autofocus
/> </QCardActions
></QCard>
</QDialog>
</template>
<style lang="scss" scoped>
.list {
max-height: 100%;
padding: 15px;
width: 100%;
}
.grid-style-transition {
transition: transform 0.28s, background-color 0.28s;
}
#true {
background-color: $positive;
}
#false {
background-color: $negative;
}
div.q-dialog__inner > div {
max-width: fit-content !important;
// background-color: red !important;
}
</style>

View File

@ -6,6 +6,8 @@ import VnPaginate from 'components/ui/VnPaginate.vue';
import { useSession } from 'src/composables/useSession'; import { useSession } from 'src/composables/useSession';
import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue'; import TicketLackFilter from 'pages/Ticket/Negative/TicketLackFilter.vue';
import TicketDescriptorDialog from 'pages/Ticket/Negative/TicketLackDescriptorDialog.vue'; import TicketDescriptorDialog from 'pages/Ticket/Negative/TicketLackDescriptorDialog.vue';
import NegativeOriginDialog from 'pages/Ticket/Negative/NegativeOriginDialog.vue';
import TotalNegativeOriginDialog from 'pages/Ticket/Negative/TotalNegativeOriginDialog.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import axios from 'axios'; import axios from 'axios';
@ -289,8 +291,18 @@ const updateNegativeOrigin = async () => {
</QCardSection> </QCardSection>
</QCard> </QCard>
</QDialog> </QDialog>
<TotalNegativeOriginDialog
<QDialog ref="totalNegativeDialogRef"
v-model="showTotalNegativeOriginDialog"
@hide="onDialogHide"
></TotalNegativeOriginDialog>
<NegativeOriginDialog
ref="originDialogRef"
@hide="onDialogHide"
v-model="showNegativeOriginDialog"
>
</NegativeOriginDialog>
<!-- <QDialog
ref="totalNegativeDialogRef" ref="totalNegativeDialogRef"
@hide="onDialogHide" @hide="onDialogHide"
v-model="showTotalNegativeOriginDialog" v-model="showTotalNegativeOriginDialog"
@ -339,9 +351,9 @@ const updateNegativeOrigin = async () => {
</VnPaginate> </VnPaginate>
</QCardSection> </QCardSection>
</QCard> </QCard>
</QDialog> </QDialog> -->
<QDialog <!-- <QDialog
ref="originDialogRef" ref="originDialogRef"
@hide="onDialogHide" @hide="onDialogHide"
v-model="showNegativeOriginDialog" v-model="showNegativeOriginDialog"
@ -387,7 +399,7 @@ const updateNegativeOrigin = async () => {
autofocus autofocus
/> </QCardActions /> </QCardActions
></QCard> ></QCard>
</QDialog> </QDialog> -->
<QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above> <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256" show-if-above>
<QScrollArea class="fit text-grey-8"> <QScrollArea class="fit text-grey-8">

View File

@ -0,0 +1,116 @@
<script setup>
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import VnPaginate from 'components/ui/VnPaginate.vue';
import { useDialogPluginComponent } from 'quasar';
const { t } = useI18n();
const selectedRows = ref([]);
const showTotalNegativeOriginDialog = ref(false);
const { dialogRef, onDialogHide } = useDialogPluginComponent();
const columns = computed(() => [
{
name: 'id',
label: t('ticket.negative.id'),
field: ({ id }) => id,
sortable: true,
},
{
name: 'itemFk',
label: t('ticket.negative.detail.itemFk'),
field: ({ itemFk }) => itemFk,
sortable: true,
},
{
name: 'type',
label: t('ticket.negative.type'),
field: ({ type }) => type,
sortable: true,
},
{
name: 'dated',
label: t('ticket.negative.detail.shipped'),
field: ({ dated }) => dated,
sortable: true,
},
{
name: 'quantity',
label: t('ticket.negative.detail.quantity'),
field: ({ quantity }) => quantity,
sortable: true,
},
]);
</script>
<template>
<QDialog ref="dialogRef" @hide="onDialogHide" v-model="showTotalNegativeOriginDialog">
<QCard class="q-pa-sm">
<QCardSection class="row items-center q-pb-none">
<span class="text-h6 text-grey">{{
t('ticket.negative.totalNegative')
}}</span>
<QSpace />
<QBtn icon="close" flat round dense v-close-popup />
</QCardSection>
<QCardSection class="row items-center justify-center column items-stretch">
<VnPaginate
data-key="NegativeOriginList"
:url="`Tickets/negativeOrigin`"
auto-load
>
<template #body="{ rows }">
<QTable
:columns="columns"
:rows="rows"
:dense="$q.screen.lt.md"
flat
row-key="itemFk"
selection="multiple"
v-model:selected="selectedRows"
:grid="$q.screen.lt.md"
auto-load
:rows-per-page-options="[0]"
hide-pagination
:pagination="{ rowsPerPage: null }"
:no-data-label="t('globals.noResults')"
>
<template #top>
<div style="width: 100%; display: table">
<div style="float: right; color: lightgray">
{{ `${rows.length} ${t('globals.results')}` }}
</div>
</div>
</template>
</QTable>
</template>
</VnPaginate>
</QCardSection>
</QCard>
</QDialog>
</template>
<style lang="scss" scoped>
.list {
max-height: 100%;
padding: 15px;
width: 100%;
}
.grid-style-transition {
transition: transform 0.28s, background-color 0.28s;
}
#true {
background-color: $positive;
}
#false {
background-color: $negative;
}
div.q-dialog__inner > div {
max-width: fit-content !important;
// background-color: red !important;
}
</style>

13
testt.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue
index 021ee685..8ff625d5 100644
--- a/src/layouts/MainLayout.vue
+++ b/src/layouts/MainLayout.vue
@@ -5,7 +5,7 @@ const quasar = useQuasar();
</script>
<template>
- <QLayout view="hHh LpR fFf">
+ <QLayout view="hHh LspR fFf">
<Navbar />
<RouterView></RouterView>
<QFooter v-if="quasar.platform.is.mobile"></QFooter>

138
workerPDA.patch Normal file
View File

@ -0,0 +1,138 @@
diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue
index 9f5ae319..61de5d9f 100644
--- a/src/components/FormModel.vue
+++ b/src/components/FormModel.vue
@@ -10,6 +10,7 @@ import { useValidator } from 'src/composables/useValidator';
import useNotify from 'src/composables/useNotify.js';
import SkeletonForm from 'components/ui/SkeletonForm.vue';
import VnConfirm from './ui/VnConfirm.vue';
+import { tMobile } from 'src/composables/tMobile';
const quasar = useQuasar();
const state = useState();
@@ -43,6 +44,10 @@ const $props = defineProps({
type: Boolean,
default: true,
},
+ defaultButtons: {
+ type: Object,
+ default: () => {},
+ },
autoLoad: {
type: Boolean,
default: false,
@@ -119,7 +124,19 @@ const hasChanges = ref(!$props.observeFormChanges);
const originalData = ref({ ...$props.formInitialData });
const formData = computed(() => state.get($props.model));
const formUrl = computed(() => $props.url);
-
+const defaultButtons = computed(() => ({
+ save: {
+ color: 'primary',
+ icon: 'restart_alt',
+ label: 'globals.save',
+ },
+ reset: {
+ color: 'primary',
+ icon: 'save',
+ label: 'globals.reset',
+ },
+ ...$props.defaultButtons,
+}));
const startFormWatcher = () => {
watch(
() => formData.value,
@@ -131,10 +148,6 @@ const startFormWatcher = () => {
);
};
-function tMobile(...args) {
- if (!quasar.platform.is.mobile) return t(...args);
-}
-
async function fetch() {
const { data } = await axios.get($props.url, {
params: { filter: JSON.stringify($props.filter) },
@@ -233,21 +246,21 @@ watch(formUrl, async () => {
<QBtnGroup push class="q-gutter-x-sm">
<slot name="moreActions" />
<QBtn
- :label="tMobile('globals.reset')"
- color="primary"
- icon="restart_alt"
+ :label="tMobile(defaultButtons.reset.label)"
+ :color="defaultButtons.reset.color"
+ :icon="defaultButtons.reset.icon"
flat
@click="reset"
:disable="!hasChanges"
- :title="t('globals.reset')"
+ :title="t(defaultButtons.reset.label)"
/>
<QBtn
- :label="tMobile('globals.save')"
- color="primary"
- icon="save"
+ :label="tMobile(defaultButtons.save.label)"
+ :color="defaultButtons.save.color"
+ :icon="defaultButtons.save.icon"
@click="save"
:disable="!hasChanges"
- :title="t('globals.save')"
+ :title="t(defaultButtons.save.label)"
/>
</QBtnGroup>
</div>
diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js
index be16e367..a9684e4d 100644
--- a/src/i18n/es/index.js
+++ b/src/i18n/es/index.js
@@ -31,6 +31,7 @@ export default {
close: 'Cerrar',
cancel: 'Cancelar',
confirm: 'Confirmar',
+ assign: 'Asignar',
back: 'Volver',
yes: 'Si',
no: 'No',
@@ -881,6 +882,7 @@ export default {
model: 'Modelo',
serialNumber: 'Número de serie',
removePDA: 'Desasignar PDA',
+ assignPDA: 'Asignar PDA',
},
create: {
name: 'Nombre',
diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue
index a487f249..964846d7 100644
--- a/src/pages/Worker/Card/WorkerPda.vue
+++ b/src/pages/Worker/Card/WorkerPda.vue
@@ -2,14 +2,16 @@
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { onMounted, ref, computed } from 'vue';
-
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
-
import useNotify from 'src/composables/useNotify.js';
import axios from 'axios';
import { useRole } from 'src/composables/useRole';
+import { tMobile } from 'src/composables/tMobile';
+import { useStateStore } from 'stores/useStateStore';
+
+const stateStore = useStateStore();
const route = useRoute();
const { t } = useI18n();
@@ -77,7 +79,9 @@ onMounted(async () => await fetchCurrentDeviceRef.value.fetch());
:url-create="`Workers/${route.params.id}/allocatePDA`"
model="DeviceProductionUser"
:form-initial-data="newPDA"
+ :default-actions="true"
auto-load
+ :default-buttons="{ save: { label: 'globals.assign' } }"
@on-data-saved="(_, data) => setCurrentPDA(data)"
>
<template #form="{ data }">