停车场-同步白名单

This commit is contained in:
XinWei 2024-07-30 16:14:23 +08:00
parent 0e40cd6c24
commit 951544f4a6
3 changed files with 683 additions and 0 deletions

View File

@ -0,0 +1,61 @@
import request from '@/config/axios'
// 同步白名单 VO
export interface SynchronizationOfWhitelistInformationVO {
id: number // id
parkNumber: string // 场库编号
method: string // 接口名称
size: number // 集合大小
plate: string // 车牌号
fixedId: number // 白名单记录流水号
chargeType: string // 收费类型
name: string // 车主姓名
certificate: string // 身份证信息
address: string // 车主联系地址
phone: string // 车主联系电话
plateColor: string // 车牌颜色
start: string // 生效日期
end: string // 失效日期
dept: string // 部门
carType: string // 车辆类型
memo: string // 备注
timeStamp: string // 时间戳
source: string // 来源
areaId: number // 区域Id
areaStart: string // 生效日期
areaEnd: string // 失效日期
areaOperate: string // 操作
}
// 同步白名单 API
export const SynchronizationOfWhitelistInformationApi = {
// 查询同步白名单分页
getSynchronizationOfWhitelistInformationPage: async (params: any) => {
return await request.get({ url: `/parking/synchronization-of-whitelist-information/page`, params })
},
// 查询同步白名单详情
getSynchronizationOfWhitelistInformation: async (id: number) => {
return await request.get({ url: `/parking/synchronization-of-whitelist-information/get?id=` + id })
},
// 新增同步白名单
createSynchronizationOfWhitelistInformation: async (data: SynchronizationOfWhitelistInformationVO) => {
return await request.post({ url: `/parking/synchronization-of-whitelist-information/create`, data })
},
// 修改同步白名单
updateSynchronizationOfWhitelistInformation: async (data: SynchronizationOfWhitelistInformationVO) => {
return await request.put({ url: `/parking/synchronization-of-whitelist-information/update`, data })
},
// 删除同步白名单
deleteSynchronizationOfWhitelistInformation: async (id: number) => {
return await request.delete({ url: `/parking/synchronization-of-whitelist-information/delete?id=` + id })
},
// 导出同步白名单 Excel
exportSynchronizationOfWhitelistInformation: async (params) => {
return await request.download({ url: `/parking/synchronization-of-whitelist-information/export-excel`, params })
},
}

View File

