From f4a49fd7ae0f1833688f314496ade4bc18aa21fa Mon Sep 17 00:00:00 2001 From: DaxPay Dev Date: Fri, 10 Jul 2026 16:50:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E7=A0=81=E7=89=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5(=E6=89=B9=E9=87=8F=E7=94=9F=E6=88=90/?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=95=86=E6=88=B7/=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=88=97=E4=BC=98=E5=8C=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 批量生成批次号布局修复;绑定商户去掉应用选择;列表主显商户名悬停看商户号。 --- .../src/api/payment/device/qrcode.api.ts | 168 +++++++ apps/daxpay-admin/src/constants/perm-codes.ts | 5 + .../langs/en-US/payment/device/qrcode.json | 57 +++ .../langs/zh-CN/payment/device/qrcode.json | 57 +++ .../payment/device/qrcode/DeviceQrCode.vue | 452 ++++++++++++++++++ .../device/qrcode/DeviceQrCodeBatchCreate.vue | 207 ++++++++ .../qrcode/DeviceQrCodeBindMerchant.vue | 121 +++++ .../device/qrcode/DeviceQrCodeEdit.vue | 239 +++++++++ 8 files changed, 1306 insertions(+) create mode 100644 apps/daxpay-admin/src/api/payment/device/qrcode.api.ts create mode 100644 apps/daxpay-admin/src/locales/langs/en-US/payment/device/qrcode.json create mode 100644 apps/daxpay-admin/src/locales/langs/zh-CN/payment/device/qrcode.json create mode 100644 apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCode.vue create mode 100644 apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBatchCreate.vue create mode 100644 apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBindMerchant.vue create mode 100644 apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeEdit.vue diff --git a/apps/daxpay-admin/src/api/payment/device/qrcode.api.ts b/apps/daxpay-admin/src/api/payment/device/qrcode.api.ts new file mode 100644 index 000000000..a81b0659a --- /dev/null +++ b/apps/daxpay-admin/src/api/payment/device/qrcode.api.ts @@ -0,0 +1,168 @@ +import type { BaseEntity, PageResult, Result } from '#/types/web'; + +import { defHttp } from '#/api/request'; + +/** + * 支付码牌 API + */ +export const DeviceQrCodeApi = { + /** + * 分页查询码牌 + */ + page( + params: DeviceQrCodeQuery & { current?: number; size?: number }, + ): Promise>> { + return defHttp.get({ url: '/admin/device/qrcode/page', params }); + }, + + /** + * 根据 id 查询码牌 + */ + get(id: string): Promise> { + return defHttp.get({ url: '/admin/device/qrcode/get', params: { id } }); + }, + + /** + * 新增码牌(快捷绑定商户) + */ + add(data: DeviceQrCodeParam): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/add', data }); + }, + + /** + * 批量创建空白码牌 + */ + createBatch(data: DeviceQrCodeBatchParam): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/create-batch', data }); + }, + + /** + * 判断批次号是否已存在 + */ + existsByBatchNo(batchNo: string): Promise> { + return defHttp.get({ url: '/admin/device/qrcode/exists-by-batch-no', params: { batchNo } }); + }, + + /** + * 批量绑定商户 + */ + bindMerchant(data: DeviceQrCodeBindMerchantParam): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/bind-merchant', data }); + }, + + /** + * 批量解绑商户 + */ + unbindMerchant(ids: string[]): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/unbind-merchant', data: ids }); + }, + + /** + * 修改码牌 + */ + update(data: DeviceQrCodeParam): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/update', data }); + }, + + /** + * 删除码牌 + */ + delete(id: string): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/delete', params: { id } }); + }, + + /** + * 修改码牌状态(启用/停用) + */ + changeStatus(id: string, status: string): Promise> { + return defHttp.post({ url: '/admin/device/qrcode/change-status', params: { id, status } }); + }, +}; + +/** 支付码牌查询参数 */ +export interface DeviceQrCodeQuery { + /** 码牌编码 */ + code?: string; + /** 码牌名称 */ + name?: string; + /** 批次号 */ + batchNo?: string; + /** 商户号 */ + mchNo?: string; + /** 金额类型 random/fixed */ + amountType?: string; + /** 状态 enabled/disabled */ + status?: string; +} + +/** 支付码牌参数 */ +export interface DeviceQrCodeParam { + /** 主键 */ + id?: string; + /** 码牌名称 */ + name?: string; + /** 商户号 */ + mchNo?: string; + /** 关联应用号(空=商户默认应用) */ + appId?: string; + /** 金额类型 random/fixed */ + amountType?: string; + /** 固定金额(分) */ + fixedAmount?: number; + /** 状态 */ + status?: string; + /** 备注 */ + remark?: string; +} + +/** 批量创建空白码牌参数 */ +export interface DeviceQrCodeBatchParam { + /** 批次号 */ + batchNo?: string; + /** 创建数量 1-999 */ + count?: number; + /** 码牌名称 */ + name?: string; + /** 金额类型 random/fixed */ + amountType?: string; + /** 固定金额(分) */ + fixedAmount?: number; + /** 状态 enabled/disabled, 空则默认启用 */ + status?: string; + /** 备注 */ + remark?: string; +} + +/** 绑定商户参数 */ +export interface DeviceQrCodeBindMerchantParam { + /** 码牌主键列表 */ + ids: string[]; + /** 商户号 */ + mchNo: string; + /** 关联应用号 */ + appId?: string; +} + +/** 支付码牌结果 */ +export interface DeviceQrCodeResult extends BaseEntity { + /** 码牌编码 */ + code?: string; + /** 码牌名称 */ + name?: string; + /** 批次号 */ + batchNo?: string; + /** 商户号 */ + mchNo?: string; + /** 商户名称(由 mchNo 翻译) */ + mchName?: string; + /** 关联应用号(空=商户默认应用) */ + appId?: string; + /** 金额类型 random/fixed */ + amountType?: string; + /** 固定金额(分) */ + fixedAmount?: number; + /** 状态 enabled/disabled */ + status?: string; + /** 备注 */ + remark?: string; +} diff --git a/apps/daxpay-admin/src/constants/perm-codes.ts b/apps/daxpay-admin/src/constants/perm-codes.ts index ae29d433a..cae79fd46 100644 --- a/apps/daxpay-admin/src/constants/perm-codes.ts +++ b/apps/daxpay-admin/src/constants/perm-codes.ts @@ -218,6 +218,11 @@ export const PermCodes = { VIEW: 'device:speaker:view', MANAGE: 'device:speaker:manage', }, + /** 码牌 menuCode=device:qrcode */ + QrCode: { + VIEW: 'device:qrcode:view', + MANAGE: 'device:qrcode:manage', + }, /** 云打印 menuCode=device:printer */ Printer: { VIEW: 'device:printer:view', diff --git a/apps/daxpay-admin/src/locales/langs/en-US/payment/device/qrcode.json b/apps/daxpay-admin/src/locales/langs/en-US/payment/device/qrcode.json new file mode 100644 index 000000000..9e66fd951 --- /dev/null +++ b/apps/daxpay-admin/src/locales/langs/en-US/payment/device/qrcode.json @@ -0,0 +1,57 @@ +{ + "title": "QR Code Board", + "field": { + "code": "Code", + "name": "Name", + "batchNo": "Batch No.", + "count": "Count", + "mchNo": "Merchant No.", + "mchName": "Merchant Name", + "merchant": "Merchant", + "appId": "Application", + "amountType": "Amount Type", + "fixedAmount": "Fixed Amount", + "status": "Status", + "remark": "Remark", + "createTime": "Create Time" + }, + "status": { + "enabled": "Enabled", + "disabled": "Disabled" + }, + "amountType": { + "random": "Custom Amount", + "fixed": "Fixed Amount" + }, + "defaultApp": "Default App", + "unbound": "Unbound", + "mchNoTooltip": "Merchant No.: {mchNo}", + "batchCreate": "Batch Create", + "bindMerchant": "Bind Merchant", + "unbindMerchant": "Unbind Merchant", + "genBatchNo": "Generate", + "batchNoPlaceholder": "Click Generate; used as code prefix", + "batchNoExists": "Batch number already exists", + "batchCreateSuccess": "Successfully created {count} blank QR codes", + "selectRequired": "Please select QR code boards first", + "validateName": "Please enter the name", + "validateMchNo": "Please select a merchant", + "validateBatchNo": "Please enter the batch number", + "validateCount": "Please enter the count", + "validateAmountType": "Please select an amount type", + "validateFixedAmount": "Please enter the fixed amount", + "validateStatus": "Please select a status", + "pleaseSelectMch": "Please select a merchant", + "pleaseSelectApp": "Leave empty to use the merchant default app", + "enable": "Enable", + "disable": "Disable", + "confirmDelete": "Are you sure to delete this QR code board?", + "confirmEnable": "Are you sure to enable this QR code board?", + "confirmDisable": "Are you sure to disable this QR code board? Payment via scan will be unavailable.", + "confirmUnbind": "Unbind selected boards from merchants? They will return to blank inventory.", + "viewCode": "View Code", + "qrCodeTitle": "QR Code", + "qrCodeTip": "Scan to enter the payment page", + "download": "Download QR Code", + "amountLabel": "Amount" +} diff --git a/apps/daxpay-admin/src/locales/langs/zh-CN/payment/device/qrcode.json b/apps/daxpay-admin/src/locales/langs/zh-CN/payment/device/qrcode.json new file mode 100644 index 000000000..39159070d --- /dev/null +++ b/apps/daxpay-admin/src/locales/langs/zh-CN/payment/device/qrcode.json @@ -0,0 +1,57 @@ +{ + "title": "支付码牌", + "field": { + "code": "码牌编码", + "name": "码牌名称", + "batchNo": "批次号", + "count": "创建数量", + "mchNo": "商户号", + "mchName": "商户名称", + "merchant": "商户", + "appId": "关联应用", + "amountType": "金额类型", + "fixedAmount": "固定金额", + "status": "状态", + "remark": "备注", + "createTime": "创建时间" + }, + "status": { + "enabled": "启用", + "disabled": "停用" + }, + "amountType": { + "random": "自定义金额", + "fixed": "固定金额" + }, + "defaultApp": "默认应用", + "unbound": "未绑定", + "mchNoTooltip": "商户号: {mchNo}", + "batchCreate": "批量生成", + "bindMerchant": "绑定商户", + "unbindMerchant": "解绑商户", + "genBatchNo": "生成", + "batchNoPlaceholder": "可点生成, 将作为码牌编码前缀", + "batchNoExists": "批次号已存在", + "batchCreateSuccess": "成功创建 {count} 张空白码牌", + "selectRequired": "请先勾选码牌", + "validateName": "请输入码牌名称", + "validateMchNo": "请选择商户", + "validateBatchNo": "请输入批次号", + "validateCount": "请输入创建数量", + "validateAmountType": "请选择金额类型", + "validateFixedAmount": "请输入固定金额", + "validateStatus": "请选择状态", + "pleaseSelectMch": "请选择商户", + "pleaseSelectApp": "不选则使用商户默认应用", + "enable": "启用", + "disable": "停用", + "confirmDelete": "确定要删除该码牌吗?", + "confirmEnable": "确定要启用该码牌吗?", + "confirmDisable": "确定要停用该码牌吗?扫码将无法支付。", + "confirmUnbind": "确定要解绑所选码牌的商户吗?解绑后将回到空白库存。", + "viewCode": "查看码牌", + "qrCodeTitle": "码牌二维码", + "qrCodeTip": "扫码即可进入支付页面", + "download": "下载二维码", + "amountLabel": "金额" +} diff --git a/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCode.vue b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCode.vue new file mode 100644 index 000000000..7e53855b9 --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCode.vue @@ -0,0 +1,452 @@ + + + + + diff --git a/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBatchCreate.vue b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBatchCreate.vue new file mode 100644 index 000000000..e448879d8 --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBatchCreate.vue @@ -0,0 +1,207 @@ + + + diff --git a/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBindMerchant.vue b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBindMerchant.vue new file mode 100644 index 000000000..f466db1e1 --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeBindMerchant.vue @@ -0,0 +1,121 @@ + + + diff --git a/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeEdit.vue b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeEdit.vue new file mode 100644 index 000000000..ad19ef122 --- /dev/null +++ b/apps/daxpay-admin/src/views/payment/device/qrcode/DeviceQrCodeEdit.vue @@ -0,0 +1,239 @@ + + +