From 3bcd4984f5215374960696bc60d499e913c8a3b1 Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Thu, 22 Feb 2024 05:11:02 -0500 Subject: [PATCH 1/3] Solucion a comentarios 17 --- src/css/app.scss | 4 + .../Customer/Card/CustomerCreditContracts.vue | 2 +- .../Customer/Card/CustomerCreditOpinion.vue | 94 ++++++++++++++++++- .../Customer/Card/CustomerFiscalData.vue | 2 +- src/pages/Customer/Card/CustomerSummary.vue | 5 + src/pages/Customer/Card/CustomerWebAccess.vue | 75 ++++++++------- .../CustomerCreditContractsInsurance.vue | 6 +- src/router/modules/customer.js | 13 +-- 8 files changed, 148 insertions(+), 53 deletions(-) diff --git a/src/css/app.scss b/src/css/app.scss index 66e7e3c37..65512eae8 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -66,6 +66,10 @@ body.body--dark { border-radius: 8px; } +.card-width { + width: 800px; +} + .vn-card-list { width: 100%; max-width: 60em; diff --git a/src/pages/Customer/Card/CustomerCreditContracts.vue b/src/pages/Customer/Card/CustomerCreditContracts.vue index 04952e913..654bd1e91 100644 --- a/src/pages/Customer/Card/CustomerCreditContracts.vue +++ b/src/pages/Customer/Card/CustomerCreditContracts.vue @@ -129,7 +129,7 @@ const updateData = () => {
-
+
{{ t('Credit') }}: diff --git a/src/pages/Customer/Card/CustomerCreditOpinion.vue b/src/pages/Customer/Card/CustomerCreditOpinion.vue index 2746750ab..1eeae0f24 100644 --- a/src/pages/Customer/Card/CustomerCreditOpinion.vue +++ b/src/pages/Customer/Card/CustomerCreditOpinion.vue @@ -1,17 +1,22 @@ + + + + es: Rating: Clasificación Recommended credit: Crédito recomendado + Since: Desde + Employee: Empleado diff --git a/src/pages/Customer/Card/CustomerFiscalData.vue b/src/pages/Customer/Card/CustomerFiscalData.vue index 0a5b6f596..f74cbc2c4 100644 --- a/src/pages/Customer/Card/CustomerFiscalData.vue +++ b/src/pages/Customer/Card/CustomerFiscalData.vue @@ -83,7 +83,7 @@ function handleLocation(data, location) { :label="t('Sage transaction type')" :options="typesTransactions" hide-selected - option-label="vat" + option-label="transaction" option-value="id" v-model="data.sageTransactionTypeFk" > diff --git a/src/pages/Customer/Card/CustomerSummary.vue b/src/pages/Customer/Card/CustomerSummary.vue index c35fa3bfa..8b4994f6e 100644 --- a/src/pages/Customer/Card/CustomerSummary.vue +++ b/src/pages/Customer/Card/CustomerSummary.vue @@ -287,3 +287,8 @@ const creditWarning = computed(() => { + + +es: + Latest tickets: Últimos tickets + diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 1dacba99e..e28331b86 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -135,42 +135,47 @@ const onSubmit = async () => { - - - - -
- -
-
+
+ + + + +
+ +
+
- -
- -
-
- - - -
-
-
-
-
+ +
+ +
+
+ + +
+ + + +
+
+ + + +
diff --git a/src/pages/Customer/components/CustomerCreditContractsInsurance.vue b/src/pages/Customer/components/CustomerCreditContractsInsurance.vue index ad2686bb6..ce880d4b5 100644 --- a/src/pages/Customer/components/CustomerCreditContractsInsurance.vue +++ b/src/pages/Customer/components/CustomerCreditContractsInsurance.vue @@ -69,7 +69,7 @@ const columns = computed(() => [ url="CreditInsurances" /> - + [ + +
+ {{ t('globals.noResults') }} +
diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 94e2d73ec..04e75b7ef 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -366,17 +366,6 @@ export default { ], }, children: [ - { - path: 'credit-contracts', - name: 'CustomerCreditContracts', - meta: { - title: 'creditContracts', - }, - component: () => - import( - 'src/pages/Customer/Card/CustomerCreditContracts.vue' - ), - }, { path: 'credit-contracts', name: 'CreditContractsCard', @@ -439,7 +428,7 @@ export default { { name: 'CustomerConsumption', title: 'consumption', - icon: 'vn:lines', + icon: 'show_chart', }, { name: 'CustomerMandates', From 980904a3820a62c8d9aa84eb9898eef7f4a3ba69 Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Thu, 22 Feb 2024 05:46:56 -0500 Subject: [PATCH 2/3] Solucion a comentarios 18 --- src/pages/Customer/Card/CustomerAddress.vue | 73 ++++++++++++++++----- 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/src/pages/Customer/Card/CustomerAddress.vue b/src/pages/Customer/Card/CustomerAddress.vue index b080fe457..77f6be0c2 100644 --- a/src/pages/Customer/Card/CustomerAddress.vue +++ b/src/pages/Customer/Card/CustomerAddress.vue @@ -3,6 +3,8 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; +import axios from 'axios'; + import FetchData from 'components/FetchData.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue'; @@ -10,6 +12,7 @@ const { t } = useI18n(); const route = useRoute(); const router = useRouter(); +const addresses = ref([]); const client = ref(null); const provincesLocation = ref([]); @@ -45,6 +48,11 @@ const addressFilter = { ], }; +const setRows = (data) => { + addresses.value = data; + sortAddresses(); +}; + const setProvince = (provinceFk) => { const result = provincesLocation.value.filter( (province) => province.id === provinceFk @@ -56,6 +64,24 @@ const isDefaultAddress = (address) => { return client?.value?.defaultAddressFk === address.id ? 1 : 0; }; +const setDefault = (address) => { + const url = `Clients/${route.params.id}`; + const payload = { defaultAddressFk: address.id }; + axios.patch(url, payload).then((res) => { + if (res.data) { + client.value.defaultAddressFk = res.data.defaultAddressFk; + sortAddresses(); + } + }); +}; + +const sortAddresses = () => { + if (!client.value || !addresses.value) return; + addresses.value = addresses.value.sort((a, b) => { + return isDefaultAddress(b) - isDefaultAddress(a); + }); +}; + const toCustomerAddressCreate = () => { router.push({ name: 'CustomerAddressCreate' }); }; @@ -72,6 +98,12 @@ const toCustomerAddressEdit = (addressId) => {