From 1adc5bd35fcd33e2929809e4209b017caf112124 Mon Sep 17 00:00:00 2001 From: xxm1995 Date: Fri, 7 Jul 2023 14:54:46 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=82=A8=E5=80=BC=E5=8D=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E7=BB=93=E7=AE=97=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/enums/payment/voucherEnum.ts | 43 ++++++++++ .../payment/cashier/CombinationCashier.vue | 50 ++++++++---- .../demo/payment/cashier/SimpleCashier.vue | 4 +- .../modules/payment/voucher/Voucher.api.ts | 6 +- .../payment/voucher/VoucherGeneration.vue | 10 ++- .../modules/payment/voucher/VoucherInfo.vue | 6 +- .../modules/payment/voucher/VoucherList.vue | 10 +-- .../modules/payment/voucher/VoucherLog.api.ts | 33 ++++++++ .../payment/voucher/VoucherLogList.vue | 79 +++++++++++++++++++ 9 files changed, 209 insertions(+), 32 deletions(-) create mode 100644 src/enums/payment/voucherEnum.ts create mode 100644 src/views/modules/payment/voucher/VoucherLog.api.ts create mode 100644 src/views/modules/payment/voucher/VoucherLogList.vue diff --git a/src/enums/payment/voucherEnum.ts b/src/enums/payment/voucherEnum.ts new file mode 100644 index 000000000..9b263864f --- /dev/null +++ b/src/enums/payment/voucherEnum.ts @@ -0,0 +1,43 @@ +/** + * 储值卡常量 + */ +export enum VoucherEnum { + /** + * 状态-正常 + */ + STATUS_NORMAL = 'normal', + + /** + * 状态-停用 + */ + STATUS_FORBIDDEN = 'forbidden', + + /** + * 储值卡日志-开通 + */ + LOG_ACTIVE = 'active', + + /** + * 储值卡日志-预冻结额度 + */ + LOG_FREEZE_BALANCE = 'freeze', + + /** + * 储值卡日志-扣减并解冻余额 + */ + LOG_REDUCE_AND_UNFREEZE_BALANCE = 'reduceAndUnfreeze', + + /** + * 储值卡日志-直接支付 + */ + LOG_PAY = 'pay', + /** + * 储值卡日志-取消支付 + */ + LOG_CLOSE_PAY = 'closePay', + + /** + * 储值卡日志-退款到本卡中 + */ + LOG_REFUND_SELF = 'refundSelf', +} diff --git a/src/views/demo/payment/cashier/CombinationCashier.vue b/src/views/demo/payment/cashier/CombinationCashier.vue index 296cd5271..0ff59b04f 100644 --- a/src/views/demo/payment/cashier/CombinationCashier.vue +++ b/src/views/demo/payment/cashier/CombinationCashier.vue @@ -18,15 +18,15 @@ - + - - - - - - + + + + @@ -43,18 +43,18 @@ diff --git a/src/views/demo/payment/cashier/SimpleCashier.vue b/src/views/demo/payment/cashier/SimpleCashier.vue index a697fe8f0..714bff969 100644 --- a/src/views/demo/payment/cashier/SimpleCashier.vue +++ b/src/views/demo/payment/cashier/SimpleCashier.vue @@ -48,7 +48,7 @@ import { FormInstance } from 'ant-design-vue/lib/form' import { useIntervalFn } from '@vueuse/core' import { useMessage } from '/@/hooks/web/useMessage' - import { findByCardNo, Voucher } from '/@/views/modules/payment/voucher/Voucher.api' + import { getAndJudgeVoucher, Voucher } from '/@/views/modules/payment/voucher/Voucher.api' import CashierQrCode from './CashierQrCode.vue' import { payChannelEnum } from '/@/enums/payment/payChannelEnum' import { findByParamKey } from '/@/api/common/Parameter' @@ -183,7 +183,7 @@ */ function getVoucher() { if (form.voucherNo) { - findByCardNo(form.voucherNo).then(({ data }) => { + getAndJudgeVoucher(form.voucherNo).then(({ data }) => { voucher = data }) } diff --git a/src/views/modules/payment/voucher/Voucher.api.ts b/src/views/modules/payment/voucher/Voucher.api.ts index 7d8524e3d..2b4f394f3 100644 --- a/src/views/modules/payment/voucher/Voucher.api.ts +++ b/src/views/modules/payment/voucher/Voucher.api.ts @@ -64,9 +64,9 @@ export function del(id) { /** * 详情 */ -export function findByCardNo(cardNo) { +export function getAndJudgeVoucher(cardNo) { return defHttp.get>({ - url: '/voucher/findByCardNo', + url: '/voucher/getAndJudgeVoucher', params: { cardNo }, }) } @@ -120,5 +120,5 @@ export interface Voucher extends BaseEntity { // 结束时间 endTime?: string // 状态 - status?: number + status?: string } diff --git a/src/views/modules/payment/voucher/VoucherGeneration.vue b/src/views/modules/payment/voucher/VoucherGeneration.vue index ceba5536a..59066715e 100644 --- a/src/views/modules/payment/voucher/VoucherGeneration.vue +++ b/src/views/modules/payment/voucher/VoucherGeneration.vue @@ -45,8 +45,8 @@ - 启用 - 停用 + 启用 + 停用 @@ -65,6 +65,7 @@ import { computed, nextTick } from 'vue' import BasicModal from '/@/components/Modal/src/BasicModal.vue' import { generationBatch } from '/@/views/modules/payment/voucher/Voucher.api' + import { VoucherEnum } from '/@/enums/payment/voucherEnum' const { handleCancel, labelCol, wrapperCol, modalWidth, title, confirmLoading, visible, editable, showable, formEditType } = useFormEdit() const { createMessage } = useMessage() @@ -78,7 +79,7 @@ enduring: true, startTime: null, endTime: null, - status: 1, + status: VoucherEnum.STATUS_NORMAL, }) const rules = computed>(() => { @@ -95,8 +96,8 @@ function init() { visible.value = true - // confirmLoading.value = true resetForm() + confirmLoading.value = false } // 时间范围变动 @@ -118,6 +119,7 @@ } await generationBatch(form) visible.value = false + confirmLoading.value = false emits('ok') }) } diff --git a/src/views/modules/payment/voucher/VoucherInfo.vue b/src/views/modules/payment/voucher/VoucherInfo.vue index e0bc557e6..b93d7105b 100644 --- a/src/views/modules/payment/voucher/VoucherInfo.vue +++ b/src/views/modules/payment/voucher/VoucherInfo.vue @@ -24,6 +24,9 @@ {{ form.enduring ? '长期' : '期限' }} + + {{ form.status === VoucherEnum.STATUS_NORMAL ? '正常' : '停用' }} + {{ form.startTime }} @@ -43,6 +46,7 @@ import { get, Voucher } from './Voucher.api' import { FormInstance, Rule } from 'ant-design-vue/lib/form' import BasicModal from '/@/components/Modal/src/BasicModal.vue' + import { VoucherEnum } from "../../../../enums/payment/voucherEnum"; const { handleCancel, modalWidth, confirmLoading, visible } = useFormEdit() // 表单 const formRef = $ref() @@ -55,7 +59,7 @@ enduring: true, startTime: '', endTime: '', - status: 0, + status: undefined, }) // 入口 function init(id) { diff --git a/src/views/modules/payment/voucher/VoucherList.vue b/src/views/modules/payment/voucher/VoucherList.vue index 45c5187ea..34ece5a06 100644 --- a/src/views/modules/payment/voucher/VoucherList.vue +++ b/src/views/modules/payment/voucher/VoucherList.vue @@ -41,12 +41,12 @@ diff --git a/src/views/modules/payment/voucher/VoucherLog.api.ts b/src/views/modules/payment/voucher/VoucherLog.api.ts new file mode 100644 index 000000000..1f5593f60 --- /dev/null +++ b/src/views/modules/payment/voucher/VoucherLog.api.ts @@ -0,0 +1,33 @@ +import { PageResult, Result } from '/#/axios' +import { defHttp } from '/@/utils/http/axios' +import { BaseEntity } from '/#/web' + +/** + * 根据储值卡Id查询日志分页 + */ +export function pageByVoucherId(params) { + return defHttp.get>>({ + url: '/voucher/log/pageByVoucherId', + params, + }) +} + +/** + * 储值卡日志 + */ +export interface VoucherLog extends BaseEntity { + /** 储值卡id */ + voucherId: string + /** 储值卡号 */ + voucherNo: string + /** 金额 */ + amount: number + /** 类型 */ + type: string + /** 交易记录ID */ + paymentId: string + /** 业务ID */ + businessId: string + /** 备注 */ + remark: string +} diff --git a/src/views/modules/payment/voucher/VoucherLogList.vue b/src/views/modules/payment/voucher/VoucherLogList.vue new file mode 100644 index 000000000..82f3a8217 --- /dev/null +++ b/src/views/modules/payment/voucher/VoucherLogList.vue @@ -0,0 +1,79 @@ + + + + +