diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index fb3ac10c3..de4724e55 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -124,11 +124,16 @@ async function onSubmit() { }); } isLoading.value = true; - await saveChanges(); + await saveChanges($props.saveFn ? formData.value : null); } async function saveChanges(data) { - if ($props.saveFn) return $props.saveFn(data, getChanges); + if ($props.saveFn) { + $props.saveFn(data, getChanges); + isLoading.value = false; + hasChanges.value = false; + return; + } const changes = data || getChanges(); try { await axios.post($props.saveUrl || $props.url + '/crud', changes); diff --git a/src/components/common/VnInputDate.vue b/src/components/common/VnInputDate.vue index 2053eceb1..fe0866292 100644 --- a/src/components/common/VnInputDate.vue +++ b/src/components/common/VnInputDate.vue @@ -15,6 +15,10 @@ const props = defineProps({ type: Boolean, default: false, }, + emitDateFormat: { + type: Boolean, + default: false, + }, }); const hover = ref(false); @@ -37,7 +41,10 @@ const value = computed({ return props.modelValue; }, set(value) { - emit('update:modelValue', joinDateAndTime(value, time.value)); + emit( + 'update:modelValue', + props.emitDateFormat ? new Date(value) : joinDateAndTime(value, time.value) + ); }, }); diff --git a/src/css/app.scss b/src/css/app.scss index 770df8e01..2e524e693 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -141,15 +141,6 @@ select:-webkit-autofill { background-color: var(--vn-section-color); } -.q-checkbox { - & .q-checkbox__label { - color: var(--vn-text-color); - } - & .q-checkbox__inner { - color: var(--vn-label-color); - } -} - .tr-header { color: var(--vn-label-color); } diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 96adf0e23..0e27eeade 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -521,7 +521,7 @@ claim: records: records card: claimId: Claim ID - assignedTo: Assigned + attendedBy: Attended by created: Created state: State ticketId: Ticket ID @@ -559,6 +559,7 @@ claim: responsible: Responsible worker: Worker redelivery: Redelivery + changeState: Change state basicData: customer: Customer assignedTo: Assigned @@ -990,7 +991,7 @@ supplier: billingData: Billing data payMethod: Pay method payDeadline: Pay deadline - payDay: Día de pago + payDay: Pay day account: Account fiscalData: Fiscal data sageTaxType: Sage tax type @@ -1132,12 +1133,13 @@ item: fixedPrice: Fixed prices wasteBreakdown: Waste breakdown itemCreate: New item - log: Log + barcode: Barcodes tax: Tax - barcode: Barcode + log: Log botanical: Botanical itemTypeCreate: New item type family: Item Type + lastEntries: Last entries descriptor: item: Item buyer: Buyer @@ -1227,6 +1229,12 @@ item/itemType: itemType: Item type basicData: Basic data summary: Summary +zone: + pageTitles: + zones: Zone + zonesList: Zones + deliveryList: Delivery days + upcomingList: Upcoming deliveries components: topbar: {} itemsFilterPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index cb2be6dc9..bc246a6cb 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -519,7 +519,7 @@ claim: records: registros card: claimId: ID reclamación - assignedTo: Asignada a + attendedBy: Atendida por created: Creada state: Estado ticketId: ID ticket @@ -557,6 +557,7 @@ claim: responsible: Responsable worker: Trabajador redelivery: Devolución + changeState: Cambiar estado basicData: customer: Cliente assignedTo: Asignada a @@ -1137,6 +1138,7 @@ item: log: Historial itemTypeCreate: Nueva familia family: Familia + lastEntries: Últimas entradas descriptor: item: Artículo buyer: Comprador @@ -1226,6 +1228,12 @@ item/itemType: itemType: Familia basicData: Datos básicos summary: Resumen +zone: + pageTitles: + zones: Zona + zonesList: Zonas + deliveryList: Días de entrega + upcomingList: Próximos repartos components: topbar: {} itemsFilterPanel: diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index be2efa31a..e2450a5e5 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -41,10 +41,6 @@ const claimStates = ref([]); const claimStatesCopy = ref([]); const optionsList = ref([]); -function setWorkers(data) { - workers.value = data; - workersCopy.value = data; -} const workersOptions = ref([]); function setClaimStates(data) { diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue index 968f1e294..aae999117 100644 --- a/src/pages/Claim/Card/ClaimDescriptor.vue +++ b/src/pages/Claim/Card/ClaimDescriptor.vue @@ -11,6 +11,7 @@ import VnLv from 'src/components/ui/VnLv.vue'; import useCardDescription from 'src/composables/useCardDescription'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; import { getUrl } from 'src/composables/getUrl'; +import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; const $props = defineProps({ id: { @@ -73,8 +74,9 @@ const filter = { const STATE_COLOR = { pending: 'warning', - managed: 'info', + incomplete: 'info', resolved: 'positive', + canceled: 'negative', }; function stateColor(code) { return STATE_COLOR[code]; @@ -127,17 +129,24 @@ onMounted(async () => { - + + + import { onMounted, ref, computed } from 'vue'; -import { useRoute } from 'vue-router'; +import { useRoute, useRouter } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { toDate, toCurrency } from 'src/filters'; import CardSummary from 'components/ui/CardSummary.vue'; @@ -13,8 +13,11 @@ import VnUserLink from 'src/components/ui/VnUserLink.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; +import axios from 'axios'; +import dashIfEmpty from 'src/filters/dashIfEmpty'; const route = useRoute(); +const router = useRouter(); const { t } = useI18n(); const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); @@ -27,7 +30,7 @@ const $props = defineProps({ }); const entityId = computed(() => $props.id || route.params.id); - +const ClaimStates = ref([]); const claimUrl = ref(); const salixUrl = ref(); const claimDmsRef = ref(); @@ -99,8 +102,9 @@ const detailsColumns = ref([ const STATE_COLOR = { pending: 'warning', - managed: 'info', + incomplete: 'info', resolved: 'positive', + canceled: 'negative', }; function stateColor(code) { return STATE_COLOR[code]; @@ -162,6 +166,10 @@ function openDialog(dmsId) { multimediaSlide.value = dmsId; multimediaDialog.value = true; } +async function changeState(value) { + await axios.patch(`Claims/updateClaim/${entityId.value}`, { claimStateFk: value }); + router.go(route.fullPath); +} +