8713-testToMaster #1539
|
@ -91,7 +91,6 @@ const components = {
|
||||||
event: updateEvent,
|
event: updateEvent,
|
||||||
attrs: {
|
attrs: {
|
||||||
...defaultAttrs,
|
...defaultAttrs,
|
||||||
style: 'min-width: 150px',
|
|
||||||
},
|
},
|
||||||
forceAttrs,
|
forceAttrs,
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,6 +31,8 @@ import VnLv from 'components/ui/VnLv.vue';
|
||||||
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
|
||||||
import VnTableFilter from './VnTableFilter.vue';
|
import VnTableFilter from './VnTableFilter.vue';
|
||||||
import { getColAlign } from 'src/composables/getColAlign';
|
import { getColAlign } from 'src/composables/getColAlign';
|
||||||
|
import RightMenu from '../common/RightMenu.vue';
|
||||||
|
import { QItemSection } from 'quasar';
|
||||||
|
|
||||||
const arrayData = useArrayData(useAttrs()['data-key']);
|
const arrayData = useArrayData(useAttrs()['data-key']);
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
|
@ -414,20 +416,13 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
eventHandlers: {
|
eventHandlers: {
|
||||||
'update:modelValue': async (value) => {
|
'update:modelValue': async (value) => {
|
||||||
if (isSelect && value) {
|
if (isSelect && value) {
|
||||||
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
await updateSelectValue(value, column, row, oldValue);
|
||||||
row[column?.name + 'TextValue'] =
|
|
||||||
value[column.attrs?.optionLabel ?? 'name'];
|
|
||||||
await column?.cellEvent?.['update:modelValue']?.(
|
|
||||||
value,
|
|
||||||
oldValue,
|
|
||||||
row,
|
|
||||||
);
|
|
||||||
} else row[column.name] = value;
|
} else row[column.name] = value;
|
||||||
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
||||||
},
|
},
|
||||||
keyup: async (event) => {
|
keyup: async (event) => {
|
||||||
if (event.key === 'Enter')
|
if (event.key === 'Enter')
|
||||||
await destroyInput(rowIndex, field, clickedElement);
|
await destroyInput(rowId, field, clickedElement);
|
||||||
},
|
},
|
||||||
keydown: async (event) => {
|
keydown: async (event) => {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
@ -458,6 +453,17 @@ async function renderInput(rowId, field, clickedElement) {
|
||||||
node.el?.querySelector('span > div > div').focus();
|
node.el?.querySelector('span > div > div').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function updateSelectValue(value, column, row, oldValue) {
|
||||||
|
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
|
||||||
|
|
||||||
|
row[column?.name + 'VnTableTextValue'] = value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
|
||||||
|
if (column?.attrs?.find?.label)
|
||||||
|
row[column?.attrs?.find?.label] = value[column.attrs?.optionLabel ?? 'name'];
|
||||||
|
|
||||||
|
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
|
||||||
|
}
|
||||||
|
|
||||||
async function destroyInput(rowIndex, field, clickedElement) {
|
async function destroyInput(rowIndex, field, clickedElement) {
|
||||||
if (!clickedElement)
|
if (!clickedElement)
|
||||||
clickedElement = document.querySelector(
|
clickedElement = document.querySelector(
|
||||||
|
@ -520,9 +526,9 @@ function getToggleIcon(value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatColumnValue(col, row, dashIfEmpty) {
|
function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
if (col?.format || row[col?.name + 'TextValue']) {
|
if (col?.format || row[col?.name + 'VnTableTextValue']) {
|
||||||
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) {
|
if (selectRegex.test(col?.component) && row[col?.name + 'VnTableTextValue']) {
|
||||||
return dashIfEmpty(row[col?.name + 'TextValue']);
|
return dashIfEmpty(row[col?.name + 'VnTableTextValue']);
|
||||||
} else {
|
} else {
|
||||||
return col.format(row, dashIfEmpty);
|
return col.format(row, dashIfEmpty);
|
||||||
}
|
}
|
||||||
|
@ -555,19 +561,33 @@ function formatColumnValue(col, row, dashIfEmpty) {
|
||||||
}
|
}
|
||||||
return dashIfEmpty(row[col?.name]);
|
return dashIfEmpty(row[col?.name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function cardClick(_, row) {
|
function cardClick(_, row) {
|
||||||
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeTextValue(data, getChanges) {
|
||||||
|
let changes = data.updates;
|
||||||
|
if (!changes) return data;
|
||||||
|
|
||||||
|
for (const change of changes) {
|
||||||
|
for (const key in change.data) {
|
||||||
|
if (key.endsWith('VnTableTextValue')) {
|
||||||
|
delete change.data[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data.updates = changes.filter((change) => Object.keys(change.data).length > 0);
|
||||||
|
|
||||||
|
if ($attrs?.beforeSaveFn) data = $attrs.beforeSaveFn(data, getChanges);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<QDrawer
|
<RightMenu v-if="$props.rightSearch">
|
||||||
v-if="$props.rightSearch"
|
<template #right-panel>
|
||||||
v-model="stateStore.rightDrawer"
|
|
||||||
side="right"
|
|
||||||
:width="256"
|
|
||||||
:overlay="$props.overlay"
|
|
||||||
>
|
|
||||||
<QScrollArea class="fit">
|
|
||||||
<VnTableFilter
|
<VnTableFilter
|
||||||
:data-key="$attrs['data-key']"
|
:data-key="$attrs['data-key']"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -581,8 +601,8 @@ function cardClick(_, row) {
|
||||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||||
</template>
|
</template>
|
||||||
</VnTableFilter>
|
</VnTableFilter>
|
||||||
</QScrollArea>
|
</template>
|
||||||
</QDrawer>
|
</RightMenu>
|
||||||
<CrudModel
|
<CrudModel
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:class="$attrs['class'] ?? 'q-px-md'"
|
:class="$attrs['class'] ?? 'q-px-md'"
|
||||||
|
@ -591,6 +611,7 @@ function cardClick(_, row) {
|
||||||
@on-fetch="(...args) => emit('onFetch', ...args)"
|
@on-fetch="(...args) => emit('onFetch', ...args)"
|
||||||
:search-url="searchUrl"
|
:search-url="searchUrl"
|
||||||
:disable-infinite-scroll="isTableMode"
|
:disable-infinite-scroll="isTableMode"
|
||||||
|
:before-save-fn="removeTextValue"
|
||||||
@save-changes="reload"
|
@save-changes="reload"
|
||||||
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
|
||||||
:auto-load="hasParams || $attrs['auto-load']"
|
:auto-load="hasParams || $attrs['auto-load']"
|
||||||
|
@ -635,20 +656,13 @@ function cardClick(_, row) {
|
||||||
:skip="columnsVisibilitySkipped"
|
:skip="columnsVisibilitySkipped"
|
||||||
/>
|
/>
|
||||||
<QBtnToggle
|
<QBtnToggle
|
||||||
|
v-if="!tableModes.some((mode) => mode.disable)"
|
||||||
v-model="mode"
|
v-model="mode"
|
||||||
toggle-color="primary"
|
toggle-color="primary"
|
||||||
class="bg-vn-section-color"
|
class="bg-vn-section-color"
|
||||||
dense
|
dense
|
||||||
:options="tableModes.filter((mode) => !mode.disable)"
|
:options="tableModes.filter((mode) => !mode.disable)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<QBtn
|
|
||||||
v-if="showRightIcon"
|
|
||||||
icon="filter_alt"
|
|
||||||
class="bg-vn-section-color q-ml-sm"
|
|
||||||
dense
|
|
||||||
@click="stateStore.toggleRightDrawer()"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template #header-cell="{ col }">
|
<template #header-cell="{ col }">
|
||||||
<QTh
|
<QTh
|
||||||
|
|
|
@ -77,7 +77,6 @@ onBeforeMount(() => {
|
||||||
function setPaymentType(accounting) {
|
function setPaymentType(accounting) {
|
||||||
if (!accounting) return;
|
if (!accounting) return;
|
||||||
accountingType.value = accounting.accountingType;
|
accountingType.value = accounting.accountingType;
|
||||||
|
|
||||||
initialData.description = [];
|
initialData.description = [];
|
||||||
initialData.payed = Date.vnNew();
|
initialData.payed = Date.vnNew();
|
||||||
isCash.value = accountingType.value.code == 'cash';
|
isCash.value = accountingType.value.code == 'cash';
|
||||||
|
@ -87,14 +86,14 @@ function setPaymentType(accounting) {
|
||||||
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
initialData.payed.getDate() + accountingType.value.daysInFuture,
|
||||||
);
|
);
|
||||||
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
maxAmount.value = accountingType.value && accountingType.value.maxAmount;
|
||||||
|
|
||||||
if (accountingType.value.code == 'compensation')
|
if (accountingType.value.code == 'compensation')
|
||||||
return (initialData.description = '');
|
return (initialData.description = '');
|
||||||
if (accountingType.value.receiptDescription)
|
|
||||||
initialData.description.push(accountingType.value.receiptDescription);
|
|
||||||
if (initialData.description) initialData.description.push(initialData.description);
|
|
||||||
|
|
||||||
initialData.description = initialData.description.join(', ');
|
let descriptions = [];
|
||||||
|
if (accountingType.value.receiptDescription)
|
||||||
|
descriptions.push(accountingType.value.receiptDescription);
|
||||||
|
if (initialData.description) descriptions.push(initialData.description);
|
||||||
|
initialData.description = descriptions.join(', ');
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateFromAmount = (event) => {
|
const calculateFromAmount = (event) => {
|
||||||
|
|
|
@ -639,7 +639,7 @@ onMounted(() => {
|
||||||
'flex-wrap': 'wrap',
|
'flex-wrap': 'wrap',
|
||||||
gap: '16px',
|
gap: '16px',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
height: '450px',
|
height: '500px',
|
||||||
},
|
},
|
||||||
columnGridStyle: {
|
columnGridStyle: {
|
||||||
'max-width': '50%',
|
'max-width': '50%',
|
||||||
|
@ -650,7 +650,7 @@ onMounted(() => {
|
||||||
:is-editable="editableMode"
|
:is-editable="editableMode"
|
||||||
:without-header="!editableMode"
|
:without-header="!editableMode"
|
||||||
:with-filters="editableMode"
|
:with-filters="editableMode"
|
||||||
:right-search="true"
|
:right-search="editableMode"
|
||||||
:right-search-icon="true"
|
:right-search-icon="true"
|
||||||
:row-click="false"
|
:row-click="false"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
|
|
@ -274,7 +274,7 @@ onBeforeMount(async () => {
|
||||||
:array-data-props="{
|
:array-data-props="{
|
||||||
url: 'Entries/filter',
|
url: 'Entries/filter',
|
||||||
order: 'landed DESC',
|
order: 'landed DESC',
|
||||||
userFilter: EntryFilter,
|
userFilter: entryQueryFilter,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #advanced-menu>
|
<template #advanced-menu>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { dashIfEmpty, toDate, toHour } from 'src/filters';
|
import { toDate, toHour } from 'src/filters';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { usePrintService } from 'src/composables/usePrintService';
|
import { usePrintService } from 'src/composables/usePrintService';
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,26 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import axios from 'axios';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
import VnUsesMana from 'components/ui/VnUsesMana.vue';
|
import VnUsesMana from 'components/ui/VnUsesMana.vue';
|
||||||
|
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
mana: {
|
|
||||||
type: Number,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
newPrice: {
|
newPrice: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
usesMana: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
manaCode: {
|
|
||||||
type: String,
|
|
||||||
default: 'mana',
|
|
||||||
},
|
|
||||||
sale: {
|
sale: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const mana = ref(null);
|
||||||
|
const usesMana = ref(false);
|
||||||
|
|
||||||
const emit = defineEmits(['save', 'cancel']);
|
const emit = defineEmits(['save', 'cancel']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -38,20 +32,35 @@ const save = (sale = $props.sale) => {
|
||||||
QPopupProxyRef.value.hide();
|
QPopupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getMana = async () => {
|
||||||
|
const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
|
||||||
|
mana.value = data;
|
||||||
|
await getUsesMana();
|
||||||
|
};
|
||||||
|
|
||||||
|
const getUsesMana = async () => {
|
||||||
|
const { data } = await axios.get('Sales/usesMana');
|
||||||
|
usesMana.value = data;
|
||||||
|
};
|
||||||
|
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
emit('cancel');
|
emit('cancel');
|
||||||
QPopupProxyRef.value.hide();
|
QPopupProxyRef.value.hide();
|
||||||
};
|
};
|
||||||
|
const hasMana = computed(() => typeof mana.value === 'number');
|
||||||
defineExpose({ save });
|
defineExpose({ save });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<QPopupProxy ref="QPopupProxyRef" data-cy="ticketEditManaProxy">
|
<QPopupProxy
|
||||||
|
ref="QPopupProxyRef"
|
||||||
|
@before-show="getMana"
|
||||||
|
data-cy="ticketEditManaProxy"
|
||||||
|
>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<QSpinner v-if="!mana" color="primary" size="md" />
|
|
||||||
<div v-else>
|
|
||||||
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
<div class="header">Mana: {{ toCurrency(mana) }}</div>
|
||||||
<div class="q-pa-md">
|
<QSpinner v-if="!hasMana" color="primary" size="md" />
|
||||||
|
<div class="q-pa-md" v-else>
|
||||||
<slot :popup="QPopupProxyRef" />
|
<slot :popup="QPopupProxyRef" />
|
||||||
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
<VnUsesMana :mana-code="manaCode" />
|
<VnUsesMana :mana-code="manaCode" />
|
||||||
|
@ -63,7 +72,7 @@ defineExpose({ save });
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -45,7 +45,6 @@ const isTicketEditable = ref(false);
|
||||||
const sales = ref([]);
|
const sales = ref([]);
|
||||||
const editableStatesOptions = ref([]);
|
const editableStatesOptions = ref([]);
|
||||||
const selectedSales = ref([]);
|
const selectedSales = ref([]);
|
||||||
const mana = ref(null);
|
|
||||||
const manaCode = ref('mana');
|
const manaCode = ref('mana');
|
||||||
const ticketState = computed(() => store.data?.ticketState?.state?.code);
|
const ticketState = computed(() => store.data?.ticketState?.state?.code);
|
||||||
const transfer = ref({
|
const transfer = ref({
|
||||||
|
@ -259,18 +258,6 @@ const DEFAULT_EDIT = {
|
||||||
oldQuantity: null,
|
oldQuantity: null,
|
||||||
};
|
};
|
||||||
const edit = ref({ ...DEFAULT_EDIT });
|
const edit = ref({ ...DEFAULT_EDIT });
|
||||||
const usesMana = ref(null);
|
|
||||||
|
|
||||||
const getUsesMana = async () => {
|
|
||||||
const { data } = await axios.get('Sales/usesMana');
|
|
||||||
usesMana.value = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getMana = async () => {
|
|
||||||
const { data } = await axios.get(`Tickets/${route.params.id}/getSalesPersonMana`);
|
|
||||||
mana.value = data;
|
|
||||||
await getUsesMana();
|
|
||||||
};
|
|
||||||
|
|
||||||
const selectedValidSales = computed(() => {
|
const selectedValidSales = computed(() => {
|
||||||
if (!sales.value) return;
|
if (!sales.value) return;
|
||||||
|
@ -278,7 +265,6 @@ const selectedValidSales = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const onOpenEditPricePopover = async (sale) => {
|
const onOpenEditPricePopover = async (sale) => {
|
||||||
await getMana();
|
|
||||||
edit.value = {
|
edit.value = {
|
||||||
sale: JSON.parse(JSON.stringify(sale)),
|
sale: JSON.parse(JSON.stringify(sale)),
|
||||||
price: sale.price,
|
price: sale.price,
|
||||||
|
@ -286,7 +272,6 @@ const onOpenEditPricePopover = async (sale) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOpenEditDiscountPopover = async (sale) => {
|
const onOpenEditDiscountPopover = async (sale) => {
|
||||||
await getMana();
|
|
||||||
if (isLocked.value) return;
|
if (isLocked.value) return;
|
||||||
if (sale) {
|
if (sale) {
|
||||||
edit.value = {
|
edit.value = {
|
||||||
|
@ -307,7 +292,6 @@ const changePrice = async (sale) => {
|
||||||
await confirmUpdate(() => updatePrice(sale, newPrice));
|
await confirmUpdate(() => updatePrice(sale, newPrice));
|
||||||
} else updatePrice(sale, newPrice);
|
} else updatePrice(sale, newPrice);
|
||||||
}
|
}
|
||||||
await getMana();
|
|
||||||
};
|
};
|
||||||
const updatePrice = async (sale, newPrice) => {
|
const updatePrice = async (sale, newPrice) => {
|
||||||
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
await axios.post(`Sales/${sale.id}/updatePrice`, { newPrice });
|
||||||
|
@ -600,9 +584,7 @@ watch(
|
||||||
:is-ticket-editable="isTicketEditable"
|
:is-ticket-editable="isTicketEditable"
|
||||||
:sales="selectedValidSales"
|
:sales="selectedValidSales"
|
||||||
:disable="!hasSelectedRows"
|
:disable="!hasSelectedRows"
|
||||||
:mana="mana"
|
|
||||||
:ticket-config="ticketConfig"
|
:ticket-config="ticketConfig"
|
||||||
@get-mana="getMana()"
|
|
||||||
@update-discounts="updateDiscounts"
|
@update-discounts="updateDiscounts"
|
||||||
@refresh-table="resetChanges"
|
@refresh-table="resetChanges"
|
||||||
/>
|
/>
|
||||||
|
@ -785,7 +767,6 @@ watch(
|
||||||
</QBtn>
|
</QBtn>
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
ref="editPriceProxyRef"
|
ref="editPriceProxyRef"
|
||||||
:mana="mana"
|
|
||||||
:sale="row"
|
:sale="row"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
@save="changePrice"
|
@save="changePrice"
|
||||||
|
@ -808,10 +789,8 @@ watch(
|
||||||
|
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
ref="editManaProxyRef"
|
ref="editManaProxyRef"
|
||||||
:mana="mana"
|
|
||||||
:sale="row"
|
:sale="row"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
:uses-mana="usesMana"
|
|
||||||
:mana-code="manaCode"
|
:mana-code="manaCode"
|
||||||
@save="changeDiscount"
|
@save="changeDiscount"
|
||||||
>
|
>
|
||||||
|
|
|
@ -34,10 +34,6 @@ const props = defineProps({
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
mana: {
|
|
||||||
type: Number,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
ticketConfig: {
|
ticketConfig: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
|
@ -220,7 +216,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
ref="editManaProxyRef"
|
ref="editManaProxyRef"
|
||||||
:sale="row"
|
:sale="row"
|
||||||
:mana="props.mana"
|
|
||||||
@save="changeMultipleDiscount"
|
@save="changeMultipleDiscount"
|
||||||
>
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { ref, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import VnTable from 'components/VnTable/VnTable.vue';
|
import VnTable from 'components/VnTable/VnTable.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { dashIfEmpty, toDate } from 'src/filters';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const quasar = useQuasar();
|
||||||
|
|
||||||
async function reactivateWorker() {
|
async function reactivateWorker() {
|
||||||
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
|
const hasToReactive = tableRef.value.CrudModelRef.formData.find(
|
||||||
(data) => !data.ended
|
(data) => !data.ended,
|
||||||
);
|
);
|
||||||
if (hasToReactive) {
|
if (hasToReactive) {
|
||||||
quasar
|
quasar
|
||||||
|
@ -38,25 +38,25 @@ const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'started',
|
name: 'started',
|
||||||
label: t('worker.business.tableVisibleColumns.started'),
|
label: t('worker.business.tableVisibleColumns.started'),
|
||||||
align: 'left',
|
|
||||||
format: ({ started }) => toDate(started),
|
format: ({ started }) => toDate(started),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '90px',
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'ended',
|
name: 'ended',
|
||||||
label: t('worker.business.tableVisibleColumns.ended'),
|
label: t('worker.business.tableVisibleColumns.ended'),
|
||||||
align: 'left',
|
|
||||||
format: ({ ended }) => toDate(ended),
|
format: ({ ended }) => toDate(ended),
|
||||||
component: 'date',
|
component: 'date',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '90px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t('worker.business.tableVisibleColumns.company'),
|
label: t('worker.business.tableVisibleColumns.company'),
|
||||||
align: 'left',
|
toolTip: t('worker.business.tableVisibleColumns.company'),
|
||||||
name: 'companyCodeFk',
|
name: 'companyCodeFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
@ -65,23 +65,23 @@ const columns = computed(() => [
|
||||||
optionLabel: 'code',
|
optionLabel: 'code',
|
||||||
optionValue: 'code',
|
optionValue: 'code',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '60px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
name: 'reasonEndFk',
|
name: 'reasonEndFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
label: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||||
|
toolTip: t('worker.business.tableVisibleColumns.reasonEnd'),
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'BusinessReasonEnds',
|
url: 'BusinessReasonEnds',
|
||||||
fields: ['id', 'reason'],
|
fields: ['id', 'reason'],
|
||||||
optionLabel: 'reason',
|
optionLabel: 'reason',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
|
format: ({ reason }, dashIfEmpty) => dashIfEmpty(reason),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
|
||||||
name: 'departmentFk',
|
name: 'departmentFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.department'),
|
label: t('worker.business.tableVisibleColumns.department'),
|
||||||
|
@ -89,15 +89,19 @@ const columns = computed(() => [
|
||||||
url: 'Departments',
|
url: 'Departments',
|
||||||
fields: ['id', 'name'],
|
fields: ['id', 'name'],
|
||||||
optionLabel: 'name',
|
optionLabel: 'name',
|
||||||
|
optionValue: 'id',
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '80px',
|
||||||
|
format: ({ departmentName }, dashIfEmpty) => dashIfEmpty(departmentName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'workerBusinessProfessionalCategoryFk',
|
name: 'workerBusinessProfessionalCategoryFk',
|
||||||
component: 'select',
|
component: 'select',
|
||||||
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
label: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||||
|
toolTip: t('worker.business.tableVisibleColumns.professionalCategory'),
|
||||||
attrs: {
|
attrs: {
|
||||||
url: 'WorkerBusinessProfessionalCategories',
|
url: 'WorkerBusinessProfessionalCategories',
|
||||||
fields: ['id', 'description', 'code'],
|
fields: ['id', 'description', 'code'],
|
||||||
|
@ -105,6 +109,9 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '100px',
|
||||||
|
format: ({ professionalDescription }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(professionalDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -118,6 +125,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ calendarTypeDescription }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(calendarTypeDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -131,6 +140,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '100px',
|
||||||
|
format: ({ workCenterName }, dashIfEmpty) => dashIfEmpty(workCenterName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -144,6 +155,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ payrollDescription }, dashIfEmpty) => dashIfEmpty(payrollDescription),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -157,6 +169,7 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ occupationName }, dashIfEmpty) => dashIfEmpty(occupationName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -165,6 +178,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '50px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -177,6 +191,8 @@ const columns = computed(() => [
|
||||||
},
|
},
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
format: ({ workerBusinessTypeName }, dashIfEmpty) =>
|
||||||
|
dashIfEmpty(workerBusinessTypeName),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -185,6 +201,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -193,6 +210,7 @@ const columns = computed(() => [
|
||||||
component: 'input',
|
component: 'input',
|
||||||
cardVisible: true,
|
cardVisible: true,
|
||||||
create: true,
|
create: true,
|
||||||
|
width: '70px',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'notes',
|
name: 'notes',
|
||||||
|
@ -208,7 +226,7 @@ const columns = computed(() => [
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="WorkerBusiness"
|
data-key="WorkerBusiness"
|
||||||
:url="`Workers/${entityId}/Business`"
|
:url="`Workers/${entityId}/getWorkerBusiness`"
|
||||||
save-url="/Businesses/crud"
|
save-url="/Businesses/crud"
|
||||||
:create="{
|
:create="{
|
||||||
urlCreate: `Workers/${entityId}/Business`,
|
urlCreate: `Workers/${entityId}/Business`,
|
||||||
|
@ -218,13 +236,12 @@ const columns = computed(() => [
|
||||||
}"
|
}"
|
||||||
order="id DESC"
|
order="id DESC"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
default-mode="card"
|
|
||||||
auto-load
|
auto-load
|
||||||
:disable-option="{ table: true }"
|
:disable-option="{ card: true }"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
card-class="grid-two q-gutter-x-xl q-gutter-y-md q-pr-lg q-py-lg"
|
|
||||||
:is-editable="true"
|
:is-editable="true"
|
||||||
:use-model="true"
|
:use-model="true"
|
||||||
|
:right-search-icon="false"
|
||||||
@save-changes="(data) => reactivateWorker(data)"
|
@save-changes="(data) => reactivateWorker(data)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<VnLv :label="t('globals.user')" :value="entity.user?.name" />
|
<VnLv :label="t('globals.user')" :value="entity.user?.name" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
class="ellipsis-text"
|
||||||
:label="t('globals.params.email')"
|
:label="t('globals.params.email')"
|
||||||
:value="entity.user?.emailUser?.email"
|
:value="entity.user?.emailUser?.email"
|
||||||
copy
|
copy
|
||||||
|
@ -177,6 +178,12 @@ const handlePhotoUpdated = (evt = false) => {
|
||||||
.photo {
|
.photo {
|
||||||
height: 256px;
|
height: 256px;
|
||||||
}
|
}
|
||||||
|
.ellipsis-text {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
|
|
Loading…
Reference in New Issue