|
|
@@ -3,11 +3,12 @@ import emitter from '@/utils/bus'
|
|
|
import { ref, watch, onMounted, onBeforeMount } from 'vue'
|
|
|
import IconDropDown from '@/components/IconDropDown'
|
|
|
import CalendarDate from './components/CalendarDate.vue'
|
|
|
-import { formatTimezone } from '@/utils/tools'
|
|
|
import dayjs from 'dayjs'
|
|
|
import { useUserStore } from '@/stores/modules/user'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
+const formatDate = userStore.dateFormat
|
|
|
+const valueFormatDate = 'MM/DD/YYYY'
|
|
|
|
|
|
onMounted(() => {
|
|
|
defaultDate()
|
|
|
@@ -73,14 +74,12 @@ const defaultDate = () => {
|
|
|
if (sessionStorage.getItem('searchTableQeuryTracking') == null) {
|
|
|
DateStart.value = [dayjs().subtract(2, 'month').startOf('month'), dayjs().add(1, 'month')]
|
|
|
daterangeObj.ETD =
|
|
|
- DateStart.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(formatDate) + ' To ' + DateStart.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETD',
|
|
|
data: [
|
|
|
- DateStart.value[0].format(userStore.dateFormat),
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(valueFormatDate),
|
|
|
+ DateStart.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
|
|
|
@@ -94,14 +93,12 @@ const defaultDate = () => {
|
|
|
dayjs(searchTableQeuryTracking.value.etd_end)
|
|
|
]
|
|
|
daterangeObj.ETD =
|
|
|
- DateStart.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(formatDate) + ' To ' + DateStart.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETD',
|
|
|
data: [
|
|
|
- DateStart.value[0].format(userStore.dateFormat),
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(valueFormatDate),
|
|
|
+ DateStart.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2.ETD = obj
|
|
|
@@ -112,14 +109,12 @@ const defaultDate = () => {
|
|
|
dayjs(searchTableQeuryTracking.value.eta_end)
|
|
|
]
|
|
|
daterangeObj.ETA =
|
|
|
- DateEnd.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateEnd.value[1].format(userStore.dateFormat)
|
|
|
+ DateEnd.value[0].format(formatDate) + ' To ' + DateEnd.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETA',
|
|
|
data: [
|
|
|
- DateEnd.value[0].format(userStore.dateFormat),
|
|
|
- DateEnd.value[1].format(userStore.dateFormat)
|
|
|
+ DateEnd.value[0].format(valueFormatDate),
|
|
|
+ DateEnd.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2.ETA = obj
|
|
|
@@ -130,14 +125,14 @@ const defaultDate = () => {
|
|
|
dayjs(searchTableQeuryTracking.value.created_time_end)
|
|
|
]
|
|
|
daterangeObj['Creation Time'] =
|
|
|
- DateCreation.value[0].format(userStore.dateFormat) +
|
|
|
+ DateCreation.value[0].format(formatDate) +
|
|
|
' To ' +
|
|
|
- DateCreation.value[1].format(userStore.dateFormat)
|
|
|
+ DateCreation.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'Creation Time',
|
|
|
data: [
|
|
|
- DateCreation.value[0].format(userStore.dateFormat),
|
|
|
- DateCreation.value[1].format(userStore.dateFormat)
|
|
|
+ DateCreation.value[0].format(valueFormatDate),
|
|
|
+ DateCreation.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2['Creation Time'] = obj
|
|
|
@@ -151,15 +146,10 @@ const defaultDate = () => {
|
|
|
if (data.eta_start) {
|
|
|
DateEnd.value = [dayjs(data.eta_start), dayjs(data.eta_end)]
|
|
|
daterangeObj.ETA =
|
|
|
- DateEnd.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateEnd.value[1].format(userStore.dateFormat)
|
|
|
+ DateEnd.value[0].format(formatDate) + ' To ' + DateEnd.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETA',
|
|
|
- data: [
|
|
|
- DateEnd.value[0].format(userStore.dateFormat),
|
|
|
- DateEnd.value[1].format(userStore.dateFormat)
|
|
|
- ]
|
|
|
+ data: [DateEnd.value[0].format(valueFormatDate), DateEnd.value[1].format(valueFormatDate)]
|
|
|
}
|
|
|
|
|
|
daterangeObj2.ETA = obj
|
|
|
@@ -168,14 +158,12 @@ const defaultDate = () => {
|
|
|
if (data.etd_start) {
|
|
|
DateStart.value = [dayjs(data.etd_start), dayjs(data.etd_end)]
|
|
|
daterangeObj.ETD =
|
|
|
- DateStart.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(formatDate) + ' To ' + DateStart.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETD',
|
|
|
data: [
|
|
|
- DateStart.value[0].format(userStore.dateFormat),
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(valueFormatDate),
|
|
|
+ DateStart.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2.ETD = obj
|
|
|
@@ -186,14 +174,12 @@ const defaultDate = () => {
|
|
|
if (sessionStorage.getItem('searchTableQeury') == null) {
|
|
|
DateStart.value = [dayjs().subtract(2, 'month').startOf('month'), dayjs().add(1, 'month')]
|
|
|
daterangeObj.ETD =
|
|
|
- DateStart.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(formatDate) + ' To ' + DateStart.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETD',
|
|
|
data: [
|
|
|
- DateStart.value[0].format(userStore.dateFormat),
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(valueFormatDate),
|
|
|
+ DateStart.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2.ETD = obj
|
|
|
@@ -202,18 +188,16 @@ const defaultDate = () => {
|
|
|
JSON.parse(sessionStorage.getItem('searchTableQeury') as string) || {}
|
|
|
if (searchTableQeury.value.f_etd_start) {
|
|
|
DateStart.value = [
|
|
|
- dayjs(searchTableQeury.value.f_etd_start),
|
|
|
- dayjs(searchTableQeury.value.f_etd_end)
|
|
|
+ dayjs(searchTableQeury.value.f_etd_start).format(valueFormatDate),
|
|
|
+ dayjs(searchTableQeury.value.f_etd_end).format(valueFormatDate)
|
|
|
]
|
|
|
daterangeObj.ETD =
|
|
|
- DateStart.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(formatDate) + ' To ' + DateStart.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETD',
|
|
|
data: [
|
|
|
- DateStart.value[0].format(userStore.dateFormat),
|
|
|
- DateStart.value[1].format(userStore.dateFormat)
|
|
|
+ DateStart.value[0].format(valueFormatDate),
|
|
|
+ DateStart.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2.ETD = obj
|
|
|
@@ -224,15 +208,10 @@ const defaultDate = () => {
|
|
|
dayjs(searchTableQeury.value.m_eta_end)
|
|
|
]
|
|
|
daterangeObj.ETA =
|
|
|
- DateEnd.value[0].format(userStore.dateFormat) +
|
|
|
- ' To ' +
|
|
|
- DateEnd.value[1].format(userStore.dateFormat)
|
|
|
+ DateEnd.value[0].format(formatDate) + ' To ' + DateEnd.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'ETA',
|
|
|
- data: [
|
|
|
- DateEnd.value[0].format(userStore.dateFormat),
|
|
|
- DateEnd.value[1].format(userStore.dateFormat)
|
|
|
- ]
|
|
|
+ data: [DateEnd.value[0].format(valueFormatDate), DateEnd.value[1].format(valueFormatDate)]
|
|
|
}
|
|
|
daterangeObj2.ETA = obj
|
|
|
}
|
|
|
@@ -242,14 +221,14 @@ const defaultDate = () => {
|
|
|
dayjs(searchTableQeury.value.created_time_end)
|
|
|
]
|
|
|
daterangeObj['Creation Time'] =
|
|
|
- DateCreation.value[0].format(userStore.dateFormat) +
|
|
|
+ DateCreation.value[0].format(formatDate) +
|
|
|
' To ' +
|
|
|
- DateCreation.value[1].format(userStore.dateFormat)
|
|
|
+ DateCreation.value[1].format(formatDate)
|
|
|
const obj = {
|
|
|
title: 'Creation Time',
|
|
|
data: [
|
|
|
- DateCreation.value[0].format(userStore.dateFormat),
|
|
|
- DateCreation.value[1].format(userStore.dateFormat)
|
|
|
+ DateCreation.value[0].format(valueFormatDate),
|
|
|
+ DateCreation.value[1].format(valueFormatDate)
|
|
|
]
|
|
|
}
|
|
|
daterangeObj2['Creation Time'] = obj
|
|
|
@@ -263,8 +242,8 @@ daterangedata.value = []
|
|
|
let daterangeObj2: any = {}
|
|
|
const DateRangeChange = (val: any) => {
|
|
|
if (val.data != null) {
|
|
|
- const date1 = formatTimezone(String(val.data[0]))
|
|
|
- const date2 = formatTimezone(String(val.data[1]))
|
|
|
+ const date1 = dayjs(String(val.data[0])).format(formatDate)
|
|
|
+ const date2 = dayjs(String(val.data[1])).format(formatDate)
|
|
|
daterangeObj[val.title] = date1 + ' To ' + date2
|
|
|
daterangeObj2[val.title] = val
|
|
|
} else {
|