diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index aafa9f4ba..94f9d9dc1 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -48,6 +48,10 @@ const $props = defineProps({ type: String, required: true, }, + description: { + type: String, + deafult: undefined, + }, }); const dmsFilter = { @@ -88,7 +92,6 @@ const dmsFilter = { ], }, }, - where: { [$props.filter]: route.params.id }, }; const columns = computed(() => [ @@ -298,6 +301,7 @@ defineExpose({ :data-key="$props.model" :url="$props.model" :user-filter="dmsFilter" + :filter="{ where: { [filter]: route.params.id } }" :order="['dmsFk DESC']" auto-load @on-fetch="setData" diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 7bcf90793..377872349 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -211,12 +211,10 @@ globals: mandates: Mandates contacts: Contacts webPayment: Web payment - fileManagement: File management unpaid: Unpaid entries: Entries buys: Buys dms: File management - entryCreate: New entry latestBuys: Latest buys reserves: Reserves tickets: Tickets diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index b2512193d..52fae877e 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -214,12 +214,10 @@ globals: mandates: Mandatos contacts: Contactos webPayment: Pago web - fileManagement: Gestión documental unpaid: Impago entries: Entradas buys: Compras dms: Gestión documental - entryCreate: Nueva entrada latestBuys: Últimas compras reserves: Reservas tickets: Tickets diff --git a/src/pages/Customer/Card/CustomerAddress.vue b/src/pages/Customer/Card/CustomerAddress.vue index f1799d0cc..5bf77d798 100644 --- a/src/pages/Customer/Card/CustomerAddress.vue +++ b/src/pages/Customer/Card/CustomerAddress.vue @@ -1,18 +1,22 @@ diff --git a/src/pages/Customer/Card/CustomerCreditContractsInsurance.vue b/src/pages/Customer/Card/CustomerCreditContractsInsurance.vue new file mode 100644 index 000000000..aac195b36 --- /dev/null +++ b/src/pages/Customer/Card/CustomerCreditContractsInsurance.vue @@ -0,0 +1,93 @@ + + + + + +es: + Created: Fecha creación + Grade: Grade + Credit: Crédito + diff --git a/src/pages/Customer/Card/CustomerDms.vue b/src/pages/Customer/Card/CustomerDms.vue new file mode 100644 index 000000000..350ee3429 --- /dev/null +++ b/src/pages/Customer/Card/CustomerDms.vue @@ -0,0 +1,28 @@ + + + + en: + ClientFileDescription: Payment law from client {clientName} ID {clientId} + es: + ClientFileDescription: Ley de pagos del cliente {clientName} ID {clientId} + diff --git a/src/pages/Customer/Card/CustomerFileManagement.vue b/src/pages/Customer/Card/CustomerFileManagement.vue deleted file mode 100644 index 419719251..000000000 --- a/src/pages/Customer/Card/CustomerFileManagement.vue +++ /dev/null @@ -1,269 +0,0 @@ - - - - - -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/CustomerSamples.vue b/src/pages/Customer/Card/CustomerSamples.vue index 19a7f8759..12fbfe6b2 100644 --- a/src/pages/Customer/Card/CustomerSamples.vue +++ b/src/pages/Customer/Card/CustomerSamples.vue @@ -20,9 +20,7 @@ const filter = { { relation: 'user', scope: { fields: ['id', 'name'] } }, { relation: 'company', scope: { fields: ['code'] } }, ], - where: { clientFk: route.params.id }, order: ['created DESC'], - limit: 20, }; const columns = computed(() => [ @@ -76,7 +74,8 @@ const tableRef = ref(); ref="tableRef" data-key="ClientSamples" auto-load - :filter="filter" + :user-filter="filter" + :filter="{ where: { clientFk: route.params.id } }" url="ClientSamples" :columns="columns" :pagination="{ rowsPerPage: 12 }" diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index bc76f5985..577397d83 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -4,16 +4,14 @@ import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; import { useQuasar } from 'quasar'; import axios from 'axios'; -import VnLocation from 'src/components/common/VnLocation.vue'; import FetchData from 'components/FetchData.vue'; -import FormModel from 'components/FormModel.vue'; -import VnRow from 'components/ui/VnRow.vue'; +import VnConfirm from 'components/ui/VnConfirm.vue'; +import CustomerAddressForm from './CustomerAddressForm.vue'; +import VnRow from 'src/components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; -import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; -import CustomerNewCustomsAgent from 'src/pages/Customer/components/CustomerNewCustomsAgent.vue'; -import VnInputNumber from 'src/components/common/VnInputNumber.vue'; -import VnConfirm from 'components/ui/VnConfirm.vue'; + +const emit = defineEmits(['onDataSaved']); const { t } = useI18n(); const route = useRoute(); @@ -22,31 +20,31 @@ const quasar = useQuasar(); const urlUpdate = ref(''); const agencyModes = ref([]); const incoterms = ref([]); -const customsAgents = ref([]); const observationTypes = ref([]); -const notes = ref([]); +const customsAgents = ref([]); let originalNotes = []; const deletes = ref([]); +const model = defineModel({ type: Object }); +const notes = ref(model.value.observations || []); +const $props = defineProps({ + id: { + type: Number, + required: true, + }, +}); + onBeforeMount(() => { - urlUpdate.value = `Clients/${route.params.id}/updateAddress/${route.params.addressId}`; + urlUpdate.value = `Clients/${route.params.id}/updateAddress/${$props.id}`; }); const getData = async (observations) => { observationTypes.value = observations; if (observationTypes.value.length) { - const filter = { - fields: ['id', 'addressFk', 'observationTypeFk', 'description'], - where: { addressFk: `${route.params.addressId}` }, - }; - const { data } = await axios.get('AddressObservations', { - params: { filter: JSON.stringify(filter) }, - }); - - if (data.length) { - originalNotes = data; - notes.value = originalNotes + if (notes.value.length) { + originalNotes = JSON.parse(JSON.stringify(notes.value)); + notes.value = notes.value .map((observation) => { const type = observationTypes.value.find( (type) => type.id === observation.observationTypeFk, @@ -56,7 +54,7 @@ const getData = async (observations) => { $isNew: false, $oldData: null, $orgIndex: null, - addressFk: `${route.params.addressId}`, + addressFk: `${$props.id}`, description: observation.description, id: observation.id, observationTypeFk: type.id, @@ -68,22 +66,6 @@ const getData = async (observations) => { } }; -const addNote = () => { - notes.value.push({ - $isNew: true, - $oldData: null, - $orgIndex: null, - addressFk: `${route.params.addressId}`, - description: '', - observationTypeFk: '', - }); -}; - -const deleteNote = (id, index) => { - deletes.value.push(id); - notes.value.splice(index, 1); -}; - const updateAddress = async (data) => { await axios.patch(urlUpdate.value, data); }; @@ -116,8 +98,9 @@ function cleanPayload(payload) { async function updateAll({ data, payload }) { await updateObservations(payload); await updateAddress(data); - toCustomerAddress(); + emit('onDataSaved'); } + function getPayload() { return { creates: notes.value.filter((note) => note.$isNew), @@ -162,23 +145,21 @@ async function handleDialog(data) { } } -const toCustomerAddress = () => { - notes.value = []; - deletes.value = []; - router.push({ - name: 'CustomerAddress', - params: { - id: route.params.id, - }, +const addNote = () => { + notes.value.push({ + $isNew: true, + $oldData: null, + $orgIndex: null, + addressFk: `${$props.id}`, + description: '', + observationTypeFk: '', }); }; -function handleLocation(data, location) { - const { town, code, provinceFk, countryFk } = location ?? {}; - data.postalCode = code; - data.city = town; - data.provinceFk = provinceFk; - data.countryFk = countryFk; -} + +const deleteNote = (id, index) => { + deletes.value.push(id); + notes.value.splice(index, 1); +}; - - - -es: - Enabled: Activo - Is equalizated: Recargo de equivalencia - Is Loginflora allowed: Compra directa en Holanda - Consignee: Consignatario - Street: Dirección fiscal - Postcode: Código postal - City: Población - Province: Provincia - Agency: Agencia - Phone: Teléfono - Mobile: Movíl - Incoterms: Incoterms - Customs agent: Agente de aduanas - New customs agent: Nuevo agente de aduanas - Notes: Notas - Observation type: Tipo de observación - Description: Descripción - Add note: Añadir nota - Remove note: Eliminar nota - Longitude: Longitud - Latitude: Latitud - confirmTicket: ¿Desea modificar también los estados de todos los tickets que están a punto de ser servidos? - confirmDeletionMessage: Si le das a aceptar, se modificaran todas las notas de los ticket a futuro -en: - confirmTicket: Do you also want to modify the states of all the tickets that are about to be served? - confirmDeletionMessage: If you click accept, all the notes of the future tickets will be modified + es: + Notes: Notas + Observation type: Tipo de observación + Description: Descripción + Add note: Añadir nota + Remove note: Eliminar nota + confirmTicket: ¿Desea modificar también los estados de todos los tickets que están a punto de ser servidos? + confirmDeletionMessage: Si le das a aceptar, se modificaran todas las notas de los ticket a futuro + en: + confirmTicket: Do you also want to modify the states of all the tickets that are about to be served? + confirmDeletionMessage: If you click accept, all the notes of the future tickets will be modified diff --git a/src/pages/Customer/components/CustomerAddressCreate.vue b/src/pages/Customer/components/CustomerAddressForm.vue similarity index 53% rename from src/pages/Customer/components/CustomerAddressCreate.vue rename to src/pages/Customer/components/CustomerAddressForm.vue index e1be6b150..7b285b6da 100644 --- a/src/pages/Customer/components/CustomerAddressCreate.vue +++ b/src/pages/Customer/components/CustomerAddressForm.vue @@ -1,36 +1,35 @@