diff --git a/src/css/app.scss b/src/css/app.scss index 65512eae8..750439e3a 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -67,7 +67,7 @@ body.body--dark { } .card-width { - width: 800px; + width: 770px; } .vn-card-list { diff --git a/src/pages/Customer/Card/CustomerAddress.vue b/src/pages/Customer/Card/CustomerAddress.vue index 77f6be0c2..66877de0e 100644 --- a/src/pages/Customer/Card/CustomerAddress.vue +++ b/src/pages/Customer/Card/CustomerAddress.vue @@ -6,7 +6,6 @@ import { useRoute, useRouter } from 'vue-router'; import axios from 'axios'; import FetchData from 'components/FetchData.vue'; -import VnPaginate from 'src/components/ui/VnPaginate.vue'; const { t } = useI18n(); const route = useRoute(); diff --git a/src/pages/Customer/Card/CustomerContacts.vue b/src/pages/Customer/Card/CustomerContacts.vue index 04f7ebeb8..6fb891dff 100644 --- a/src/pages/Customer/Card/CustomerContacts.vue +++ b/src/pages/Customer/Card/CustomerContacts.vue @@ -46,11 +46,11 @@ onMounted(() => {
{{ t('Remove contact') }} @@ -60,11 +60,11 @@ onMounted(() => { {{ t('Add contact') }} diff --git a/src/pages/Customer/Card/CustomerCreditOpinion.vue b/src/pages/Customer/Card/CustomerCreditOpinion.vue index a4d63574a..e2d4cdfcb 100644 --- a/src/pages/Customer/Card/CustomerCreditOpinion.vue +++ b/src/pages/Customer/Card/CustomerCreditOpinion.vue @@ -126,7 +126,7 @@ const columns = computed(() => [ -
+
[
+ +
+ {{ t('globals.noResults') }} +
diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index c2fb00cf1..46e728b0d 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -30,6 +30,7 @@ const incoterms = ref([]); const customsAgents = ref([]); const observationTypes = ref([]); const notes = ref([]); +const deletes = ref([]); onBeforeMount(() => { urlUpdate.value = `Clients/${route.params.id}/updateAddress/${route.params.addressId}`; @@ -68,6 +69,7 @@ const getData = async (observations) => { $orgIndex: null, addressFk: `${route.params.addressId}`, description: observation.description, + id: observation.id, observationTypeFk: type.id, } : null; @@ -88,15 +90,23 @@ const addNote = () => { }); }; -const deleteNote = (index) => { +const deleteNote = (id, index) => { + deletes.value.push(id); notes.value.splice(index, 1); }; const onDataSaved = async () => { - const payload = { - creates: notes.value, - }; + let payload = {}; + const creates = notes.value.filter((note) => note.$isNew); + if (creates.length) { + payload.creates = creates; + } + if (deletes.value.length) { + payload.deletes = deletes.value; + } await axios.post('AddressObservations/crud', payload); + notes.value = []; + deletes.value = []; toCustomerAddress(); }; @@ -347,7 +357,7 @@ const toCustomerAddress = () => {