收费信息、远程抬杠、心跳日志、场库、区域、通道
This commit is contained in:
parent
587c832c77
commit
896fa99546
46
src/api/parking/heartbeat/message/index.ts
Normal file
46
src/api/parking/heartbeat/message/index.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 心跳管理 VO
|
||||
export interface HeartbeatVO {
|
||||
id: number // 编号
|
||||
parkNumber: string // 场库编号
|
||||
parkName: string // 场库名称
|
||||
spaceCount: number // 场库总车位数
|
||||
freeSpaceCount: number // 场库空车位数
|
||||
bookSpaceCount: number // 场库可预约数
|
||||
bookInParkCount: number // 场库在场预约数
|
||||
areaList: string // 区域属性
|
||||
}
|
||||
|
||||
// 心跳管理 API
|
||||
export const HeartbeatApi = {
|
||||
// 查询心跳管理分页
|
||||
getHeartbeatPage: async (params: any) => {
|
||||
return await request.get({ url: `/parking/heartbeat/page`, params })
|
||||
},
|
||||
|
||||
// 查询心跳管理详情
|
||||
getHeartbeat: async (id: number) => {
|
||||
return await request.get({ url: `/parking/heartbeat/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增心跳管理
|
||||
createHeartbeat: async (data: HeartbeatVO) => {
|
||||
return await request.post({ url: `/parking/heartbeat/create`, data })
|
||||
},
|
||||
|
||||
// 修改心跳管理
|
||||
updateHeartbeat: async (data: HeartbeatVO) => {
|
||||
return await request.put({ url: `/parking/heartbeat/update`, data })
|
||||
},
|
||||
|
||||
// 删除心跳管理
|
||||
deleteHeartbeat: async (id: number) => {
|
||||
return await request.delete({ url: `/parking/heartbeat/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出心跳管理 Excel
|
||||
exportHeartbeat: async (params) => {
|
||||
return await request.download({ url: `/parking/heartbeat/export-excel`, params })
|
||||
},
|
||||
}
|
41
src/api/parking/instructiondelivery/liftingrod/index.ts
Normal file
41
src/api/parking/instructiondelivery/liftingrod/index.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 远程抬杠日志 VO
|
||||
export interface LiftingRodVO {
|
||||
id: number // id
|
||||
parkNumber: string // 停车场编号
|
||||
passagewayId: string // 通道Id
|
||||
}
|
||||
|
||||
// 远程抬杠日志 API
|
||||
export const LiftingRodApi = {
|
||||
// 查询远程抬杠日志分页
|
||||
getLiftingRodPage: async (params: any) => {
|
||||
return await request.get({ url: `/parking/lifting-rod/page`, params })
|
||||
},
|
||||
|
||||
// 查询远程抬杠日志详情
|
||||
getLiftingRod: async (id: number) => {
|
||||
return await request.get({ url: `/parking/lifting-rod/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增远程抬杠日志
|
||||
createLiftingRod: async (data: LiftingRodVO) => {
|
||||
return await request.post({ url: `/parking/lifting-rod/create`, data })
|
||||
},
|
||||
|
||||
// 修改远程抬杠日志
|
||||
updateLiftingRod: async (data: LiftingRodVO) => {
|
||||
return await request.put({ url: `/parking/lifting-rod/update`, data })
|
||||
},
|
||||
|
||||
// 删除远程抬杠日志
|
||||
deleteLiftingRod: async (id: number) => {
|
||||
return await request.delete({ url: `/parking/lifting-rod/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出远程抬杠日志 Excel
|
||||
exportLiftingRod: async (params) => {
|
||||
return await request.download({ url: `/parking/lifting-rod/export-excel`, params })
|
||||
},
|
||||
}
|
59
src/api/parking/moneymanage/chargeinfo/index.ts
Normal file
59
src/api/parking/moneymanage/chargeinfo/index.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 收费信息 VO
|
||||
export interface chargeInfoVO {
|
||||
id: number // id
|
||||
parkNumber: string // 场库编号
|
||||
plate: string // 车牌号
|
||||
inTime: string // 入场时间
|
||||
outTime: string // 结算时间
|
||||
inChannel: string // 入场通道
|
||||
outChannel: string // 出场通道
|
||||
payKind: string // 支付类型
|
||||
payChannel: string // 支付渠道
|
||||
orderId: string // 入场订单号
|
||||
carType: string // 车辆类型
|
||||
payNo: string // 支付订单号
|
||||
memo: string // 备注
|
||||
charge: string // 应缴金额
|
||||
realCharge: string // 实收金额
|
||||
couponCharge: string // 优惠金额
|
||||
areaId: string // 区域 ID
|
||||
operatorName: string // 操作员名称
|
||||
operatorTelphone: string // 操作员联系电话
|
||||
outTradeNo: string // 支付订单号
|
||||
plateColor: string // 车牌颜色
|
||||
}
|
||||
|
||||
// 收费信息 API
|
||||
export const chargeInfoApi = {
|
||||
// 查询收费信息分页
|
||||
getchargeInfoPage: async (params: any) => {
|
||||
return await request.get({ url: `/parking/charge-info/page`, params })
|
||||
},
|
||||
|
||||
// 查询收费信息详情
|
||||
getchargeInfo: async (id: number) => {
|
||||
return await request.get({ url: `/parking/charge-info/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增收费信息
|
||||
createchargeInfo: async (data: chargeInfoVO) => {
|
||||
return await request.post({ url: `/parking/charge-info/create`, data })
|
||||
},
|
||||
|
||||
// 修改收费信息
|
||||
updatechargeInfo: async (data: chargeInfoVO) => {
|
||||
return await request.put({ url: `/parking/charge-info/update`, data })
|
||||
},
|
||||
|
||||
// 删除收费信息
|
||||
deletechargeInfo: async (id: number) => {
|
||||
return await request.delete({ url: `/parking/charge-info/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出收费信息 Excel
|
||||
exportchargeInfo: async (params) => {
|
||||
return await request.download({ url: `/parking/charge-info/export-excel`, params })
|
||||
},
|
||||
}
|
46
src/api/parking/parkmanage/area/index.ts
Normal file
46
src/api/parking/parkmanage/area/index.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 区域列表 VO
|
||||
export interface AreaVO {
|
||||
areaName: string // 区域名称
|
||||
spaceCount: number // 区域车位数
|
||||
lastSpaceCount: number // 区域空位数
|
||||
bookSpaceCount: number // 区域可预约车位数
|
||||
bookInParkCount: number // 区域在场预约数
|
||||
id: number // id
|
||||
areaId: number // 区域Id
|
||||
parkNumber: string // 场库编号
|
||||
}
|
||||
|
||||
// 区域列表 API
|
||||
export const AreaApi = {
|
||||
// 查询区域列表分页
|
||||
getAreaPage: async (params: any) => {
|
||||
return await request.get({ url: `/parking/area/page`, params })
|
||||
},
|
||||
|
||||
// 查询区域列表详情
|
||||
getArea: async (id: number) => {
|
||||
return await request.get({ url: `/parking/area/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增区域列表
|
||||
createArea: async (data: AreaVO) => {
|
||||
return await request.post({ url: `/parking/area/create`, data })
|
||||
},
|
||||
|
||||
// 修改区域列表
|
||||
updateArea: async (data: AreaVO) => {
|
||||
return await request.put({ url: `/parking/area/update`, data })
|
||||
},
|
||||
|
||||
// 删除区域列表
|
||||
deleteArea: async (id: number) => {
|
||||
return await request.delete({ url: `/parking/area/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出区域列表 Excel
|
||||
exportArea: async (params) => {
|
||||
return await request.download({ url: `/parking/area/export-excel`, params })
|
||||
},
|
||||
}
|
44
src/api/parking/parkmanage/park/index.ts
Normal file
44
src/api/parking/parkmanage/park/index.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 场库列表 VO
|
||||
export interface ParkVO {
|
||||
parkNumber: string // 场库编号
|
||||
parkName: string // 场库名称
|
||||
spaceCount: number // 场库总车位数
|
||||
freeSpaceCount: number // 场库空车位数
|
||||
bookSpaceCount: number // 场库可预约数
|
||||
bookInParkCount: number // 场库在场预约数
|
||||
}
|
||||
|
||||
// 场库列表 API
|
||||
export const ParkApi = {
|
||||
// 查询场库列表分页
|
||||
getParkPage: async (params: any) => {
|
||||
return await request.get({ url: `/parking/park/page`, params })
|
||||
},
|
||||
|
||||
// 查询场库列表详情
|
||||
getPark: async (id: number) => {
|
||||
return await request.get({ url: `/parking/park/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增场库列表
|
||||
createPark: async (data: ParkVO) => {
|
||||
return await request.post({ url: `/parking/park/create`, data })
|
||||
},
|
||||
|
||||
// 修改场库列表
|
||||
updatePark: async (data: ParkVO) => {
|
||||
return await request.put({ url: `/parking/park/update`, data })
|
||||
},
|
||||
|
||||
// 删除场库列表
|
||||
deletePark: async (id: number) => {
|
||||
return await request.delete({ url: `/parking/park/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出场库列表 Excel
|
||||
exportPark: async (params) => {
|
||||
return await request.download({ url: `/parking/park/export-excel`, params })
|
||||
},
|
||||
}
|
43
src/api/parking/parkmanage/passageway/index.ts
Normal file
43
src/api/parking/parkmanage/passageway/index.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 通道信息 VO
|
||||
export interface PassagewayVO {
|
||||
passagewayId: string // 通道 Id
|
||||
parkNumber: string // 场库编号
|
||||
passagewayName: string // 通道名称
|
||||
sourceAreaId: string // 源区域 Id
|
||||
targetAreaId: string // 目标区域 Id
|
||||
}
|
||||
|
||||
// 通道信息 API
|
||||
export const PassagewayApi = {
|
||||
// 查询通道信息分页
|
||||
getPassagewayPage: async (params: any) => {
|
||||
return await request.get({ url: `/parking/passageway/page`, params })
|
||||
},
|
||||
|
||||
// 查询通道信息详情
|
||||
getPassageway: async (id: number) => {
|
||||
return await request.get({ url: `/parking/passageway/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增通道信息
|
||||
createPassageway: async (data: PassagewayVO) => {
|
||||
return await request.post({ url: `/parking/passageway/create`, data })
|
||||
},
|
||||
|
||||
// 修改通道信息
|
||||
updatePassageway: async (data: PassagewayVO) => {
|
||||
return await request.put({ url: `/parking/passageway/update`, data })
|
||||
},
|
||||
|
||||
// 删除通道信息
|
||||
deletePassageway: async (id: number) => {
|
||||
return await request.delete({ url: `/parking/passageway/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出通道信息 Excel
|
||||
exportPassageway: async (params) => {
|
||||
return await request.download({ url: `/parking/passageway/export-excel`, params })
|
||||
},
|
||||
}
|
128
src/views/parking/heartbeat/message/HeartbeatForm.vue
Normal file
128
src/views/parking/heartbeat/message/HeartbeatForm.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<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="parkNumber">
|
||||
<el-input v-model="formData.parkNumber" placeholder="请输入场库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库名称" prop="parkName">
|
||||
<el-input v-model="formData.parkName" placeholder="请输入场库名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库总车位数" prop="spaceCount">
|
||||
<el-input v-model="formData.spaceCount" placeholder="请输入场库总车位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库空车位数" prop="freeSpaceCount">
|
||||
<el-input v-model="formData.freeSpaceCount" placeholder="请输入场库空车位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库可预约数" prop="bookSpaceCount">
|
||||
<el-input v-model="formData.bookSpaceCount" placeholder="请输入场库可预约数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库在场预约数" prop="bookInParkCount">
|
||||
<el-input v-model="formData.bookInParkCount" placeholder="请输入场库在场预约数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域属性" prop="areaList">
|
||||
<el-input v-model="formData.areaList" 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 { HeartbeatApi, HeartbeatVO } from '@/api/parking/heartbeat/message'
|
||||
|
||||
/** 心跳管理 表单 */
|
||||
defineOptions({ name: 'HeartbeatForm' })
|
||||
|
||||
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,
|
||||
parkNumber: undefined,
|
||||
parkName: undefined,
|
||||
spaceCount: undefined,
|
||||
freeSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
areaList: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
|
||||
parkName: [{ required: true, message: '场库名称不能为空', trigger: 'blur' }],
|
||||
spaceCount: [{ required: true, message: '场库总车位数不能为空', trigger: 'blur' }],
|
||||
freeSpaceCount: [{ required: true, message: '场库空车位数不能为空', trigger: 'blur' }],
|
||||
bookSpaceCount: [{ required: true, message: '场库可预约数不能为空', trigger: 'blur' }],
|
||||
bookInParkCount: [{ required: true, message: '场库在场预约数不能为空', trigger: 'blur' }],
|
||||
areaList: [{ 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 HeartbeatApi.getHeartbeat(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 HeartbeatVO
|
||||
if (formType.value === 'create') {
|
||||
await HeartbeatApi.createHeartbeat(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await HeartbeatApi.updateHeartbeat(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
parkNumber: undefined,
|
||||
parkName: undefined,
|
||||
spaceCount: undefined,
|
||||
freeSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
areaList: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
253
src/views/parking/heartbeat/message/index.vue
Normal file
253
src/views/parking/heartbeat/message/index.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="场库编号" prop="parkNumber">
|
||||
<el-input
|
||||
v-model="queryParams.parkNumber"
|
||||
placeholder="请输入场库编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库名称" prop="parkName">
|
||||
<el-input
|
||||
v-model="queryParams.parkName"
|
||||
placeholder="请输入场库名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库总车位数" prop="spaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.spaceCount"
|
||||
placeholder="请输入场库总车位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库空车位数" prop="freeSpaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.freeSpaceCount"
|
||||
placeholder="请输入场库空车位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库可预约数" prop="bookSpaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.bookSpaceCount"
|
||||
placeholder="请输入场库可预约数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库在场预约数" prop="bookInParkCount">
|
||||
<el-input
|
||||
v-model="queryParams.bookInParkCount"
|
||||
placeholder="请输入场库在场预约数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域属性" prop="areaList">
|
||||
<el-input
|
||||
v-model="queryParams.areaList"
|
||||
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="['parking:heartbeat:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['parking:heartbeat: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="编号" align="center" prop="id" />
|
||||
<el-table-column label="场库编号" align="center" prop="parkNumber" />
|
||||
<el-table-column label="场库名称" align="center" prop="parkName" />
|
||||
<el-table-column label="场库总车位数" align="center" prop="spaceCount" />
|
||||
<el-table-column label="场库空车位数" align="center" prop="freeSpaceCount" />
|
||||
<el-table-column label="场库可预约数" align="center" prop="bookSpaceCount" />
|
||||
<el-table-column label="场库在场预约数" align="center" prop="bookInParkCount" />
|
||||
<el-table-column label="区域属性" align="center" prop="areaList" />
|
||||
<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="['parking:heartbeat:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['parking:heartbeat: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<HeartbeatForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { HeartbeatApi, HeartbeatVO } from '@/api/parking/heartbeat/message'
|
||||
import HeartbeatForm from './HeartbeatForm.vue'
|
||||
|
||||
/** 心跳管理 列表 */
|
||||
defineOptions({ name: 'Heartbeat' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<HeartbeatVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
parkNumber: undefined,
|
||||
parkName: undefined,
|
||||
spaceCount: undefined,
|
||||
freeSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
areaList: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await HeartbeatApi.getHeartbeatPage(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 HeartbeatApi.deleteHeartbeat(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await HeartbeatApi.exportHeartbeat(queryParams)
|
||||
download.excel(data, '心跳管理.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
@ -0,0 +1,98 @@
|
||||
<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="parkNumber">
|
||||
<el-input v-model="formData.parkNumber" placeholder="请输入停车场编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道Id" prop="passagewayId">
|
||||
<el-input v-model="formData.passagewayId" placeholder="请输入通道Id" />
|
||||
</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 { LiftingRodApi, LiftingRodVO } from '@/api/parking/instructiondelivery/liftingrod'
|
||||
|
||||
/** 远程抬杠日志 表单 */
|
||||
defineOptions({ name: 'LiftingRodForm' })
|
||||
|
||||
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,
|
||||
parkNumber: undefined,
|
||||
passagewayId: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
parkNumber: [{ required: true, message: '停车场编号不能为空', trigger: 'blur' }],
|
||||
passagewayId: [{ required: true, message: '通道Id不能为空', 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 LiftingRodApi.getLiftingRod(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 LiftingRodVO
|
||||
if (formType.value === 'create') {
|
||||
await LiftingRodApi.createLiftingRod(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await LiftingRodApi.updateLiftingRod(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
parkNumber: undefined,
|
||||
passagewayId: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
198
src/views/parking/instructiondelivery/liftingrod/index.vue
Normal file
198
src/views/parking/instructiondelivery/liftingrod/index.vue
Normal file
@ -0,0 +1,198 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="停车场编号" prop="parkNumber">
|
||||
<el-input
|
||||
v-model="queryParams.parkNumber"
|
||||
placeholder="请输入停车场编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道Id" prop="passagewayId">
|
||||
<el-input
|
||||
v-model="queryParams.passagewayId"
|
||||
placeholder="请输入通道Id"
|
||||
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="['parking:lifting-rod:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['parking:lifting-rod: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="parkNumber" />
|
||||
<el-table-column label="通道Id" align="center" prop="passagewayId" />
|
||||
<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="['parking:lifting-rod:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['parking:lifting-rod: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<LiftingRodForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { LiftingRodApi, LiftingRodVO } from '@/api/parking/instructiondelivery/liftingrod'
|
||||
import LiftingRodForm from './LiftingRodForm.vue'
|
||||
|
||||
/** 远程抬杠日志 列表 */
|
||||
defineOptions({ name: 'LiftingRod' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<LiftingRodVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
parkNumber: undefined,
|
||||
passagewayId: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await LiftingRodApi.getLiftingRodPage(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 LiftingRodApi.deleteLiftingRod(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await LiftingRodApi.exportLiftingRod(queryParams)
|
||||
download.excel(data, '远程抬杠日志.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
212
src/views/parking/moneymanage/chargeinfo/chargeInfoForm.vue
Normal file
212
src/views/parking/moneymanage/chargeinfo/chargeInfoForm.vue
Normal file
@ -0,0 +1,212 @@
|
||||
<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="parkNumber">
|
||||
<el-input v-model="formData.parkNumber" placeholder="请输入场库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号" prop="plate">
|
||||
<el-input v-model="formData.plate" placeholder="请输入车牌号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入场时间" prop="inTime">
|
||||
<el-date-picker
|
||||
v-model="formData.inTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择入场时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算时间" prop="outTime">
|
||||
<el-date-picker
|
||||
v-model="formData.outTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择结算时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场通道" prop="inChannel">
|
||||
<el-input v-model="formData.inChannel" placeholder="请输入入场通道" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出场通道" prop="outChannel">
|
||||
<el-input v-model="formData.outChannel" placeholder="请输入出场通道" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付类型" prop="payKind">
|
||||
<el-input v-model="formData.payKind" placeholder="请输入支付类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付渠道" prop="payChannel">
|
||||
<el-input v-model="formData.payChannel" placeholder="请输入支付渠道" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入场订单号" prop="orderId">
|
||||
<el-input v-model="formData.orderId" placeholder="请输入入场订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆类型" prop="carType">
|
||||
<el-select v-model="formData.carType" placeholder="请选择车辆类型">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付订单号" prop="payNo">
|
||||
<el-input v-model="formData.payNo" placeholder="请输入支付订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="memo">
|
||||
<el-input v-model="formData.memo" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="应缴金额" prop="charge">
|
||||
<el-input v-model="formData.charge" placeholder="请输入应缴金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实收金额" prop="realCharge">
|
||||
<el-input v-model="formData.realCharge" placeholder="请输入实收金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠金额" prop="couponCharge">
|
||||
<el-input v-model="formData.couponCharge" placeholder="请输入优惠金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域 ID" prop="areaId">
|
||||
<el-input v-model="formData.areaId" placeholder="请输入区域 ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作员名称" prop="operatorName">
|
||||
<el-input v-model="formData.operatorName" placeholder="请输入操作员名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="操作员联系电话" prop="operatorTelphone">
|
||||
<el-input v-model="formData.operatorTelphone" placeholder="请输入操作员联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="支付订单号" prop="outTradeNo">
|
||||
<el-input v-model="formData.outTradeNo" placeholder="请输入支付订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌颜色" prop="plateColor">
|
||||
<el-input v-model="formData.plateColor" 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 { chargeInfoApi, chargeInfoVO } from '@/api/parking/moneymanage/chargeinfo'
|
||||
|
||||
/** 收费信息 表单 */
|
||||
defineOptions({ name: 'ChargeInfoForm' })
|
||||
|
||||
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,
|
||||
parkNumber: undefined,
|
||||
plate: undefined,
|
||||
inTime: undefined,
|
||||
outTime: undefined,
|
||||
inChannel: undefined,
|
||||
outChannel: undefined,
|
||||
payKind: undefined,
|
||||
payChannel: undefined,
|
||||
orderId: undefined,
|
||||
carType: undefined,
|
||||
payNo: undefined,
|
||||
memo: undefined,
|
||||
charge: undefined,
|
||||
realCharge: undefined,
|
||||
couponCharge: undefined,
|
||||
areaId: undefined,
|
||||
operatorName: undefined,
|
||||
operatorTelphone: undefined,
|
||||
outTradeNo: undefined,
|
||||
plateColor: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
plate: [{ required: true, message: '车牌号不能为空', trigger: 'blur' }],
|
||||
inTime: [{ required: true, message: '入场时间不能为空', trigger: 'blur' }],
|
||||
outTime: [{ required: true, message: '结算时间不能为空', trigger: 'blur' }],
|
||||
payKind: [{ required: true, message: '支付类型不能为空', trigger: 'blur' }],
|
||||
payChannel: [{ required: true, message: '支付渠道不能为空', trigger: 'blur' }],
|
||||
memo: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
|
||||
charge: [{ required: true, message: '应缴金额不能为空', trigger: 'blur' }],
|
||||
realCharge: [{ required: true, message: '实收金额不能为空', trigger: 'blur' }],
|
||||
couponCharge: [{ required: true, message: '优惠金额不能为空', trigger: 'blur' }],
|
||||
areaId: [{ required: true, message: '区域 ID不能为空', trigger: 'blur' }],
|
||||
operatorName: [{ required: true, message: '操作员名称不能为空', trigger: 'blur' }],
|
||||
operatorTelphone: [{ required: true, message: '操作员联系电话不能为空', trigger: 'blur' }],
|
||||
outTradeNo: [{ required: true, message: '支付订单号不能为空', trigger: 'blur' }],
|
||||
plateColor: [{ 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 chargeInfoApi.getchargeInfo(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 chargeInfoVO
|
||||
if (formType.value === 'create') {
|
||||
await chargeInfoApi.createchargeInfo(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await chargeInfoApi.updatechargeInfo(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
parkNumber: undefined,
|
||||
plate: undefined,
|
||||
inTime: undefined,
|
||||
outTime: undefined,
|
||||
inChannel: undefined,
|
||||
outChannel: undefined,
|
||||
payKind: undefined,
|
||||
payChannel: undefined,
|
||||
orderId: undefined,
|
||||
carType: undefined,
|
||||
payNo: undefined,
|
||||
memo: undefined,
|
||||
charge: undefined,
|
||||
realCharge: undefined,
|
||||
couponCharge: undefined,
|
||||
areaId: undefined,
|
||||
operatorName: undefined,
|
||||
operatorTelphone: undefined,
|
||||
outTradeNo: undefined,
|
||||
plateColor: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
401
src/views/parking/moneymanage/chargeinfo/index.vue
Normal file
401
src/views/parking/moneymanage/chargeinfo/index.vue
Normal file
@ -0,0 +1,401 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="场库编号" prop="parkNumber">
|
||||
<el-input
|
||||
v-model="queryParams.parkNumber"
|
||||
placeholder="请输入场库编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌号" prop="plate">
|
||||
<el-input
|
||||
v-model="queryParams.plate"
|
||||
placeholder="请输入车牌号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入场时间" prop="inTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.inTime"
|
||||
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="outTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.outTime"
|
||||
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="inChannel">
|
||||
<el-input
|
||||
v-model="queryParams.inChannel"
|
||||
placeholder="请输入入场通道"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出场通道" prop="outChannel">
|
||||
<el-input
|
||||
v-model="queryParams.outChannel"
|
||||
placeholder="请输入出场通道"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付类型" prop="payKind">
|
||||
<el-input
|
||||
v-model="queryParams.payKind"
|
||||
placeholder="请输入支付类型"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付渠道" prop="payChannel">
|
||||
<el-input
|
||||
v-model="queryParams.payChannel"
|
||||
placeholder="请输入支付渠道"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="入场订单号" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入入场订单号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="车辆类型" prop="carType">
|
||||
<el-select
|
||||
v-model="queryParams.carType"
|
||||
placeholder="请选择车辆类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付订单号" prop="payNo">
|
||||
<el-input
|
||||
v-model="queryParams.payNo"
|
||||
placeholder="请输入支付订单号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="备注" prop="memo">
|
||||
<el-input
|
||||
v-model="queryParams.memo"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="应缴金额" prop="charge">
|
||||
<el-input
|
||||
v-model="queryParams.charge"
|
||||
placeholder="请输入应缴金额"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="实收金额" prop="realCharge">
|
||||
<el-input
|
||||
v-model="queryParams.realCharge"
|
||||
placeholder="请输入实收金额"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠金额" prop="couponCharge">
|
||||
<el-input
|
||||
v-model="queryParams.couponCharge"
|
||||
placeholder="请输入优惠金额"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="区域 ID" prop="areaId">
|
||||
<el-input
|
||||
v-model="queryParams.areaId"
|
||||
placeholder="请输入区域 ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="操作员名称" prop="operatorName">
|
||||
<el-input
|
||||
v-model="queryParams.operatorName"
|
||||
placeholder="请输入操作员名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="操作员联系电话" prop="operatorTelphone">
|
||||
<el-input
|
||||
v-model="queryParams.operatorTelphone"
|
||||
placeholder="请输入操作员联系电话"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付订单号" prop="outTradeNo">
|
||||
<el-input
|
||||
v-model="queryParams.outTradeNo"
|
||||
placeholder="请输入支付订单号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车牌颜色" prop="plateColor">
|
||||
<el-input
|
||||
v-model="queryParams.plateColor"
|
||||
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="['parking:charge-info:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['parking:charge-info: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="parkNumber" />
|
||||
<el-table-column label="车牌号" align="center" prop="plate" />
|
||||
<!-- <el-table-column label="入场时间" align="center" prop="inTime" />
|
||||
<el-table-column label="结算时间" align="center" prop="outTime" />
|
||||
<el-table-column label="入场通道" align="center" prop="inChannel" />
|
||||
<el-table-column label="出场通道" align="center" prop="outChannel" /> -->
|
||||
<el-table-column label="支付类型" align="center" prop="payKind" />
|
||||
<el-table-column label="支付渠道" align="center" prop="payChannel" />
|
||||
<!-- <el-table-column label="入场订单号" align="center" prop="orderId" /> -->
|
||||
<el-table-column label="车辆类型" align="center" prop="carType" />
|
||||
<el-table-column label="支付订单号" align="center" prop="payNo" />
|
||||
<!-- <el-table-column label="备注" align="center" prop="memo" /> -->
|
||||
<el-table-column label="应缴金额" align="center" prop="charge" />
|
||||
<el-table-column label="实收金额" align="center" prop="realCharge" />
|
||||
<el-table-column label="优惠金额" align="center" prop="couponCharge" />
|
||||
<el-table-column label="区域 ID" align="center" prop="areaId" />
|
||||
<!-- <el-table-column label="操作员名称" align="center" prop="operatorName" />
|
||||
<el-table-column label="操作员联系电话" align="center" prop="operatorTelphone" /> -->
|
||||
<!-- <el-table-column label="支付订单号" align="center" prop="outTradeNo" /> -->
|
||||
<!-- <el-table-column label="车牌颜色" align="center" prop="plateColor" />
|
||||
<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="['parking:charge-info:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['parking:charge-info: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<chargeInfoForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { chargeInfoApi, chargeInfoVO } from '@/api/parking/moneymanage/chargeinfo'
|
||||
import chargeInfoForm from './chargeInfoForm.vue'
|
||||
|
||||
/** 收费信息 列表 */
|
||||
defineOptions({ name: 'ChargeInfo' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<chargeInfoVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
parkNumber: undefined,
|
||||
plate: undefined,
|
||||
inTime: [],
|
||||
outTime: [],
|
||||
inChannel: undefined,
|
||||
outChannel: undefined,
|
||||
payKind: undefined,
|
||||
payChannel: undefined,
|
||||
orderId: undefined,
|
||||
carType: undefined,
|
||||
payNo: undefined,
|
||||
memo: undefined,
|
||||
charge: undefined,
|
||||
realCharge: undefined,
|
||||
couponCharge: undefined,
|
||||
areaId: undefined,
|
||||
operatorName: undefined,
|
||||
operatorTelphone: undefined,
|
||||
outTradeNo: undefined,
|
||||
plateColor: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await chargeInfoApi.getchargeInfoPage(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 chargeInfoApi.deletechargeInfo(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await chargeInfoApi.exportchargeInfo(queryParams)
|
||||
download.excel(data, '收费信息.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
128
src/views/parking/parkmanage/area/AreaForm.vue
Normal file
128
src/views/parking/parkmanage/area/AreaForm.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<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="areaName">
|
||||
<el-input v-model="formData.areaName" placeholder="请输入区域名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域车位数" prop="spaceCount">
|
||||
<el-input v-model="formData.spaceCount" placeholder="请输入区域车位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域空位数" prop="lastSpaceCount">
|
||||
<el-input v-model="formData.lastSpaceCount" placeholder="请输入区域空位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域可预约车位数" prop="bookSpaceCount">
|
||||
<el-input v-model="formData.bookSpaceCount" placeholder="请输入区域可预约车位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域在场预约数" prop="bookInParkCount">
|
||||
<el-input v-model="formData.bookInParkCount" placeholder="请输入区域在场预约数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域Id" prop="areaId">
|
||||
<el-input v-model="formData.areaId" placeholder="请输入区域Id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库编号" prop="parkNumber">
|
||||
<el-input v-model="formData.parkNumber" 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 { AreaApi, AreaVO } from '@/api/parking/parkmanage/area'
|
||||
|
||||
/** 区域列表 表单 */
|
||||
defineOptions({ name: 'AreaForm' })
|
||||
|
||||
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({
|
||||
areaName: undefined,
|
||||
spaceCount: undefined,
|
||||
lastSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
id: undefined,
|
||||
areaId: undefined,
|
||||
parkNumber: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
areaName: [{ required: true, message: '区域名称不能为空', trigger: 'blur' }],
|
||||
spaceCount: [{ required: true, message: '区域车位数不能为空', trigger: 'blur' }],
|
||||
lastSpaceCount: [{ required: true, message: '区域空位数不能为空', trigger: 'blur' }],
|
||||
bookSpaceCount: [{ required: true, message: '区域可预约车位数不能为空', trigger: 'blur' }],
|
||||
bookInParkCount: [{ required: true, message: '区域在场预约数不能为空', trigger: 'blur' }],
|
||||
areaId: [{ required: true, message: '区域Id不能为空', trigger: 'blur' }],
|
||||
parkNumber: [{ 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 AreaApi.getArea(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 AreaVO
|
||||
if (formType.value === 'create') {
|
||||
await AreaApi.createArea(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await AreaApi.updateArea(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
areaName: undefined,
|
||||
spaceCount: undefined,
|
||||
lastSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
id: undefined,
|
||||
areaId: undefined,
|
||||
parkNumber: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
253
src/views/parking/parkmanage/area/index.vue
Normal file
253
src/views/parking/parkmanage/area/index.vue
Normal file
@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="区域名称" prop="areaName">
|
||||
<el-input
|
||||
v-model="queryParams.areaName"
|
||||
placeholder="请输入区域名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域车位数" prop="spaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.spaceCount"
|
||||
placeholder="请输入区域车位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域空位数" prop="lastSpaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.lastSpaceCount"
|
||||
placeholder="请输入区域空位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域可预约车位数" prop="bookSpaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.bookSpaceCount"
|
||||
placeholder="请输入区域可预约车位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域在场预约数" prop="bookInParkCount">
|
||||
<el-input
|
||||
v-model="queryParams.bookInParkCount"
|
||||
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 label="区域Id" prop="areaId">
|
||||
<el-input
|
||||
v-model="queryParams.areaId"
|
||||
placeholder="请输入区域Id"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库编号" prop="parkNumber">
|
||||
<el-input
|
||||
v-model="queryParams.parkNumber"
|
||||
placeholder="请输入场库编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
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="['parking:area:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['parking:area: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="areaName" />
|
||||
<el-table-column label="区域车位数" align="center" prop="spaceCount" />
|
||||
<el-table-column label="区域空位数" align="center" prop="lastSpaceCount" />
|
||||
<el-table-column label="区域可预约车位数" align="center" prop="bookSpaceCount" />
|
||||
<el-table-column label="区域在场预约数" align="center" prop="bookInParkCount" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="区域Id" align="center" prop="areaId" />
|
||||
<el-table-column label="场库编号" align="center" prop="parkNumber" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['parking:area:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['parking:area: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<AreaForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { AreaApi, AreaVO } from '@/api/parking/parkmanage/area'
|
||||
import AreaForm from './AreaForm.vue'
|
||||
|
||||
/** 区域列表 列表 */
|
||||
defineOptions({ name: 'Area' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<AreaVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
areaName: undefined,
|
||||
spaceCount: undefined,
|
||||
lastSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
createTime: [],
|
||||
areaId: undefined,
|
||||
parkNumber: undefined,
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await AreaApi.getAreaPage(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 AreaApi.deleteArea(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await AreaApi.exportArea(queryParams)
|
||||
download.excel(data, '区域列表.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
116
src/views/parking/parkmanage/park/ParkForm.vue
Normal file
116
src/views/parking/parkmanage/park/ParkForm.vue
Normal file
@ -0,0 +1,116 @@
|
||||
<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="parkName">
|
||||
<el-input v-model="formData.parkName" placeholder="请输入场库名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库总车位数" prop="spaceCount">
|
||||
<el-input v-model="formData.spaceCount" placeholder="请输入场库总车位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库空车位数" prop="freeSpaceCount">
|
||||
<el-input v-model="formData.freeSpaceCount" placeholder="请输入场库空车位数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库可预约数" prop="bookSpaceCount">
|
||||
<el-input v-model="formData.bookSpaceCount" placeholder="请输入场库可预约数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场库在场预约数" prop="bookInParkCount">
|
||||
<el-input v-model="formData.bookInParkCount" 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 { ParkApi, ParkVO } from '@/api/parking/parkmanage/park'
|
||||
|
||||
/** 场库列表 表单 */
|
||||
defineOptions({ name: 'ParkForm' })
|
||||
|
||||
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({
|
||||
parkNumber: undefined,
|
||||
parkName: undefined,
|
||||
spaceCount: undefined,
|
||||
freeSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
parkName: [{ required: true, message: '场库名称不能为空', trigger: 'blur' }],
|
||||
spaceCount: [{ required: true, message: '场库总车位数不能为空', trigger: 'blur' }],
|
||||
freeSpaceCount: [{ required: true, message: '场库空车位数不能为空', trigger: 'blur' }],
|
||||
bookSpaceCount: [{ required: true, message: '场库可预约数不能为空', trigger: 'blur' }],
|
||||
bookInParkCount: [{ 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 ParkApi.getPark(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 ParkVO
|
||||
if (formType.value === 'create') {
|
||||
await ParkApi.createPark(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ParkApi.updatePark(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
parkNumber: undefined,
|
||||
parkName: undefined,
|
||||
spaceCount: undefined,
|
||||
freeSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
231
src/views/parking/parkmanage/park/index.vue
Normal file
231
src/views/parking/parkmanage/park/index.vue
Normal file
@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="场库名称" prop="parkName">
|
||||
<el-input
|
||||
v-model="queryParams.parkName"
|
||||
placeholder="请输入场库名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库总车位数" prop="spaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.spaceCount"
|
||||
placeholder="请输入场库总车位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库空车位数" prop="freeSpaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.freeSpaceCount"
|
||||
placeholder="请输入场库空车位数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库可预约数" prop="bookSpaceCount">
|
||||
<el-input
|
||||
v-model="queryParams.bookSpaceCount"
|
||||
placeholder="请输入场库可预约数"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="场库在场预约数" prop="bookInParkCount">
|
||||
<el-input
|
||||
v-model="queryParams.bookInParkCount"
|
||||
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="['parking:park:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['parking:park: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="场库编号" align="center" prop="parkNumber" />
|
||||
<el-table-column label="场库名称" align="center" prop="parkName" />
|
||||
<el-table-column label="场库总车位数" align="center" prop="spaceCount" />
|
||||
<el-table-column label="场库空车位数" align="center" prop="freeSpaceCount" />
|
||||
<el-table-column label="场库可预约数" align="center" prop="bookSpaceCount" />
|
||||
<el-table-column label="场库在场预约数" align="center" prop="bookInParkCount" />
|
||||
<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.parkNumber)"
|
||||
v-hasPermi="['parking:park:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.parkNumber)"
|
||||
v-hasPermi="['parking:park: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ParkForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { ParkApi, ParkVO } from '@/api/parking/parkmanage/park'
|
||||
import ParkForm from './ParkForm.vue'
|
||||
|
||||
/** 场库列表 列表 */
|
||||
defineOptions({ name: 'Park' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<ParkVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
parkName: undefined,
|
||||
spaceCount: undefined,
|
||||
freeSpaceCount: undefined,
|
||||
bookSpaceCount: undefined,
|
||||
bookInParkCount: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ParkApi.getParkPage(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 ParkApi.deletePark(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await ParkApi.exportPark(queryParams)
|
||||
download.excel(data, '场库列表.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
110
src/views/parking/parkmanage/passageway/PassagewayForm.vue
Normal file
110
src/views/parking/parkmanage/passageway/PassagewayForm.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<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="parkNumber">
|
||||
<el-input v-model="formData.parkNumber" placeholder="请输入场库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道名称" prop="passagewayName">
|
||||
<el-input v-model="formData.passagewayName" placeholder="请输入通道名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="源区域 Id" prop="sourceAreaId">
|
||||
<el-input v-model="formData.sourceAreaId" placeholder="请输入源区域 Id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标区域 Id" prop="targetAreaId">
|
||||
<el-input v-model="formData.targetAreaId" placeholder="请输入目标区域 Id" />
|
||||
</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 { PassagewayApi, PassagewayVO } from '@/api/parking/parkmanage/passageway'
|
||||
|
||||
/** 通道信息 表单 */
|
||||
defineOptions({ name: 'PassagewayForm' })
|
||||
|
||||
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({
|
||||
passagewayId: undefined,
|
||||
parkNumber: undefined,
|
||||
passagewayName: undefined,
|
||||
sourceAreaId: undefined,
|
||||
targetAreaId: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
|
||||
passagewayName: [{ required: true, message: '通道名称不能为空', trigger: 'blur' }],
|
||||
sourceAreaId: [{ required: true, message: '源区域 Id不能为空', trigger: 'blur' }],
|
||||
targetAreaId: [{ required: true, message: '目标区域 Id不能为空', 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 PassagewayApi.getPassageway(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 PassagewayVO
|
||||
if (formType.value === 'create') {
|
||||
await PassagewayApi.createPassageway(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await PassagewayApi.updatePassageway(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
passagewayId: undefined,
|
||||
parkNumber: undefined,
|
||||
passagewayName: undefined,
|
||||
sourceAreaId: undefined,
|
||||
targetAreaId: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
220
src/views/parking/parkmanage/passageway/index.vue
Normal file
220
src/views/parking/parkmanage/passageway/index.vue
Normal file
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="场库编号" prop="parkNumber">
|
||||
<el-input
|
||||
v-model="queryParams.parkNumber"
|
||||
placeholder="请输入场库编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道名称" prop="passagewayName">
|
||||
<el-input
|
||||
v-model="queryParams.passagewayName"
|
||||
placeholder="请输入通道名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="源区域 Id" prop="sourceAreaId">
|
||||
<el-input
|
||||
v-model="queryParams.sourceAreaId"
|
||||
placeholder="请输入源区域 Id"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="目标区域 Id" prop="targetAreaId">
|
||||
<el-input
|
||||
v-model="queryParams.targetAreaId"
|
||||
placeholder="请输入目标区域 Id"
|
||||
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="['parking:passageway:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['parking:passageway: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="passagewayId" />
|
||||
<el-table-column label="场库编号" align="center" prop="parkNumber" />
|
||||
<el-table-column label="通道名称" align="center" prop="passagewayName" />
|
||||
<el-table-column label="源区域 Id" align="center" prop="sourceAreaId" />
|
||||
<el-table-column label="目标区域 Id" align="center" prop="targetAreaId" />
|
||||
<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="['parking:passageway:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['parking:passageway: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<PassagewayForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { PassagewayApi, PassagewayVO } from '@/api/parking/parkmanage/passageway'
|
||||
import PassagewayForm from './PassagewayForm.vue'
|
||||
|
||||
/** 通道信息 列表 */
|
||||
defineOptions({ name: 'Passageway' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<PassagewayVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
parkNumber: undefined,
|
||||
passagewayName: undefined,
|
||||
sourceAreaId: undefined,
|
||||
targetAreaId: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await PassagewayApi.getPassagewayPage(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 PassagewayApi.deletePassageway(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await PassagewayApi.exportPassageway(queryParams)
|
||||
download.excel(data, '通道信息.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user