#8604: TicketFuture to VnTable #1395
|
@ -11,6 +11,7 @@ export async function useCau(res, message) {
|
|||
const { config, headers, request, status, statusText, data } = res || {};
|
||||
const { params, url, method, signal, headers: confHeaders } = config || {};
|
||||
const { message: resMessage, code, name } = data?.error || {};
|
||||
delete confHeaders.Authorization;
|
||||
|
||||
const additionalData = {
|
||||
path: location.hash,
|
||||
|
@ -40,7 +41,7 @@ export async function useCau(res, message) {
|
|||
handler: async () => {
|
||||
const locale = i18n.global.t;
|
||||
const reason = ref(
|
||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : ''
|
||||
code == 'ACCESS_DENIED' ? locale('cau.askPrivileges') : '',
|
||||
);
|
||||
openConfirmationModal(
|
||||
locale('cau.title'),
|
||||
|
@ -59,10 +60,9 @@ export async function useCau(res, message) {
|
|||
'onUpdate:modelValue': (val) => (reason.value = val),
|
||||
label: locale('cau.inputLabel'),
|
||||
class: 'full-width',
|
||||
required: true,
|
||||
autofocus: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -35,6 +35,12 @@ account.value.hasAccount = hasAccount.value;
|
|||
const entityId = computed(() => +route.params.id);
|
||||
const hasitManagementAccess = ref();
|
||||
const hasSysadminAccess = ref();
|
||||
const isHimself = computed(() => user.value.id === account.value.id);
|
||||
const url = computed(() =>
|
||||
isHimself.value
|
||||
? 'Accounts/change-password'
|
||||
: `Accounts/${entityId.value}/setPassword`
|
||||
);
|
||||
|
||||
async function updateStatusAccount(active) {
|
||||
if (active) {
|
||||
|
@ -107,11 +113,8 @@ onMounted(() => {
|
|||
:ask-old-pass="askOldPass"
|
||||
:submit-fn="
|
||||
async (newPassword, oldPassword) => {
|
||||
await axios.patch(`Accounts/change-password`, {
|
||||
userId: entityId,
|
||||
newPassword,
|
||||
oldPassword,
|
||||
});
|
||||
const body = isHimself ? { userId: entityId, oldPassword } : {};
|
||||
await axios.patch(url, { ...body, newPassword });
|
||||
}
|
||||
"
|
||||
/>
|
||||
|
@ -155,16 +158,10 @@ onMounted(() => {
|
|||
>
|
||||
<QItemSection>{{ t('globals.delete') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="hasSysadminAccess"
|
||||
v-ripple
|
||||
clickable
|
||||
@click="user.id === account.id ? onChangePass(true) : onChangePass(false)"
|
||||
>
|
||||
<QItemSection v-if="user.id === account.id">
|
||||
{{ t('globals.changePass') }}
|
||||
<QItem v-if="hasSysadminAccess" v-ripple clickable>
|
||||
<QItemSection @click="onChangePass(isHimself)">
|
||||
{{ isHimself ? t('globals.changePass') : t('globals.setPass') }}
|
||||
</QItemSection>
|
||||
<QItemSection v-else>{{ t('globals.setPass') }}</QItemSection>
|
||||
</QItem>
|
||||
<QItem
|
||||
v-if="!account.hasAccount && hasSysadminAccess"
|
||||
|
|
|
@ -190,7 +190,7 @@ async function saveWhenHasChanges() {
|
|||
ref="claimLinesForm"
|
||||
:url="`Claims/${route.params.id}/lines`"
|
||||
save-url="ClaimBeginnings/crud"
|
||||
:filter="linesFilter"
|
||||
:user-filter="linesFilter"
|
||||
@on-fetch="onFetch"
|
||||
v-model:selected="selected"
|
||||
:default-save="false"
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import FetchData from 'components/FetchData.vue';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
|
@ -14,15 +12,14 @@ const props = defineProps({
|
|||
type: String,
|
||||
required: true,
|
||||
},
|
||||
states: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const states = ref([]);
|
||||
|
||||
defineExpose({ states });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
<div class="q-gutter-x-xs">
|
||||
|
|
|
@ -10,12 +10,13 @@ import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
|||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||
import ZoneDescriptorProxy from '../Zone/Card/ZoneDescriptorProxy.vue';
|
||||
import VnSection from 'src/components/common/VnSection.vue';
|
||||
import FetchData from 'src/components/FetchData.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const dataKey = 'ClaimList';
|
||||
|
||||
const claimFilterRef = ref();
|
||||
const states = ref([]);
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -81,8 +82,7 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
label: t('claim.state'),
|
||||
format: ({ stateCode }) =>
|
||||
claimFilterRef.value?.states.find(({ code }) => code === stateCode)
|
||||
?.description,
|
||||
states.value?.find(({ code }) => code === stateCode)?.description,
|
||||
name: 'stateCode',
|
||||
chip: {
|
||||
condition: () => true,
|
||||
|
@ -92,7 +92,7 @@ const columns = computed(() => [
|
|||
name: 'claimStateFk',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
options: claimFilterRef.value?.states,
|
||||
options: states.value,
|
||||
optionLabel: 'description',
|
||||
},
|
||||
},
|
||||
|
@ -125,6 +125,7 @@ const STATE_COLOR = {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData url="ClaimStates" @on-fetch="(data) => (states = data)" auto-load />
|
||||
<VnSection
|
||||
:data-key="dataKey"
|
||||
:columns="columns"
|
||||
|
@ -135,7 +136,7 @@ const STATE_COLOR = {
|
|||
}"
|
||||
>
|
||||
<template #advanced-menu>
|
||||
<ClaimFilter data-key="ClaimList" ref="claimFilterRef" />
|
||||
<ClaimFilter :data-key ref="claimFilterRef" :states />
|
||||
</template>
|
||||
<template #body>
|
||||
<VnTable
|
||||
|
|
|
@ -10,6 +10,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnLocation from 'src/components/common/VnLocation.vue';
|
||||
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
|
||||
import { getDifferences, getUpdatedValues } from 'src/filters';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
|
@ -24,6 +25,12 @@ function handleLocation(data, location) {
|
|||
data.provinceFk = provinceFk;
|
||||
data.countryFk = countryFk;
|
||||
}
|
||||
function onBeforeSave(formData, originalData) {
|
||||
return getUpdatedValues(
|
||||
Object.keys(getDifferences(formData, originalData)),
|
||||
formData,
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -37,6 +44,7 @@ function handleLocation(data, location) {
|
|||
:url-update="`Clients/${route.params.id}/updateFiscalData`"
|
||||
auto-load
|
||||
model="Customer"
|
||||
:mapper="onBeforeSave"
|
||||
>
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
|
@ -114,7 +122,7 @@ function handleLocation(data, location) {
|
|||
<VnCheckbox
|
||||
v-model="data.isVies"
|
||||
:label="t('globals.isVies')"
|
||||
:info="t('whenActivatingIt')"
|
||||
:info="t('whenActivatingIt')"
|
||||
/>
|
||||
</VnRow>
|
||||
|
||||
|
@ -127,7 +135,7 @@ function handleLocation(data, location) {
|
|||
</VnRow>
|
||||
|
||||
<VnRow>
|
||||
<VnCheckbox
|
||||
<VnCheckbox
|
||||
v-model="data.isEqualizated"
|
||||
:label="t('Is equalizated')"
|
||||
:info="t('inOrderToInvoice')"
|
||||
|
|
|
@ -39,7 +39,7 @@ const addToOrder = async () => {
|
|||
});
|
||||
|
||||
const { data: orderTotal } = await axios.get(
|
||||
`Orders/${Number(route.params.id)}/getTotal`
|
||||
`Orders/${Number(route.params.id)}/getTotal`,
|
||||
);
|
||||
|
||||
state.set('orderTotal', orderTotal);
|
||||
|
@ -56,7 +56,7 @@ const canAddToOrder = () => {
|
|||
if (canAddToOrder) {
|
||||
const excedQuantity = prices.value.reduce(
|
||||
(acc, { quantity }) => acc + quantity,
|
||||
0
|
||||
0,
|
||||
);
|
||||
if (excedQuantity > props.item.available) {
|
||||
canAddToOrder = false;
|
||||
|
|
|
@ -31,20 +31,18 @@ onMounted(async () => {
|
|||
ref="summary"
|
||||
:url="`Departments/${entityId}`"
|
||||
class="full-width"
|
||||
style="max-width: 900px"
|
||||
module-name="Department"
|
||||
>
|
||||
<template #header="{ entity }">
|
||||
<div>{{ entity.name }}</div>
|
||||
</template>
|
||||
<template #body="{ entity: department }">
|
||||
<QCard class="column">
|
||||
<QCard class="vn-one">
|
||||
<VnTitle
|
||||
:url="`#/worker/department/${entityId}/basic-data`"
|
||||
:text="t('Basic data')"
|
||||
/>
|
||||
<div class="full-width row wrap justify-between content-between">
|
||||
<div class="column" style="min-width: 50%">
|
||||
<div class="column">
|
||||
<VnLv :label="t('globals.name')" :value="department.name" dash />
|
||||
<VnLv :label="t('globals.code')" :value="department.code" dash />
|
||||
<VnLv
|
||||
|
|
|
@ -35,7 +35,7 @@ const filterWhere = computed(() => ({
|
|||
auto-load
|
||||
@on-fetch="(data) => (validAddresses = data)"
|
||||
/>
|
||||
<FormModel :url="`Zones/${route.params.id}`" auto-load model="zone">
|
||||
<FormModel :url="`Zones/${$route.params.id}`" auto-load data-key="Zone">
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
<VnInput
|
||||
|
|
Loading…
Reference in New Issue