diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue
index fb5e426dd..6bfa97e55 100644
--- a/src/components/VnTable/VnTable.vue
+++ b/src/components/VnTable/VnTable.vue
@@ -59,8 +59,8 @@ const $props = defineProps({
default: true,
},
bottom: {
- type: Object,
- default: null,
+ type: Boolean,
+ default: false,
},
cardClass: {
type: String,
@@ -477,29 +477,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
/>
-
-
-
- createAsDialog
- ? (showForm = !showForm)
- : handleOnDataSaved(create)
- "
- class="cursor-pointer fill-icon"
- color="primary"
- icon="add_circle"
- size="md"
- round
- flat
- shortcut="+"
- :disabled="!disabledAttr"
- />
-
- {{ createForm.title }}
-
-
-
+
+
+ createAsDialog
+ ? (showForm = !showForm)
+ : handleOnDataSaved(create)
+ "
+ class="cursor-pointer fill-icon"
+ color="primary"
+ icon="add_circle"
+ size="md"
+ round
+ flat
+ shortcut="+"
+ :disabled="!disabledAttr"
+ />
+
+ {{ createForm.title }}
+
+
diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue
index 8aa725b4a..58b7667d2 100644
--- a/src/components/common/VnSelect.vue
+++ b/src/components/common/VnSelect.vue
@@ -166,7 +166,11 @@ onMounted(() => {
const arrayDataKey =
$props.dataKey ?? ($props.url?.length > 0 ? $props.url : $attrs.name ?? $attrs.label);
-const arrayData = useArrayData(arrayDataKey, { url: $props.url, searchUrl: false });
+const arrayData = useArrayData(arrayDataKey, {
+ url: $props.url,
+ searchUrl: false,
+ mapKey: $attrs['map-key'],
+});
function findKeyInOptions() {
if (!$props.options) return;
diff --git a/src/components/ui/VnSms.vue b/src/components/ui/VnSms.vue
index bf6e0695e..8b25ba5da 100644
--- a/src/components/ui/VnSms.vue
+++ b/src/components/ui/VnSms.vue
@@ -54,6 +54,7 @@ function formatNumber(number) {
:offset="100"
:limit="5"
auto-load
+ map-key="smsFk"
>
{
- const minDate = Date.vnNew();
- minDate.setHours(0, 0, 0, 0);
- minDate.setMonth(minDate.getMonth() - 2);
-
- const maxDate = Date.vnNew();
- maxDate.setHours(23, 59, 59, 59);
-
- return {
- campaign: campaignList.value[0]?.id,
- from: minDate,
- to: maxDate,
+ const campaign = campaignList.value[0]?.id;
+ const userParams = {
+ campaign,
+ ...updateDateParams(campaign, { from: Date.vnNew(), to: Date.vnNew() }),
};
+ return userParams;
});
const openReportPdf = () => {
openReport(`Clients/${route.params.id}/campaign-metrics-pdf`, getParams());
@@ -134,6 +128,23 @@ const sendCampaignMetricsEmail = ({ address }) => {
...getParams(),
});
};
+
+const updateDateParams = (value, params) => {
+ if (!value) {
+ params.from = null;
+ params.to = null;
+ return;
+ }
+ const campaign = campaignList.value.find((c) => c.id === value);
+ if (!campaign) return;
+
+ const { dated, previousDays, scopeDays } = campaign;
+ const _date = new Date(dated);
+ const [from, to] = dateRange(_date);
+ params.from = new Date(from.setDate(from.getDate() - previousDays)).toISOString();
+ params.to = new Date(to.setDate(to.getDate() + scopeDays)).toISOString();
+ return params;
+};
@@ -144,7 +155,6 @@ const sendCampaignMetricsEmail = ({ address }) => {
:order="['itemTypeFk', 'itemName', 'itemSize', 'description']"
:columns="columns"
search-url="consumption"
- :filter="filter"
:user-params="userParams"
:default-remove="false"
:default-reset="false"
@@ -201,6 +211,7 @@ const sendCampaignMetricsEmail = ({ address }) => {
class="q-px-sm q-pt-none fit"
dense
option-label="code"
+ @update:model-value="(data) => updateDateParams(data, params)"
>
diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue
index 703a00a0e..8aa785c74 100644
--- a/src/pages/Ticket/Card/TicketSale.vue
+++ b/src/pages/Ticket/Card/TicketSale.vue
@@ -54,6 +54,7 @@ const transfer = ref({
});
const tableRef = ref([]);
const canProceed = ref();
+const isLoading = ref(false);
watch(
() => route.params.id,
@@ -213,6 +214,9 @@ const updateQuantity = async ({ quantity, id }) => {
};
const addSale = async (sale) => {
+ if (isLoading.value) return;
+
+ isLoading.value = true;
const params = {
barcode: sale.itemFk,
quantity: sale.quantity,
@@ -233,7 +237,7 @@ const addSale = async (sale) => {
sale.item = newSale.item;
notify('globals.dataSaved', 'positive');
- window.location.reload();
+ arrayData.fetch({});
};
const updateConcept = async (sale) => {
@@ -464,6 +468,7 @@ const addRow = (original = null) => {
};
const endNewRow = (row) => {
+ if (!row) return;
if (row.itemFk && row.quantity) {
row.isNew = false;
}
diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue
index ccc7aab3f..0a535afcb 100644
--- a/src/pages/Zone/ZoneDeliveryPanel.vue
+++ b/src/pages/Zone/ZoneDeliveryPanel.vue
@@ -89,7 +89,7 @@ watch(
v-model="formData.geoFk"
url="Postcodes/location"
:fields="['geoFk', 'code', 'townFk', 'countryFk']"
- sort-by="code, townFk"
+ :sort-by="['code ASC']"
option-value="geoFk"
option-label="code"
:filter-options="['code']"
@@ -97,6 +97,7 @@ watch(
dense
outlined
rounded
+ map-key="geoFk"
>