Merge branch 'master' into hotfix_ticket_shipped
gitea/salix-front/pipeline/pr-master This commit looks good
Details
gitea/salix-front/pipeline/pr-master This commit looks good
Details
This commit is contained in:
commit
26009d809e
|
@ -174,17 +174,21 @@ const getSaleTotal = (sale) => {
|
||||||
return price - discount;
|
return price - discount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getRowUpdateInputEvents = (sale) => ({
|
||||||
|
'keyup.enter': () => {
|
||||||
|
changeQuantity(sale);
|
||||||
|
},
|
||||||
|
blur: () => {
|
||||||
|
changeQuantity(sale);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const resetChanges = async () => {
|
const resetChanges = async () => {
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
};
|
};
|
||||||
const rowToUpdate = ref(null);
|
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
if (
|
if (!sale.itemFk || sale.quantity == null || sale?.originalQuantity === sale.quantity)
|
||||||
!sale.itemFk ||
|
|
||||||
sale.quantity == null ||
|
|
||||||
edit.value?.oldQuantity === sale.quantity
|
|
||||||
)
|
|
||||||
return;
|
return;
|
||||||
if (!sale.id) return addSale(sale);
|
if (!sale.id) return addSale(sale);
|
||||||
|
|
||||||
|
@ -196,11 +200,8 @@ const changeQuantity = async (sale) => {
|
||||||
const updateQuantity = async (sale) => {
|
const updateQuantity = async (sale) => {
|
||||||
try {
|
try {
|
||||||
let { quantity, id } = sale;
|
let { quantity, id } = sale;
|
||||||
if (!rowToUpdate.value) return;
|
|
||||||
rowToUpdate.value = null;
|
|
||||||
sale.isNew = false;
|
sale.isNew = false;
|
||||||
const params = { quantity: quantity };
|
await axios.post(`Sales/${id}/updateQuantity`, { quantity });
|
||||||
await axios.post(`Sales/${id}/updateQuantity`, params);
|
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -816,9 +817,7 @@ watch(
|
||||||
v-if="row.isNew || isTicketEditable"
|
v-if="row.isNew || isTicketEditable"
|
||||||
type="number"
|
type="number"
|
||||||
v-model.number="row.quantity"
|
v-model.number="row.quantity"
|
||||||
@blur="changeQuantity(row)"
|
v-on="getRowUpdateInputEvents(row)"
|
||||||
@keyup.enter.stop="changeQuantity(row)"
|
|
||||||
@update:model-value="() => (rowToUpdate = row)"
|
|
||||||
@focus="edit.oldQuantity = row.quantity"
|
@focus="edit.oldQuantity = row.quantity"
|
||||||
/>
|
/>
|
||||||
<span v-else>{{ row.quantity }}</span>
|
<span v-else>{{ row.quantity }}</span>
|
||||||
|
|
|
@ -50,6 +50,7 @@ const { dialog } = useQuasar();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
const acl = useAcl();
|
const acl = useAcl();
|
||||||
const btnDropdownRef = ref(null);
|
const btnDropdownRef = ref(null);
|
||||||
|
const editManaProxyRef = ref(null);
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
|
||||||
const newDiscount = ref(null);
|
const newDiscount = ref(null);
|
||||||
|
@ -131,13 +132,13 @@ const createClaim = () => {
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Claim out of time'),
|
t('Claim out of time'),
|
||||||
t('Do you want to continue?'),
|
t('Do you want to continue?'),
|
||||||
onCreateClaimAccepted
|
onCreateClaimAccepted,
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
openConfirmationModal(
|
openConfirmationModal(
|
||||||
t('Do you want to create a claim?'),
|
t('Do you want to create a claim?'),
|
||||||
false,
|
false,
|
||||||
onCreateClaimAccepted
|
onCreateClaimAccepted,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -216,8 +217,15 @@ const createRefund = async (withWarehouse) => {
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
<QItemLabel>{{ t('Update discount') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<TicketEditManaProxy :mana="props.mana" @save="changeMultipleDiscount()">
|
<TicketEditManaProxy
|
||||||
|
ref="editManaProxyRef"
|
||||||
|
:sale="row"
|
||||||
|
:mana="props.mana"
|
||||||
|
@save="changeMultipleDiscount"
|
||||||
|
>
|
||||||
<VnInput
|
<VnInput
|
||||||
|
autofocus
|
||||||
|
@keyup.enter.stop="() => editManaProxyRef.save(row)"
|
||||||
v-model.number="newDiscount"
|
v-model.number="newDiscount"
|
||||||
:label="t('ticketSale.discount')"
|
:label="t('ticketSale.discount')"
|
||||||
type="number"
|
type="number"
|
||||||
|
|
|
@ -45,6 +45,15 @@ const descriptorData = useArrayData('ticketData');
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
|
||||||
});
|
});
|
||||||
|
const formattedAddress = computed(() => {
|
||||||
|
if (!ticket.value) return '';
|
||||||
|
|
||||||
|
const address = ticket.value.address;
|
||||||
|
const postcode = address.postalCode;
|
||||||
|
const province = address.province ? `(${address.province.name})` : '';
|
||||||
|
|
||||||
|
return `${address.street} - ${postcode} - ${address.city} ${province}`;
|
||||||
|
});
|
||||||
|
|
||||||
function isEditable() {
|
function isEditable() {
|
||||||
try {
|
try {
|
||||||
|
@ -237,7 +246,7 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('ticket.summary.consigneeStreet')"
|
:label="t('ticket.summary.consigneeStreet')"
|
||||||
:value="entity.address?.street"
|
:value="formattedAddress"
|
||||||
/>
|
/>
|
||||||
</QCard>
|
</QCard>
|
||||||
<QCard class="vn-one" v-if="entity.notes.length">
|
<QCard class="vn-one" v-if="entity.notes.length">
|
||||||
|
|
Loading…
Reference in New Issue