feat: refs #6321 remove agency
This commit is contained in:
parent
c65f1524c6
commit
de454313cf
|
@ -1,10 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
import axios from 'axios';
|
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
|
||||||
|
|
||||||
import { toDateFormat } from 'src/filters/date.js';
|
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import split from './components/split';
|
import split from './components/split';
|
||||||
const emit = defineEmits(['ticketTransfered']);
|
const emit = defineEmits(['ticketTransfered']);
|
||||||
|
@ -16,51 +12,17 @@ const $props = defineProps({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
const splitDate = ref(Date.vnNew());
|
const splitDate = ref(Date.vnNew());
|
||||||
const agencySelected = ref(null);
|
|
||||||
const zoneSelected = ref(null);
|
|
||||||
|
|
||||||
const splitSelectedRows = async () => {
|
const splitSelectedRows = async () => {
|
||||||
const tickets = Array.isArray($props.ticket) ? $props.ticket : [$props.ticket];
|
const tickets = Array.isArray($props.ticket) ? $props.ticket : [$props.ticket];
|
||||||
await split(tickets, splitDate.value);
|
await split(tickets, splitDate.value);
|
||||||
emit('ticketTransfered', tickets);
|
emit('ticketTransfered', tickets);
|
||||||
};
|
};
|
||||||
const agencies = ref([]);
|
|
||||||
const handleDateChanged = async () => {
|
|
||||||
const { data: agencyData } = await axios.get('Agencies/getLanded', {
|
|
||||||
params: {
|
|
||||||
addressFk: 123,
|
|
||||||
agencyModeFk: 8,
|
|
||||||
warehouseFk: 1,
|
|
||||||
shipped: '2001-02-08T23:00:00.000Z',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (!agencyData) agencies.value = [];
|
|
||||||
const { zoneFk } = agencyData;
|
|
||||||
const { data: zoneData } = await axios.get('Zones/Includingexpired', {
|
|
||||||
params: { filter: { fields: ['id', 'name'], where: { id: zoneFk } } },
|
|
||||||
});
|
|
||||||
agencies = zoneData;
|
|
||||||
if (zoneData.length === 1) zoneSelected.value = zoneData[0];
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<VnInputDate
|
<VnInputDate class="q-mr-sm" :label="$t('New date')" v-model="splitDate" clearable />
|
||||||
class="q-mr-sm"
|
|
||||||
:label="$t('New date')"
|
|
||||||
v-model="splitDate"
|
|
||||||
clearable
|
|
||||||
@update:model-value="handleDateChanged"
|
|
||||||
/>
|
|
||||||
<VnSelect
|
|
||||||
class="q-ml-sm"
|
|
||||||
:disable="splitDate"
|
|
||||||
:label="t('Agency')"
|
|
||||||
v-model="agencySelected"
|
|
||||||
:options="agencies"
|
|
||||||
/>
|
|
||||||
<QBtn class="q-mr-sm" color="primary" label="Split" @click="splitSelectedRows"></QBtn>
|
<QBtn class="q-mr-sm" color="primary" label="Split" @click="splitSelectedRows"></QBtn>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
Loading…
Reference in New Issue