From 12d19c93e9abacb18312969326b8ff1896b0b8af Mon Sep 17 00:00:00 2001 From: kkfluous Date: Mon, 16 Mar 2026 01:30:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(energy):=20=E5=AE=9E=E7=8E=B0=E5=8A=A0?= =?UTF-8?q?=E6=B0=A2=E6=98=8E=E7=BB=86=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=88=E5=90=AB=E5=AE=A1=E6=A0=B8=E5=BC=B9=E7=AA=97=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- .../src/views/energy/hydrogen-detail/data.ts | 181 +++++++++++++++ .../views/energy/hydrogen-detail/index.vue | 216 ++++++++++++++++++ .../hydrogen-detail/modules/audit-modal.vue | 108 +++++++++ 3 files changed, 505 insertions(+) create mode 100644 apps/web-antd/src/views/energy/hydrogen-detail/data.ts create mode 100644 apps/web-antd/src/views/energy/hydrogen-detail/index.vue create mode 100644 apps/web-antd/src/views/energy/hydrogen-detail/modules/audit-modal.vue diff --git a/apps/web-antd/src/views/energy/hydrogen-detail/data.ts b/apps/web-antd/src/views/energy/hydrogen-detail/data.ts new file mode 100644 index 0000000..d738ad7 --- /dev/null +++ b/apps/web-antd/src/views/energy/hydrogen-detail/data.ts @@ -0,0 +1,181 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { EnergyHydrogenDetailApi } from '#/api/energy/hydrogen-detail'; + +import { useActionColumn } from '#/utils/table'; +import { getRangePickerDefaultProps } from '#/utils'; + +export const AUDIT_STATUS_OPTIONS = [ + { label: '待审核', value: 0, color: 'orange' }, + { label: '已审核', value: 1, color: 'green' }, + { label: '审核驳回', value: 2, color: 'red' }, +]; + +export const DEDUCTION_STATUS_OPTIONS = [ + { label: '未扣款', value: 0, color: 'default' }, + { label: '已扣款', value: 1, color: 'green' }, + { label: '扣款失败', value: 2, color: 'red' }, +]; + +export const SETTLEMENT_STATUS_OPTIONS = [ + { label: '未结算', value: 0, color: 'default' }, + { label: '已结算', value: 1, color: 'green' }, +]; + +/** 搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'stationName', + label: '加氢站', + component: 'Input', + componentProps: { + placeholder: '请输入加氢站', + allowClear: true, + }, + }, + { + fieldName: 'customerName', + label: '客户名称', + component: 'Input', + componentProps: { + placeholder: '请输入客户名称', + allowClear: true, + }, + }, + { + fieldName: 'plateNumber', + label: '车牌号', + component: 'Input', + componentProps: { + placeholder: '请输入车牌号', + allowClear: true, + }, + }, + { + fieldName: 'hydrogenDate', + label: '加氢日期', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + class: 'w-full', + }, + }, + { + fieldName: 'auditStatus', + label: '审核状态', + component: 'Select', + componentProps: { + options: AUDIT_STATUS_OPTIONS, + placeholder: '请选择审核状态', + allowClear: true, + }, + }, + { + fieldName: 'deductionStatus', + label: '扣款状态', + component: 'Select', + componentProps: { + options: DEDUCTION_STATUS_OPTIONS, + placeholder: '请选择扣款状态', + allowClear: true, + }, + }, + { + fieldName: 'settlementStatus', + label: '结算状态', + component: 'Select', + componentProps: { + options: SETTLEMENT_STATUS_OPTIONS, + placeholder: '请选择结算状态', + allowClear: true, + }, + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 60, + fixed: 'left', + }, + { + field: 'stationName', + title: '加氢站', + minWidth: 150, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户名称', + minWidth: 150, + }, + { + field: 'plateNumber', + title: '车牌号', + minWidth: 120, + }, + { + field: 'hydrogenDate', + title: '加氢日期', + minWidth: 120, + formatter: 'formatDate', + align: 'center', + }, + { + field: 'hydrogenQuantity', + title: '加氢量', + minWidth: 80, + align: 'right', + }, + { + field: 'costPrice', + title: '成本单价', + minWidth: 80, + align: 'right', + }, + { + field: 'costAmount', + title: '成本金额', + minWidth: 100, + align: 'right', + }, + { + field: 'customerPrice', + title: '对客单价', + minWidth: 80, + align: 'right', + }, + { + field: 'customerAmount', + title: '对客金额', + minWidth: 100, + align: 'right', + }, + { + field: 'auditStatus', + title: '审核状态', + minWidth: 100, + align: 'center', + slots: { default: 'auditStatus' }, + }, + { + field: 'deductionStatus', + title: '扣款状态', + minWidth: 100, + align: 'center', + slots: { default: 'deductionStatus' }, + }, + { + field: 'settlementStatus', + title: '结算状态', + minWidth: 100, + align: 'center', + slots: { default: 'settlementStatus' }, + }, + useActionColumn(2), + ]; +} diff --git a/apps/web-antd/src/views/energy/hydrogen-detail/index.vue b/apps/web-antd/src/views/energy/hydrogen-detail/index.vue new file mode 100644 index 0000000..e3301c6 --- /dev/null +++ b/apps/web-antd/src/views/energy/hydrogen-detail/index.vue @@ -0,0 +1,216 @@ + + + diff --git a/apps/web-antd/src/views/energy/hydrogen-detail/modules/audit-modal.vue b/apps/web-antd/src/views/energy/hydrogen-detail/modules/audit-modal.vue new file mode 100644 index 0000000..8c2e393 --- /dev/null +++ b/apps/web-antd/src/views/energy/hydrogen-detail/modules/audit-modal.vue @@ -0,0 +1,108 @@ + + +