ticketManager

This commit is contained in:
XinWei 2024-07-04 11:55:11 +08:00
parent 276bb0518b
commit 49e6901642
17 changed files with 30252 additions and 11 deletions

2
.env
View File

@ -1,5 +1,5 @@
# 标题
VITE_APP_TITLE=芋道管理系统
VITE_APP_TITLE=智慧轮渡大数据平台
# 项目本地运行端口号
VITE_PORT=80

View File

@ -86,7 +86,7 @@
"source.fixAll.eslint": "explicit"
},
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "Vue.volar"
},
"i18n-ally.localesPaths": ["src/locales"],
"i18n-ally.keystyle": "nested",

28781
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
import request from '@/config/axios'
// 设备 VO
export interface AssetVO {
dataId: string // 数据ID
assetname: string // 设备名称
assettype: string // 设备类型ID
assettypename: string // 设备类型名称
isOnline: string // 设备状态
lastfeedbacktime: number // 最后一次反馈时间
}
// 设备 API
export const AssetApi = {
// 查询设备分页
getAssetPage: async (params: any) => {
return await request.get({ url: `/ticket/asset/page`, params })
},
// 查询设备详情
getAsset: async (id: number) => {
return await request.get({ url: `/ticket/asset/get?id=` + id })
},
// 新增设备
createAsset: async (data: AssetVO) => {
return await request.post({ url: `/ticket/asset/create`, data })
},
// 修改设备
updateAsset: async (data: AssetVO) => {
return await request.put({ url: `/ticket/asset/update`, data })
},
// 删除设备
deleteAsset: async (id: number) => {
return await request.delete({ url: `/ticket/asset/delete?id=` + id })
},
// 导出设备 Excel
exportAsset: async (params) => {
return await request.download({ url: `/ticket/asset/export-excel`, params })
},
}

View File

@ -0,0 +1,47 @@
import request from '@/config/axios'
// 检票 VO
export interface CheckTicketVO {
dataId: string // 数据ID
checkstation: string // 检票点ID
checkstationname: string // 检票点名称
checkticketdate: string // 检票日期
checktickettime: string // 检票时间
personcount: number // 人数
sdshipping: string // 订单明细ID
ticket: string // 票ID
salepropetyvaluename: string // 销售特征名称(票种名称)
}
// 检票 API
export const CheckTicketApi = {
// 查询检票分页
getCheckTicketPage: async (params: any) => {
return await request.get({ url: `/ticket/check-ticket/page`, params })
},
// 查询检票详情
getCheckTicket: async (id: number) => {
return await request.get({ url: `/ticket/check-ticket/get?id=` + id })
},
// 新增检票
createCheckTicket: async (data: CheckTicketVO) => {
return await request.post({ url: `/ticket/check-ticket/create`, data })
},
// 修改检票
updateCheckTicket: async (data: CheckTicketVO) => {
return await request.put({ url: `/ticket/check-ticket/update`, data })
},
// 删除检票
deleteCheckTicket: async (id: number) => {
return await request.delete({ url: `/ticket/check-ticket/delete?id=` + id })
},
// 导出检票 Excel
exportCheckTicket: async (params) => {
return await request.download({ url: `/ticket/check-ticket/export-excel`, params })
},
}

View File

@ -0,0 +1,53 @@
import request from '@/config/axios'
// 售票 VO
export interface SaleDataVO {
dataId: string // 数据id
amount: number // 金额
certificateno: string // 证件号
certificatetype: string // 证件类别
item: string // 产品ID
itemname: string // 产品名称
itemtype: string // 产品类型ID
itemtypename: string // 产品类型名称
productbatchno: string // 出游日期
quantity: number // 数量
sddate: string // 销售日期
sdno: string // 订单号
sdtime: string // 销售时间
transactiontypeno: string // 交易类别(订单类型)
salepropetyvaluename: string // 销售特征名称(票种名称)
}
// 售票 API
export const SaleDataApi = {
// 查询售票分页
getSaleDataPage: async (params: any) => {
return await request.get({ url: `/ticket/sale-data/page`, params })
},
// 查询售票详情
getSaleData: async (id: number) => {
return await request.get({ url: `/ticket/sale-data/get?id=` + id })
},
// 新增售票
createSaleData: async (data: SaleDataVO) => {
return await request.post({ url: `/ticket/sale-data/create`, data })
},
// 修改售票
updateSaleData: async (data: SaleDataVO) => {
return await request.put({ url: `/ticket/sale-data/update`, data })
},
// 删除售票
deleteSaleData: async (id: number) => {
return await request.delete({ url: `/ticket/sale-data/delete?id=` + id })
},
// 导出售票 Excel
exportSaleData: async (params) => {
return await request.download({ url: `/ticket/sale-data/export-excel`, params })
},
}

