Merge branch 'dev' into Fix-TicketSale
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-10-01 09:53:34 +00:00
commit 6e4677848f
13 changed files with 70 additions and 34 deletions

View File

@ -317,8 +317,8 @@ defineExpose({
params,
});
function handleOnDataSaved(_) {
if (_.onDataSaved) _.onDataSaved(this);
function handleOnDataSaved(_, res) {
if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value });
else $props.create.onDataSaved(_);
}
</script>
@ -771,6 +771,16 @@ es:
color: var(--vn-text-color);
}
.q-table--dark .q-table__bottom,
.q-table--dark thead,
.q-table--dark tr {
border-color: var(--vn-section-color);
}
.q-table__container > div:first-child {
background-color: var(--vn-page-color);
}
.grid-three {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, max-content));

View File

@ -12,6 +12,16 @@ const props = defineProps({
default: null,
},
});
const locationProperties = [
'postcode',
(obj) =>
obj.city
? `${obj.city}${obj.province?.name ? `(${obj.province.name})` : ''}`
: null,
(obj) => obj.country?.name,
];
const formatLocation = (obj, properties) => {
const parts = properties.map((prop) => {
if (typeof prop === 'string') {
@ -29,17 +39,10 @@ const formatLocation = (obj, properties) => {
return filteredParts.join(', ');
};
const locationProperties = [
'postcode',
(obj) =>
obj.city
? `${obj.city}${obj.province?.name ? `(${obj.province.name})` : ''}`
: null,
(obj) => obj.country?.name,
];
const modelValue = ref(
props.location ? formatLocation(props.location, locationProperties) : null
);
function showLabel(data) {
const dataProperties = [
'code',

View File

@ -406,6 +406,7 @@ watch(
:skeleton="false"
auto-load
@on-fetch="setLogTree"
search-url="logs"
>
<template #body>
<div

View File

@ -18,6 +18,7 @@ const contactChannels = ref([]);
const title = ref();
const handleSalesModelValue = (val) => ({
or: [
{ id: val },
{ name: val },
{ nickname: { like: '%' + val + '%' } },
{ code: { like: `${val}%` } },

View File

@ -93,6 +93,7 @@ function handleLocation(data, location) {
<VnRow>
<VnLocation
:rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:location="data"
@update:model-value="(location) => handleLocation(data, location)"

View File

@ -13,6 +13,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
import VnRow from 'src/components/ui/VnRow.vue';
const route = useRoute();
const { t } = useI18n();
const grafanaUrl = 'https://grafana.verdnatura.es';
const $props = defineProps({
id: {

View File

@ -429,10 +429,9 @@ function handleLocation(data, location) {
:params="{
departmentCodes: ['VT', 'shopping'],
}"
option-label="nickname"
option-value="id"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
:use-like="false"
emit-value
auto-load
>

View File

@ -3,7 +3,6 @@ import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import { toCurrency, toDate, dateRange } from 'filters/index';
import CustomerNotificationsFilter from './CustomerDefaulterFilter.vue';
import CustomerBalanceDueTotal from './CustomerBalanceDueTotal.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
@ -11,7 +10,6 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInput from 'src/components/common/VnInput.vue';
import CustomerDefaulterAddObservation from './CustomerDefaulterAddObservation.vue';
import DepartmentDescriptorProxy from 'src/pages/Department/Card/DepartmentDescriptorProxy.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnTable from 'src/components/VnTable/VnTable.vue';
const { t } = useI18n();
@ -192,11 +190,6 @@ function exprBuilder(param, value) {
</script>
<template>
<RightMenu>
<template #right-panel>
<CustomerNotificationsFilter data-key="CustomerDefaulter" />
</template>
</RightMenu>
<VnSubToolbar>
<template #st-data>
<CustomerBalanceDueTotal :amount="balanceDueTotal" />

View File

@ -84,6 +84,7 @@ function handleLocation(data, location) {
<VnRow>
<VnLocation
:rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:location="
data.postalCode

View File

@ -52,7 +52,22 @@ function handleLocation(data, location) {
:url-update="`Suppliers/${route.params.id}/updateFiscalData`"
model="supplier"
:filter="{
fields: ['id', 'name', 'city', 'postCode', 'countryFk', 'provinceFk'],
fields: [
'id',
'nif',
'city',
'name',
'account',
'postCode',
'countryFk',
'provinceFk',
'sageTaxTypeFk',
'sageWithholdingFk',
'sageTransactionTypeFk',
'supplierActivityFk',
'healthRegister',
'street',
],
include: [
{
relation: 'province',
@ -146,6 +161,7 @@ function handleLocation(data, location) {
<VnRow>
<VnLocation
:rules="validate('Worker.postcode')"
:roles-allowed-to-create="['deliveryAssistant', 'administrative']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:location="{
postcode: data.postCode,

View File

@ -1,7 +1,7 @@
<script setup>
import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue';
import { onMounted, ref, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
@ -12,6 +12,8 @@ import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescripto
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { getUrl } from 'src/composables/getUrl';
import useNotify from 'src/composables/useNotify.js';
import { useArrayData } from 'composables/useArrayData';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
@ -19,8 +21,7 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const route = useRoute();
const router = useRouter();
const { notify } = useNotify();
const { t } = useI18n();
const $props = defineProps({
@ -38,6 +39,8 @@ const ticket = computed(() => summaryRef.value?.entity);
const editableStates = ref([]);
const ticketUrl = ref();
const grafanaUrl = 'https://grafana.verdnatura.es';
const stateBtnDropdownRef = ref();
const descriptorData = useArrayData('ticketData');
onMounted(async () => {
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
@ -64,15 +67,19 @@ function isEditable() {
}
async function changeState(value) {
if (!ticket.value.id) return;
const formData = {
ticketFk: ticket.value.id,
code: value,
};
await axios.post(`Tickets/state`, formData);
router.go(route.fullPath);
try {
stateBtnDropdownRef.value.hide();
const formData = {
ticketFk: entityId.value,
code: value,
};
await axios.post(`Tickets/state`, formData);
notify('globals.dataSaved', 'positive');
summaryRef.value?.fetch();
descriptorData.fetch({});
} catch (err) {
console.error('Error changing ticket state', err);
}
}
function getNoteValue(description) {
@ -125,6 +132,7 @@ function toTicketUrl(section) {
</template>
<template #header-right>
<QBtnDropdown
ref="stateBtnDropdownRef"
color="black"
text-color="white"
:label="t('ticket.summary.changeState')"
@ -137,7 +145,7 @@ function toTicketUrl(section) {
option-value="code"
hide-dropdown-icon
focus-on-mount
@update:model-value="changeState(item.code)"
@update:model-value="changeState"
/>
</QBtnDropdown>
</template>

View File

@ -214,6 +214,7 @@ async function autofillBic(worker) {
<VnInput v-model="data.name" :label="t('worker.create.webUser')" />
<VnInput
v-model="data.email"
type="email"
:label="t('worker.create.personalEmail')"
/>
</VnRow>
@ -262,6 +263,7 @@ async function autofillBic(worker) {
</VnRow>
<VnRow>
<VnLocation
:roles-allowed-to-create="['deliveryAssistant']"
:acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]"
:options="postcodesOptions"
@update:model-value="(location) => handleLocation(data, location)"

View File

@ -59,7 +59,7 @@ export default {
component: () => import('src/pages/Entry/EntryLatestBuys.vue'),
},
{
path: 'stock-bought',
path: 'stock-Bought',
name: 'EntryStockBought',
meta: {
title: 'reserves',