添加售票管理中证件类别和交易类型字典

This commit is contained in:
XinWei 2024-07-24 14:27:02 +08:00
parent 8c3d81bf63
commit d35742e5c8
3 changed files with 106 additions and 102 deletions

View File

@ -212,5 +212,7 @@ export enum DICT_TYPE {
ERP_STOCK_RECORD_BIZ_TYPE = 'erp_stock_record_biz_type', // 库存明细的业务类型 ERP_STOCK_RECORD_BIZ_TYPE = 'erp_stock_record_biz_type', // 库存明细的业务类型
// ========== TICKET - 票务系统模块 ========== // ========== TICKET - 票务系统模块 ==========
ASSET_STATUS_TYPE = 'asset_status_type' ASSET_STATUS_TYPE = 'asset_status_type', // 设备状态
TRANSACTION_TYPE_NO = 'transaction_type_no', // 交易类型(订单类型)
CERTIFICATE_TYPE = 'certificate_type' // 证件类型
} }

View File

@ -1,12 +1,6 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form <el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="数据id" prop="dataId"> <el-form-item label="数据id" prop="dataId">
<el-input v-model="formData.dataId" placeholder="请输入数据id" /> <el-input v-model="formData.dataId" placeholder="请输入数据id" />
</el-form-item> </el-form-item>
@ -17,7 +11,11 @@
<el-input v-model="formData.certificateno" placeholder="请输入证件号" /> <el-input v-model="formData.certificateno" placeholder="请输入证件号" />
</el-form-item> </el-form-item>
<el-form-item label="证件类别" prop="certificatetype"> <el-form-item label="证件类别" prop="certificatetype">
<el-input v-model="formData.certificatetype" placeholder="请输入证件类别" /> <el-select v-model="formData.certificatetype" placeholder="请输入证件类别" clearable>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CERTIFICATE_TYPE)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="产品ID" prop="item"> <el-form-item label="产品ID" prop="item">
<el-input v-model="formData.item" placeholder="请输入产品ID" /> <el-input v-model="formData.item" placeholder="请输入产品ID" />
@ -38,26 +36,21 @@
<el-input v-model="formData.quantity" placeholder="请输入数量" /> <el-input v-model="formData.quantity" placeholder="请输入数量" />
</el-form-item> </el-form-item>
<el-form-item label="销售日期" prop="sddate"> <el-form-item label="销售日期" prop="sddate">
<el-date-picker <el-date-picker v-model="formData.sddate" type="date" value-format="x" placeholder="选择销售日期" />
v-model="formData.sddate"
type="date"
value-format="x"
placeholder="选择销售日期"
/>
</el-form-item> </el-form-item>
<el-form-item label="订单号" prop="sdno"> <el-form-item label="订单号" prop="sdno">
<el-input v-model="formData.sdno" placeholder="请输入订单号" /> <el-input v-model="formData.sdno" placeholder="请输入订单号" />
</el-form-item> </el-form-item>
<el-form-item label="销售时间" prop="sdtime"> <el-form-item label="销售时间" prop="sdtime">
<el-date-picker <el-date-picker v-model="formData.sdtime" type="date" value-format="x" placeholder="选择销售时间" />
v-model="formData.sdtime"
type="date"
value-format="x"
placeholder="选择销售时间"
/>
</el-form-item> </el-form-item>
<el-form-item label="交易类别(订单类型)" prop="transactiontypeno"> <el-form-item label="交易类别(订单类型)" prop="transactiontypeno">
<el-input v-model="formData.transactiontypeno" placeholder="请输入交易类别(订单类型)" /> <el-select v-model="formData.transactiontypeno" placeholder="请选择交易类别(订单类型)" clearable>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TRANSACTION_TYPE_NO)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="销售特征名称(票种名称)" prop="salepropetyvaluename"> <el-form-item label="销售特征名称(票种名称)" prop="salepropetyvaluename">
<el-input v-model="formData.salepropetyvaluename" placeholder="请输入销售特征名称(票种名称)" /> <el-input v-model="formData.salepropetyvaluename" placeholder="请输入销售特征名称(票种名称)" />
@ -70,19 +63,19 @@
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { SaleDataApi, SaleDataVO } from '@/api/ticket/saledata' import { SaleDataApi, SaleDataVO } from '@/api/ticket/saledata'
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
/** 售票 表单 */
defineOptions({ name: 'SaleDataForm' })
/** 售票 表单 */ const { t } = useI18n() //
defineOptions({ name: 'SaleDataForm' }) const message = useMessage() //
const { t } = useI18n() // const dialogVisible = ref(false) //
const message = useMessage() // const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const dialogVisible = ref(false) // const formType = ref('') // create - update -
const dialogTitle = ref('') // const formData = ref({
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
dataId: undefined, dataId: undefined,
amount: undefined, amount: undefined,
certificateno: undefined, certificateno: undefined,
@ -98,13 +91,13 @@ const formData = ref({
sdtime: undefined, sdtime: undefined,
transactiontypeno: undefined, transactiontypeno: undefined,
salepropetyvaluename: undefined, salepropetyvaluename: undefined,
}) })
const formRules = reactive({ const formRules = reactive({
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
@ -118,12 +111,12 @@ const open = async (type: string, id?: number) => {
formLoading.value = false formLoading.value = false
} }
} }
} }
defineExpose({ open }) // open defineExpose({ open }) // open
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() await formRef.value.validate()
// //
@ -143,10 +136,10 @@ const submitForm = async () => {
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
dataId: undefined, dataId: undefined,
amount: undefined, amount: undefined,
@ -165,5 +158,5 @@ const resetForm = () => {
salepropetyvaluename: undefined, salepropetyvaluename: undefined,
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }
</script> </script>

View File

@ -198,7 +198,11 @@
<el-table-column label="数据ID" align="center" prop="dataId" /> <el-table-column label="数据ID" align="center" prop="dataId" />
<el-table-column label="金额" align="center" prop="amount" /> <el-table-column label="金额" align="center" prop="amount" />
<el-table-column label="证件号" align="center" prop="certificateno" /> <el-table-column label="证件号" align="center" prop="certificateno" />
<el-table-column label="证件类别" align="center" prop="certificatetype" /> <el-table-column label="证件类别" align="center" prop="certificatetype">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CERTIFICATE_TYPE" :value="scope.row.certificatetype" />
</template>
</el-table-column>
<el-table-column label="产品ID" align="center" prop="item" /> <el-table-column label="产品ID" align="center" prop="item" />
<el-table-column label="产品名称" align="center" prop="itemname" /> <el-table-column label="产品名称" align="center" prop="itemname" />
<el-table-column label="产品类型ID" align="center" prop="itemtype" /> <el-table-column label="产品类型ID" align="center" prop="itemtype" />
@ -208,7 +212,11 @@
<el-table-column label="销售日期" align="center" prop="sddate" /> <el-table-column label="销售日期" align="center" prop="sddate" />
<el-table-column label="订单号" align="center" prop="sdno" /> <el-table-column label="订单号" align="center" prop="sdno" />
<el-table-column label="销售时间" align="center" prop="sdtime" /> <el-table-column label="销售时间" align="center" prop="sdtime" />
<el-table-column label="交易类别(订单类型)" align="center" prop="transactiontypeno" /> <el-table-column label="交易类别(订单类型)" align="center" prop="transactiontypeno">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TRANSACTION_TYPE_NO" :value="scope.row.transactiontypeno" />
</template>
</el-table-column>
<el-table-column label="销售特征名称(票种名称)" align="center" prop="salepropetyvaluename" /> <el-table-column label="销售特征名称(票种名称)" align="center" prop="salepropetyvaluename" />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="scope"> <template #default="scope">
@ -248,6 +256,7 @@
import download from '@/utils/download' import download from '@/utils/download'
import { SaleDataApi, SaleDataVO } from '@/api/ticket/saledata' import { SaleDataApi, SaleDataVO } from '@/api/ticket/saledata'
import SaleDataForm from './SaleDataForm.vue' import SaleDataForm from './SaleDataForm.vue'
import { DICT_TYPE } from '@/utils/dict'
/** 售票 列表 */ /** 售票 列表 */
defineOptions({ name: 'SaleData' }) defineOptions({ name: 'SaleData' })