View File

@ -66,10 +66,10 @@ watch(
]"
to="/"
>
<img
<!-- <img
class="h-[calc(var(--logo-height)-10px)] w-[calc(var(--logo-height)-10px)]"
src="@/assets/imgs/logo.png"
/>
/> -->
<div
v-if="show"
:class="[

View File

@ -209,5 +209,8 @@ export enum DICT_TYPE {
// ========== ERP - 企业资源计划模块 ==========
ERP_AUDIT_STATUS = 'erp_audit_status', // ERP 审批状态
ERP_STOCK_RECORD_BIZ_TYPE = 'erp_stock_record_biz_type' // 库存明细的业务类型
ERP_STOCK_RECORD_BIZ_TYPE = 'erp_stock_record_biz_type', // 库存明细的业务类型
// ========== TICKET - 票务系统模块 ==========
ASSET_STATUS_TYPE = 'asset_status_type'
}

View File

@ -56,7 +56,7 @@
</el-card>
</div>
<el-row class="mt-8px" :gutter="8" justify="space-between">
<!-- <el-row class="mt-8px" :gutter="8" justify="space-between">
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-8px">
<el-card shadow="never">
<template #header>
@ -169,7 +169,7 @@
</el-skeleton>
</el-card>
</el-col>
</el-row>
</el-row> -->
</template>
<script lang="ts" setup>
import { set } from 'lodash-es'

View File

@ -9,7 +9,7 @@
>
<!-- 左上角的 logo + 系统标题 -->
<div class="relative flex items-center text-white">
<img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
<!-- <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" /> -->
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
</div>
<!-- 左边的背景图 + 欢迎语 -->
@ -33,7 +33,7 @@
class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"
>
<div class="flex items-center at-2xl:hidden at-xl:hidden">
<img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
<!-- <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" /> -->
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
</div>
<div class="flex items-center justify-end space-x-10px">

View File

@ -9,7 +9,7 @@
>
<!-- 左上角的 logo + 系统标题 -->
<div class="relative flex items-center text-white">
<img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
<!-- <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" /> -->
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
</div>
<!-- 左边的背景图 + 欢迎语 -->
@ -33,7 +33,7 @@
class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"
>
<div class="flex items-center at-2xl:hidden at-xl:hidden">
<img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
<!-- <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" /> -->
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
</div>
<div class="flex items-center justify-end space-x-10px">

View File

