Merge branch 'dev' into 7088-testFetchedTags
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
09cc12667c
|
@ -314,7 +314,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
|||
show-if-above
|
||||
>
|
||||
<QScrollArea class="fit">
|
||||
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" />
|
||||
<VnTableFilter :data-key="$attrs['data-key']" :columns="columns" :redirect="redirect" />
|
||||
</QScrollArea>
|
||||
</QDrawer>
|
||||
<CrudModel
|
||||
|
|
|
@ -11,9 +11,9 @@ function getBadgeAttrs(date) {
|
|||
|
||||
let timeDiff = today - timeTicket;
|
||||
|
||||
if (timeDiff == 0) return { color: 'warning', 'text-color': 'black' };
|
||||
if (timeDiff < 0) return { color: 'success', 'text-color': 'black' };
|
||||
return { color: 'transparent', 'text-color': 'white' };
|
||||
if (timeDiff == 0) return { color: 'warning', class: 'black-text-color' };
|
||||
if (timeDiff < 0) return { color: 'success', class: 'black-text-color' };
|
||||
return { color: 'transparent', class: 'normal-text-color' };
|
||||
}
|
||||
|
||||
function formatShippedDate(date) {
|
||||
|
@ -29,3 +29,11 @@ function formatShippedDate(date) {
|
|||
{{ formatShippedDate(date) }}
|
||||
</QBadge>
|
||||
</template>
|
||||
<style lang="scss">
|
||||
.black-text-color {
|
||||
color: var(--vn-black-text-color);
|
||||
}
|
||||
.normal-text-color {
|
||||
color: var(--vn-text-color);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,11 +4,12 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue';
|
|||
import VnTableFilter from '../VnTable/VnTableFilter.vue';
|
||||
import { onBeforeMount, computed } from 'vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const $props = defineProps({
|
||||
section: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: null,
|
||||
},
|
||||
dataKey: {
|
||||
type: String,
|
||||
|
@ -40,8 +41,17 @@ const $props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
||||
const route = useRoute();
|
||||
let arrayData;
|
||||
const sectionValue = computed(() => $props.section ?? $props.dataKey);
|
||||
const isMainSection = computed(() => {
|
||||
const isSame = sectionValue.value == route.name;
|
||||
if (!isSame && arrayData) {
|
||||
arrayData.reset(['userParams', 'userFilter']);
|
||||
}
|
||||
return isSame;
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
if ($props.dataKey)
|
||||
arrayData = useArrayData($props.dataKey, {
|
||||
|
@ -74,6 +84,6 @@ onBeforeMount(() => {
|
|||
</slot>
|
||||
</template>
|
||||
</RightMenu>
|
||||
<slot name="body" v-if="sectionValue == $route.name" />
|
||||
<slot name="body" v-if="isMainSection" />
|
||||
<RouterView v-else />
|
||||
</template>
|
||||
|
|
|
@ -126,6 +126,7 @@ async function search() {
|
|||
delete filter.params.search;
|
||||
}
|
||||
await arrayData.applyFilter(filter);
|
||||
searchText.value = undefined;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
@ -3,20 +3,21 @@
|
|||
@import '@quasar/quasar-ui-qcalendar/src/QCalendarMonth.sass';
|
||||
|
||||
body.body--light {
|
||||
--font-color: black;
|
||||
--vn-header-color: #cecece;
|
||||
--vn-page-color: #ffffff;
|
||||
--vn-section-color: #e0e0e0;
|
||||
--vn-section-hover-color: #b9b9b9;
|
||||
--vn-text-color: var(--font-color);
|
||||
--vn-text-color: black;
|
||||
--vn-label-color: #5f5f5f;
|
||||
--vn-accent-color: #e7e3e3;
|
||||
--vn-empty-tag: #acacac;
|
||||
--vn-black-text-color: black;
|
||||
--vn-text-color-contrast: white;
|
||||
|
||||
background-color: var(--vn-page-color);
|
||||
|
||||
.q-header .q-toolbar {
|
||||
color: var(--font-color);
|
||||
color: var(--vn-text-color);
|
||||
}
|
||||
}
|
||||
body.body--dark {
|
||||
|
@ -28,6 +29,8 @@ body.body--dark {
|
|||
--vn-label-color: #a8a8a8;
|
||||
--vn-accent-color: #424242;
|
||||
--vn-empty-tag: #2d2d2d;
|
||||
--vn-black-text-color: black;
|
||||
--vn-text-color-contrast: black;
|
||||
|
||||
background-color: var(--vn-page-color);
|
||||
}
|
||||
|
@ -86,6 +89,10 @@ select:-webkit-autofill {
|
|||
background-color: var(--vn-section-hover-color);
|
||||
}
|
||||
|
||||
.bg-vn-page {
|
||||
background-color: var(--vn-page-color);
|
||||
}
|
||||
|
||||
.color-vn-label {
|
||||
color: var(--vn-label-color);
|
||||
}
|
||||
|
@ -189,7 +196,7 @@ select:-webkit-autofill {
|
|||
|
||||
.q-tooltip {
|
||||
background-color: var(--vn-page-color);
|
||||
color: var(--font-color);
|
||||
color: var(--vn-text-color);
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,9 +63,10 @@ const columns = computed(() => [
|
|||
<template>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<VnTable
|
||||
data-key="Mandates"
|
||||
url="Mandates"
|
||||
:filter="filter"
|
||||
auto-load
|
||||
url="Mandates"
|
||||
:columns="columns"
|
||||
class="full-width q-mt-md"
|
||||
:right-search="false"
|
||||
|
|
|
@ -233,7 +233,7 @@ async function updateWarehouse(warehouseFk) {
|
|||
</div>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QPage class="column items-center">
|
||||
<QTable
|
||||
:rows="itemBalances"
|
||||
:columns="columns"
|
||||
|
|
|
@ -10,21 +10,12 @@ import { dashIfEmpty } from 'src/filters';
|
|||
import { toCurrency } from 'filters/index';
|
||||
import { useArrayData } from 'composables/useArrayData';
|
||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||
import axios from 'axios';
|
||||
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const from = ref();
|
||||
const to = ref();
|
||||
const hideInventory = ref(true);
|
||||
const inventorySupplierFk = ref();
|
||||
|
||||
async function getInventorySupplier() {
|
||||
inventorySupplierFk.value = (
|
||||
await axios.get(`InventoryConfigs`)
|
||||
)?.data[0]?.supplierFk;
|
||||
}
|
||||
|
||||
const exprBuilder = (param, value) => {
|
||||
switch (param) {
|
||||
|
@ -49,10 +40,6 @@ const where = {
|
|||
itemFk: route.params.id,
|
||||
};
|
||||
|
||||
if (hideInventory.value) {
|
||||
where.supplierFk = { neq: inventorySupplierFk };
|
||||
}
|
||||
|
||||
const arrayData = useArrayData('ItemLastEntries', {
|
||||
url: 'Items/lastEntriesFilter',
|
||||
order: ['landed DESC', 'buyFk DESC'],
|
||||
|
@ -110,7 +97,7 @@ const columns = computed(() => [
|
|||
format: (val) => dashIfEmpty(val),
|
||||
},
|
||||
{
|
||||
label: t('shelvings.packing'),
|
||||
label: 'Packing',
|
||||
name: 'packing',
|
||||
field: 'packing',
|
||||
align: 'center',
|
||||
|
@ -182,15 +169,11 @@ const updateFilter = async () => {
|
|||
const userFilter = arrayData.store.userFilter.where;
|
||||
|
||||
userFilter.landed = filter;
|
||||
if (hideInventory.value) userFilter.supplierFk = { neq: inventorySupplierFk };
|
||||
else delete userFilter.supplierFk;
|
||||
|
||||
await fetchItemLastEntries();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await getInventorySupplier();
|
||||
|
||||
const _from = Date.vnNew();
|
||||
_from.setDate(_from.getDate() - 75);
|
||||
from.value = getDate(_from, 'from');
|
||||
|
@ -200,12 +183,16 @@ onMounted(async () => {
|
|||
|
||||
updateFilter();
|
||||
|
||||
watch([from, to, hideInventory], ([nFrom, nTo], [oFrom, oTo]) => {
|
||||
watch([from, to], ([nFrom, nTo], [oFrom, oTo]) => {
|
||||
if (nFrom && nFrom != oFrom) nFrom = getDate(new Date(nFrom), 'from');
|
||||
if (nTo && nTo != oTo) nTo = getDate(new Date(nTo), 'to');
|
||||
updateFilter();
|
||||
});
|
||||
});
|
||||
|
||||
function getBadgeClass(groupingMode, expectedGrouping) {
|
||||
return groupingMode === expectedGrouping ? 'accent-badge' : 'simple-badge';
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<VnSubToolbar>
|
||||
|
@ -224,13 +211,6 @@ onMounted(async () => {
|
|||
class="q-mr-lg"
|
||||
data-cy="to"
|
||||
/>
|
||||
<QCheckbox
|
||||
:label="t('Hide inventory supplier')"
|
||||
v-model="hideInventory"
|
||||
dense
|
||||
class="q-mr-lg"
|
||||
data-cy="hideInventory"
|
||||
/>
|
||||
</template>
|
||||
</VnSubToolbar>
|
||||
<QPage class="column items-center q-pa-xd">
|
||||
|
@ -249,6 +229,11 @@ onMounted(async () => {
|
|||
/>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-warehouse="{ row }">
|
||||
<QTd>
|
||||
<span>{{ row.warehouse }}</span>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-date="{ row }">
|
||||
<QTd class="text-center">
|
||||
<VnDateBadge :date="row.landed" />
|
||||
|
@ -262,32 +247,37 @@ onMounted(async () => {
|
|||
</div>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-pvp="{ value }">
|
||||
<QTd @click.stop class="text-center">
|
||||
<span> {{ value }}</span>
|
||||
<QTooltip> {{ t('lastEntries.grouping') }}/Packing </QTooltip></QTd
|
||||
>
|
||||
</template>
|
||||
<template #body-cell-printedStickers="{ row }">
|
||||
<QTd @click.stop class="text-center">
|
||||
<span style="color: var(--vn-label-color)">
|
||||
{{ row.printedStickers }}</span
|
||||
>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-packing="{ row }">
|
||||
<QTd @click.stop>
|
||||
<QBadge
|
||||
class="center-content"
|
||||
:class="getBadgeClass(row.groupingMode, 'packing')"
|
||||
rounded
|
||||
:color="row.groupingMode == 'packing' ? 'grey-13' : 'black'"
|
||||
>
|
||||
{{ dashIfEmpty(row.packing) }}
|
||||
<QTooltip>{{ t('lastEntries.packing') }}</QTooltip>
|
||||
<QTooltip>Packing</QTooltip>
|
||||
</QBadge>
|
||||
</QTd>
|
||||
</template>
|
||||
<template #body-cell-pvp="{ value }">
|
||||
<QTd @click.stop class="text-center">
|
||||
<span> {{ value }}</span>
|
||||
<QTooltip>
|
||||
{{ t('lastEntries.grouping') }}/{{ t('lastEntries.packing') }}
|
||||
</QTooltip></QTd
|
||||
>
|
||||
</template>
|
||||
<template #body-cell-grouping="{ row }">
|
||||
<QTd @click.stop>
|
||||
<QBadge
|
||||
class="center-content"
|
||||
:class="getBadgeClass(row.groupingMode, 'grouping')"
|
||||
rounded
|
||||
:color="row.groupingMode == 'grouping' ? 'grey-13' : 'black'"
|
||||
>
|
||||
{{ dashIfEmpty(row.grouping) }}
|
||||
<QTooltip>{{ t('lastEntries.grouping') }}</QTooltip>
|
||||
|
@ -315,13 +305,16 @@ onMounted(async () => {
|
|||
</template>
|
||||
<template #body-cell-supplier="{ row }">
|
||||
<QTd @click.stop>
|
||||
<div class="full-width flex justify-center">
|
||||
<SupplierDescriptorProxy
|
||||
:id="row.supplierFk"
|
||||
class="q-ma-none"
|
||||
<div class="full-width flex justify-left">
|
||||
<QBadge
|
||||
:class="
|
||||
row.isInventorySupplier ? 'bg-vn-page' : 'transparent'
|
||||
"
|
||||
dense
|
||||
/>
|
||||
>
|
||||
<SupplierDescriptorProxy :id="row.supplierFk" />
|
||||
<span class="link">{{ row.supplier }}</span>
|
||||
</QBadge>
|
||||
</div>
|
||||
</QTd>
|
||||
</template>
|
||||
|
@ -349,4 +342,13 @@ onMounted(async () => {
|
|||
background-color: red;
|
||||
}
|
||||
}
|
||||
.accent-badge {
|
||||
background-color: var(--vn-label-color);
|
||||
color: var(--vn-text-color-contrast);
|
||||
}
|
||||
.simple-badge {
|
||||
background-color: transparent;
|
||||
color: var(--vn-text-color);
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -53,7 +53,6 @@ const columns = computed(() => [
|
|||
name: 'itemFk',
|
||||
...defaultColumnAttrs,
|
||||
isId: true,
|
||||
cardVisible: true,
|
||||
columnField: {
|
||||
component: 'input',
|
||||
type: 'number',
|
||||
|
@ -65,14 +64,12 @@ const columns = computed(() => [
|
|||
name: 'name',
|
||||
...defaultColumnAttrs,
|
||||
create: true,
|
||||
cardVisible: true,
|
||||
},
|
||||
{
|
||||
label: t('item.fixedPrice.groupingPrice'),
|
||||
field: 'rate2',
|
||||
name: 'rate2',
|
||||
...defaultColumnAttrs,
|
||||
cardVisible: true,
|
||||
component: 'input',
|
||||
type: 'number',
|
||||
},
|
||||
|
@ -81,7 +78,6 @@ const columns = computed(() => [
|
|||
field: 'rate3',
|
||||
name: 'rate3',
|
||||
...defaultColumnAttrs,
|
||||
cardVisible: true,
|
||||
component: 'input',
|
||||
type: 'number',
|
||||
},
|
||||
|
@ -91,7 +87,6 @@ const columns = computed(() => [
|
|||
field: 'minPrice',
|
||||
name: 'minPrice',
|
||||
...defaultColumnAttrs,
|
||||
cardVisible: true,
|
||||
component: 'input',
|
||||
type: 'number',
|
||||
},
|
||||
|
@ -100,7 +95,6 @@ const columns = computed(() => [
|
|||
field: 'started',
|
||||
name: 'started',
|
||||
format: ({ started }) => toDate(started),
|
||||
cardVisible: true,
|
||||
...defaultColumnAttrs,
|
||||
columnField: {
|
||||
component: 'date',
|
||||
|
@ -116,7 +110,6 @@ const columns = computed(() => [
|
|||
field: 'ended',
|
||||
name: 'ended',
|
||||
...defaultColumnAttrs,
|
||||
cardVisible: true,
|
||||
columnField: {
|
||||
component: 'date',
|
||||
class: 'shrink',
|
||||
|
@ -251,11 +244,14 @@ const upsertPrice = async (props, resetMinPrice = false) => {
|
|||
}
|
||||
if (!changes.updates && !changes.creates) return;
|
||||
const data = await upsertFixedPrice(row);
|
||||
tableRef.value.CrudModelRef.formData[props.rowIndex] = data;
|
||||
Object.assign(tableRef.value.CrudModelRef.formData[props.rowIndex], data);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
tableRef.value.reload();
|
||||
};
|
||||
|
||||
async function upsertFixedPrice(row) {
|
||||
const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row);
|
||||
data.hasMinPrice = data.hasMinPrice ? 1 : 0;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -395,18 +391,11 @@ function handleOnDataSave({ CrudModelRef }) {
|
|||
</template>
|
||||
</VnSubToolbar>
|
||||
<VnTable
|
||||
@on-fetch="
|
||||
(data) =>
|
||||
data.forEach((item) => {
|
||||
item.hasMinPrice = `${item.hasMinPrice !== 0}`;
|
||||
})
|
||||
"
|
||||
:default-remove="false"
|
||||
:default-reset="false"
|
||||
:default-save="false"
|
||||
data-key="ItemFixedPrices"
|
||||
url="FixedPrices/filter"
|
||||
:order="['itemFk DESC', 'name DESC']"
|
||||
save-url="FixedPrices/crud"
|
||||
ref="tableRef"
|
||||
dense
|
||||
|
@ -498,14 +487,15 @@ function handleOnDataSave({ CrudModelRef }) {
|
|||
<QCheckbox
|
||||
:model-value="props.row.hasMinPrice"
|
||||
@update:model-value="updateMinPrice($event, props)"
|
||||
:false-value="'false'"
|
||||
:true-value="'true'"
|
||||
:false-value="0"
|
||||
:true-value="1"
|
||||
:toggle-indeterminate="false"
|
||||
/>
|
||||
<VnInput
|
||||
class="col"
|
||||
type="currency"
|
||||
mask="###.##"
|
||||
:disable="props.row.hasMinPrice === 1"
|
||||
:disable="props.row.hasMinPrice === 0"
|
||||
v-model.number="props.row.minPrice"
|
||||
v-on="getRowUpdateInputEvents(props)"
|
||||
>
|
||||
|
|
|
@ -221,7 +221,7 @@ async function handleConfirm() {
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<FetchedTags :item="props.row.item" />
|
||||
<FetchedTags :item="props.row.item" :columns="3" />
|
||||
</QTd>
|
||||
<QTd key="quantity" :props="props">
|
||||
{{ props.row.quantity }}
|
||||
|
|
|
@ -59,7 +59,7 @@ const arrayData = useArrayData('ZoneEvents');
|
|||
const exclusionGeoCreate = async () => {
|
||||
const params = {
|
||||
zoneFk: parseInt(route.params.id),
|
||||
date: dated.value,
|
||||
date: dated,
|
||||
geoIds: tickedNodes.value,
|
||||
};
|
||||
await axios.post('Zones/exclusionGeo', params);
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
describe('ItemLastEntries', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1280, 720);
|
||||
cy.login('buyer');
|
||||
cy.visit('/#/item/1/last-entries');
|
||||
cy.intercept('GET', /.*lastEntriesFilter/).as('item');
|
||||
cy.waitForElement('tbody');
|
||||
});
|
||||
|
||||
it('should filter by agency', () => {
|
||||
cy.get('tbody > tr')
|
||||
.its('length')
|
||||
.then((rowCount) => {
|
||||
cy.get('[data-cy="hideInventory"]').click();
|
||||
cy.wait('@item');
|
||||
cy.waitForElement('tbody');
|
||||
cy.get('tbody > tr').should('have.length.greaterThan', rowCount);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue