diff --git a/src/pages/Department/Card/DepartmentDescriptor.vue b/src/pages/Department/Card/DepartmentDescriptor.vue
index e08495faf..b219ccfe1 100644
--- a/src/pages/Department/Card/DepartmentDescriptor.vue
+++ b/src/pages/Department/Card/DepartmentDescriptor.vue
@@ -106,7 +106,7 @@ const { openConfirmationModal } = useVnConfirm();
:to="{
name: 'WorkerList',
query: {
- params: JSON.stringify({ departmentFk: entityId }),
+ table: JSON.stringify({ departmentFk: entityId }),
},
}"
>
diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue
index 96a003a09..c2f2c19a0 100644
--- a/src/pages/Item/Card/ItemDiary.vue
+++ b/src/pages/Item/Card/ItemDiary.vue
@@ -1,7 +1,7 @@
- (itemBalances = data)"
- />
fetchItemBalances() && updateWarehouse(value)
+ (val) => fetchItemBalances() && updateWarehouse(val)
"
class="q-mr-lg"
+ :is-clearable="false"
/>
{
+ if (!val) where.date = null;
+ else where.date = inventoriedDate;
+ await fetchItemBalances();
+ }
+ "
class="q-mr-lg"
/>
diff --git a/src/pages/Item/Card/ItemLastEntries.vue b/src/pages/Item/Card/ItemLastEntries.vue
index c2df553c3..7d8890c2b 100644
--- a/src/pages/Item/Card/ItemLastEntries.vue
+++ b/src/pages/Item/Card/ItemLastEntries.vue
@@ -36,18 +36,7 @@ const exprBuilder = (param, value) => {
}
};
-const where = {
- itemFk: route.params.id,
-};
-
-const arrayData = useArrayData('ItemLastEntries', {
- url: 'Items/lastEntriesFilter',
- order: ['landed DESC', 'buyFk DESC'],
- exprBuilder: exprBuilder,
- userFilter: {
- where: where,
- },
-});
+let arrayData = useArrayData('ItemLastEntries');
const itemLastEntries = ref([]);
const columns = computed(() => [
@@ -161,25 +150,51 @@ const getDate = (date, type) => {
};
const updateFilter = async () => {
- let filter;
- if (!from.value && to.value) filter = { lte: to.value };
- else if (from.value && !to.value) filter = { gte: from.value };
- else if (from.value && to.value) filter = { between: [from.value, to.value] };
-
- const userFilter = arrayData.store.userFilter.where;
-
- userFilter.landed = filter;
+ let landed;
+ if (!from.value && to.value) landed = { lte: to.value };
+ else if (from.value && !to.value) landed = { gte: from.value };
+ else if (from.value && to.value) landed = { between: [from.value, to.value] };
+ arrayData.store.filter.where.landed = landed;
await fetchItemLastEntries();
};
onMounted(async () => {
- const _from = Date.vnNew();
- _from.setDate(_from.getDate() - 75);
- from.value = getDate(_from, 'from');
- const _to = Date.vnNew();
- _to.setDate(_to.getDate() + 10);
- to.value = getDate(_to, 'to');
+ const landed = arrayData.store.filter.where?.landed;
+ arrayData = useArrayData('ItemLastEntries', {
+ url: 'Items/lastEntriesFilter',
+ order: ['landed DESC', 'buyFk DESC'],
+ exprBuilder: exprBuilder,
+ filter: {
+ where: {
+ itemFk: route.params.id,
+ landed,
+ },
+ },
+ });
+
+ if (landed) {
+ const key = Object.keys(landed)[0];
+ switch (key) {
+ case 'gte':
+ from.value = landed.gte;
+ break;
+ case 'lte':
+ to.value = landed.lte;
+ break;
+ case 'between':
+ from.value = landed.between[0];
+ to.value = landed.between[1];
+ break;
+ }
+ } else {
+ const _from = Date.vnNew();
+ _from.setDate(_from.getDate() - 75);
+ from.value = getDate(_from, 'from');
+ const _to = Date.vnNew();
+ _to.setDate(_to.getDate() + 10);
+ to.value = getDate(_to, 'to');
+ }
updateFilter();