diff --git a/src/views/daxpay/common/config/cashier/checkout/CheckoutConfig.api.vue b/src/views/daxpay/common/config/cashier/checkout/CheckoutConfig.api.vue new file mode 100644 index 00000000..0a8d203d --- /dev/null +++ b/src/views/daxpay/common/config/cashier/checkout/CheckoutConfig.api.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/src/views/daxpay/common/config/cashier/code/CashierCodeConfig.api.ts b/src/views/daxpay/common/config/cashier/code/CashierCodeConfig.api.ts new file mode 100644 index 00000000..5cf9a866 --- /dev/null +++ b/src/views/daxpay/common/config/cashier/code/CashierCodeConfig.api.ts @@ -0,0 +1,134 @@ +import { defHttp } from '@/utils/http/axios' +import { Result } from '#/axios' +import { MchEntity } from '#/web' + +/** + * 根据AppId查询码牌列表 + */ +export const findAllByAppId = (appId) => + defHttp.get>({ + url: '/cashier/code/config/findAllByAppId', + params: { appId }, + }) + +/** + * 根据id查询码牌信息 + */ +export const findById = (id) => + defHttp.get>({ url: '/cashier/code/config/findById', params: { id } }) + +/** + * 码牌配置保存 + */ +export const save = (param: CashierCodeConfig) => + defHttp.post({ url: '/cashier/code/config/save', data: param }) + +/** + * 码牌配置更新 + */ +export const update = (param: CashierCodeConfig) => + defHttp.post({ url: '/cashier/code/config/update', data: param }) + +/** + * 码牌配置删除 + */ +export const remove = (id) => defHttp.post({ url: '/cashier/code/config/delete', params: { id } }) + +/** + * 获取码牌地址 + */ +export const getCashierCodeUrl = (id) => + defHttp.get>({ url: '/cashier/code/config/getCashierCodeUrl', params: { id } }) +/** + * 获取码牌各类型配置列表 + */ +export const findTypeByCodeId = (cashierCodeId) => + defHttp.get>({ + url: '/cashier/code/config/type/findAll', + params: { cashierCodeId }, + }) +/** + * 获取码牌类型配置详情 + */ +export const findTypeById = (id) => + defHttp.get>({ url: '/cashier/code/config/type/findById', params: { id } }) +/** + * 码牌类型配置保存 + */ +export const saveType = (param: CashierCodeTypeConfig) => + defHttp.post({ url: '/cashier/code/config/type/save', data: param }) +/** + * 码牌类型配置更新 + */ +export const updateType = (param: CashierCodeTypeConfig) => + defHttp.post({ url: '/cashier/code/config/type/update', data: param }) +/** + * 码牌类型配置删除 + */ +export const deleteType = (id) => defHttp.post({ url: '/cashier/code/config/type/delete', params: { id } }) + +/** + * 码牌类型是否存在 + */ +export const existsByType = (type, cashierCodeId) => + defHttp.get>({ + url: '/cashier/code/config/type/exists', + params: { type, cashierCodeId }, + }) + +/** + * 码牌类型是否存在(不包括自身) + */ +export const existsByTypeNotId = (type, cashierCodeId, id) => + defHttp.get>({ + url: '/cashier/code/config/type/existsNotId', + params: { type, cashierCodeId, id }, + }) + +/** + * 收银台码牌配置 + */ +export interface CashierCodeConfig extends MchEntity { + /** 码牌名称 */ + name?: string + /** 码牌code */ + code?: string + /** 模板编号 */ + templateCode?: string + /** 是否启用 */ + enable?: boolean + /** 备注 */ + remark?: string +} + +/** + * 特定类型码牌配置 + */ +export interface CashierCodeTypeConfig extends MchEntity { + /** 码牌ID */ + cashierCodeId?: string + + /** + * 码牌类型 + */ + type?: string + + /** + * 支付通道 + */ + channel?: string + + /** + * 支付方式 + */ + payMethod?: string + + /** 是否开启分账 */ + allocation?: boolean + + /** 自动分账 */ + autoAllocation?: boolean + + /** 备注 */ + remark?: string +} diff --git a/src/views/daxpay/common/config/cashier/code/CashierCodeConfigEdit.vue b/src/views/daxpay/common/config/cashier/code/CashierCodeConfigEdit.vue new file mode 100644 index 00000000..38473e36 --- /dev/null +++ b/src/views/daxpay/common/config/cashier/code/CashierCodeConfigEdit.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/src/views/daxpay/common/config/cashier/code/CashierCodeConfigList.vue b/src/views/daxpay/common/config/cashier/code/CashierCodeConfigList.vue new file mode 100644 index 00000000..7df6fc83 --- /dev/null +++ b/src/views/daxpay/common/config/cashier/code/CashierCodeConfigList.vue @@ -0,0 +1,218 @@ + + + diff --git a/src/views/daxpay/common/merchant/cashier/ChannelCashierConfigEdit.vue b/src/views/daxpay/common/config/cashier/code/CashierCodeTypeConfigEdit.vue similarity index 73% rename from src/views/daxpay/common/merchant/cashier/ChannelCashierConfigEdit.vue rename to src/views/daxpay/common/config/cashier/code/CashierCodeTypeConfigEdit.vue index 5b02b914..b31bf4a9 100644 --- a/src/views/daxpay/common/merchant/cashier/ChannelCashierConfigEdit.vue +++ b/src/views/daxpay/common/config/cashier/code/CashierCodeTypeConfigEdit.vue @@ -20,23 +20,16 @@ - + - - - - - - @@ -101,15 +86,14 @@ import { BasicModal } from '@/components/Modal' import { LabeledValue } from 'ant-design-vue/lib/select' import { - get, - add, - update, + findTypeById, + saveType, + updateType, existsByType, existsByTypeNotId, - ChannelCashierConfig, - } from './ChannelCashierConfig.api' + CashierCodeTypeConfig, + } from './CashierCodeConfig.api' import { useDict } from '@/hooks/bootx/useDict' - import { MchApp } from '@/views/daxpay/common/merchant/app/MchApp.api' const { initFormEditType, @@ -133,18 +117,19 @@ const channelList = ref([]) const methodList = ref([]) - let form = ref({ + let form = ref({ allocation: false, autoAllocation: false, }) // 校验 const rules = reactive({ - cashierType: [ + type: [ { required: true, message: '请选择收银台类型' }, { validator: validateCode, trigger: 'blur' }, ], - cashierName: [{ required: true, message: '请输入收银台名称' }], - name: [{ required: true, message: '请输入字典项名称' }], + channel: [{ required: true, message: '请选择支付通道' }], + payMethod: [{ required: true, message: '请选择支付方式' }], + allocation: [{ required: true, message: '' }], } as Record) // 事件 @@ -158,7 +143,7 @@ * 初始化数据 */ async function initData() { - cashierTypeList.value = await dictDropDown('cashier_type') + cashierTypeList.value = await dictDropDown('cashier_code_type') channelList.value = await dictDropDown('channel') methodList.value = await dictDropDown('pay_method') } @@ -166,10 +151,10 @@ /** * 入口 */ - function init(id, editType: FormEditType, mchApp: MchApp) { + function init(id, editType: FormEditType, configId: string) { initFormEditType(editType) resetForm() - form.value.appId = unref(mchApp.appId) + form.value.cashierCodeId = unref(configId) getInfo(id, editType) } /** @@ -178,7 +163,7 @@ function getInfo(id, editType: FormEditType) { if ([FormEditType.Edit, FormEditType.Show].includes(editType)) { confirmLoading.value = true - get(id).then(({ data }) => { + findTypeById(id).then(({ data }) => { form.value = data confirmLoading.value = false }) @@ -193,9 +178,9 @@ formRef.value?.validate().then(async () => { confirmLoading.value = true if (formEditType.value === FormEditType.Add) { - await add(form.value).finally(() => (confirmLoading.value = false)) + await saveType(form.value).finally(() => (confirmLoading.value = false)) } else if (formEditType.value === FormEditType.Edit) { - await update(form.value).finally(() => (confirmLoading.value = false)) + await updateType(form.value).finally(() => (confirmLoading.value = false)) } handleCancel() emits('ok') @@ -206,13 +191,13 @@ * 校验编码重复 */ async function validateCode() { - const { cashierType, appId, id } = form.value + const { type, cashierCodeId, id } = form.value if (id) { - const res = await existsByTypeNotId(appId, cashierType, id) - return res.data ? Promise.reject('该收银台类型已存在') : Promise.resolve() + const res = await existsByTypeNotId(type, cashierCodeId, id) + return res.data ? Promise.reject('该码牌类型已存在') : Promise.resolve() } else { - const res = await existsByType(appId, cashierType) - return res.data ? Promise.reject('该收银台类型已存在') : Promise.resolve() + const res = await existsByType(type, cashierCodeId) + return res.data ? Promise.reject('该码牌类型已存在') : Promise.resolve() } } diff --git a/src/views/daxpay/common/merchant/cashier/ChannelCashierConfigList.vue b/src/views/daxpay/common/config/cashier/code/CashierCodeTypeConfigList.vue similarity index 61% rename from src/views/daxpay/common/merchant/cashier/ChannelCashierConfigList.vue rename to src/views/daxpay/common/config/cashier/code/CashierCodeTypeConfigList.vue index 91974308..98f9f6c7 100644 --- a/src/views/daxpay/common/merchant/cashier/ChannelCashierConfigList.vue +++ b/src/views/daxpay/common/config/cashier/code/CashierCodeTypeConfigList.vue @@ -3,7 +3,7 @@ showFooter v-bind="$attrs" width="70%" - title="收银配置" + title="码牌类型配置" :mask-closable="true" :open="visible" @close="handleCancel" @@ -17,32 +17,25 @@ - + - - + - + - - - @@ -57,36 +50,39 @@ - + - - diff --git a/src/views/daxpay/common/order/pay/PayOrder.api.ts b/src/views/daxpay/common/order/pay/PayOrder.api.ts index f8e53ce7..774a49f2 100644 --- a/src/views/daxpay/common/order/pay/PayOrder.api.ts +++ b/src/views/daxpay/common/order/pay/PayOrder.api.ts @@ -70,7 +70,7 @@ export function cancel(id) { /** * 触发分账 */ -export function allocationByOrderNo(orderNo) { +export function allocByOrderNo(orderNo) { return defHttp.post>({ url: '/order/pay/allocation', params: { orderNo }, diff --git a/src/views/daxpay/common/order/pay/PayOrderList.vue b/src/views/daxpay/common/order/pay/PayOrderList.vue index fc837310..af5cc7ba 100644 --- a/src/views/daxpay/common/order/pay/PayOrderList.vue +++ b/src/views/daxpay/common/order/pay/PayOrderList.vue @@ -137,7 +137,7 @@