Compare commits
No commits in common. "b21f3357218b79139340bfa2c0a400da4621e925" and "797cebd8dc83aaee59b1d5bcbc9f53fcc4e41f7f" have entirely different histories.
b21f335721
...
797cebd8dc
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -12,15 +12,6 @@ export interface WhiteVO {
|
||||
dept: string // 部门
|
||||
memo: string // 备注
|
||||
source: string // 来源
|
||||
name: string //
|
||||
carType: string
|
||||
areaId: number
|
||||
areaStart: string
|
||||
areaEnd: string
|
||||
address: string
|
||||
phone: string
|
||||
plateColor: string
|
||||
|
||||
}
|
||||
|
||||
// 白名单管理 API
|
||||
|
@ -1,47 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 航班 VO
|
||||
export interface FlightVO {
|
||||
id: number // id
|
||||
flightName: string // 航班名称
|
||||
}
|
||||
|
||||
|
||||
// 航班 API
|
||||
export const FlightApi = {
|
||||
|
||||
//查询航班下拉框数据
|
||||
getFlightName: async () =>{
|
||||
return await request.get({ url : `/ticket/flight/flightNameOption`})
|
||||
},
|
||||
|
||||
// 查询航班分页
|
||||
getFlightPage: async (params: any) => {
|
||||
return await request.get({ url: `/ticket/flight/page`, params })
|
||||
},
|
||||
|
||||
// 查询航班详情
|
||||
getFlight: async (id: number) => {
|
||||
return await request.get({ url: `/ticket/flight/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增航班
|
||||
createFlight: async (data: FlightVO) => {
|
||||
return await request.post({ url: `/ticket/flight/create`, data })
|
||||
},
|
||||
|
||||
// 修改航班
|
||||
updateFlight: async (data: FlightVO) => {
|
||||
return await request.put({ url: `/ticket/flight/update`, data })
|
||||
},
|
||||
|
||||
// 删除航班
|
||||
deleteFlight: async (id: number) => {
|
||||
return await request.delete({ url: `/ticket/flight/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出航班 Excel
|
||||
exportFlight: async (params) => {
|
||||
return await request.download({ url: `/ticket/flight/export-excel`, params })
|
||||
},
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 航线 VO
|
||||
export interface ShipRouteVO {
|
||||
id: number // id
|
||||
flightId: number // 航班
|
||||
routeName: string // 航线名称
|
||||
}
|
||||
|
||||
// 航线 API
|
||||
export const ShipRouteApi = {
|
||||
|
||||
//查询航班下拉框数据
|
||||
getRouteName: async () =>{
|
||||
return await request.get({ url : `/ticket/ship-route/routeNameOption`})
|
||||
},
|
||||
|
||||
// 查询航线分页
|
||||
getShipRoutePage: async (params: any) => {
|
||||
return await request.get({ url: `/ticket/ship-route/page`, params })
|
||||
},
|
||||
|
||||
// 查询航线详情
|
||||
getShipRoute: async (id: number) => {
|
||||
return await request.get({ url: `/ticket/ship-route/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增航线
|
||||
createShipRoute: async (data: ShipRouteVO) => {
|
||||
return await request.post({ url: `/ticket/ship-route/create`, data })
|
||||
},
|
||||
|
||||
// 修改航线
|
||||
updateShipRoute: async (data: ShipRouteVO) => {
|
||||
return await request.put({ url: `/ticket/ship-route/update`, data })
|
||||
},
|
||||
|
||||
// 删除航线
|
||||
deleteShipRoute: async (id: number) => {
|
||||
return await request.delete({ url: `/ticket/ship-route/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出航线 Excel
|
||||
exportShipRoute: async (params) => {
|
||||
return await request.download({ url: `/ticket/ship-route/export-excel`, params })
|
||||
},
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 今日航班 VO
|
||||
export interface TodayFlightVO {
|
||||
id: number // id
|
||||
shipRouteId: number // 航线
|
||||
classes: string // 班次
|
||||
flightDate: string // 当日日期
|
||||
startTime: string // 开始时间
|
||||
}
|
||||
|
||||
// 今日航班 API
|
||||
export const TodayFlightApi = {
|
||||
// 查询今日航班分页
|
||||
getTodayFlightPage: async (params: any) => {
|
||||
return await request.get({ url: `/ticket/today-flight/page`, params })
|
||||
},
|
||||
|
||||
// 查询今日航班详情
|
||||
getTodayFlight: async (id: number) => {
|
||||
return await request.get({ url: `/ticket/today-flight/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增今日航班
|
||||
createTodayFlight: async (data: TodayFlightVO) => {
|
||||
return await request.post({ url: `/ticket/today-flight/create`, data })
|
||||
},
|
||||
|
||||
// 修改今日航班
|
||||
updateTodayFlight: async (data: TodayFlightVO) => {
|
||||
return await request.put({ url: `/ticket/today-flight/update`, data })
|
||||
},
|
||||
|
||||
// 删除今日航班
|
||||
deleteTodayFlight: async (id: number) => {
|
||||
return await request.delete({ url: `/ticket/today-flight/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出今日航班 Excel
|
||||
exportTodayFlight: async (params) => {
|
||||
return await request.download({ url: `/ticket/today-flight/export-excel`, params })
|
||||
},
|
||||
}
|
@ -26,15 +26,15 @@
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="操作员 Id" prop="operatorId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.operatorId"-->
|
||||
<!-- placeholder="请输入操作员 Id"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="操作员 Id" prop="operatorId">
|
||||
<el-input
|
||||
v-model="queryParams.operatorId"
|
||||
placeholder="请输入操作员 Id"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作员姓名" prop="operatorName">
|
||||
<el-input
|
||||
v-model="queryParams.operatorName"
|
||||
@ -262,14 +262,14 @@
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="openForm('create')"-->
|
||||
<!-- v-hasPermi="['parking:appearance-record:create']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['parking:appearance-record:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@ -324,14 +324,14 @@
|
||||
/>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="110">
|
||||
<template #default="scope">
|
||||
<!-- <el-button-->
|
||||
<!-- link-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="openForm('update', scope.row.id)"-->
|
||||
<!-- v-hasPermi="['parking:appearance-record:update']"-->
|
||||
<!-- >-->
|
||||
<!-- 编辑-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['parking:appearance-record:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
|
@ -55,10 +55,6 @@ const formData = ref({
|
||||
memo: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
|
||||
plate: [{ required: true, message: '车牌号不能为空', trigger: 'blur' }],
|
||||
memo: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
|
||||
source: [{ required: true, message: '来源不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
@ -64,53 +64,53 @@
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="访问事由" prop="visitReason">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.visitReason"-->
|
||||
<!-- placeholder="请输入访问事由"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="放行类型" prop="openGateMode">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.openGateMode"-->
|
||||
<!-- placeholder="请输入放行类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="匹配模式" prop="matchMode">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.matchMode"-->
|
||||
<!-- placeholder="请输入匹配模式"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="是否开闸" prop="barriorOpen">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.barriorOpen"-->
|
||||
<!-- placeholder="请输入是否开闸"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="开闸耗时" prop="costTime">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="queryParams.costTime"-->
|
||||
<!-- value-format="YYYY-MM-DD HH:mm:ss"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期"-->
|
||||
<!-- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="访问事由" prop="visitReason">
|
||||
<el-input
|
||||
v-model="queryParams.visitReason"
|
||||
placeholder="请输入访问事由"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="放行类型" prop="openGateMode">
|
||||
<el-input
|
||||
v-model="queryParams.openGateMode"
|
||||
placeholder="请输入放行类型"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="匹配模式" prop="matchMode">
|
||||
<el-input
|
||||
v-model="queryParams.matchMode"
|
||||
placeholder="请输入匹配模式"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开闸" prop="barriorOpen">
|
||||
<el-input
|
||||
v-model="queryParams.barriorOpen"
|
||||
placeholder="请输入是否开闸"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开闸耗时" prop="costTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.costTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
@ -125,14 +125,14 @@
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="openForm('create')"-->
|
||||
<!-- v-hasPermi="['parking:entry-record:create']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:plus" class="mr-5px" /> 新增-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['parking:entry-record:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@ -171,14 +171,14 @@
|
||||
/>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="110">
|
||||
<template #default="scope">
|
||||
<!-- <el-button-->
|
||||
<!-- link-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="openForm('update', scope.row.id)"-->
|
||||
<!-- v-hasPermi="['parking:entry-record:update']"-->
|
||||
<!-- >-->
|
||||
<!-- 编辑-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['parking:entry-record:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
|
@ -147,14 +147,6 @@
|
||||
<el-table-column label="部门" align="center" prop="dept" />
|
||||
<el-table-column label="备注" align="center" prop="memo" />
|
||||
<el-table-column label="来源" align="center" prop="source" />
|
||||
<el-table-column label="车主姓名" align="center" prop="name" />
|
||||
<el-table-column label="车子类型" align="center" prop="carType" />
|
||||
<el-table-column label="地址id" align="center" prop="areaId" />
|
||||
<el-table-column label="地址有效日期" align="center" prop="areaStart" />
|
||||
<el-table-column label="地址失效日期" align="center" prop="areaEnd" />
|
||||
<el-table-column label="地址" align="center" prop="address" />
|
||||
<el-table-column label="手机号码" align="center" prop="phone" />
|
||||
<el-table-column label="车牌颜色" align="center" prop="palteColor" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
|
@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="航班名称" prop="flightName">
|
||||
<el-input v-model="formData.flightName" placeholder="请输入航班名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { FlightApi, FlightVO } from '@/api/ticket/flight'
|
||||
|
||||
/** 航班 表单 */
|
||||
defineOptions({ name: 'FlightForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
flightName: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
flightName: [{ required: true, message: '航班名称不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await FlightApi.getFlight(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as FlightVO
|
||||
if (formType.value === 'create') {
|
||||
await FlightApi.createFlight(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await FlightApi.updateFlight(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
flightName: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
@ -1,187 +0,0 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="航班名称" prop="flightName">
|
||||
<el-input
|
||||
v-model="queryParams.flightName"
|
||||
placeholder="请输入航班名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['ticket:flight:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['ticket:flight:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="id" align="center" prop="id" />
|
||||
<el-table-column label="航班名称" align="center" prop="flightName" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['ticket:flight:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['ticket:flight:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<FlightForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { FlightApi, FlightVO } from '@/api/ticket/flight'
|
||||
import FlightForm from './FlightForm.vue'
|
||||
|
||||
/** 航班 列表 */
|
||||
defineOptions({ name: 'Flight' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<FlightVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
flightName: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await FlightApi.getFlightPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await FlightApi.deleteFlight(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await FlightApi.exportFlight(queryParams)
|
||||
download.excel(data, '航班.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
@ -1,123 +0,0 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<!-- <el-form-item label="归属航班" prop="flightId">
|
||||
<el-input v-model="formData.flightId" placeholder="请输入航班" />
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="所属航班" prop="flightId">
|
||||
<el-select v-model="formData.flightId" placeholder="请选择所属航班" clearable class="!w-240px">
|
||||
<el-option v-for="flightNameOptions in option" :key="flightNameOptions.id"
|
||||
:label="flightNameOptions.flightName" :value="flightNameOptions.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="航线名称" prop="routeName">
|
||||
<el-input v-model="formData.routeName" placeholder="请输入航线名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ShipRouteApi, ShipRouteVO } from '@/api/ticket/shiproute'
|
||||
import { FlightApi, FlightVO } from '@/api/ticket/flight'
|
||||
|
||||
/** 航线 表单 */
|
||||
defineOptions({ name: 'ShipRouteForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const option = ref<FlightVO[]>([]);
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
flightId: undefined,
|
||||
routeName: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
flightId: [{ required: true, message: '归属航班不能为空', trigger: 'blur' }],
|
||||
routeName: [{ required: true, message: '航线名称不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await ShipRouteApi.getShipRoute(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
//初始化航班名称下拉框
|
||||
const getFlightName = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
option.value = await FlightApi.getFlightName()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as ShipRouteVO
|
||||
if (formType.value === 'create') {
|
||||
await ShipRouteApi.createShipRoute(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ShipRouteApi.updateShipRoute(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
flightId: undefined,
|
||||
routeName: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getFlightName()
|
||||
})
|
||||
</script>
|
@ -1,230 +0,0 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form-item label="归属航班" prop="flightId">
|
||||
<el-input
|
||||
v-model="queryParams.flightId"
|
||||
placeholder="请输入航班"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="所属航班" prop="flightId">
|
||||
<el-select
|
||||
v-model="queryParams.flightId"
|
||||
placeholder="请选择属于航班"
|
||||
clearable
|
||||
class="!w-200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="flightNameOptions in option"
|
||||
:key="flightNameOptions.id"
|
||||
:label="flightNameOptions.flightName"
|
||||
:value="flightNameOptions.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="航线名称" prop="routeName">
|
||||
<el-input
|
||||
v-model="queryParams.routeName"
|
||||
placeholder="请输入航线名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['ticket:ship-route:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['ticket:ship-route:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="所属航班" align="center" prop="flightName" />
|
||||
<el-table-column label="航线名称" align="center" prop="routeName" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['ticket:ship-route:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['ticket:ship-route:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ShipRouteForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { ShipRouteApi, ShipRouteVO } from '@/api/ticket/shiproute'
|
||||
import ShipRouteForm from './ShipRouteForm.vue'
|
||||
import { FlightApi, FlightVO } from '@/api/ticket/flight'
|
||||
|
||||
/** 航线 列表 */
|
||||
defineOptions({ name: 'ShipRoute' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<ShipRouteVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const option = ref<FlightVO[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
flightId: undefined,
|
||||
routeName: undefined,
|
||||
createTime: [],
|
||||
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ShipRouteApi.getShipRoutePage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
//初始化航班名称下拉框
|
||||
const getFlightName = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
option.value = await FlightApi.getFlightName()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await ShipRouteApi.deleteShipRoute(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await ShipRouteApi.exportShipRoute(queryParams)
|
||||
download.excel(data, '航线.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getFlightName()
|
||||
})
|
||||
</script>
|
@ -1,136 +0,0 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="航线" prop="shipRouteId">
|
||||
<el-select v-model="formData.shipRouteId" placeholder="请选择所属航线" clearable class="!w-240px">
|
||||
<el-option v-for="shipRouteNameOptions in option" :key="shipRouteNameOptions.id"
|
||||
:label="shipRouteNameOptions.routeName" :value="shipRouteNameOptions.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班次" prop="classes">
|
||||
<el-input v-model="formData.classes" placeholder="请输入班次" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出发时间" prop="startTime">
|
||||
<el-time-select
|
||||
v-model="formData.startTime"
|
||||
start="05:00"
|
||||
step="00:05"
|
||||
end="20:00"
|
||||
placeholder="选择出发时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { TodayFlightApi, TodayFlightVO } from '@/api/ticket/todayflight'
|
||||
import { ShipRouteApi, ShipRouteVO } from '@/api/ticket/shiproute'
|
||||
|
||||
/** 今日航班 表单 */
|
||||
defineOptions({ name: 'TodayFlightForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
// const value = ref('');
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const option = ref<ShipRouteVO[]>([]);
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
shipRouteId: undefined,
|
||||
classes: undefined,
|
||||
// flightDate: undefined,
|
||||
startTime: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
shipRouteId: [{ required: true, message: '航线不能为空', trigger: 'blur' }],
|
||||
classes: [{ required: true, message: '班次不能为空', trigger: 'blur' }],
|
||||
// flightDate: [{ required: true, message: '当日日期不能为空', trigger: 'blur' }],
|
||||
startTime: [{ required: true, message: '出发时间不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await TodayFlightApi.getTodayFlight(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as TodayFlightVO
|
||||
if (formType.value === 'create') {
|
||||
await TodayFlightApi.createTodayFlight(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await TodayFlightApi.updateTodayFlight(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
//初始化航线名称下拉框
|
||||
const getRouteName = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
option.value = await ShipRouteApi.getRouteName()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
shipRouteId: undefined,
|
||||
classes: undefined,
|
||||
// flightDate: undefined,
|
||||
startTime: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getRouteName()
|
||||
})
|
||||
</script>
|
@ -1,254 +0,0 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form-item label="航线" prop="shipRouteId">
|
||||
<el-input
|
||||
v-model="queryParams.shipRouteId"
|
||||
placeholder="请输入航线"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="航线" prop="shipRouteId">
|
||||
<el-select
|
||||
v-model="queryParams.shipRouteId"
|
||||
placeholder="请选择属于航线"
|
||||
clearable
|
||||
class="!w-200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="shipRouteNameOptions in option"
|
||||
:key="shipRouteNameOptions.id"
|
||||
:label="shipRouteNameOptions.routeName"
|
||||
:value="shipRouteNameOptions.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="班次" prop="classes">
|
||||
<el-input
|
||||
v-model="queryParams.classes"
|
||||
placeholder="请输入班次"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="当日日期" prop="flightDate">
|
||||
<el-date-picker
|
||||
v-model="queryParams.flightDate"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="出发时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.startTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['ticket:today-flight:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['ticket:today-flight:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="航线" align="center" prop="shipRouteName" />
|
||||
<el-table-column label="班次" align="center" prop="classes" />
|
||||
<el-table-column label="出发时间" align="center" prop="startTime" width="180px"/>
|
||||
<!-- <el-table-column label="当日日期" align="center" prop="flightDate" /> -->
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['ticket:today-flight:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['ticket:today-flight:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<TodayFlightForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { TodayFlightApi, TodayFlightVO } from '@/api/ticket/todayflight'
|
||||
import TodayFlightForm from './TodayFlightForm.vue'
|
||||
import { ShipRouteApi, ShipRouteVO } from '@/api/ticket/shiproute'
|
||||
|
||||
/** 今日航班 列表 */
|
||||
defineOptions({ name: 'TodayFlight' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<TodayFlightVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const option = ref<ShipRouteVO[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
shipRouteId: undefined,
|
||||
classes: undefined,
|
||||
flightDate: [],
|
||||
startTime: [],
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await TodayFlightApi.getTodayFlightPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
//初始化航线名称下拉框
|
||||
const getRouteName = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
option.value = await ShipRouteApi.getRouteName()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await TodayFlightApi.deleteTodayFlight(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await TodayFlightApi.exportTodayFlight(queryParams)
|
||||
download.excel(data, '今日航班.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getRouteName()
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user