@ -0,0 +1,202 @@
<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="method">
<el-input v-model="formData.method" placeholder="请输入接口名称" />
</el-form-item>
<el-form-item label="集合大小" prop="size">
<el-input v-model="formData.size" 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="fixedId">
<el-input v-model="formData.fixedId" placeholder="请输入白名单记录流水号" />
</el-form-item>
<el-form-item label="收费类型" prop="chargeType">
<el-select v-model="formData.chargeType" placeholder="请选择收费类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="车主姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入车主姓名" />
</el-form-item>
<el-form-item label="身份证信息" prop="certificate">
<el-input v-model="formData.certificate" placeholder="请输入身份证信息" />
</el-form-item>
<el-form-item label="车主联系地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入车主联系地址" />
</el-form-item>
<el-form-item label="车主联系电话" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入车主联系电话" />
</el-form-item>
<el-form-item label="车牌颜色" prop="plateColor">
<el-input v-model="formData.plateColor" placeholder="请输入车牌颜色" />
</el-form-item>
<el-form-item label="生效日期" prop="start">
<el-input v-model="formData.start" placeholder="请输入生效日期" />
</el-form-item>
<el-form-item label="失效日期" prop="end">
<el-input v-model="formData.end" placeholder="请输入失效日期" />
</el-form-item>
<el-form-item label="部门" prop="dept">
<el-input v-model="formData.dept" 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="memo">
<el-input v-model="formData.memo" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="时间戳" prop="timeStamp">
<el-input v-model="formData.timeStamp" placeholder="请输入时间戳" />
</el-form-item>
<el-form-item label="来源" prop="source">
<el-input v-model="formData.source" 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="areaStart">
<el-input v-model="formData.areaStart" placeholder="请输入生效日期" />
</el-form-item>
<el-form-item label="失效日期" prop="areaEnd">
<el-input v-model="formData.areaEnd" placeholder="请输入失效日期" />
</el-form-item>
<el-form-item label="操作" prop="areaOperate">
<el-input v-model="formData.areaOperate" 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 { SynchronizationOfWhitelistInformationApi, SynchronizationOfWhitelistInformationVO } from '@/api/parking/synchronizationofwhitelistinformation'
/** 同步白名单 表单 */
defineOptions({ name: 'SynchronizationOfWhitelistInformationForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
parkNumber: undefined,
method: undefined,
size: undefined,
plate: undefined,
fixedId: undefined,
chargeType: undefined,
name: undefined,
certificate: undefined,
address: undefined,
phone: undefined,
plateColor: undefined,
start: undefined,
end: undefined,
dept: undefined,
carType: undefined,
memo: undefined,
timeStamp: undefined,
source: undefined,
areaId: undefined,
areaStart: undefined,
areaEnd: undefined,
areaOperate: undefined,
})
const formRules = reactive({
parkNumber: [{ required: true, message: '场库编号不能为空', trigger: 'blur' }],
method: [{ 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 SynchronizationOfWhitelistInformationApi.getSynchronizationOfWhitelistInformation(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 SynchronizationOfWhitelistInformationVO
if (formType.value === 'create') {
await SynchronizationOfWhitelistInformationApi.createSynchronizationOfWhitelistInformation(data)
message.success(t('common.createSuccess'))
} else {
await SynchronizationOfWhitelistInformationApi.updateSynchronizationOfWhitelistInformation(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
parkNumber: undefined,
method: undefined,
size: undefined,
plate: undefined,
fixedId: undefined,
chargeType: undefined,
name: undefined,
certificate: undefined,
address: undefined,
phone: undefined,
plateColor: undefined,
start: undefined,
end: undefined,
dept: undefined,
carType: undefined,
memo: undefined,
timeStamp: undefined,
source: undefined,
areaId: undefined,
areaStart: undefined,
areaEnd: undefined,
areaOperate: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,420 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<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="method">
<el-input
v-model="queryParams.method"
placeholder="请输入接口名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="集合大小" prop="size">
<el-input
v-model="queryParams.size"
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="fixedId">
<el-input
v-model="queryParams.fixedId"
placeholder="请输入白名单记录流水号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="收费类型" prop="chargeType">
<el-select
v-model="queryParams.chargeType"
placeholder="请选择收费类型"
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="车主姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入车主姓名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="身份证信息" prop="certificate">
<el-input
v-model="queryParams.certificate"
placeholder="请输入身份证信息"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车主联系地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入车主联系地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="车主联系电话" prop="phone">
<el-input
v-model="queryParams.phone"
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="start">
<el-input
v-model="queryParams.start"
placeholder="请输入生效日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="失效日期" prop="end">
<el-input
v-model="queryParams.end"
placeholder="请输入失效日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="部门" prop="dept">
<el-input
v-model="queryParams.dept"
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="memo">
<el-input
v-model="queryParams.memo"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="时间戳" prop="timeStamp">
<el-input
v-model="queryParams.timeStamp"
placeholder="请输入时间戳"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="来源" prop="source">
<el-input
v-model="queryParams.source"
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="areaStart">
<el-input
v-model="queryParams.areaStart"
placeholder="请输入生效日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="失效日期" prop="areaEnd">
<el-input
v-model="queryParams.areaEnd"
placeholder="请输入失效日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="操作" prop="areaOperate">
<el-input
v-model="queryParams.areaOperate"
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:synchronization-of-whitelist-information:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['parking:synchronization-of-whitelist-information: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="method" />
<el-table-column label="集合大小" align="center" prop="size" />
<el-table-column label="车牌号" align="center" prop="plate" />
<el-table-column label="白名单记录流水号" align="center" prop="fixedId" />
<el-table-column label="收费类型" align="center" prop="chargeType" />
<el-table-column label="车主姓名" align="center" prop="name" />
<el-table-column label="身份证信息" align="center" prop="certificate" />
<el-table-column label="车主联系地址" align="center" prop="address" />
<el-table-column label="车主联系电话" align="center" prop="phone" />
<el-table-column label="车牌颜色" align="center" prop="plateColor" />
<el-table-column label="生效日期" align="center" prop="start" />
<el-table-column label="失效日期" align="center" prop="end" />
<el-table-column label="部门" align="center" prop="dept" />
<el-table-column label="车辆类型" align="center" prop="carType" />
<el-table-column label="备注" align="center" prop="memo" />
<el-table-column label="时间戳" align="center" prop="timeStamp" />
<el-table-column label="来源" align="center" prop="source" />
<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="areaOperate" />
<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:synchronization-of-whitelist-information:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['parking:synchronization-of-whitelist-information: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>
<!-- 表单弹窗添加/修改 -->
<SynchronizationOfWhitelistInformationForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { SynchronizationOfWhitelistInformationApi, SynchronizationOfWhitelistInformationVO } from '@/api/parking/synchronizationofwhitelistinformation'
import SynchronizationOfWhitelistInformationForm from './SynchronizationOfWhitelistInformationForm.vue'
/** 同步白名单 列表 */
defineOptions({ name: 'SynchronizationOfWhitelistInformation' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<SynchronizationOfWhitelistInformationVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
parkNumber: undefined,
method: undefined,
size: undefined,
plate: undefined,
fixedId: undefined,
chargeType: undefined,
name: undefined,
certificate: undefined,
address: undefined,
phone: undefined,
plateColor: undefined,
start: undefined,
end: undefined,
dept: undefined,
carType: undefined,
memo: undefined,
timeStamp: undefined,
source: undefined,
areaId: undefined,
areaStart: undefined,
areaEnd: undefined,
areaOperate: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SynchronizationOfWhitelistInformationApi.getSynchronizationOfWhitelistInformationPage(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 SynchronizationOfWhitelistInformationApi.deleteSynchronizationOfWhitelistInformation(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SynchronizationOfWhitelistInformationApi.exportSynchronizationOfWhitelistInformation(queryParams)
download.excel(data, '同步白名单.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>