@ -0,0 +1,127 @@
<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="数据ID" prop="dataId">
<el-input v-model="formData.dataId" placeholder="请输入数据ID" />
</el-form-item>
<el-form-item label="设备名称" prop="assetname">
<el-input v-model="formData.assetname" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备类型ID" prop="assettype">
<el-input v-model="formData.assettype" placeholder="请输入设备类型ID" />
</el-form-item>
<el-form-item label="设备类型名称" prop="assettypename">
<el-input v-model="formData.assettypename" placeholder="请输入设备类型名称" />
</el-form-item>
<el-form-item label="设备状态" prop="isOnline">
<el-select v-model="formData.isOnline" placeholder="请选择设备状态">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ASSET_STATUS_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="最后一次反馈时间" prop="lastfeedbacktime">
<el-date-picker
v-model="formData.lastfeedbacktime"
type="date"
value-format="x"
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 { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { AssetApi, AssetVO } from '@/api/ticket/asset'
/** 设备 表单 */
defineOptions({ name: 'AssetForm' })
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({
dataId: undefined,
assetname: undefined,
assettype: undefined,
assettypename: undefined,
isOnline: undefined,
lastfeedbacktime: undefined,
})
const formRules = reactive({
})
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 AssetApi.getAsset(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 AssetVO
if (formType.value === 'create') {
await AssetApi.createAsset(data)
message.success(t('common.createSuccess'))
} else {
await AssetApi.updateAsset(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
dataId: undefined,
assetname: undefined,
assettype: undefined,
assettypename: undefined,
isOnline: undefined,
lastfeedbacktime: undefined,
}
formRef.value?.resetFields()
}
</script>

View 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="ID" prop="id">
<el-input
v-model="queryParams.id"
placeholder="请输入ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item label="数据ID" prop="dataId">
<el-input
v-model="queryParams.dataId"
placeholder="请输入数据ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="设备名称" prop="assetname">
<el-input
v-model="queryParams.assetname"
placeholder="请输入设备名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!--
<el-form-item label="设备类型ID" prop="assettype">
<el-input
v-model="queryParams.assettype"
placeholder="请输入设备类型ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item label="设备类型名称" prop="assettypename">
<el-input
v-model="queryParams.assettypename"
placeholder="请输入设备类型名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="设备状态" prop="isOnline">
<el-select
v-model="queryParams.isOnline"
placeholder="请选择设备状态"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ASSET_STATUS_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!--
<el-form-item label="最后一次反馈时间" prop="lastfeedbacktime">
<el-date-picker
v-model="queryParams.lastfeedbacktime"
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 style="float: right;">
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['ticket:asset:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['ticket:asset: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" >
<template #default="scope">{{ (queryParams.pageNo - 1) * queryParams.pageSize + scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="数据ID" align="center" prop="dataId" />
<el-table-column label="设备名称" align="center" prop="assetname" />
<el-table-column label="设备类型ID" align="center" prop="assettype" />
<el-table-column label="设备类型名称" align="center" prop="assettypename" />
<el-table-column label="设备状态" align="center" prop="isOnline">
<template #default="scope">
<dict-tag :type="DICT_TYPE.ASSET_STATUS_TYPE" :value="scope.row.isOnline" />
</template>
</el-table-column>
<el-table-column label="最后一次反馈时间" align="center" prop="lastfeedbacktime" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['ticket:asset:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['ticket:asset: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>
<!-- 表单弹窗添加/修改 -->
<AssetForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import download from '@/utils/download'
import { AssetApi, AssetVO } from '@/api/ticket/asset'
import AssetForm from './AssetForm.vue'
/** 设备 列表 */
defineOptions({ name: 'Asset' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<AssetVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: undefined,
dataId: undefined,
assetname: undefined,
assettype: undefined,
assettypename: undefined,
isOnline: undefined,
lastfeedbacktime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await AssetApi.getAssetPage(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 AssetApi.deleteAsset(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await AssetApi.exportAsset(queryParams)
download.excel(data, '设备.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

View File

@ -0,0 +1,139 @@
<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="数据ID" prop="dataId">
<el-input v-model="formData.dataId" placeholder="请输入数据ID" />
</el-form-item>
<el-form-item label="检票点ID" prop="checkstation">
<el-input v-model="formData.checkstation" placeholder="请输入检票点ID" />
</el-form-item>
<el-form-item label="检票点名称" prop="checkstationname">
<el-input v-model="formData.checkstationname" placeholder="请输入检票点名称" />
</el-form-item>
<el-form-item label="检票日期" prop="checkticketdate">
<el-date-picker
v-model="formData.checkticketdate"
type="date"
value-format="x"
placeholder="选择检票日期"
/>
</el-form-item>
<el-form-item label="检票时间" prop="checktickettime">
<el-date-picker
v-model="formData.checktickettime"
type="date"
value-format="x"
placeholder="选择检票时间"
/>
</el-form-item>
<el-form-item label="人数" prop="personcount">
<el-input v-model="formData.personcount" placeholder="请输入人数" />
</el-form-item>
<el-form-item label="订单明细ID" prop="sdshipping">
<el-input v-model="formData.sdshipping" placeholder="请输入订单明细ID" />
</el-form-item>
<el-form-item label="票ID" prop="ticket">
<el-input v-model="formData.ticket" placeholder="请输入票ID" />
</el-form-item>
<el-form-item label="销售特征名称(票种名称)" prop="salepropetyvaluename">
<el-input v-model="formData.salepropetyvaluename" 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 { CheckTicketApi, CheckTicketVO } from '@/api/ticket/checkticket'
/** 检票 表单 */
defineOptions({ name: 'CheckTicketForm' })
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({
dataId: undefined,
checkstation: undefined,
checkstationname: undefined,
checkticketdate: undefined,
checktickettime: undefined,
personcount: undefined,
sdshipping: undefined,
ticket: undefined,
salepropetyvaluename: undefined,
})
const formRules = reactive({
})
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 CheckTicketApi.getCheckTicket(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 CheckTicketVO
if (formType.value === 'create') {
await CheckTicketApi.createCheckTicket(data)
message.success(t('common.createSuccess'))
} else {
await CheckTicketApi.updateCheckTicket(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
dataId: undefined,
checkstation: undefined,
checkstationname: undefined,
checkticketdate: undefined,
checktickettime: undefined,
personcount: undefined,
sdshipping: undefined,
ticket: undefined,
salepropetyvaluename: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,279 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="auto"
>
<!--
<el-form-item label="ID" prop="id">
<el-input
v-model="queryParams.id"
placeholder="请输入ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item label="数据ID" prop="dataId">
<el-input
v-model="queryParams.dataId"
placeholder="请输入数据ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="检票点ID" prop="checkstation">
<el-input
v-model="queryParams.checkstation"
placeholder="请输入检票点ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="检票点名称" prop="checkstationname">
<el-input
v-model="queryParams.checkstationname"
placeholder="请输入检票点名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!--
<el-form-item label="检票日期" prop="checkticketdate">
<el-date-picker
v-model="queryParams.checkticketdate"
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="checktickettime">
<el-date-picker
v-model="queryParams.checktickettime"
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="personcount">
<el-input
v-model="queryParams.personcount"
placeholder="请输入人数"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item label="订单明细ID" prop="sdshipping">
<el-input
v-model="queryParams.sdshipping"
placeholder="请输入订单明细ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="票ID" prop="ticket">
<el-input
v-model="queryParams.ticket"
placeholder="请输入票ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!--
<el-form-item label="销售特征名称(票种名称)" prop="salepropetyvaluename">
<el-input
v-model="queryParams.salepropetyvaluename"
placeholder="请输入销售特征名称(票种名称)"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item style="float: right;">
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['ticket:check-ticket:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['ticket:check-ticket: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" >
<template #default="scope">{{ (queryParams.pageNo - 1) * queryParams.pageSize + scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="数据ID" align="center" prop="dataId" />
<el-table-column label="检票点ID" align="center" prop="checkstation" />
<el-table-column label="检票点名称" align="center" prop="checkstationname" />
<el-table-column label="检票日期" align="center" prop="checkticketdate" />
<el-table-column label="检票时间" align="center" prop="checktickettime" />
<el-table-column label="人数" align="center" prop="personcount" />
<el-table-column label="订单明细ID" align="center" prop="sdshipping" />
<el-table-column label="票ID" align="center" prop="ticket" />
<el-table-column label="销售特征名称(票种名称)" align="center" prop="salepropetyvaluename" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['ticket:check-ticket:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['ticket:check-ticket: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>
<!-- 表单弹窗添加/修改 -->
<CheckTicketForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CheckTicketApi, CheckTicketVO } from '@/api/ticket/checkticket'
import CheckTicketForm from './CheckTicketForm.vue'
/** 检票 列表 */
defineOptions({ name: 'CheckTicket' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<CheckTicketVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: undefined,
dataId: undefined,
checkstation: undefined,
checkstationname: undefined,
checkticketdate: [],
checktickettime: [],
personcount: undefined,
sdshipping: undefined,
ticket: undefined,
salepropetyvaluename: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CheckTicketApi.getCheckTicketPage(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 CheckTicketApi.deleteCheckTicket(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CheckTicketApi.exportCheckTicket(queryParams)
download.excel(data, '检票.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

View File

@ -0,0 +1,169 @@
<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="数据id" prop="dataId">
<el-input v-model="formData.dataId" placeholder="请输入数据id" />
</el-form-item>
<el-form-item label="金额" prop="amount">
<el-input v-model="formData.amount" placeholder="请输入金额" />
</el-form-item>
<el-form-item label="证件号" prop="certificateno">
<el-input v-model="formData.certificateno" placeholder="请输入证件号" />
</el-form-item>
<el-form-item label="证件类别" prop="certificatetype">
<el-input v-model="formData.certificatetype" placeholder="请输入证件类别" />
</el-form-item>
<el-form-item label="产品ID" prop="item">
<el-input v-model="formData.item" placeholder="请输入产品ID" />
</el-form-item>
<el-form-item label="产品名称" prop="itemname">
<el-input v-model="formData.itemname" placeholder="请输入产品名称" />
</el-form-item>
<el-form-item label="产品类型ID" prop="itemtype">
<el-input v-model="formData.itemtype" placeholder="请输入产品类型ID" />
</el-form-item>
<el-form-item label="产品类型名称" prop="itemtypename">
<el-input v-model="formData.itemtypename" placeholder="请输入产品类型名称" />
</el-form-item>
<el-form-item label="出游日期" prop="productbatchno">
<el-input v-model="formData.productbatchno" placeholder="请输入出游日期" />
</el-form-item>
<el-form-item label="数量" prop="quantity">
<el-input v-model="formData.quantity" placeholder="请输入数量" />
</el-form-item>
<el-form-item label="销售日期" prop="sddate">
<el-date-picker
v-model="formData.sddate"
type="date"
value-format="x"
placeholder="选择销售日期"
/>
</el-form-item>
<el-form-item label="订单号" prop="sdno">
<el-input v-model="formData.sdno" placeholder="请输入订单号" />
</el-form-item>
<el-form-item label="销售时间" prop="sdtime">
<el-date-picker
v-model="formData.sdtime"
type="date"
value-format="x"
placeholder="选择销售时间"
/>
</el-form-item>
<el-form-item label="交易类别(订单类型)" prop="transactiontypeno">
<el-input v-model="formData.transactiontypeno" placeholder="请输入交易类别(订单类型)" />
</el-form-item>
<el-form-item label="销售特征名称(票种名称)" prop="salepropetyvaluename">
<el-input v-model="formData.salepropetyvaluename" 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 { SaleDataApi, SaleDataVO } from '@/api/ticket/saledata'
/** 售票 表单 */
defineOptions({ name: 'SaleDataForm' })
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({
dataId: undefined,
amount: undefined,
certificateno: undefined,
certificatetype: undefined,
item: undefined,
itemname: undefined,
itemtype: undefined,
itemtypename: undefined,
productbatchno: undefined,
quantity: undefined,
sddate: undefined,
sdno: undefined,
sdtime: undefined,
transactiontypeno: undefined,
salepropetyvaluename: undefined,
})
const formRules = reactive({
})
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 SaleDataApi.getSaleData(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 SaleDataVO
if (formType.value === 'create') {
await SaleDataApi.createSaleData(data)
message.success(t('common.createSuccess'))
} else {
await SaleDataApi.updateSaleData(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
dataId: undefined,
amount: undefined,
certificateno: undefined,
certificatetype: undefined,
item: undefined,
itemname: undefined,
itemtype: undefined,
itemtypename: undefined,
productbatchno: undefined,
quantity: undefined,
sddate: undefined,
sdno: undefined,
sdtime: undefined,
transactiontypeno: undefined,
salepropetyvaluename: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,346 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="auto"
>
<!--
<el-form-item label="ID" prop="id">
<el-input
v-model="queryParams.id"
placeholder="请输入ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item label="数据ID" prop="dataId">
<el-input
v-model="queryParams.dataId"
placeholder="请输入数据ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="金额" prop="amount">
<el-input
v-model="queryParams.amount"
placeholder="请输入金额"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="证件号" prop="certificateno">
<el-input
v-model="queryParams.certificateno"
placeholder="请输入证件号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!--
<el-form-item label="证件类别" prop="certificatetype">
<el-input
v-model="queryParams.certificatetype"
placeholder="请输入证件类别"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item label="产品ID" prop="item">
<el-input
v-model="queryParams.item"
placeholder="请输入产品ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产品名称" prop="itemname">
<el-input
v-model="queryParams.itemname"
placeholder="请输入产品名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产品类型ID" prop="itemtype">
<el-input
v-model="queryParams.itemtype"
placeholder="请输入产品类型ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产品类型名称" prop="itemtypename">
<el-input
v-model="queryParams.itemtypename"
placeholder="请输入产品类型名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!--
<el-form-item label="出游日期" prop="productbatchno">
<el-input
v-model="queryParams.productbatchno"
placeholder="请输入出游日期"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="数量" prop="quantity">
<el-input
v-model="queryParams.quantity"
placeholder="请输入数量"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="销售日期" prop="sddate">
<el-date-picker
v-model="queryParams.sddate"
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="sdno">
<el-input
v-model="queryParams.sdno"
placeholder="请输入订单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!--
<el-form-item label="销售时间" prop="sdtime">
<el-date-picker
v-model="queryParams.sdtime"
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="transactiontypeno">
<el-input
v-model="queryParams.transactiontypeno"
placeholder="请输入交易类别(订单类型)"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="销售特征名称(票种名称)" prop="salepropetyvaluename">
<el-input
v-model="queryParams.salepropetyvaluename"
placeholder="请输入销售特征名称(票种名称)"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
-->
<el-form-item style="float: right;">
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['ticket:sale-data:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['ticket:sale-data: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" >
<template #default="scope">{{ (queryParams.pageNo - 1) * queryParams.pageSize + scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="数据ID" align="center" prop="dataId" />
<el-table-column label="金额" align="center" prop="amount" />
<el-table-column label="证件号" align="center" prop="certificateno" />
<el-table-column label="证件类别" align="center" prop="certificatetype" />
<el-table-column label="产品ID" align="center" prop="item" />
<el-table-column label="产品名称" align="center" prop="itemname" />
<el-table-column label="产品类型ID" align="center" prop="itemtype" />
<el-table-column label="产品类型名称" align="center" prop="itemtypename" />
<el-table-column label="出游日期" align="center" prop="productbatchno" />
<el-table-column label="数量" align="center" prop="quantity" />
<el-table-column label="销售日期" align="center" prop="sddate" />
<el-table-column label="订单号" align="center" prop="sdno" />
<el-table-column label="销售时间" align="center" prop="sdtime" />
<el-table-column label="交易类别(订单类型)" align="center" prop="transactiontypeno" />
<el-table-column label="销售特征名称(票种名称)" align="center" prop="salepropetyvaluename" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['ticket:sale-data:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['ticket:sale-data: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>
<!-- 表单弹窗添加/修改 -->
<SaleDataForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { SaleDataApi, SaleDataVO } from '@/api/ticket/saledata'
import SaleDataForm from './SaleDataForm.vue'
/** 售票 列表 */
defineOptions({ name: 'SaleData' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<SaleDataVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
id: undefined,
dataId: undefined,
amount: undefined,
certificateno: undefined,
certificatetype: undefined,
item: undefined,
itemname: undefined,
itemtype: undefined,
itemtypename: undefined,
productbatchno: undefined,
quantity: undefined,
sddate: [],
sdno: undefined,
sdtime: [],
transactiontypeno: undefined,
salepropetyvaluename: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await SaleDataApi.getSaleDataPage(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 SaleDataApi.deleteSaleData(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SaleDataApi.exportSaleData(queryParams)
download.excel(data, '售票.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>