fix: changes in sale and summary
This commit is contained in:
parent
bd3de77cbd
commit
afc52f6cea
|
@ -3,7 +3,7 @@ import axios from 'axios';
|
||||||
import { ref, toRefs } from 'vue';
|
import { ref, toRefs } from 'vue';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { usePrintService } from 'composables/usePrintService';
|
import { usePrintService } from 'composables/usePrintService';
|
||||||
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
import SendEmailDialog from 'components/common/SendEmailDialog.vue';
|
||||||
import VnConfirm from 'components/ui/VnConfirm.vue';
|
import VnConfirm from 'components/ui/VnConfirm.vue';
|
||||||
|
@ -23,6 +23,7 @@ const props = defineProps({
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const { push, currentRoute } = useRouter();
|
const { push, currentRoute } = useRouter();
|
||||||
const { dialog, notify } = useQuasar();
|
const { dialog, notify } = useQuasar();
|
||||||
|
@ -334,7 +335,11 @@ async function handleInvoiceOutData() {
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
:url="`Tickets/${ticketId}/isEditable`"
|
:url="
|
||||||
|
route.path.startsWith('/ticket')
|
||||||
|
? `Tickets/${ticketId}/isEditable`
|
||||||
|
: `Tickets/${ticket}/isEditable`
|
||||||
|
"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="handleFetchData"
|
@on-fetch="handleFetchData"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -13,12 +13,21 @@ const $props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
usesMana: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
manaCode: {
|
||||||
|
type: String,
|
||||||
|
default: 'mana',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['save', 'cancel']);
|
const emit = defineEmits(['save', 'cancel']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const QPopupProxyRef = ref(null);
|
const QPopupProxyRef = ref(null);
|
||||||
|
const manaCode = ref($props.manaCode);
|
||||||
|
|
||||||
const save = () => {
|
const save = () => {
|
||||||
emit('save');
|
emit('save');
|
||||||
|
@ -47,6 +56,23 @@ const cancel = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
|
<QRadio
|
||||||
|
v-model="manaCode"
|
||||||
|
dense
|
||||||
|
val="mana"
|
||||||
|
:label="t('Promotion mana')"
|
||||||
|
:dark="true"
|
||||||
|
/>
|
||||||
|
<QRadio
|
||||||
|
v-model="manaCode"
|
||||||
|
dense
|
||||||
|
val="manaClaim"
|
||||||
|
:label="t('Claim mana')"
|
||||||
|
:dark="true"
|
||||||
|
class="q-mb-sm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -761,6 +761,8 @@ watch(
|
||||||
<TicketEditManaProxy
|
<TicketEditManaProxy
|
||||||
:mana="mana"
|
:mana="mana"
|
||||||
:new-price="getNewPrice"
|
:new-price="getNewPrice"
|
||||||
|
:uses-mana="usesMana"
|
||||||
|
:mana-code="manaCode"
|
||||||
@save="changeDiscount(row)"
|
@save="changeDiscount(row)"
|
||||||
>
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
@ -768,6 +770,23 @@ watch(
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
/>
|
/>
|
||||||
|
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
|
||||||
|
<QRadio
|
||||||
|
v-model="edit.manaCode"
|
||||||
|
dense
|
||||||
|
val="mana"
|
||||||
|
:label="t('Promotion mana')"
|
||||||
|
:dark="true"
|
||||||
|
/>
|
||||||
|
<QRadio
|
||||||
|
v-model="edit.manaCode"
|
||||||
|
dense
|
||||||
|
val="manaClaim"
|
||||||
|
:label="t('Claim mana')"
|
||||||
|
:dark="true"
|
||||||
|
class="q-mb-sm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</TicketEditManaProxy>
|
</TicketEditManaProxy>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
<span v-else>{{ toPercentage(row.discount / 100) }}</span>
|
||||||
|
|
|
@ -19,6 +19,7 @@ import VnTitle from 'src/components/common/VnTitle.vue';
|
||||||
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
|
||||||
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
|
import TicketDescriptorMenu from './TicketDescriptorMenu.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -68,7 +69,7 @@ function isEditable() {
|
||||||
|
|
||||||
async function changeState(value) {
|
async function changeState(value) {
|
||||||
try {
|
try {
|
||||||
stateBtnDropdownRef.value.hide();
|
stateBtnDropdownRef.value?.hide();
|
||||||
const formData = {
|
const formData = {
|
||||||
ticketFk: entityId.value,
|
ticketFk: entityId.value,
|
||||||
code: value,
|
code: value,
|
||||||
|
@ -108,6 +109,10 @@ function getNoteValue(description) {
|
||||||
function toTicketUrl(section) {
|
function toTicketUrl(section) {
|
||||||
return '#/ticket/' + entityId.value + '/' + section;
|
return '#/ticket/' + entityId.value + '/' + section;
|
||||||
}
|
}
|
||||||
|
function isOnTicketCard() {
|
||||||
|
const currentPath = route.path;
|
||||||
|
return currentPath.startsWith('/ticket');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -122,6 +127,16 @@ function toTicketUrl(section) {
|
||||||
:url="`Tickets/${entityId}/summary`"
|
:url="`Tickets/${entityId}/summary`"
|
||||||
data-key="TicketSummary"
|
data-key="TicketSummary"
|
||||||
>
|
>
|
||||||
|
<template #header-left>
|
||||||
|
<router-link
|
||||||
|
v-if="route?.name !== 'TicketSummary'"
|
||||||
|
:to="{ name: 'TicketSummary', params: { id: entityId } }"
|
||||||
|
class="header link"
|
||||||
|
:href="entryUrl"
|
||||||
|
>
|
||||||
|
<QIcon name="open_in_new" color="white" size="sm" />
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
<template #header="{ entity }">
|
<template #header="{ entity }">
|
||||||
<div>
|
<div>
|
||||||
Ticket #{{ entity.id }} - {{ entity.client?.name }} ({{
|
Ticket #{{ entity.id }} - {{ entity.client?.name }} ({{
|
||||||
|
@ -131,6 +146,7 @@ function toTicketUrl(section) {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #header-right>
|
<template #header-right>
|
||||||
|
<div class="flex items-end">
|
||||||
<QBtnDropdown
|
<QBtnDropdown
|
||||||
ref="stateBtnDropdownRef"
|
ref="stateBtnDropdownRef"
|
||||||
color="black"
|
color="black"
|
||||||
|
@ -148,6 +164,25 @@ function toTicketUrl(section) {
|
||||||
@update:model-value="changeState"
|
@update:model-value="changeState"
|
||||||
/>
|
/>
|
||||||
</QBtnDropdown>
|
</QBtnDropdown>
|
||||||
|
<QBtn
|
||||||
|
v-if="!isOnTicketCard()"
|
||||||
|
icon="more_vert"
|
||||||
|
round
|
||||||
|
size="md"
|
||||||
|
flat
|
||||||
|
color="white"
|
||||||
|
>
|
||||||
|
<QMenu>
|
||||||
|
<QList>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<TicketDescriptorMenu :ticket="entityId" />
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</QList>
|
||||||
|
</QMenu>
|
||||||
|
</QBtn>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ entity }">
|
<template #body="{ entity }">
|
||||||
<QCard class="vn-one">
|
<QCard class="vn-one">
|
||||||
|
|
|
@ -20,18 +20,16 @@ const provinces = ref([]);
|
||||||
const states = ref([]);
|
const states = ref([]);
|
||||||
const agencies = ref([]);
|
const agencies = ref([]);
|
||||||
const warehouses = ref([]);
|
const warehouses = ref([]);
|
||||||
const alertLevels = ref([]);
|
|
||||||
const groupedStates = ref([]);
|
const groupedStates = ref([]);
|
||||||
|
|
||||||
const getGroupedStates = () => {
|
const getGroupedStates = (data) => {
|
||||||
for (const state of alertLevels.value) {
|
for (const state of data) {
|
||||||
groupedStates.value.push({
|
groupedStates.value.push({
|
||||||
id: state.id,
|
id: state.id,
|
||||||
name: t(`${state.code}`),
|
name: t(`${state.code}`),
|
||||||
code: state.code,
|
code: state.code,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(groupedStates.value);
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -42,7 +40,7 @@ const getGroupedStates = () => {
|
||||||
url="AlertLevels"
|
url="AlertLevels"
|
||||||
@on-fetch="
|
@on-fetch="
|
||||||
(data) => {
|
(data) => {
|
||||||
(alertLevels = data), getGroupedStates();
|
getGroupedStates(data);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
auto-load
|
auto-load
|
||||||
|
@ -130,10 +128,10 @@ const getGroupedStates = () => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection v-if="!alertLevels">
|
<QItemSection v-if="!groupedStates">
|
||||||
<QSkeleton type="QInput" class="full-width" />
|
<QSkeleton type="QInput" class="full-width" />
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="alertLevels">
|
<QItemSection v-if="groupedStates">
|
||||||
<QSelect
|
<QSelect
|
||||||
:label="t('Grouped state')"
|
:label="t('Grouped state')"
|
||||||
v-model="params.groupedStates"
|
v-model="params.groupedStates"
|
||||||
|
|
Loading…
Reference in New Issue