123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <template>
- <el-form :model="formData" inline class="station-form">
- <el-form-item :prop="formData.startDate" style="width: 160px">
- <el-date-picker
- v-model="formData.startDate"
- type="datetime"
- format="YYYY-MM-DD HH:mm"
- value-format="YYYY-MM-DD hh:mm"
- size="default"
- :clearable="false"
- />
- </el-form-item>
- <el-form-item :prop="formData.endDate" style="width: 160px">
- <el-date-picker
- v-model="formData.endDate"
- type="datetime"
- format="YYYY-MM-DD HH:mm"
- value-format="YYYY-MM-DD hh:mm"
- size="default"
- :clearable="false"
- />
- </el-form-item>
- <el-form-item :prop="formData.flightStatus" style="width: 104px">
- <el-select
- v-model="formData.flightStatus"
- size="default"
- placeholder="全部航班"
- >
- <el-option
- v-for="option in flightStatusOptions"
- :key="option.value"
- :label="option.label"
- :value="option.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item :prop="formData.flightWarning" style="width: 104px">
- <el-select
- v-model="formData.flightWarning"
- size="default"
- placeholder="全部航班"
- >
- <el-option
- v-for="option in flightWarningOptions"
- :key="option.value"
- :label="option.label"
- :value="option.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item
- v-if="international"
- :prop="formData.waybillType"
- style="width: 104px"
- >
- <el-select
- v-model="formData.waybillType"
- size="default"
- placeholder="运单类型"
- >
- <el-option
- v-for="option in waybillTypeOptions"
- :key="option.value"
- :label="option.label"
- :value="option.value"
- />
- </el-select>
- </el-form-item>
- </el-form>
- </template>
- <script setup lang="ts">
- import { parseTime } from '@/utils/validate'
- import type { selectOptions } from '../../type'
- const props = defineProps({
- international: {
- type: Boolean,
- default: false,
- },
- })
- const emit = defineEmits(['formDataChange'])
- const formData = reactive({
- startDate: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
- endDate: parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
- flightStatus: '',
- flightWarning: '',
- waybillType: '',
- })
- watchEffect(() => {
- emit('formDataChange', formData)
- })
- const flightStatusOptions = ref<selectOptions>([])
- const flightWarningOptions = ref<selectOptions>([])
- const waybillTypeOptions = ref<selectOptions>([])
- const getFlightStatusOptions = async () => {}
- const getFlightWarningOptions = async () => {}
- const getWaybillTypeOptions = async () => {}
- const getSelectOptions = () => {
- getFlightStatusOptions()
- getFlightWarningOptions()
- getWaybillTypeOptions()
- }
- onMounted(() => {
- getSelectOptions()
- })
- </script>
- <style scoped lang="scss">
- .station-form :deep {
- .el-form-item {
- margin: 0;
- &:not(:last-of-type) {
- margin-right: 8px;
- }
- .el-input__inner {
- font-size: 14px;
- font-family: Helvetica, Microsoft YaHei;
- color: #303133;
- &::-webkit-input-placeholder {
- font-size: 14px;
- font-family: Helvetica, Microsoft YaHei;
- color: #303133;
- }
- }
- }
- }
- </style>
|