| | |
| | | import type { VbenFormSchema } from '#/adapter/form'; |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | |
| | | import { DICT_TYPE } from '@vben/constants'; |
| | | import { getDictOptions } from '@vben/hooks'; |
| | | |
| | | import { erpPriceMultiply } from '#/packages/utils/src'; |
| | | |
| | | import { z } from '#/adapter/form'; |
| | |
| | | fieldName: 'quotationTime', |
| | | label: '报价日期', |
| | | component: 'DatePicker', |
| | | rules: 'required', |
| | | componentProps: { |
| | | showTime: false, |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | placeholder: '请选择报价日期', |
| | | }, |
| | | }, |
| | |
| | | componentProps: { |
| | | showTime: false, |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'x', |
| | | valueFormat: 'YYYY-MM-DD', |
| | | placeholder: '请选择有效期', |
| | | }, |
| | | }, |
| | |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'quotationType', |
| | | label: '报价类型', |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DICT_TYPE.CRM_QUOTATION_TYPE), |
| | | placeholder: '请选择报价类型', |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'capacity', |
| | | label: '合同容量(kVA)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: '请输入合同容量', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'maxDemand', |
| | | label: '最大需量(kW)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: '请输入最大需量', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'unitPrice', |
| | | label: '电度单价(元/kWh)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | min: 0, |
| | | precision: 4, |
| | | placeholder: '请输入电度单价', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'tariffMode', |
| | | label: '电价模式', |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DICT_TYPE.CRM_TARIFF_MODE), |
| | | placeholder: '请选择电价模式', |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'powerFactorFee', |
| | | label: '力调电费(元)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | min: 0, |
| | | precision: 2, |
| | | placeholder: '请输入力调电费', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'billingCycle', |
| | | label: '结算周期(月)', |
| | | component: 'InputNumber', |
| | | componentProps: { |
| | | class: '!w-full', |
| | | min: 1, |
| | | precision: 0, |
| | | placeholder: '请输入结算周期', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'remark', |
| | | label: '备注', |
| | | component: 'Textarea', |
| | |
| | | }, |
| | | { |
| | | fieldName: 'items', |
| | | label: '物料清单', |
| | | label: '产品清单', |
| | | component: 'Input', |
| | | formItemClass: 'col-span-3', |
| | | }, |
| | |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'quotationType', |
| | | title: '报价类型', |
| | | minWidth: 100, |
| | | cellRender: { |
| | | name: 'CellDict', |
| | | props: { type: DICT_TYPE.CRM_QUOTATION_TYPE }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'customerName', |
| | | title: '客户名称', |
| | | minWidth: 120, |
| | |
| | | ]; |
| | | } |
| | | |
| | | /** 物料明细表格列 */ |
| | | /** 产品明细表格列 */ |
| | | export function useItemColumns(): VxeTableGridOptions['columns'] { |
| | | return [ |
| | | { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, |
| | | { |
| | | field: 'itemId', |
| | | title: '物料名称', |
| | | title: '产品名称', |
| | | minWidth: 200, |
| | | slots: { default: 'itemId' }, |
| | | }, |
| | | { |
| | | field: 'itemSpecification', |
| | | title: '规格型号', |
| | | minWidth: 120, |
| | | }, |
| | | { |
| | | field: 'itemBarCode', |
| | | title: '条码', |
| | | minWidth: 120, |
| | | }, |
| | | { |