forked from verdnatura/salix-front
Merge branch 'dev' into 7671_dense_itemFixedPrices
This commit is contained in:
commit
f038f0a60f
|
@ -152,7 +152,7 @@ function splitColumns(columns) {
|
|||
columns: [],
|
||||
chips: [],
|
||||
create: [],
|
||||
visible: [],
|
||||
cardVisible: [],
|
||||
};
|
||||
|
||||
for (const col of columns) {
|
||||
|
@ -160,7 +160,7 @@ function splitColumns(columns) {
|
|||
if (col.chip) splittedColumns.value.chips.push(col);
|
||||
if (col.isTitle) splittedColumns.value.title = col;
|
||||
if (col.create) splittedColumns.value.create.push(col);
|
||||
if (col.cardVisible) splittedColumns.value.visible.push(col);
|
||||
if (col.cardVisible) splittedColumns.value.cardVisible.push(col);
|
||||
if ($props.isEditable && col.disable == null) col.disable = false;
|
||||
if ($props.useModel) col.columnFilter = { ...col.columnFilter, inWhere: true };
|
||||
splittedColumns.value.columns.push(col);
|
||||
|
@ -311,7 +311,11 @@ defineExpose({
|
|||
/>
|
||||
</template>
|
||||
<template #header-cell="{ col }">
|
||||
<QTh v-if="col.visible" auto-width style="min-width: 100px">
|
||||
<QTh
|
||||
v-if="col.visible ?? true"
|
||||
auto-width
|
||||
style="min-width: 100px"
|
||||
>
|
||||
<div
|
||||
class="q-pt-sm q-px-sm ellipsis"
|
||||
:class="`text-${col?.align ?? 'left'}`"
|
||||
|
@ -354,7 +358,7 @@ defineExpose({
|
|||
auto-width
|
||||
class="no-margin q-px-xs"
|
||||
:class="getColAlign(col)"
|
||||
v-if="col.visible"
|
||||
v-if="col.visible ?? true"
|
||||
>
|
||||
<slot :name="`column-${col.name}`" :col="col" :row="row">
|
||||
<VnTableColumn
|
||||
|
@ -443,7 +447,7 @@ defineExpose({
|
|||
:class="$props.cardClass"
|
||||
>
|
||||
<div
|
||||
v-for="col of splittedColumns.visible"
|
||||
v-for="col of splittedColumns.cardVisible"
|
||||
:key="col.name"
|
||||
class="fields"
|
||||
>
|
||||
|
|
|
@ -21,9 +21,6 @@ const quasar = useQuasar();
|
|||
const componentKey = ref(0);
|
||||
const tableLinesRef = ref();
|
||||
const order = ref();
|
||||
const refresh = () => {
|
||||
componentKey.value += 1;
|
||||
};
|
||||
const orderSummary = ref({
|
||||
total: null,
|
||||
vat: null,
|
||||
|
@ -66,37 +63,6 @@ const lineFilter = ref({
|
|||
where: { orderFk: route.params.id },
|
||||
});
|
||||
|
||||
function confirmRemove(item) {
|
||||
quasar.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('confirmDeletion'),
|
||||
message: t('confirmDeletionMessage'),
|
||||
promise: async () => remove(item),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function remove(item) {
|
||||
await axios.post('OrderRows/removes', {
|
||||
actualOrderId: route.params.id,
|
||||
rows: [item.id],
|
||||
});
|
||||
quasar.notify({
|
||||
message: t('globals.dataDeleted'),
|
||||
type: 'positive',
|
||||
});
|
||||
refresh();
|
||||
}
|
||||
|
||||
async function confirmOrder() {
|
||||
await axios.post(`Orders/${route.params.id}/confirm`);
|
||||
quasar.notify({
|
||||
message: t('globals.confirm'),
|
||||
type: 'positive',
|
||||
});
|
||||
}
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
align: 'center',
|
||||
|
@ -121,6 +87,7 @@ const columns = computed(() => [
|
|||
condition: () => true,
|
||||
},
|
||||
isId: true,
|
||||
format: (row) => row?.item?.id,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -196,6 +163,39 @@ const columns = computed(() => [
|
|||
],
|
||||
},
|
||||
]);
|
||||
|
||||
function confirmRemove(item) {
|
||||
quasar.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
title: t('confirmDeletion'),
|
||||
message: t('confirmDeletionMessage'),
|
||||
promise: async () => remove(item),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function remove(item) {
|
||||
console.log('item: ', item);
|
||||
console.log('id: ', route.params.id);
|
||||
await axios.post('OrderRows/removes', {
|
||||
actualOrderId: route.params.id,
|
||||
rows: [item.id],
|
||||
});
|
||||
quasar.notify({
|
||||
message: t('globals.dataDeleted'),
|
||||
type: 'positive',
|
||||
});
|
||||
tableLinesRef.value.reload();
|
||||
}
|
||||
|
||||
async function confirmOrder() {
|
||||
await axios.post(`Orders/${route.params.id}/confirm`);
|
||||
quasar.notify({
|
||||
message: t('globals.confirm'),
|
||||
type: 'positive',
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -71,7 +71,7 @@ watch(
|
|||
const data = ref(useCardDescription());
|
||||
const setData = (entity) => {
|
||||
if (!entity) return;
|
||||
data.value = useCardDescription(entity.user.nickname, entity.id);
|
||||
data.value = useCardDescription(entity.user?.nickname, entity.id);
|
||||
};
|
||||
|
||||
const openChangePasswordForm = () => changePasswordFormDialog.value.show();
|
||||
|
|
Loading…
Reference in New Issue