Browse Source

统计图表-统计维度选项修改

zhongxiaoyu 1 year ago
parent
commit
5745c077b2

+ 193 - 0
src/components/YearRangePicker/index.vue

@@ -0,0 +1,193 @@
+<template>
+  <div :class="['year-range-picker', { 'is-focus': isFocus }]">
+    <el-date-picker
+      ref="start"
+      v-model="value[0]"
+      type="year"
+      :size="size"
+      format="yyyy"
+      value-format="yyyy"
+      :placeholder="startPlaceholder"
+      :editable="false"
+      :clearable="false"
+      @focus="focusHandler"
+      @blur="blurHandler"
+      @change="
+        val => {
+          dateChangeHandler(val, 0)
+        }
+      "
+    />
+    <span class="range-separator">{{ rangeSeparator }}</span>
+    <el-date-picker
+      ref="end"
+      v-model="value[1]"
+      type="year"
+      :size="size"
+      :format="format"
+      :value-format="valueFormat"
+      :placeholder="endPlaceholder"
+      :editable="false"
+      @focus="focusHandler"
+      @blur="blurHandler"
+      @change="
+        val => {
+          dateChangeHandler(val, 1)
+        }
+      "
+    />
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'YearRangePicker',
+  props: {
+    value: {
+      type: Array,
+      required: true,
+    },
+    size: {
+      type: String,
+      default: 'small',
+    },
+    format: {
+      type: String,
+      default: 'yyyy',
+    },
+    valueFormat: {
+      type: String,
+      default: 'yyyy',
+    },
+    startPlaceholder: {
+      type: String,
+      default: '开始年份',
+    },
+    endPlaceholder: {
+      type: String,
+      default: '结束年份',
+    },
+    rangeSeparator: {
+      type: String,
+      default: '-',
+    },
+  },
+  data() {
+    return {
+      current: '',
+      temp: ['', ''],
+      selectCount: 0,
+      focusCount: 0,
+      blurCount: 0,
+    }
+  },
+  computed: {
+    canceled() {
+      return this.selectCount !== this.blurCount
+    },
+    isFocus() {
+      return this.focusCount !== this.blurCount
+    },
+  },
+  methods: {
+    focusHandler() {
+      this.focusCount++
+      if (this.value[0] && this.value[1]) {
+        this.temp[0] = this.value[0]
+        this.temp[1] = this.value[1]
+      }
+      this.$emit('input', ['', ''])
+    },
+    blurHandler() {
+      this.blurCount++
+      if (this.canceled) {
+        if (this.temp[0] && this.temp[1]) {
+          this.$emit('input', [this.temp[0], this.temp[1]])
+        }
+        this.init()
+      }
+    },
+    dateChangeHandler(val, index) {
+      if (!val) {
+        this.$emit('input', ['', ''])
+        return
+      }
+
+      this.selectCount++
+
+      if (!this.current) {
+        this.current = val
+        this.focus(index)
+      } else {
+        if (Number(val) <= Number(this.current)) {
+          this.$emit('input', [val, this.current])
+        } else {
+          this.$emit('input', [this.current, val])
+        }
+        this.init()
+      }
+    },
+    focus(index) {
+      const refMap = ['start', 'end']
+      this.$refs[refMap[index]].focus()
+    },
+    init() {
+      this.current = ''
+      this.temp[0] = this.temp[1] = ''
+      this.selectCount = this.focusCount = this.blurCount = 0
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.year-range-picker {
+  display: flex;
+  background-color: #fff;
+  border-radius: 4px;
+  border: 1px solid #fff;
+  &:hover {
+    border-color: #c0c4cc;
+  }
+  &.is-focus {
+    border-color: #409eff;
+  }
+  .range-separator {
+    width: 30px;
+    text-align: center;
+    font-size: 13px;
+    font-family: Helvetica, Microsoft YaHei;
+  }
+  ::v-deep .el-date-editor {
+    width: calc((100% - 30px) / 2);
+    .el-input__prefix {
+      color: #303133;
+      font-size: 14px;
+    }
+    &:last-of-type .el-input__prefix {
+      display: none;
+    }
+    .el-input__inner {
+      border: none;
+      padding: 0;
+      background-color: transparent;
+      text-align: center;
+    }
+    &.el-input--large .el-input__inner {
+      height: 38px;
+    }
+    &.el-input--small .el-input__inner {
+      height: 30px;
+    }
+    &.el-input--mini .el-input__inner {
+      height: 26px;
+    }
+    &:first-of-type .el-input__inner {
+      padding-left: 33px;
+    }
+    &:last-of-type .el-input__inner {
+      padding-right: 33px;
+    }
+  }
+}
+</style>

+ 3 - 3
src/views/statisticsCharts/components/newBarStatisticsCharts.vue

@@ -297,7 +297,7 @@ export default {
       params.fd2 = formData.dateTime[1]
       delete params.dateTime
       this.admin = JSON.parse(JSON.stringify(params))
-      delete params.timedim
+      delete params.baggageType
       this.getSingleChartsData(this.querySettings.serviceId, params)
     },
     async getMultipleChartsData(id, paramsList) {
@@ -383,9 +383,9 @@ export default {
         this.seriesKey = 'out_num'
       } else if (this.admin.io === '中转') {
         this.seriesKey = 'trans_num'
-      } else if (this.admin.timedim === '正常') {
+      } else if (this.admin.baggageType === '正常') {
         this.seriesKey = 'bag_num'
-      } else if (this.admin.timedim === '异常') {
+      } else if (this.admin.baggageType === '异常') {
         this.seriesKey = 'exception_num'
       }
       for (let i = 0; i < filteredList.length; i++) {

+ 126 - 14
src/views/statisticsCharts/components/statisticsHeader.vue

@@ -50,12 +50,34 @@
             v-model="formData[item.prop]"
             :size="item.size || 'small'"
             type="daterange"
+            format="yyyy-MM-dd"
             value-format="yyyy-MM-dd"
+            unlink-panels
             range-separator="至"
             start-placeholder="开始日期"
             end-placeholder="结束日期"
           />
         </template>
+        <template v-if="item.inputType === 'monthPicker'">
+          <el-date-picker
+            v-model="formData[item.prop]"
+            :size="item.size || 'small'"
+            type="monthrange"
+            format="yyyy-MM"
+            value-format="yyyy-MM"
+            unlink-panels
+            range-separator="至"
+            start-placeholder="开始月份"
+            end-placeholder="结束月份"
+          />
+        </template>
+        <template v-if="item.inputType === 'yearPicker'">
+          <year-range-picker
+            v-model="formData[item.prop]"
+            :size="item.size || 'small'"
+            range-separator="至"
+          />
+        </template>
         <template v-if="item.inputType === 'cascader'">
           <el-cascader
             v-model="formData[item.prop]"
@@ -99,8 +121,12 @@
 <script>
 import { TempQuery } from '@/api/temp'
 import { mapGetters } from 'vuex'
+import YearRangePicker from '@/components/YearRangePicker'
+import { parseTime } from '@/utils'
+
 export default {
   name: 'StatisticsHeader',
+  components: { YearRangePicker },
   props: {
     title: {
       type: String,
@@ -136,7 +162,7 @@ export default {
       formData: {
         range: '',
         inOrOut: '',
-        interval: '',
+        td: '',
         air_line: [],
         area: '',
         airport: [],
@@ -202,11 +228,10 @@ export default {
           options: [],
         },
         {
-          prop: 'interval',
+          prop: 'td',
           inputType: 'select',
           placeholder: '时间维度',
           requiredWarning: '请先选择统计时间维度',
-          // clearable: true,
           options: [
             {
               value: '日',
@@ -216,15 +241,79 @@ export default {
               value: '月',
               label: '按月统计',
             },
-            {
-              value: '季',
-              label: '按季统计',
-            },
             {
               value: '年',
               label: '按年统计',
             },
           ],
+          changeHandler(value) {
+            const typeMap = {
+              日: 'datePicker',
+              月: 'monthPicker',
+              年: 'yearPicker',
+            }
+            const dateTimeItem = this.formItems.find(
+              item => item.prop === 'dateTime'
+            )
+            if (dateTimeItem) {
+              dateTimeItem.inputType = typeMap[value]
+              const dateTime = formData.dateTime
+              if (dateTime && dateTime[0] && dateTime[1]) {
+                if (value === '年') {
+                  this.formData.dateTime[0] = dateTime[0].split('-')[0]
+                  this.formData.dateTime[1] = dateTime[1].split('-')[0]
+                }
+                if (value === '月') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12`
+                  }
+                  if (oldValue === '日') {
+                    this.formData.dateTime[0] = dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                    this.formData.dateTime[1] = dateTime[1]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                  }
+                }
+                if (value === '日') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12-31`
+                  }
+                  if (oldValue === '月') {
+                    this.formData.dateTime[0] = `${dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')}-01`
+                    let [year, month] = dateTime[1].split('-')
+                    if (month === '12') {
+                      year = Number(year) + 1
+                      month = 1
+                    } else {
+                      month = Number(month) + 1
+                    }
+                    const day = 24 * 60 * 60 * 1000
+                    this.formData.dateTime[1] = parseTime(
+                      new Date(`${year}-${month}-01`) - day * 1,
+                      '{y}-{m}-{d}'
+                    )
+                  }
+                }
+              }
+            }
+          },
         },
         {
           prop: 'dateTime',
@@ -312,7 +401,7 @@ export default {
             item.changeHandler &&
             String(val[item.prop]) !== String(oldVal[item.prop])
           ) {
-            item.changeHandler.call(this, val[item.prop])
+            item.changeHandler.call(this, val[item.prop], oldVal[item.prop])
           }
         })
       },
@@ -350,11 +439,12 @@ export default {
   },
   methods: {
     getData() {
+      const formData = this._.cloneDeep(this.formData)
       try {
         this.formItems.forEach(item => {
           if (
             item.requiredWarning &&
-            (!this.formData[item.prop] || this.formData[item.prop].length === 0)
+            (!formData[item.prop] || formData[item.prop].length === 0)
           ) {
             throw new Error(item.requiredWarning)
           }
@@ -363,20 +453,40 @@ export default {
         this.$message.warning(error.message)
         return
       }
-      if (this.formData.range === '航线' && !this.formData.air_line) {
+      if (formData.range === '航线' && !formData.air_line) {
         this.$message.warning('请先选择航线')
         return
-      } else if (this.formData.range === '航站' && !this.formData.airport) {
+      } else if (formData.range === '航站' && !formData.airport) {
         this.$message.warning('请先选择航站')
         return
-      } else if (this.formData.range === '基地分公司' && !this.formData.area) {
+      } else if (formData.range === '基地分公司' && !formData.area) {
         this.$message.warning('请先选择基地分公司')
         return
       }
-      this.$emit('getFormData', this.formData)
       this.$store.dispatch('savedSettings/saveFormData', {
-        formData: this.formData,
+        formData,
       })
+      if (formData.td === '月') {
+        formData.dateTime[0] = `${formData.dateTime[0]}-01`
+        let [year, month] = formData.dateTime[1].split('-')
+        if (month === '12') {
+          year = Number(year) + 1
+          month = 1
+        } else {
+          month = Number(month) + 1
+        }
+        const day = 24 * 60 * 60 * 1000
+        formData.dateTime[1] = parseTime(
+          new Date(`${year}-${month}-01`) - day * 1,
+          '{y}-{m}-{d}'
+        )
+      } else if (formData.td === '年') {
+        formData.dateTime = [
+          `${formData.dateTime[0]}-01-01`,
+          `${formData.dateTime[1]}-12-31`,
+        ]
+      }
+      this.$emit('getFormData', formData)
     },
     exportClickHandler() {
       this.$emit('export')
@@ -520,6 +630,8 @@ export default {
             }
           }
         }
+        .el-date-editor--monthrange.el-input,
+        .el-date-editor--monthrange.el-input__inner,
         .el-date-editor--daterange.el-input,
         .el-date-editor--daterange.el-input__inner,
         .el-date-editor--timerange.el-input,

+ 92 - 3
src/views/statisticsCharts/views/baggage/airlineStatisticsCharts.vue

@@ -18,12 +18,101 @@ export default {
         serviceId: SERVICE_ID.LuggagecId,
       },
       formData: {
+        td: '日',
         air_line: null,
-        // iata_code: null,
         dateTime: [],
-        timedim: '',
+        baggageType: '',
       },
       formItems: [
+        {
+          prop: 'td',
+          inputType: 'select',
+          placeholder: '时间维度',
+          requiredWarning: '请先选择统计时间维度',
+          options: [
+            {
+              value: '日',
+              label: '按日统计',
+            },
+            {
+              value: '月',
+              label: '按月统计',
+            },
+            {
+              value: '年',
+              label: '按年统计',
+            },
+          ],
+          changeHandler(value, oldValue) {
+            const typeMap = {
+              日: 'datePicker',
+              月: 'monthPicker',
+              年: 'yearPicker',
+            }
+            const dateTimeItem = this.formItems.find(
+              item => item.prop === 'dateTime'
+            )
+            const formData = this._.cloneDeep(this.formData)
+            if (dateTimeItem) {
+              dateTimeItem.inputType = typeMap[value]
+              const dateTime = formData.dateTime
+              if (dateTime && dateTime[0] && dateTime[1]) {
+                if (value === '年') {
+                  this.formData.dateTime[0] = dateTime[0].split('-')[0]
+                  this.formData.dateTime[1] = dateTime[1].split('-')[0]
+                }
+                if (value === '月') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12`
+                  }
+                  if (oldValue === '日') {
+                    this.formData.dateTime[0] = dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                    this.formData.dateTime[1] = dateTime[1]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                  }
+                }
+                if (value === '日') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12-31`
+                  }
+                  if (oldValue === '月') {
+                    this.formData.dateTime[0] = `${dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')}-01`
+                    let [year, month] = dateTime[1].split('-')
+                    if (month === '12') {
+                      year = Number(year) + 1
+                      month = 1
+                    } else {
+                      month = Number(month) + 1
+                    }
+                    const day = 24 * 60 * 60 * 1000
+                    this.formData.dateTime[1] = parseTime(
+                      new Date(`${year}-${month}-01`) - day * 1,
+                      '{y}-{m}-{d}'
+                    )
+                  }
+                }
+              }
+            }
+          },
+        },
         {
           prop: 'air_line',
           inputType: 'select',
@@ -37,7 +126,7 @@ export default {
           options: [],
         },
         {
-          prop: 'timedim',
+          prop: 'baggageType',
           inputType: 'select',
           placeholder: '行李类型',
           requiredWarning: '请先选择行李类型',

+ 90 - 0
src/views/statisticsCharts/views/baggage/baggageAllStatisticsCharts.vue

@@ -18,11 +18,101 @@ export default {
         serviceId: SERVICE_ID.LuggageInId,
       },
       formData: {
+        td: '日',
         airport: 'CAN',
         dateTime: [],
         io: '',
       },
       formItems: [
+        {
+          prop: 'td',
+          inputType: 'select',
+          placeholder: '时间维度',
+          requiredWarning: '请先选择统计时间维度',
+          options: [
+            {
+              value: '日',
+              label: '按日统计',
+            },
+            {
+              value: '月',
+              label: '按月统计',
+            },
+            {
+              value: '年',
+              label: '按年统计',
+            },
+          ],
+          changeHandler(value, oldValue) {
+            const typeMap = {
+              日: 'datePicker',
+              月: 'monthPicker',
+              年: 'yearPicker',
+            }
+            const dateTimeItem = this.formItems.find(
+              item => item.prop === 'dateTime'
+            )
+            const formData = this._.cloneDeep(this.formData)
+            if (dateTimeItem) {
+              dateTimeItem.inputType = typeMap[value]
+              const dateTime = formData.dateTime
+              if (dateTime && dateTime[0] && dateTime[1]) {
+                if (value === '年') {
+                  this.formData.dateTime[0] = dateTime[0].split('-')[0]
+                  this.formData.dateTime[1] = dateTime[1].split('-')[0]
+                }
+                if (value === '月') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12`
+                  }
+                  if (oldValue === '日') {
+                    this.formData.dateTime[0] = dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                    this.formData.dateTime[1] = dateTime[1]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                  }
+                }
+                if (value === '日') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12-31`
+                  }
+                  if (oldValue === '月') {
+                    this.formData.dateTime[0] = `${dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')}-01`
+                    let [year, month] = dateTime[1].split('-')
+                    if (month === '12') {
+                      year = Number(year) + 1
+                      month = 1
+                    } else {
+                      month = Number(month) + 1
+                    }
+                    const day = 24 * 60 * 60 * 1000
+                    this.formData.dateTime[1] = parseTime(
+                      new Date(`${year}-${month}-01`) - day * 1,
+                      '{y}-{m}-{d}'
+                    )
+                  }
+                }
+              }
+            }
+          },
+        },
         {
           prop: 'airport',
           inputType: 'select',

+ 92 - 2
src/views/statisticsCharts/views/baggage/companyStatisticsCharts.vue

@@ -18,11 +18,101 @@ export default {
         serviceId: SERVICE_ID.LuggagecId,
       },
       formData: {
+        td: '日',
         iata_code: null,
         dateTime: [],
-        timedim: '',
+        baggageType: '',
       },
       formItems: [
+        {
+          prop: 'td',
+          inputType: 'select',
+          placeholder: '时间维度',
+          requiredWarning: '请先选择统计时间维度',
+          options: [
+            {
+              value: '日',
+              label: '按日统计',
+            },
+            {
+              value: '月',
+              label: '按月统计',
+            },
+            {
+              value: '年',
+              label: '按年统计',
+            },
+          ],
+          changeHandler(value, oldValue) {
+            const typeMap = {
+              日: 'datePicker',
+              月: 'monthPicker',
+              年: 'yearPicker',
+            }
+            const dateTimeItem = this.formItems.find(
+              item => item.prop === 'dateTime'
+            )
+            const formData = this._.cloneDeep(this.formData)
+            if (dateTimeItem) {
+              dateTimeItem.inputType = typeMap[value]
+              const dateTime = formData.dateTime
+              if (dateTime && dateTime[0] && dateTime[1]) {
+                if (value === '年') {
+                  this.formData.dateTime[0] = dateTime[0].split('-')[0]
+                  this.formData.dateTime[1] = dateTime[1].split('-')[0]
+                }
+                if (value === '月') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12`
+                  }
+                  if (oldValue === '日') {
+                    this.formData.dateTime[0] = dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                    this.formData.dateTime[1] = dateTime[1]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                  }
+                }
+                if (value === '日') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12-31`
+                  }
+                  if (oldValue === '月') {
+                    this.formData.dateTime[0] = `${dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')}-01`
+                    let [year, month] = dateTime[1].split('-')
+                    if (month === '12') {
+                      year = Number(year) + 1
+                      month = 1
+                    } else {
+                      month = Number(month) + 1
+                    }
+                    const day = 24 * 60 * 60 * 1000
+                    this.formData.dateTime[1] = parseTime(
+                      new Date(`${year}-${month}-01`) - day * 1,
+                      '{y}-{m}-{d}'
+                    )
+                  }
+                }
+              }
+            }
+          },
+        },
         {
           prop: 'iata_code',
           inputType: 'select',
@@ -38,7 +128,7 @@ export default {
           options: [],
         },
         {
-          prop: 'timedim',
+          prop: 'baggageType',
           inputType: 'select',
           placeholder: '行李类型',
           requiredWarning: '请先选择行李类型',

+ 71 - 1
src/views/statisticsCharts/views/workloadStatisticsCharts.vue

@@ -10,6 +10,7 @@
 <script>
 import CommonBarStatisticsCharts from '../components/newBarStatisticsCharts.vue'
 import { Query } from '@/api/webApi'
+import { parseTime } from '@/utils'
 
 export default {
   name: 'WorkloadStatisticsCharts',
@@ -23,7 +24,7 @@ export default {
         xAxisKey: 'fd',
       },
       formData: {
-        td: '',
+        td: '',
         agent_number: '',
         airport: '',
         dateTime: [],
@@ -48,6 +49,75 @@ export default {
               label: '按年统计',
             },
           ],
+          changeHandler(value, oldValue) {
+            const typeMap = {
+              日: 'datePicker',
+              月: 'monthPicker',
+              年: 'yearPicker',
+            }
+            const dateTimeItem = this.formItems.find(
+              item => item.prop === 'dateTime'
+            )
+            const formData = this._.cloneDeep(this.formData)
+            if (dateTimeItem) {
+              dateTimeItem.inputType = typeMap[value]
+              const dateTime = formData.dateTime
+              if (dateTime && dateTime[0] && dateTime[1]) {
+                if (value === '年') {
+                  this.formData.dateTime[0] = dateTime[0].split('-')[0]
+                  this.formData.dateTime[1] = dateTime[1].split('-')[0]
+                }
+                if (value === '月') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12`
+                  }
+                  if (oldValue === '日') {
+                    this.formData.dateTime[0] = dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                    this.formData.dateTime[1] = dateTime[1]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')
+                  }
+                }
+                if (value === '日') {
+                  if (oldValue === '年') {
+                    this.formData.dateTime[0] = `${
+                      dateTime[0].split('-')[0]
+                    }-01-01`
+                    this.formData.dateTime[1] = `${
+                      dateTime[1].split('-')[0]
+                    }-12-31`
+                  }
+                  if (oldValue === '月') {
+                    this.formData.dateTime[0] = `${dateTime[0]
+                      .split('-')
+                      .slice(0, 2)
+                      .join('-')}-01`
+                    let [year, month] = dateTime[1].split('-')
+                    if (month === '12') {
+                      year = Number(year) + 1
+                      month = 1
+                    } else {
+                      month = Number(month) + 1
+                    }
+                    const day = 24 * 60 * 60 * 1000
+                    this.formData.dateTime[1] = parseTime(
+                      new Date(`${year}-${month}-01`) - day * 1,
+                      '{y}-{m}-{d}'
+                    )
+                  }
+                }
+              }
+            }
+          },
         },
         {
           prop: 'airport',