From ad84c21e8416c8d6f61b93e67128af7f3f4582cd Mon Sep 17 00:00:00 2001 From: kkfluous Date: Mon, 16 Mar 2026 01:36:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(energy):=20=E5=AE=9E=E7=8E=B0=E8=83=BD?= =?UTF-8?q?=E6=BA=90=E8=B4=A6=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5=EF=BC=88?= =?UTF-8?q?=E5=90=AB=E7=94=9F=E6=88=90=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 --- apps/web-antd/src/views/energy/bill/data.ts | 188 ++++++++++++ apps/web-antd/src/views/energy/bill/index.vue | 275 ++++++++++++++++++ .../energy/bill/modules/generate-modal.vue | 136 +++++++++ 3 files changed, 599 insertions(+) create mode 100644 apps/web-antd/src/views/energy/bill/data.ts create mode 100644 apps/web-antd/src/views/energy/bill/index.vue create mode 100644 apps/web-antd/src/views/energy/bill/modules/generate-modal.vue diff --git a/apps/web-antd/src/views/energy/bill/data.ts b/apps/web-antd/src/views/energy/bill/data.ts new file mode 100644 index 0000000..3299207 --- /dev/null +++ b/apps/web-antd/src/views/energy/bill/data.ts @@ -0,0 +1,188 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { EnergyBillApi } from '#/api/energy/bill'; + +import { useActionColumn } from '#/utils/table'; + +export const COOPERATION_TYPE_OPTIONS = [ + { label: '预充值', value: 1, color: 'blue' }, + { label: '月结算', value: 2, color: 'pink' }, +]; + +export const BILL_STATUS_OPTIONS = [ + { label: '草稿', value: 0, color: 'orange' }, + { label: '已确认', value: 1, color: 'green' }, +]; + +export const BILL_AUDIT_STATUS_OPTIONS = [ + { label: '待审核', value: 0, color: 'orange' }, + { label: '已通过', value: 1, color: 'green' }, + { label: '已驳回', value: 2, color: 'red' }, +]; + +export const PAYMENT_STATUS_OPTIONS = [ + { label: '未支付', value: 0, color: 'default' }, + { label: '部分支付', value: 1, color: 'orange' }, + { label: '已支付', value: 2, color: 'green' }, +]; + +/** 搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'customerName', + label: '客户名称', + component: 'Input', + componentProps: { + placeholder: '请输入客户名称', + allowClear: true, + }, + }, + { + fieldName: 'stationName', + label: '加氢站', + component: 'Input', + componentProps: { + placeholder: '请输入加氢站', + allowClear: true, + }, + }, + { + fieldName: 'billPeriod', + label: '账单周期', + component: 'DatePicker', + componentProps: { + picker: 'month', + format: 'YYYY-MM', + valueFormat: 'YYYY-MM', + placeholder: '选择月份', + allowClear: true, + class: 'w-full', + }, + }, + { + fieldName: 'cooperationType', + label: '合作模式', + component: 'Select', + componentProps: { + options: COOPERATION_TYPE_OPTIONS, + placeholder: '请选择合作模式', + allowClear: true, + }, + }, + { + fieldName: 'status', + label: '账单状态', + component: 'Select', + componentProps: { + options: BILL_STATUS_OPTIONS, + placeholder: '请选择账单状态', + allowClear: true, + }, + }, + { + fieldName: 'auditStatus', + label: '审核状态', + component: 'Select', + componentProps: { + options: BILL_AUDIT_STATUS_OPTIONS, + placeholder: '请选择审核状态', + allowClear: true, + }, + }, + { + fieldName: 'paymentStatus', + label: '付款状态', + component: 'Select', + componentProps: { + options: PAYMENT_STATUS_OPTIONS, + placeholder: '请选择付款状态', + allowClear: true, + }, + }, + ]; +} + +/** 表格列配置 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'billCode', + title: '账单编号', + minWidth: 180, + fixed: 'left', + slots: { default: 'billCode' }, + }, + { + field: 'customerName', + title: '客户名称', + minWidth: 150, + }, + { + field: 'stationName', + title: '加氢站', + minWidth: 150, + }, + { + field: 'cooperationType', + title: '合作模式', + minWidth: 100, + align: 'center', + slots: { default: 'cooperationType' }, + }, + { + field: 'billPeriodStart', + title: '账单周期', + minWidth: 100, + align: 'center', + formatter: ({ row }: { row: EnergyBillApi.Bill }) => { + if (row.billPeriodStart) { + return row.billPeriodStart.substring(0, 7); + } + return '—'; + }, + }, + { + field: 'receivableAmount', + title: '应收金额', + minWidth: 100, + align: 'right', + }, + { + field: 'adjustmentAmount', + title: '调整金额', + minWidth: 100, + align: 'right', + slots: { default: 'adjustmentAmount' }, + }, + { + field: 'actualAmount', + title: '实收金额', + minWidth: 100, + align: 'right', + slots: { default: 'actualAmount' }, + }, + { + field: 'status', + title: '账单状态', + minWidth: 100, + align: 'center', + slots: { default: 'status' }, + }, + { + field: 'auditStatus', + title: '审核状态', + minWidth: 100, + align: 'center', + slots: { default: 'auditStatus' }, + }, + { + field: 'paymentStatus', + title: '付款状态', + minWidth: 100, + align: 'center', + slots: { default: 'paymentStatus' }, + }, + useActionColumn(3), + ]; +} diff --git a/apps/web-antd/src/views/energy/bill/index.vue b/apps/web-antd/src/views/energy/bill/index.vue new file mode 100644 index 0000000..afd0b9a --- /dev/null +++ b/apps/web-antd/src/views/energy/bill/index.vue @@ -0,0 +1,275 @@ + + + diff --git a/apps/web-antd/src/views/energy/bill/modules/generate-modal.vue b/apps/web-antd/src/views/energy/bill/modules/generate-modal.vue new file mode 100644 index 0000000..f97f17b --- /dev/null +++ b/apps/web-antd/src/views/energy/bill/modules/generate-modal.vue @@ -0,0 +1,136 @@ + + +