|
@@ -367,7 +367,7 @@ import Echarts from '@/components/Echarts/commonChartsBar.vue'
|
|
|
import ComHead from './components/comHead.vue'
|
|
|
import { Calendar, CaretBottom } from '@element-plus/icons-vue'
|
|
|
import Dialog from '@/components/dialog/index.vue'
|
|
|
-import { usePublic, showTimeMsg } from './hooks/usePublic'
|
|
|
+import { usePublic, showTimeMsg, parseDate } from './hooks/usePublic'
|
|
|
// import nodeCode from './hooks/nodeCode'
|
|
|
import { parseTime, isValue } from '@/utils/validate'
|
|
|
import * as _ from 'lodash'
|
|
@@ -531,12 +531,6 @@ const pubFunc = (listValues, target, type?) => {
|
|
|
return newObj
|
|
|
}
|
|
|
|
|
|
-const parseDate = (date: string) => {
|
|
|
- const dates = date.split('-')
|
|
|
- const newDate = dates.shift()
|
|
|
- return dates.join('-')
|
|
|
-}
|
|
|
-
|
|
|
// 特货分类统计-选取下拉数据
|
|
|
const handleCommand = (command: string) => {
|
|
|
specialGoods.value = command
|
|
@@ -564,10 +558,16 @@ const waybillTrendFunc = async () => {
|
|
|
{ flightDate1: waybillDates.startDate, flightDate2: waybillDates.endDate },
|
|
|
])) as any
|
|
|
if (listValues && isValue(listValues)) {
|
|
|
- listValues.forEach(item => {
|
|
|
- item.jobTime = parseDate(item['jobTime'])
|
|
|
- })
|
|
|
- waybillTrendObj.value = pubFunc(listValues, optionLeft, true)
|
|
|
+ const dealedList = listValues.reduce((preList, currentValue) => {
|
|
|
+ if (typeof currentValue.jobTime === 'string') {
|
|
|
+ return [...preList, {
|
|
|
+ ...currentValue,
|
|
|
+ jobTime: parseDate(currentValue.jobTime)
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ return preList
|
|
|
+ }, [])
|
|
|
+ waybillTrendObj.value = pubFunc(dealedList, optionLeft, true)
|
|
|
}
|
|
|
loading2.value = false
|
|
|
}
|
|
@@ -739,11 +739,17 @@ const pickingFuncs = async () => {
|
|
|
])) as any
|
|
|
if (listValues && isValue(listValues)) {
|
|
|
const newObj: any = _.cloneDeep(airlineAbnormalBaggage.option.baseOption)
|
|
|
- listValues.forEach(item => {
|
|
|
- item.jobTime = parseDate(item['flightDate'])
|
|
|
- item.weight = item['flightNum']
|
|
|
- })
|
|
|
- pickingObj.value = pubFunc(listValues, newObj)
|
|
|
+ const dealedList = listValues.reduce((preList, currentValue) => {
|
|
|
+ if (typeof currentValue.jobTime === 'string') {
|
|
|
+ return [...preList, {
|
|
|
+ ...currentValue,
|
|
|
+ jobTime: parseDate(currentValue.jobTime),
|
|
|
+ weight: currentValue.flightNum
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ return preList
|
|
|
+ }, [])
|
|
|
+ pickingObj.value = pubFunc(dealedList, newObj)
|
|
|
}
|
|
|
loading8.value = false
|
|
|
}
|