From ee25ed00fb44c4a33398b1bdf706603bcc9f0024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Tue, 2 Jun 2026 08:20:11 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E8=AE=A2=E5=8D=95=E8=BF=BD=E6=BA=AF?= =?UTF-8?q?=E3=80=81=E6=A8=A1=E6=8B=9F=E6=94=AF=E4=BB=98=EF=BC=88=E4=BB=85?= =?UTF-8?q?=E9=99=90=E6=9C=AC=E5=9C=B0=E7=8E=AF=E5=A2=83=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/business/order/api/order-ops.ts | 31 ++ .../order/components/order-trace-drawer.vue | 467 ++++++++++++++++++ .../reconciliation-detail-table.vue | 154 ++++++ .../order/product-order/components/detail.vue | 30 +- .../business/order/product-order/index.vue | 53 +- .../business/order/register/config/table.ts | 14 +- .../views/business/order/register/index.vue | 75 ++- .../finance/withdrawal/api/account-change.ts | 7 + .../components/settlement-detail-drawer.vue | 119 +++++ .../config/account-change-search.ts | 37 ++ .../withdrawal/config/account-change-table.ts | 50 ++ .../config/settlement-log-search.ts | 48 ++ .../withdrawal/config/settlement-table.ts | 19 +- .../src/views/finance/withdrawal/index.vue | 230 +++++---- 14 files changed, 1191 insertions(+), 143 deletions(-) create mode 100644 apps/web-antd/src/views/business/order/api/order-ops.ts create mode 100644 apps/web-antd/src/views/business/order/components/order-trace-drawer.vue create mode 100644 apps/web-antd/src/views/business/order/components/reconciliation-detail-table.vue create mode 100644 apps/web-antd/src/views/finance/withdrawal/api/account-change.ts create mode 100644 apps/web-antd/src/views/finance/withdrawal/components/settlement-detail-drawer.vue create mode 100644 apps/web-antd/src/views/finance/withdrawal/config/account-change-search.ts create mode 100644 apps/web-antd/src/views/finance/withdrawal/config/account-change-table.ts create mode 100644 apps/web-antd/src/views/finance/withdrawal/config/settlement-log-search.ts diff --git a/apps/web-antd/src/views/business/order/api/order-ops.ts b/apps/web-antd/src/views/business/order/api/order-ops.ts new file mode 100644 index 00000000..6f0e1b69 --- /dev/null +++ b/apps/web-antd/src/views/business/order/api/order-ops.ts @@ -0,0 +1,31 @@ +import { requestClient } from '#/api/request'; + +const prefix = 'order/'; + +export async function simulatePayApi(data: { + order_id: number; + order_type: 'product' | 'register'; +}) { + return requestClient.post(`${prefix}simulate-pay`, data); +} + +export async function getOrderTraceApi(params: { + order_id: number; + scene: 'product' | 'register'; +}) { + return requestClient.get(`${prefix}trace`, { params }); +} + +export async function getOrderLedgerDetailApi(params: { + order_id: number; + order_type: number; + scope?: 'all' | 'platform' | 'store'; +}) { + return requestClient.get(`${prefix}ledger-detail`, { params }); +} + +export async function getOrderReconciliationDetailApi(params: { + product_order_id: number; +}) { + return requestClient.get(`${prefix}reconciliation-detail`, { params }); +} diff --git a/apps/web-antd/src/views/business/order/components/order-trace-drawer.vue b/apps/web-antd/src/views/business/order/components/order-trace-drawer.vue new file mode 100644 index 00000000..087f695d --- /dev/null +++ b/apps/web-antd/src/views/business/order/components/order-trace-drawer.vue @@ -0,0 +1,467 @@ + + + diff --git a/apps/web-antd/src/views/business/order/components/reconciliation-detail-table.vue b/apps/web-antd/src/views/business/order/components/reconciliation-detail-table.vue new file mode 100644 index 00000000..7b07014d --- /dev/null +++ b/apps/web-antd/src/views/business/order/components/reconciliation-detail-table.vue @@ -0,0 +1,154 @@ + + + diff --git a/apps/web-antd/src/views/business/order/product-order/components/detail.vue b/apps/web-antd/src/views/business/order/product-order/components/detail.vue index 0283ec41..2545a628 100644 --- a/apps/web-antd/src/views/business/order/product-order/components/detail.vue +++ b/apps/web-antd/src/views/business/order/product-order/components/detail.vue @@ -1,11 +1,13 @@ + + diff --git a/apps/web-antd/src/views/finance/withdrawal/config/account-change-search.ts b/apps/web-antd/src/views/finance/withdrawal/config/account-change-search.ts new file mode 100644 index 00000000..fbbbd738 --- /dev/null +++ b/apps/web-antd/src/views/finance/withdrawal/config/account-change-search.ts @@ -0,0 +1,37 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const accountChangeSearchOptions: VbenFormProps = { + collapsed: false, + schema: [ + { + component: 'VbenSelect', + componentProps: { + placeholder: '来源类型', + allowClear: true, + options: [ + { label: '分账', value: 'settle' }, + { label: '提现', value: 'withdraw' }, + { label: '退款', value: 'refund' }, + ], + }, + defaultValue: '', + fieldName: 'source_type', + label: '来源类型', + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '输入订单号', + }, + defaultValue: '', + fieldName: 'order_no', + label: '订单号', + }, + ], + showCollapseButton: true, + submitButtonOptions: { + content: '查询', + }, + submitOnChange: true, + submitOnEnter: false, +}; diff --git a/apps/web-antd/src/views/finance/withdrawal/config/account-change-table.ts b/apps/web-antd/src/views/finance/withdrawal/config/account-change-table.ts new file mode 100644 index 00000000..6ca936e1 --- /dev/null +++ b/apps/web-antd/src/views/finance/withdrawal/config/account-change-table.ts @@ -0,0 +1,50 @@ +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { getAccountAbleChangeLogList } from '#/views/finance/withdrawal/api/account-change'; + +export const accountChangeGridOptions: VxeGridProps = { + columnConfig: { + useKey: true, + }, + rowConfig: { + keyField: 'id', + useKey: true, + }, + columns: [ + { field: 'created_at', title: '变动时间', width: 170 }, + { field: 'source_type_txt', title: '来源类型', width: 100 }, + { field: 'field_name_txt', title: '变更字段', width: 120 }, + { field: 'before_amount', title: '变动前', width: 110 }, + { field: 'after_amount', title: '变动后', width: 110 }, + { field: 'change_amount', title: '变动值', width: 110 }, + { field: 'order_no', title: '订单号', minWidth: 160 }, + { field: 'source_table', title: '来源表', width: 140 }, + { field: 'remark', title: '备注', minWidth: 180 }, + { type: 'html', title: '操作', slots: { default: 'action' }, width: 100 }, + ], + keepSource: true, + pagerConfig: {}, + proxyConfig: { + ajax: { + query: async ({ page }, formValues) => { + return await getAccountAbleChangeLogList({ + page: page.currentPage, + pageSize: page.pageSize, + ...formValues, + }); + }, + }, + }, + border: false, + toolbarConfig: { + search: true, + refresh: true, + print: false, + export: false, + zoom: true, + slots: { + buttons: 'toolbar-buttons', + }, + }, + showOverflow: false, +}; diff --git a/apps/web-antd/src/views/finance/withdrawal/config/settlement-log-search.ts b/apps/web-antd/src/views/finance/withdrawal/config/settlement-log-search.ts new file mode 100644 index 00000000..06c564dc --- /dev/null +++ b/apps/web-antd/src/views/finance/withdrawal/config/settlement-log-search.ts @@ -0,0 +1,48 @@ +import type { VbenFormProps } from '#/adapter/form'; + +export const formOptions3: VbenFormProps = { + collapsed: false, + schema: [ + { + component: 'Switch', + componentProps: { + class: 'w-auto', + }, + defaultValue: true, + fieldName: 'merge_by_order', + label: '同订单合并', + }, + { + component: 'VbenInput', + componentProps: { + placeholder: '输入订单号', + }, + defaultValue: '', + fieldName: 'order_no', + label: '订单号', + }, + { + component: 'VbenSelect', + componentProps: { + placeholder: '选择费用类型', + options: [ + { label: '药品费用', value: 1 }, + { label: '挂号费用', value: 2 }, + { label: '快递费用', value: 3 }, + { label: '代煎费用', value: 4 }, + { label: '加工费用', value: 5 }, + { label: '诊疗费用', value: 6 }, + ], + }, + defaultValue: '', + fieldName: 'fee_type', + label: '费用类型', + }, + ], + showCollapseButton: true, + submitButtonOptions: { + content: '查询', + }, + submitOnChange: true, + submitOnEnter: false, +}; diff --git a/apps/web-antd/src/views/finance/withdrawal/config/settlement-table.ts b/apps/web-antd/src/views/finance/withdrawal/config/settlement-table.ts index e3ebc1a4..2fe7d711 100644 --- a/apps/web-antd/src/views/finance/withdrawal/config/settlement-table.ts +++ b/apps/web-antd/src/views/finance/withdrawal/config/settlement-table.ts @@ -77,6 +77,13 @@ export const gridOptions2: VxeGridProps = { showOverflow: false, }; +function normalizeMergeByOrder(value: unknown): 0 | 1 { + if (value === false || value === 0 || value === '0') { + return 0; + } + return 1; +} + export const gridOptions3: VxeGridProps = { checkboxConfig: { highlight: true, @@ -86,29 +93,31 @@ export const gridOptions3: VxeGridProps = { useKey: true, }, rowConfig: { + keyField: 'id', useKey: true, }, columns: [ - // { type: 'checkbox', width: 60 }, - // { field: 'id', align: 'left', title: 'ID', width: 100 }, { field: 'order_no', title: '订单号' }, + { field: 'order_type_txt', title: '订单类型' }, { field: 'fee_type_txt', title: '费用类型' }, { field: 'amount', title: '金额' }, { field: 'type_txt', title: '类型' }, { field: 'content', title: '说明' }, - { field: 'created_at', title: '创建时间' }, + { field: 'created_at', title: '结算时间' }, { type: 'html', title: '操作', slots: { default: 'action' } }, ], keepSource: true, pagerConfig: {}, proxyConfig: { ajax: { - // 请求后端接口方法 query: async ({ page }, formValues) => { + const { merge_by_order, ...rest } = formValues || {}; return await getSettlementLedgerLogList({ page: page.currentPage, pageSize: page.pageSize, - ...formValues, + merge_by_order: normalizeMergeByOrder(merge_by_order), + exclude_zero_amount: 1, + ...rest, }); }, }, diff --git a/apps/web-antd/src/views/finance/withdrawal/index.vue b/apps/web-antd/src/views/finance/withdrawal/index.vue index ce45c962..0976ace8 100644 --- a/apps/web-antd/src/views/finance/withdrawal/index.vue +++ b/apps/web-antd/src/views/finance/withdrawal/index.vue @@ -1,19 +1,27 @@