diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 594780220d..9633117b82 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -112,14 +112,18 @@ function tMobile(...args) { } async function fetch() { - const { data } = await axios.get($props.url, { - params: { filter: JSON.stringify($props.filter) }, - }); + try { + const { data } = await axios.get($props.url, { + params: { filter: JSON.stringify($props.filter) }, + }); + state.set($props.model, data); + originalData.value = data && JSON.parse(JSON.stringify(data)); - state.set($props.model, data); - originalData.value = data && JSON.parse(JSON.stringify(data)); - - emit('onFetch', state.get($props.model)); + emit('onFetch', state.get($props.model)); + } catch (error) { + state.set($props.model, {}); + originalData.value = {}; + } } async function save() { diff --git a/src/css/app.scss b/src/css/app.scss index dbf45ce893..864e3033fe 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -48,6 +48,10 @@ body.body--dark { background-color: var(--vn-dark); } +.color-vn-label { + color: var(--vn-label); +} + .color-vn-text { color: var(--vn-text); } diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index e74933477e..9e2cfb6ffb 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -27,7 +27,6 @@ const companiesOptions = ref([]); const companyId = ref(null); const receiptsRef = ref(null); const rows = ref([]); -const workerId = ref(null); const filterCompanies = { order: ['code'] }; const params = { @@ -37,49 +36,49 @@ const params = { }; const filter = { include: { relation: 'company', scope: { fields: ['code'] } }, - where: { clientFk: `${route.params.id}`, companyFk: user.value.companyFk }, + where: { clientFk: route.params.id, companyFk: user.value.companyFk }, }; const tableColumnComponents = { payed: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, created: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, userName: { component: QBtn, props: () => ({ flat: true, color: 'blue' }), - event: ({ row }) => (workerId.value = row.clientFk), + event: () => {}, }, description: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, bankFk: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, debit: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, credit: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, balance: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, isConciliate: { component: QCheckbox, @@ -87,7 +86,7 @@ const tableColumnComponents = { disable: true, 'model-value': Boolean(prop.value), }), - event: () => (workerId.value = null), + event: () => {}, }, }; @@ -207,11 +206,11 @@ const updateCompanyId = (id) => { -
- {{ t('globals.noResults') }} -
-
- - es: Enter a new search: Introduce una nueva búsqueda diff --git a/src/pages/Customer/Card/CustomerCreditContracts.vue b/src/pages/Customer/Card/CustomerCreditContracts.vue index 71bf42fd4c..c23e3e6c0d 100644 --- a/src/pages/Customer/Card/CustomerCreditContracts.vue +++ b/src/pages/Customer/Card/CustomerCreditContracts.vue @@ -108,7 +108,7 @@ const updateData = () => {
-
+
{{ t('Since') }}:
@@ -116,7 +116,9 @@ const updateData = () => {
-
{{ t('To') }}:
+
+ {{ t('To') }}: +
{{ toDate(item.finished) }}
@@ -129,7 +131,7 @@ const updateData = () => {
-
+
{{ t('Credit') }}:
@@ -137,7 +139,7 @@ const updateData = () => {
-
+
{{ t('Grade') }}:
@@ -145,7 +147,7 @@ const updateData = () => {
-
+
{{ t('Date') }}:
@@ -167,7 +169,7 @@ const updateData = () => {
-
+
{{ t('globals.noResults') }}
@@ -188,9 +190,6 @@ const updateData = () => { + es: Since: Desde diff --git a/src/pages/Customer/Card/CustomerFileManagement.vue b/src/pages/Customer/Card/CustomerFileManagement.vue index 228b34a44b..47b561596a 100644 --- a/src/pages/Customer/Card/CustomerFileManagement.vue +++ b/src/pages/Customer/Card/CustomerFileManagement.vue @@ -1,3 +1,263 @@ + + + + + + +es: + Id: Id + Type: Tipo + Order: Orden + Reference: Referencia + Description: Descripción + Original: Original + File: Fichero + Employee: Empleado + Created: Fecha creación + Upload file: Subir fichero + diff --git a/src/pages/Customer/Card/CustomerGreuges.vue b/src/pages/Customer/Card/CustomerGreuges.vue index 19cbb42ba4..4328f43124 100644 --- a/src/pages/Customer/Card/CustomerGreuges.vue +++ b/src/pages/Customer/Card/CustomerGreuges.vue @@ -16,7 +16,6 @@ const router = useRouter(); const rows = ref([]); const totalAmount = ref(0); -const workerId = ref(null); const filter = { include: [ @@ -44,27 +43,27 @@ const tableColumnComponents = { date: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, createdBy: { component: QBtn, props: () => ({ flat: true, color: 'blue' }), - event: ({ row }) => (workerId.value = row.clientFk), + event: () => {}, }, comment: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, type: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, amount: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, }; @@ -121,18 +120,18 @@ const toCustomerGreugeCreate = () => {
- {{ t('Total') }}: + {{ t('Total') }}: {{ toCurrency(totalAmount) }}
- - -
- {{ t('globals.noResults') }} -
-
@@ -172,10 +168,6 @@ const toCustomerGreugeCreate = () => { border-radius: 10px; padding: 10px; } - -.label-color { - color: var(--vn-label); -} diff --git a/src/pages/Customer/Card/CustomerLog.vue b/src/pages/Customer/Card/CustomerLog.vue index 36d79959d5..5616bdf879 100644 --- a/src/pages/Customer/Card/CustomerLog.vue +++ b/src/pages/Customer/Card/CustomerLog.vue @@ -124,7 +124,7 @@ const setInq = (value, status) => { :url="urlClientLogsModels" /> -
+
{{ t('globals.noResults') }}
diff --git a/src/pages/Customer/Card/CustomerMandates.vue b/src/pages/Customer/Card/CustomerMandates.vue index 676c9f5518..9d9634a165 100644 --- a/src/pages/Customer/Card/CustomerMandates.vue +++ b/src/pages/Customer/Card/CustomerMandates.vue @@ -5,13 +5,7 @@ const { t } = useI18n(); - - diff --git a/src/pages/Customer/Card/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue index 781c57e501..eca1e165fe 100644 --- a/src/pages/Customer/Card/CustomerNotes.vue +++ b/src/pages/Customer/Card/CustomerNotes.vue @@ -43,8 +43,8 @@ const toCustomerNoteCreate = () => { }" >
-

{{ item.worker.user.nickname }}

-

+

{{ item.worker.user.nickname }}

+

{{ date.formatDate(item?.created, 'DD-MM-YYYY HH:mm:ss') }} @@ -55,7 +55,7 @@ const toCustomerNoteCreate = () => {

-
+
{{ t('globals.noResults') }}
@@ -89,8 +89,4 @@ const toCustomerNoteCreate = () => { border-radius: 10px; padding: 10px; } - -.label-color { - color: var(--vn-label); -} diff --git a/src/pages/Customer/Card/CustomerRecoveries.vue b/src/pages/Customer/Card/CustomerRecoveries.vue index e747b3d79b..749eec4cc0 100644 --- a/src/pages/Customer/Card/CustomerRecoveries.vue +++ b/src/pages/Customer/Card/CustomerRecoveries.vue @@ -15,7 +15,7 @@ const router = useRouter(); const rows = ref([]); const filter = { - where: { clientFk: `${route.params.id}` }, + where: { clientFk: route.params.id }, order: ['started DESC'], limit: 20, }; @@ -89,11 +89,11 @@ const toCustomerRecoverieCreate = () => { - - -
- {{ t('globals.noResults') }} -
-
@@ -132,10 +126,6 @@ const toCustomerRecoverieCreate = () => { border-radius: 10px; padding: 10px; } - -.label-color { - color: var(--vn-label); -} diff --git a/src/pages/Customer/Card/CustomerSamples.vue b/src/pages/Customer/Card/CustomerSamples.vue index c0d84eff6c..ca5d63dcbd 100644 --- a/src/pages/Customer/Card/CustomerSamples.vue +++ b/src/pages/Customer/Card/CustomerSamples.vue @@ -12,7 +12,6 @@ const { t } = useI18n(); const route = useRoute(); const router = useRouter(); -const workerId = ref(null); const rows = ref([]); const filter = { @@ -30,22 +29,22 @@ const tableColumnComponents = { sent: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, description: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, worker: { component: QBtn, props: () => ({ flat: true, color: 'blue' }), - event: ({ row }) => (workerId.value = row.clientFk), + event: () => {}, }, company: { component: 'span', props: () => {}, - event: () => (workerId.value = null), + event: () => {}, }, }; @@ -71,7 +70,7 @@ const columns = computed(() => [ }, { align: 'left', - field: (value) => value.company.code, + field: (value) => value.company?.code, label: t('Company'), name: 'company', }, @@ -97,7 +96,7 @@ const toCustomerSamplesCreate = () => { :rows="rows" class="full-width q-mt-md" row-key="id" - v-if="rows?.length" + :no-data-label="t('globals.noResults')" > - - -
- {{ t('globals.noResults') }} -
-
@@ -137,10 +133,6 @@ const toCustomerSamplesCreate = () => { border-radius: 10px; padding: 10px; } - -.label-color { - color: var(--vn-label); -} diff --git a/src/pages/Customer/Card/CustomerUnpaid.vue b/src/pages/Customer/Card/CustomerUnpaid.vue index 66f771aba1..54b4851db5 100644 --- a/src/pages/Customer/Card/CustomerUnpaid.vue +++ b/src/pages/Customer/Card/CustomerUnpaid.vue @@ -1,3 +1,57 @@ + + + + +es: + Unpaid client: Cliente impagado + Date: Fecha + Amount: Importe + diff --git a/src/pages/Customer/Card/CustomerWebPayment.vue b/src/pages/Customer/Card/CustomerWebPayment.vue index 676c9f5518..9d9634a165 100644 --- a/src/pages/Customer/Card/CustomerWebPayment.vue +++ b/src/pages/Customer/Card/CustomerWebPayment.vue @@ -5,13 +5,7 @@ const { t } = useI18n(); - - diff --git a/src/pages/Customer/Defaulter/CustomerDefaulter.vue b/src/pages/Customer/Defaulter/CustomerDefaulter.vue index 19e46c0847..40638a4ab1 100644 --- a/src/pages/Customer/Defaulter/CustomerDefaulter.vue +++ b/src/pages/Customer/Defaulter/CustomerDefaulter.vue @@ -18,7 +18,6 @@ const { t } = useI18n(); const quasar = useQuasar(); const balanceDueTotal = ref(0); -const customerId = ref(0); const selected = ref([]); const workerId = ref(0); const rows = ref([]); @@ -27,7 +26,7 @@ const tableColumnComponents = { client: { component: QBtn, props: () => ({ flat: true, color: 'blue' }), - event: ({ row }) => selectCustomerId(row.clientFk), + event: () => {}, }, isWorker: { component: QCheckbox, @@ -36,10 +35,10 @@ const tableColumnComponents = { 'model-value': Boolean(row.selected), }), }, - salesperson: { + salesPerson: { component: QBtn, props: () => ({ flat: true, color: 'blue' }), - event: ({ row }) => selectWorkerId(row.salesPersonFk), + event: () => {}, }, country: { component: 'span', @@ -59,7 +58,7 @@ const tableColumnComponents = { author: { component: QBtn, props: () => ({ flat: true, color: 'blue' }), - event: ({ row }) => selectWorkerId(row.workerFk), + event: () => {}, }, lastObservation: { component: 'span', @@ -100,7 +99,7 @@ const columns = computed(() => [ align: 'left', field: 'salesPersonName', label: t('Salesperson'), - name: 'salesperson', + name: 'salesPerson', }, { align: 'left', @@ -159,16 +158,6 @@ const setRows = (data) => { }, 0); }; -const selectCustomerId = (id) => { - workerId.value = 0; - customerId.value = id; -}; - -const selectWorkerId = (id) => { - customerId.value = 0; - workerId.value = id; -}; - const viewAddObservation = (rowsSelected) => { quasar.dialog({ component: CustomerDefaulterAddObservation, @@ -234,8 +223,18 @@ const refreshData = () => { > {{ props.value }} - - + + + diff --git a/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue b/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue index b150f4d8bd..2d5125f391 100644 --- a/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue +++ b/src/pages/Customer/Defaulter/CustomerDefaulterAddObservation.vue @@ -3,7 +3,9 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; import axios from 'axios'; -import { useQuasar } from 'quasar'; +import { useDialogPluginComponent } from 'quasar'; + +import useNotify from 'src/composables/useNotify'; import VnRow from 'components/ui/VnRow.vue'; @@ -18,8 +20,9 @@ const $props = defineProps({ }, }); +const { dialogRef } = useDialogPluginComponent(); +const { notify } = useNotify(); const { t } = useI18n(); -const quasar = useQuasar(); const newObservation = ref(null); @@ -38,15 +41,9 @@ const onSubmit = async () => { await $props.promise(); - quasar.notify({ - message: t('globals.dataSaved'), - type: 'positive', - }); + notify('globals.dataSaved', 'positive'); } catch (error) { - quasar.notify({ - message: t(`${error.message}`), - type: 'negative', - }); + notify(error.message, 'negative'); } }; diff --git a/src/pages/Customer/components/CustomerFileManagementActions.vue b/src/pages/Customer/components/CustomerFileManagementActions.vue new file mode 100644 index 0000000000..105c12cf7e --- /dev/null +++ b/src/pages/Customer/components/CustomerFileManagementActions.vue @@ -0,0 +1,96 @@ + + + + + +es: + Download file: Descargar fichero + Edit file: Editar fichero + Remove file: Eliminar fichero + diff --git a/src/pages/Customer/components/CustomerFileManagementCreate.vue b/src/pages/Customer/components/CustomerFileManagementCreate.vue new file mode 100644 index 0000000000..c401d1924b --- /dev/null +++ b/src/pages/Customer/components/CustomerFileManagementCreate.vue @@ -0,0 +1,241 @@ + + + + + +en: + clientFileDescription: '{dmsTypeName} FROM CLIENT {clientName} ID {clientId}' +es: + Reference: Referencia + Company: Empresa + Warehouse: Almacén + Type: Tipo + Description: Descripción + clientFileDescription: '{dmsTypeName} DEL CLIENTE {clientName} ID {clientId}' + File: Fichero + Select a file: Selecciona un fichero + Allowed content types: Tipos de archivo permitidos + Generate identifier for original file: Generar identificador para archivo original + diff --git a/src/pages/Customer/components/CustomerFileManagementDelete.vue b/src/pages/Customer/components/CustomerFileManagementDelete.vue new file mode 100644 index 0000000000..aadcd5c126 --- /dev/null +++ b/src/pages/Customer/components/CustomerFileManagementDelete.vue @@ -0,0 +1,81 @@ + + + + + +es: + This file will be deleted: Este fichero va a ser borrado + Are you sure you want to continue?: ¿Seguro que quieres continuar? + diff --git a/src/pages/Customer/components/CustomerFileManagementEdit.vue b/src/pages/Customer/components/CustomerFileManagementEdit.vue new file mode 100644 index 0000000000..6773db42e6 --- /dev/null +++ b/src/pages/Customer/components/CustomerFileManagementEdit.vue @@ -0,0 +1,220 @@ + + + + + +en: + clientFileDescription: '{dmsTypeName} FROM CLIENT {clientName} ID {clientId}' +es: + Reference: Referencia + Company: Empresa + Warehouse: Almacén + Type: Tipo + Description: Descripción + clientFileDescription: '{dmsTypeName} DEL CLIENTE {clientName} ID {clientId}' + File: Fichero + Select a file: Selecciona un fichero + Allowed content types: Tipos de archivo permitidos + Generate identifier for original file: Generar identificador para archivo original + diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 46202128c7..88faec2a5c 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -356,12 +356,12 @@ export default { { name: 'CustomerCreditContracts', title: 'creditContracts', - icon: 'paid', + icon: 'vn:solunion', }, { name: 'CustomerCreditOpinion', title: 'creditOpinion', - icon: 'paid', + icon: 'vn:linesprepaired', }, ], }, @@ -371,7 +371,6 @@ export default { name: 'CustomerCreditContracts', meta: { title: 'creditContracts', - icon: 'paid', }, component: () => import( @@ -388,7 +387,6 @@ export default { name: 'CustomerCreditContracts', meta: { title: 'creditContracts', - icon: 'paid', }, component: () => import( @@ -418,7 +416,6 @@ export default { name: 'CustomerCreditOpinion', meta: { title: 'creditOpinion', - icon: 'paid', }, component: () => import( @@ -437,37 +434,37 @@ export default { { name: 'CustomerSamples', title: 'samples', - icon: 'pending', + icon: 'vn:notes', }, { name: 'CustomerConsumption', title: 'consumption', - icon: 'pending', + icon: 'vn:lines', }, { name: 'CustomerMandates', title: 'mandates', - icon: 'pending', + icon: 'vn:mandatory', }, { name: 'CustomerContacts', title: 'contacts', - icon: 'pending', + icon: 'contact_phone', }, { name: 'CustomerWebPayment', title: 'webPayment', - icon: 'pending', + icon: 'vn:onlinepayment', }, { name: 'CustomerFileManagement', title: 'fileManagement', - icon: 'pending', + icon: 'Upload', }, { name: 'CustomerUnpaid', title: 'unpaid', - icon: 'pending', + icon: 'vn:supplierfalse', }, ], }, @@ -477,7 +474,6 @@ export default { name: 'CustomerSamples', meta: { title: 'samples', - icon: 'paid', }, component: () => import('src/pages/Customer/Card/CustomerSamples.vue'), @@ -492,7 +488,6 @@ export default { name: 'CustomerSamples', meta: { title: 'samples', - icon: 'paid', }, component: () => import( @@ -514,7 +509,6 @@ export default { name: 'CustomerConsumption', meta: { title: 'consumption', - icon: 'paid', }, component: () => import('src/pages/Customer/Card/CustomerConsumption.vue'), @@ -524,7 +518,6 @@ export default { name: 'CustomerMandates', meta: { title: 'mandates', - icon: 'paid', }, component: () => import('src/pages/Customer/Card/CustomerMandates.vue'), @@ -534,7 +527,6 @@ export default { name: 'CustomerContacts', meta: { title: 'contacts', - icon: 'paid', }, component: () => import('src/pages/Customer/Card/CustomerContacts.vue'), @@ -544,7 +536,6 @@ export default { name: 'CustomerWebPayment', meta: { title: 'webPayment', - icon: 'paid', }, component: () => import('src/pages/Customer/Card/CustomerWebPayment.vue'), @@ -554,7 +545,6 @@ export default { name: 'CustomerFileManagement', meta: { title: 'fileManagement', - icon: 'paid', }, component: () => import( @@ -571,7 +561,6 @@ export default { name: 'CustomerFileManagement', meta: { title: 'fileManagement', - icon: 'paid', }, component: () => import( @@ -586,6 +575,14 @@ export default { 'src/pages/Customer/components/CustomerFileManagementCreate.vue' ), }, + { + path: ':dmsId/edit', + name: 'CustomerFileManagementEdit', + component: () => + import( + 'src/pages/Customer/components/CustomerFileManagementEdit.vue' + ), + }, ], }, { @@ -593,7 +590,6 @@ export default { name: 'CustomerUnpaid', meta: { title: 'unpaid', - icon: 'paid', }, component: () => import('src/pages/Customer/Card/CustomerUnpaid.vue'),