diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue
index 8a91d3c95..340a9e550 100644
--- a/src/components/common/VnLog.vue
+++ b/src/components/common/VnLog.vue
@@ -421,12 +421,13 @@ setLogTree();
>
-
+
diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index 96d097191..eb0bbbe66 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -79,6 +79,7 @@ watch(
const isLoading = ref(false);
async function search() {
+ store.filter.where = {};
isLoading.value = true;
const params = { ...userParams.value };
store.userParamsChanged = true;
diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue
index 4dae312ce..c00849512 100644
--- a/src/components/ui/VnPaginate.vue
+++ b/src/components/ui/VnPaginate.vue
@@ -95,6 +95,8 @@ const addFilter = async (filter, params) => {
};
async function fetch() {
+ store.filter.skip = 0;
+ store.skip = 0;
await arrayData.fetch({ append: false });
if (!store.hasMoreData) {
isLoading.value = false;
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index fc8475ace..344267ef7 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -81,8 +81,10 @@ async function search() {
const staticParams = Object.entries(store.userParams).filter(
([key, value]) => value && (props.staticParams || []).includes(key)
);
+ // const filter =props?.where? { where: JSON.parse(props.where) }: {}
await arrayData.applyFilter({
params: {
+ // filter ,
...Object.fromEntries(staticParams),
search: searchText.value,
},
@@ -106,6 +108,7 @@ async function search() {
let targetUrl;
if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`);
+ if (path.endsWith('-list')) targetUrl = path.replace('-list', `/${targetId}/summary`);
else if (path.includes(':id')) targetUrl = path.replace(':id', targetId);
await router.push({ path: targetUrl });
diff --git a/src/components/ui/VnUserLink.vue b/src/components/ui/VnUserLink.vue
index 47287c12b..33836550a 100644
--- a/src/components/ui/VnUserLink.vue
+++ b/src/components/ui/VnUserLink.vue
@@ -1,6 +1,5 @@
@@ -292,6 +301,14 @@ async function importToNewRefundTicket() {
v-model:selected="selectedRows"
:grid="$q.screen.lt.md"
>
+
+
+
+ {{ value }}
+
+
+
+
@@ -383,6 +400,7 @@ async function importToNewRefundTicket() {
icon="check"
@click="regularizeClaim"
:disable="claim.claimStateFk == resolvedStateId"
+ :loading="loading"
/>
diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue
index c4a7db201..52fbfca98 100644
--- a/src/pages/Claim/Card/ClaimLines.vue
+++ b/src/pages/Claim/Card/ClaimLines.vue
@@ -45,20 +45,25 @@ async function onFetchClaim(data) {
const amount = ref();
const amountClaimed = ref();
-async function onFetch(rows) {
+async function onFetch(rows, newRows) {
+ if (newRows) rows = newRows;
amount.value = 0;
amountClaimed.value = 0;
if (!rows || !rows.length) return;
- amount.value = rows.reduce(
- (accumulator, { sale }) => accumulator + sale.price * sale.quantity,
- 0
- );
+ for (const row of rows) {
+ const { sale } = row;
+ amount.value = amount.value + totalRow(sale);
+ const price = row.quantity * sale.price;
+ const discount = (sale.discount * price) / 100;
+ amountClaimed.value = amountClaimed.value + (price - discount);
+ }
+}
- amountClaimed.value = rows.reduce(
- (accumulator, line) => accumulator + line.sale.price * line.quantity,
- 0
- );
+function totalRow({ price, quantity, discount }) {
+ const amount = price * quantity;
+ const appliedDiscount = (discount * amount) / 100;
+ return amount - appliedDiscount;
}
const columns = computed(() => [
@@ -102,12 +107,7 @@ const columns = computed(() => [
{
name: 'total',
label: t('Total'),
- field: ({ sale }) => {
- const amount = sale.price * sale.quantity;
- const appliedDiscount = (sale.discount * amount) / 100;
-
- return amount - appliedDiscount;
- },
+ field: ({ sale }) => totalRow(sale),
format: (value) => toCurrency(value),
sortable: true,
},
@@ -129,6 +129,7 @@ async function updateDiscount({ saleFk, discount, canceller }) {
await axios.post(query, body, {
signal: canceller.signal,
});
+ await claimLinesForm.value.reload();
}
function onUpdateDiscount(response) {
@@ -151,8 +152,11 @@ function showImportDialog() {
.onOk(() => claimLinesForm.value.reload());
}
-function saveWhenHasChanges() {
- claimLinesForm.value.getChanges().updates && claimLinesForm.value.onSubmit();
+async function saveWhenHasChanges() {
+ if (claimLinesForm.value.getChanges().updates) {
+ await claimLinesForm.value.onSubmit();
+ await claimLinesForm.value.reload();
+ }
}
@@ -188,7 +192,6 @@ function saveWhenHasChanges() {
save-url="ClaimBeginnings/crud"
:filter="linesFilter"
@on-fetch="onFetch"
- @save-changes="onFetch"
v-model:selected="selected"
:default-save="false"
:default-reset="false"
diff --git a/src/pages/Item/ItemTypeCreate.vue b/src/pages/Item/ItemTypeCreate.vue
new file mode 100644
index 000000000..af3dc34ea
--- /dev/null
+++ b/src/pages/Item/ItemTypeCreate.vue
@@ -0,0 +1,91 @@
+
+
+
+ (workersOptions = data)"
+ :filter="{ order: 'firstName ASC', fields: ['id', 'firstName'] }"
+ auto-load
+ />
+ (categoriesOptions = data)"
+ :filter="{ order: 'name ASC', fields: ['id', 'name'] }"
+ auto-load
+ />
+ (temperaturesOptions = data)"
+ :filter="{ order: 'name ASC', fields: ['code', 'name'] }"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue
new file mode 100644
index 000000000..9d826655f
--- /dev/null
+++ b/src/pages/Item/ItemTypeList.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('globals.collapseMenu') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('New item type') }}
+
+
+
+
+
+es:
+ New item type: Nueva familia
+ Name: Nombre
+ Search item type: Buscar familia
+ Search itemType by id, name or code: Buscar familia por id, nombre o código
+
diff --git a/src/pages/ItemType/Card/ItemTypeBasicData.vue b/src/pages/ItemType/Card/ItemTypeBasicData.vue
new file mode 100644
index 000000000..0bdfab951
--- /dev/null
+++ b/src/pages/ItemType/Card/ItemTypeBasicData.vue
@@ -0,0 +1,79 @@
+
+
+ (workersOptions = data)"
+ :filter="{ order: 'firstName ASC', fields: ['id', 'firstName'] }"
+ auto-load
+ />
+ (categoriesOptions = data)"
+ :filter="{ order: 'name ASC', fields: ['id', 'name'] }"
+ auto-load
+ />
+ (temperaturesOptions = data)"
+ :filter="{ order: 'name ASC', fields: ['code', 'name'] }"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/ItemType/Card/ItemTypeCard.vue b/src/pages/ItemType/Card/ItemTypeCard.vue
new file mode 100644
index 000000000..cb8adf7f6
--- /dev/null
+++ b/src/pages/ItemType/Card/ItemTypeCard.vue
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/src/pages/ItemType/Card/ItemTypeDescriptor.vue b/src/pages/ItemType/Card/ItemTypeDescriptor.vue
new file mode 100644
index 000000000..e565a791b
--- /dev/null
+++ b/src/pages/ItemType/Card/ItemTypeDescriptor.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+ {{ t('Go to module index') }}
+
+
+
+
+
+
+
+
+ {{ entity.worker?.firstName }}
+
+
+
+
+
+
+
+
+
+es:
+ Go to module index: Ir al índice del módulo
+
diff --git a/src/pages/ItemType/Card/ItemTypeSummary.vue b/src/pages/ItemType/Card/ItemTypeSummary.vue
new file mode 100644
index 000000000..62d1c74ab
--- /dev/null
+++ b/src/pages/ItemType/Card/ItemTypeSummary.vue
@@ -0,0 +1,109 @@
+
+
+
+ setItemTypeData(data)"
+ class="full-width"
+ >
+
+
+
+
+
+ {{ itemType.id }} - {{ itemType.name }} -
+ {{ itemType.worker?.firstName }}
+ {{ itemType.worker?.lastName }}
+
+
+
+
+
+
+
+
+
+
+ {{ itemType.worker?.firstName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/ItemType/ItemTypeFilter.vue b/src/pages/ItemType/ItemTypeFilter.vue
new file mode 100644
index 000000000..2a86795c2
--- /dev/null
+++ b/src/pages/ItemType/ItemTypeFilter.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+ {{ t(`params.${tag.label}`) }}:
+ {{ formatFn(tag.value) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ params:
+ name: Name
+ code: Code
+es:
+ params:
+ name: Nombre
+ code: Código
+ Name: Nombre
+ Code: Código
+
diff --git a/src/pages/ItemType/locale/en.yml b/src/pages/ItemType/locale/en.yml
new file mode 100644
index 000000000..7889418ea
--- /dev/null
+++ b/src/pages/ItemType/locale/en.yml
@@ -0,0 +1,12 @@
+shared:
+ code: Code
+ name: Name
+ worker: Worker
+ category: Category
+ temperature: Temperature
+summary:
+ id: id
+ life: Life
+ promo: Promo
+ itemPackingType: Item packing type
+ isUnconventionalSize: Is unconventional size
diff --git a/src/pages/ItemType/locale/es.yml b/src/pages/ItemType/locale/es.yml
new file mode 100644
index 000000000..9a94dceb6
--- /dev/null
+++ b/src/pages/ItemType/locale/es.yml
@@ -0,0 +1,17 @@
+shared:
+ code: Código
+ name: Nombre
+ worker: Trabajador
+ category: Reino
+ temperature: Temperatura
+summary:
+ id: id
+ code: Código
+ name: Nombre
+ worker: Trabajador
+ category: Reino
+ temperature: Temperatura
+ life: Vida
+ promo: Promoción
+ itemPackingType: Tipo de embalaje
+ isUnconventionalSize: Es de tamaño poco convencional
diff --git a/src/pages/Shelving/Card/ShelvingSummary.vue b/src/pages/Shelving/Card/ShelvingSummary.vue
index 49470719e..649799b00 100644
--- a/src/pages/Shelving/Card/ShelvingSummary.vue
+++ b/src/pages/Shelving/Card/ShelvingSummary.vue
@@ -20,14 +20,14 @@ const router = useRouter();
const { t } = useI18n();
const entityId = computed(() => $props.id || route.params.id);
-const isDialog = Boolean($props.id);
-const hideRightDrawer = () => {
- if (!isDialog) {
- stateStore.rightDrawer = false;
- }
-};
-onMounted(hideRightDrawer);
-onUnmounted(hideRightDrawer);
+const isDialog = false;
+// const hideRightDrawer = () => {
+// if (!isDialog) {
+// stateStore.rightDrawer = false;
+// }
+// };
+// onMounted(hideRightDrawer);
+// onUnmounted(hideRightDrawer);
const filter = {
include: [
{
@@ -46,23 +46,6 @@ const filter = {
-
-
-
-
-
- {{ t('globals.collapseMenu') }}
-
-
-
-
-
@@ -102,18 +85,4 @@ const filter = {
-
-
-
-
-
diff --git a/src/router/modules/department.js b/src/router/modules/department.js
index aaffc3460..dfd5e64ba 100644
--- a/src/router/modules/department.js
+++ b/src/router/modules/department.js
@@ -6,6 +6,7 @@ export default {
meta: {
title: 'department',
icon: 'vn:greuge',
+ moduleName: 'Department',
},
component: RouterView,
redirect: { name: 'DepartmentCard' },
diff --git a/src/router/modules/index.js b/src/router/modules/index.js
index 6f4b0b35e..941358d26 100644
--- a/src/router/modules/index.js
+++ b/src/router/modules/index.js
@@ -16,6 +16,7 @@ import Entry from './entry';
import roadmap from './roadmap';
import Parking from './parking';
import Agency from './agency';
+import ItemType from './itemType';
export default [
Item,
@@ -36,4 +37,5 @@ export default [
roadmap,
Parking,
Agency,
+ ItemType,
];
diff --git a/src/router/modules/item.js b/src/router/modules/item.js
index 729cfd30c..d79ac3071 100644
--- a/src/router/modules/item.js
+++ b/src/router/modules/item.js
@@ -11,7 +11,13 @@ export default {
component: RouterView,
redirect: { name: 'ItemMain' },
menus: {
- main: ['ItemList', 'WasteBreakdown', 'ItemFixedPrice', 'ItemRequest'],
+ main: [
+ 'ItemList',
+ 'WasteBreakdown',
+ 'ItemFixedPrice',
+ 'ItemRequest',
+ 'ItemTypeList',
+ ],
card: [
'ItemBasicData',
'ItemLog',
@@ -68,6 +74,23 @@ export default {
'https://grafana.verdnatura.es/d/TTNXQAxVk';
},
},
+ {
+ path: 'item-type-list',
+ name: 'ItemTypeList',
+ meta: {
+ title: 'family',
+ icon: 'contact_support',
+ },
+ component: () => import('src/pages/Item/ItemTypeList.vue'),
+ },
+ {
+ path: 'item-type-list/create',
+ name: 'ItemTypeCreate',
+ meta: {
+ title: 'itemTypeCreate',
+ },
+ component: () => import('src/pages/Item/ItemTypeCreate.vue'),
+ },
{
path: 'request',
name: 'ItemRequest',
diff --git a/src/router/modules/itemType.js b/src/router/modules/itemType.js
new file mode 100644
index 000000000..8064c41ff
--- /dev/null
+++ b/src/router/modules/itemType.js
@@ -0,0 +1,46 @@
+import { RouterView } from 'vue-router';
+
+export default {
+ path: '/item/item-type',
+ name: 'ItemType',
+ meta: {
+ title: 'itemType',
+ icon: 'contact_support',
+ moduleName: 'ItemType',
+ },
+ component: RouterView,
+ redirect: { name: 'ItemTypeList' },
+ menus: {
+ main: [],
+ card: ['ItemTypeBasicData'],
+ },
+ children: [
+ {
+ name: 'ItemTypeCard',
+ path: ':id',
+ component: () => import('src/pages/ItemType/Card/ItemTypeCard.vue'),
+ redirect: { name: 'ItemTypeSummary' },
+ children: [
+ {
+ name: 'ItemTypeSummary',
+ path: 'summary',
+ meta: {
+ title: 'summary',
+ },
+ component: () =>
+ import('src/pages/ItemType/Card/ItemTypeSummary.vue'),
+ },
+ {
+ name: 'ItemTypeBasicData',
+ path: 'basic-data',
+ meta: {
+ title: 'basicData',
+ icon: 'vn:settings',
+ },
+ component: () =>
+ import('src/pages/ItemType/Card/ItemTypeBasicData.vue'),
+ },
+ ],
+ },
+ ],
+};
diff --git a/src/router/modules/roadmap.js b/src/router/modules/roadmap.js
index 02edf94be..6b2aa6a13 100644
--- a/src/router/modules/roadmap.js
+++ b/src/router/modules/roadmap.js
@@ -6,6 +6,7 @@ export default {
meta: {
title: 'roadmap',
icon: 'vn:troncales',
+ moduleName: 'Roadmap',
},
component: RouterView,
redirect: { name: 'RouteMain' },
diff --git a/src/router/routes.js b/src/router/routes.js
index ca52441e7..92145d44e 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -10,6 +10,7 @@ import supplier from './modules/Supplier';
import route from './modules/route';
import travel from './modules/travel';
import department from './modules/department';
+import ItemType from './modules/itemType';
import shelving from 'src/router/modules/shelving';
import order from 'src/router/modules/order';
import entry from 'src/router/modules/entry';
@@ -73,6 +74,7 @@ const routes = [
entry,
parking,
agency,
+ ItemType,
{
path: '/:catchAll(.*)*',
name: 'NotFound',