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/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) => { es: Rating: Clasificación Recommended credit: Crédito recomendado + Since: Desde + Employee: Empleado diff --git a/src/pages/Customer/Card/CustomerCredits.vue b/src/pages/Customer/Card/CustomerCredits.vue index b59cf5f68..8931fdd1e 100644 --- a/src/pages/Customer/Card/CustomerCredits.vue +++ b/src/pages/Customer/Card/CustomerCredits.vue @@ -85,39 +85,45 @@ const toCustomerCreditCreate = () => { url="ClientCredits" /> - - - - +
+ + + + -
- {{ t('globals.noResults') }} -
- +
+ {{ t('globals.noResults') }} +
+
+
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/CustomerNotes.vue b/src/pages/Customer/Card/CustomerNotes.vue index d9400e663..734ee4522 100644 --- a/src/pages/Customer/Card/CustomerNotes.vue +++ b/src/pages/Customer/Card/CustomerNotes.vue @@ -23,45 +23,52 @@ const toCustomerNoteCreate = () => { + + +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',