index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <el-form :model="formData" inline class="station-form">
  3. <el-form-item :prop="formData.startDate" style="width: 160px">
  4. <el-date-picker
  5. v-model="formData.startDate"
  6. type="datetime"
  7. format="YYYY-MM-DD HH:mm"
  8. value-format="YYYY-MM-DD hh:mm"
  9. size="default"
  10. :clearable="false"
  11. />
  12. </el-form-item>
  13. <el-form-item :prop="formData.endDate" style="width: 160px">
  14. <el-date-picker
  15. v-model="formData.endDate"
  16. type="datetime"
  17. format="YYYY-MM-DD HH:mm"
  18. value-format="YYYY-MM-DD hh:mm"
  19. size="default"
  20. :clearable="false"
  21. />
  22. </el-form-item>
  23. <el-form-item :prop="formData.flightStatus" style="width: 104px">
  24. <el-select
  25. v-model="formData.flightStatus"
  26. size="default"
  27. placeholder="全部航班"
  28. >
  29. <el-option
  30. v-for="option in flightStatusOptions"
  31. :key="option.value"
  32. :label="option.label"
  33. :value="option.value"
  34. />
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item :prop="formData.flightWarning" style="width: 104px">
  38. <el-select
  39. v-model="formData.flightWarning"
  40. size="default"
  41. placeholder="全部航班"
  42. >
  43. <el-option
  44. v-for="option in flightWarningOptions"
  45. :key="option.value"
  46. :label="option.label"
  47. :value="option.value"
  48. />
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item
  52. v-if="international"
  53. :prop="formData.waybillType"
  54. style="width: 104px"
  55. >
  56. <el-select
  57. v-model="formData.waybillType"
  58. size="default"
  59. placeholder="运单类型"
  60. >
  61. <el-option
  62. v-for="option in waybillTypeOptions"
  63. :key="option.value"
  64. :label="option.label"
  65. :value="option.value"
  66. />
  67. </el-select>
  68. </el-form-item>
  69. </el-form>
  70. </template>
  71. <script setup lang="ts">
  72. import { parseTime } from '@/utils/validate'
  73. import type { selectOptions } from '../../type'
  74. const props = defineProps({
  75. international: {
  76. type: Boolean,
  77. default: false,
  78. },
  79. })
  80. const emit = defineEmits(['formDataChange'])
  81. const formData = reactive({
  82. startDate: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
  83. endDate: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
  84. flightStatus: '',
  85. flightWarning: '',
  86. waybillType: '',
  87. })
  88. watchEffect(() => {
  89. emit('formDataChange', formData)
  90. })
  91. const flightStatusOptions = ref<selectOptions>([])
  92. const flightWarningOptions = ref<selectOptions>([])
  93. const waybillTypeOptions = ref<selectOptions>([])
  94. const getFlightStatusOptions = async () => {}
  95. const getFlightWarningOptions = async () => {}
  96. const getWaybillTypeOptions = async () => {}
  97. const getSelectOptions = () => {
  98. getFlightStatusOptions()
  99. getFlightWarningOptions()
  100. getWaybillTypeOptions()
  101. }
  102. onMounted(() => {
  103. getSelectOptions()
  104. })
  105. </script>
  106. <style scoped lang="scss">
  107. .station-form :deep {
  108. .el-form-item {
  109. margin: 0;
  110. &:not(:last-of-type) {
  111. margin-right: 8px;
  112. }
  113. .el-input__inner {
  114. font-size: 14px;
  115. font-family: Helvetica, Microsoft YaHei;
  116. color: #303133;
  117. &::-webkit-input-placeholder {
  118. font-size: 14px;
  119. font-family: Helvetica, Microsoft YaHei;
  120. color: #303133;
  121. }
  122. }
  123. }
  124. }
  125. </style>