+
-
+ |
{{ item.warehouse }}
|
-
+ |
{
diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue
index 4d84a32fc..8d2b5309e 100644
--- a/src/pages/Order/Card/OrderDescriptor.vue
+++ b/src/pages/Order/Card/OrderDescriptor.vue
@@ -4,13 +4,13 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { toCurrency, toDate } from 'src/filters';
import { useState } from 'src/composables/useState';
-
import useCardDescription from 'src/composables/useCardDescription';
-import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
+
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
-import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue';
import FetchData from 'components/FetchData.vue';
+import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue';
+import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
const DEFAULT_ITEMS = 0;
@@ -25,6 +25,8 @@ const $props = defineProps({
const route = useRoute();
const state = useState();
const { t } = useI18n();
+const data = ref(useCardDescription());
+const getTotalRef = ref();
const entityId = computed(() => {
return $props.id || route.params.id;
@@ -57,11 +59,11 @@ const filter = {
],
};
-const data = ref(useCardDescription());
const setData = (entity) => {
if (!entity) return;
+ getTotalRef.value && getTotalRef.value.fetch();
data.value = useCardDescription(entity?.client?.name, entity?.id);
- state.set('OrderDescriptor', entity);
+ state.set('orderData', entity);
};
const getConfirmationValue = (isConfirmed) => {
@@ -69,10 +71,15 @@ const getConfirmationValue = (isConfirmed) => {
};
const total = ref(null);
+
+function ticketFilter(order) {
+ return JSON.stringify({ id: order.id });
+}
(total = response)"
auto-load
@@ -120,7 +127,7 @@ const total = ref(null);
color="primary"
:to="{
name: 'TicketList',
- query: { params: JSON.stringify({ orderFk: entity.id }) },
+ query: { table: ticketFilter(entity) },
}"
>
{{ t('order.summary.orderTicketList') }}
diff --git a/src/pages/Order/Card/OrderForm.vue b/src/pages/Order/Card/OrderForm.vue
index 91640101c..74d0a8b75 100644
--- a/src/pages/Order/Card/OrderForm.vue
+++ b/src/pages/Order/Card/OrderForm.vue
@@ -64,11 +64,14 @@ const fetchOrderDetails = (order) => {
};
const orderMapper = (order) => {
- return {
+ const mappedOrder = {
addressId: order.addressFk,
- agencyModeId: order.agencyModeFk,
landed: new Date(order.landed).toISOString(),
};
+ if (order.agencyModeFk !== null && order.agencyModeFk !== undefined) {
+ mappedOrder.agencyModeId = order.agencyModeFk;
+ }
+ return mappedOrder;
};
const orderFilter = {
include: [
@@ -184,7 +187,19 @@ const onClientChange = async (clientId) => {
option-value="agencyModeFk"
option-label="agencyMode"
hide-selected
- :disable="!agencyList?.length"
+ :disable="!agencyList?.length && data.isConfirmed === 1"
+ clearable
+ emit-value
+ map-options
+ :model-value="
+ !data.isConfirmed &&
+ agencyList?.length &&
+ agencyList.some(
+ (agency) => agency.agencyModeFk === data.agency_id
+ )
+ ? data.agencyModeFk
+ : null
+ "
>
diff --git a/src/pages/Order/Card/OrderLines.vue b/src/pages/Order/Card/OrderLines.vue
index 21ea3b300..d4a5c4b1d 100644
--- a/src/pages/Order/Card/OrderLines.vue
+++ b/src/pages/Order/Card/OrderLines.vue
@@ -61,6 +61,13 @@ const lineFilter = ref({
fields: ['id', 'name'],
},
},
+ {
+ relation: 'order',
+ scope: {
+ fields: ['id', 'isConfirmed'],
+ where: { id: route.params.id },
+ },
+ },
],
where: { orderFk: route.params.id },
});
@@ -157,8 +164,9 @@ const columns = computed(() => [
name: 'tableActions',
actions: [
{
- title: t('delete'),
+ title: t('Delete'),
icon: 'delete',
+ show: (row) => !row.order.isConfirmed,
action: (row) => confirmRemove(row),
isPrimary: true,
},
@@ -281,6 +289,15 @@ watch(
{{ toCurrency(row.quantity * row.price) }}
+
+
+
diff --git a/src/pages/Order/Card/OrderVolume.vue b/src/pages/Order/Card/OrderVolume.vue
index 69f0a9c6b..8622a1fa5 100644
--- a/src/pages/Order/Card/OrderVolume.vue
+++ b/src/pages/Order/Card/OrderVolume.vue
@@ -10,14 +10,16 @@ import FetchData from 'components/FetchData.vue';
import VnLv from 'components/ui/VnLv.vue';
import CardList from 'components/ui/CardList.vue';
import FetchedTags from 'components/ui/FetchedTags.vue';
-
+import { useStateStore } from 'stores/useStateStore';
import { dashIfEmpty } from 'src/filters';
+import { onMounted } from 'vue';
const router = useRouter();
const route = useRoute();
const { t } = useI18n();
const volumeSummary = ref(null);
const volumeRef = ref();
+const stateStore = useStateStore();
const volumeFilter = ref({
include: [
{
@@ -46,6 +48,7 @@ watch(
volumeRef.value.fetch();
}
);
+onMounted(() => (stateStore.rightDrawer = false));
@@ -63,9 +66,6 @@ watch(
{{ t('globals.noResults') }}
-
|