Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into test
This commit is contained in:
commit
7357559c48
|
@ -107,6 +107,7 @@ const manageDate = (date) => {
|
|||
:rules="mixinRules"
|
||||
:clearable="false"
|
||||
@click="isPopupOpen = !isPopupOpen"
|
||||
@keydown="isPopupOpen = false"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template #append>
|
||||
|
|
|
@ -81,6 +81,7 @@ function dateToTime(newDate) {
|
|||
style="min-width: 100px"
|
||||
:rules="mixinRules"
|
||||
@click="isPopupOpen = !isPopupOpen"
|
||||
@keydown="isPopupOpen = false"
|
||||
type="time"
|
||||
hide-bottom-space
|
||||
>
|
||||
|
|
|
@ -294,7 +294,7 @@ async function onScroll({ to, direction, from, index }) {
|
|||
}
|
||||
}
|
||||
|
||||
defineExpose({ opts: myOptions });
|
||||
defineExpose({ opts: myOptions, vnSelectRef });
|
||||
|
||||
function handleKeyDown(event) {
|
||||
if (event.key === 'Tab' && !event.shiftKey) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRole } from 'src/composables/useRole';
|
||||
import { useAcl } from 'src/composables/useAcl';
|
||||
|
||||
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
|||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const value = defineModel({ type: [String, Number, Object] });
|
||||
const select = ref(null);
|
||||
const $props = defineProps({
|
||||
rolesAllowedToCreate: {
|
||||
type: Array,
|
||||
|
@ -33,10 +34,13 @@ const isAllowedToCreate = computed(() => {
|
|||
if ($props.acls.length) return acl.hasAny($props.acls);
|
||||
return role.hasAny($props.rolesAllowedToCreate);
|
||||
});
|
||||
|
||||
defineExpose({ vnSelectDialogRef: select });
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSelect
|
||||
ref="select"
|
||||
v-model="value"
|
||||
v-bind="$attrs"
|
||||
@update:model-value="(...args) => emit('update:modelValue', ...args)"
|
||||
|
|
|
@ -306,6 +306,14 @@ input::-webkit-inner-spin-button {
|
|||
.no-visible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.q-item > .q-item__section:has(.q-checkbox) {
|
||||
max-width: min-content;
|
||||
}
|
||||
|
||||
.row > .column:has(.q-checkbox) {
|
||||
max-width: min-content;
|
||||
}
|
||||
.q-field__inner {
|
||||
.q-field__control {
|
||||
min-height: auto !important;
|
||||
|
|
|
@ -773,6 +773,7 @@ travel:
|
|||
totalEntries: Total entries
|
||||
totalEntriesTooltip: Total entries
|
||||
daysOnward: Landed days onwards
|
||||
awb: AWB
|
||||
summary:
|
||||
entryId: Entry Id
|
||||
freight: Freight
|
||||
|
|
|
@ -774,6 +774,7 @@ travel:
|
|||
totalEntries: ∑
|
||||
totalEntriesTooltip: Entradas totales
|
||||
daysOnward: Días de llegada en adelante
|
||||
awb: AWB
|
||||
summary:
|
||||
entryId: Id entrada
|
||||
freight: Porte
|
||||
|
|
|
@ -38,7 +38,7 @@ const getBankEntities = (data, formData) => {
|
|||
hide-selected
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="data.payMethod"
|
||||
v-model="data.payMethodFk"
|
||||
/>
|
||||
<VnInput :label="t('Due day')" clearable v-model="data.dueDay" />
|
||||
</VnRow>
|
||||
|
|
|
@ -59,6 +59,7 @@ const columns = computed(() => [
|
|||
</script>
|
||||
<template>
|
||||
<VnTable
|
||||
:user-filter="{ include: filter.include }"
|
||||
ref="tableRef"
|
||||
data-key="ClientCredit"
|
||||
url="ClientCredits"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
|
@ -11,15 +11,9 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
|
|||
import VnLv from 'src/components/ui/VnLv.vue';
|
||||
import VnUserLink from 'src/components/ui/VnUserLink.vue';
|
||||
import CustomerDescriptorMenu from './CustomerDescriptorMenu.vue';
|
||||
import { useState } from 'src/composables/useState';
|
||||
const state = useState();
|
||||
|
||||
const customer = ref();
|
||||
|
||||
onMounted(async () => {
|
||||
customer.value = state.get('customer');
|
||||
if (customer.value) customer.value.webAccess = data.value?.account?.isActive;
|
||||
});
|
||||
const customerDebt = ref();
|
||||
const customerCredit = ref();
|
||||
|
||||
const $props = defineProps({
|
||||
id: {
|
||||
|
@ -42,10 +36,12 @@ const entityId = computed(() => {
|
|||
|
||||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => {
|
||||
customerDebt.value = entity?.debt;
|
||||
customerCredit.value = entity?.credit;
|
||||
data.value = useCardDescription(entity?.name, entity?.id);
|
||||
};
|
||||
const debtWarning = computed(() => {
|
||||
return customer.value?.debt > customer.value?.credit ? 'negative' : 'primary';
|
||||
return customerDebt.value > customerCredit.value ? 'negative' : 'primary';
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -97,26 +93,21 @@ const debtWarning = computed(() => {
|
|||
:value="entity.businessType.description"
|
||||
/>
|
||||
</template>
|
||||
<template #icons>
|
||||
<QCardActions v-if="customer" class="q-gutter-x-md">
|
||||
<template #icons="{ entity }">
|
||||
<QCardActions class="q-gutter-x-md">
|
||||
<QIcon
|
||||
v-if="!customer.isActive"
|
||||
v-if="!entity.isActive"
|
||||
name="vn:disabled"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QTooltip>{{ t('customer.card.isDisabled') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="customer.isFreezed"
|
||||
name="vn:frozen"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<QIcon v-if="entity.isFreezed" name="vn:frozen" size="xs" color="primary">
|
||||
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!customer.account?.active"
|
||||
v-if="!entity.account?.active"
|
||||
color="primary"
|
||||
name="vn:noweb"
|
||||
size="xs"
|
||||
|
@ -124,7 +115,7 @@ const debtWarning = computed(() => {
|
|||
<QTooltip>{{ t('customer.card.webAccountInactive') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="customer.debt > customer.credit"
|
||||
v-if="entity.debt > entity.credit"
|
||||
name="vn:risk"
|
||||
size="xs"
|
||||
:color="debtWarning"
|
||||
|
@ -132,7 +123,7 @@ const debtWarning = computed(() => {
|
|||
<QTooltip>{{ t('customer.card.hasDebt') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="!customer.isTaxDataChecked"
|
||||
v-if="!entity.isTaxDataChecked"
|
||||
name="vn:no036"
|
||||
size="xs"
|
||||
color="primary"
|
||||
|
@ -140,7 +131,7 @@ const debtWarning = computed(() => {
|
|||
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QBtn
|
||||
v-if="customer.unpaid"
|
||||
v-if="entity.unpaid"
|
||||
flat
|
||||
size="sm"
|
||||
icon="vn:Client_unpaid"
|
||||
|
|
|
@ -84,6 +84,7 @@ const columns = computed(() => [
|
|||
component: 'number',
|
||||
autofocus: true,
|
||||
required: true,
|
||||
positive: false,
|
||||
},
|
||||
format: ({ amount }) => toCurrency(amount),
|
||||
create: true,
|
||||
|
|
|
@ -25,6 +25,7 @@ const sageTaxTypes = ref([]);
|
|||
const sageTransactionTypes = ref([]);
|
||||
const rowsSelected = ref([]);
|
||||
const invoiceInFormRef = ref();
|
||||
const expenseRef = ref();
|
||||
|
||||
defineProps({
|
||||
actionIcon: {
|
||||
|
@ -128,7 +129,7 @@ function autocompleteExpense(evt, row, col) {
|
|||
({ id }) => id == useAccountShortToStandard(param)
|
||||
);
|
||||
|
||||
if (lookup) row[col.model] = lookup;
|
||||
expenseRef.value.vnSelectDialogRef.vnSelectRef.toggleOption(lookup);
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
@ -167,6 +168,7 @@ function autocompleteExpense(evt, row, col) {
|
|||
<template #body-cell-expense="{ row, col }">
|
||||
<QTd>
|
||||
<VnSelectDialog
|
||||
ref="expenseRef"
|
||||
v-model="row[col.model]"
|
||||
:options="col.options"
|
||||
:option-value="col.optionValue"
|
||||
|
|
|
@ -208,15 +208,28 @@ async function remove(item) {
|
|||
async function handleConfirm() {
|
||||
const result = await confirm(route.params.id);
|
||||
if (result) {
|
||||
const sale = await axios.get(`OrderRows`, {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
where: { orderFk: route.params.id },
|
||||
}),
|
||||
},
|
||||
});
|
||||
const ticket = await axios.get(`Sales`, {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
where: { id: sale.data[0].saleFk },
|
||||
}),
|
||||
},
|
||||
});
|
||||
quasar.notify({
|
||||
message: t('globals.dataSaved'),
|
||||
type: 'positive',
|
||||
});
|
||||
router.push({
|
||||
name: 'TicketSale',
|
||||
query: {
|
||||
table: JSON.stringify({ id: route.params.id }),
|
||||
},
|
||||
params: { id: ticket.data[0].ticketFk },
|
||||
query: { table: JSON.stringify({ filter: { limit: 20, skip: 0 } }) },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,8 @@ function handleLocation(data, location) {
|
|||
'supplierActivityFk',
|
||||
'healthRegister',
|
||||
'street',
|
||||
'isVies',
|
||||
'isTrucker',
|
||||
],
|
||||
include: [
|
||||
{
|
||||
|
|
|
@ -54,7 +54,6 @@ const transfer = ref({
|
|||
});
|
||||
const tableRef = ref([]);
|
||||
const canProceed = ref();
|
||||
const isLoading = ref(false);
|
||||
|
||||
watch(
|
||||
() => route.params.id,
|
||||
|
@ -197,6 +196,7 @@ const changeQuantity = async (sale) => {
|
|||
try {
|
||||
if (!rowToUpdate.value) return;
|
||||
rowToUpdate.value = null;
|
||||
sale.isNew = false;
|
||||
await updateQuantity(sale);
|
||||
} catch (e) {
|
||||
const { quantity } = tableRef.value.CrudModelRef.originalData.find(
|
||||
|
@ -214,9 +214,6 @@ const updateQuantity = async ({ quantity, id }) => {
|
|||
};
|
||||
|
||||
const addSale = async (sale) => {
|
||||
if (isLoading.value) return;
|
||||
|
||||
isLoading.value = true;
|
||||
const params = {
|
||||
barcode: sale.itemFk,
|
||||
quantity: sale.quantity,
|
||||
|
@ -237,6 +234,7 @@ const addSale = async (sale) => {
|
|||
sale.item = newSale.item;
|
||||
|
||||
notify('globals.dataSaved', 'positive');
|
||||
sale.isNew = false;
|
||||
arrayData.fetch({});
|
||||
};
|
||||
|
||||
|
@ -754,6 +752,7 @@ watch(
|
|||
option-label="name"
|
||||
option-value="id"
|
||||
v-model="row.itemFk"
|
||||
:use-like="false"
|
||||
@update:model-value="updateItem(row)"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
|
|
@ -166,6 +166,7 @@ async function handleSave() {
|
|||
v-model="row.ticketServiceTypeFk"
|
||||
:options="ticketServiceOptions"
|
||||
option-label="name"
|
||||
:roles-allowed-to-create="['administrative']"
|
||||
option-value="id"
|
||||
hide-selected
|
||||
>
|
||||
|
|
|
@ -79,6 +79,13 @@ const columns = computed(() => [
|
|||
cardVisible: true,
|
||||
create: true,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'awb',
|
||||
label: t('travel.travelList.tableVisibleColumns.awb'),
|
||||
columnFilter: false,
|
||||
format: (row) => row.awbCode,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'warehouseInFk',
|
||||
|
|
|
@ -27,7 +27,7 @@ const initialData = computed(() => {
|
|||
return {
|
||||
userFk: routeId.value,
|
||||
deviceProductionFk: null,
|
||||
simSerialNumber: null,
|
||||
simFk: null,
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -42,7 +42,7 @@ const deallocatePDA = async (deviceProductionFk) => {
|
|||
|
||||
function reloadData() {
|
||||
initialData.value.deviceProductionFk = null;
|
||||
initialData.value.simSerialNumber = null;
|
||||
initialData.value.simFk = null;
|
||||
paginate.value.fetch();
|
||||
}
|
||||
</script>
|
||||
|
@ -89,7 +89,7 @@ function reloadData() {
|
|||
/>
|
||||
<VnInput
|
||||
:label="t('Current SIM')"
|
||||
:model-value="row?.simSerialNumber"
|
||||
:model-value="row?.simFk"
|
||||
disable
|
||||
/>
|
||||
<QBtn
|
||||
|
@ -150,7 +150,7 @@ function reloadData() {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnInput
|
||||
v-model="data.simSerialNumber"
|
||||
v-model="data.simFk"
|
||||
:label="t('SIM serial number')"
|
||||
id="simSerialNumber"
|
||||
use-input
|
||||
|
|
|
@ -283,21 +283,22 @@ const fetchWeekData = async () => {
|
|||
year: selectedDateYear.value,
|
||||
week: selectedWeekNumber.value,
|
||||
};
|
||||
const mail = (
|
||||
await axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
})
|
||||
).data[0];
|
||||
try {
|
||||
const [{ data: mailData }, { data: countData }] = await Promise.all([
|
||||
axiosNoError.get(`Workers/${route.params.id}/mail`, {
|
||||
params: { filter: { where } },
|
||||
}),
|
||||
axiosNoError.get('WorkerTimeControlMails/count', { params: { where } }),
|
||||
]);
|
||||
|
||||
if (!mail) state.value = null;
|
||||
else {
|
||||
state.value = mail.state;
|
||||
reason.value = mail.reason;
|
||||
const mail = mailData[0];
|
||||
|
||||
state.value = mail?.state;
|
||||
reason.value = mail?.reason;
|
||||
canResend.value = !!countData.count;
|
||||
} catch {
|
||||
state.value = null;
|
||||
}
|
||||
|
||||
canResend.value = !!(
|
||||
await axiosNoError.get('WorkerTimeControlMails/count', { params: { where } })
|
||||
).data.count;
|
||||
};
|
||||
|
||||
const setHours = (data) => {
|
||||
|
|
Loading…
Reference in New Issue