From a4025834e2304dc57f6e98d58feeb9416bd90609 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 14:10:49 +0800
Subject: [PATCH] feat 功能变更
---
src/views/crm/contract/data.ts | 134 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 129 insertions(+), 5 deletions(-)
diff --git a/src/views/crm/contract/data.ts b/src/views/crm/contract/data.ts
index de4629d..87bfcf2 100644
--- a/src/views/crm/contract/data.ts
+++ b/src/views/crm/contract/data.ts
@@ -1,6 +1,8 @@
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 { useUserStore } from '@vben/stores';
import { erpPriceInputFormatter, erpPriceMultiply } from '@vben/utils';
@@ -66,6 +68,10 @@
componentProps: {
placeholder: '璇烽�夋嫨瀹㈡埛',
},
+ dependencies: {
+ triggerFields: ['customerId'],
+ disabled: (values) => !!values.customerId,
+ },
},
{
fieldName: 'orderDate',
@@ -75,7 +81,7 @@
componentProps: {
showTime: false,
format: 'YYYY-MM-DD',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD',
placeholder: '璇烽�夋嫨涓嬪崟鏃ユ湡',
},
},
@@ -88,9 +94,15 @@
placeholder: '璇烽�夋嫨鍟嗘満',
},
dependencies: {
- triggerFields: ['customerId'],
- disabled: (values) => !values.customerId,
+ triggerFields: ['customerId', 'businessId'],
+ disabled: (values) => !!values.businessId || !values.customerId,
async componentProps(values) {
+ if (values.businessId && values.businessName) {
+ return {
+ options: [{ label: values.businessName, value: values.businessId }],
+ placeholder: '璇烽�夋嫨鍟嗘満',
+ };
+ }
if (!values.customerId) {
return {
options: [],
@@ -118,7 +130,7 @@
componentProps: {
showTime: false,
format: 'YYYY-MM-DD',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD',
placeholder: '璇烽�夋嫨鍚堝悓寮�濮嬫椂闂�',
},
},
@@ -129,7 +141,7 @@
componentProps: {
showTime: false,
format: 'YYYY-MM-DD',
- valueFormat: 'x',
+ valueFormat: 'YYYY-MM-DD',
placeholder: '璇烽�夋嫨鍚堝悓缁撴潫鏃堕棿',
},
},
@@ -186,6 +198,78 @@
placeholder: '璇烽�夋嫨瀹㈡埛绛剧害浜�',
};
},
+ },
+ },
+ {
+ fieldName: 'contractType',
+ label: '鍚堝悓绫诲瀷',
+ component: 'Select',
+ componentProps: {
+ options: getDictOptions(DICT_TYPE.CRM_CONTRACT_TYPE),
+ placeholder: '璇烽�夋嫨鍚堝悓绫诲瀷',
+ allowClear: true,
+ },
+ },
+ {
+ fieldName: 'voltageLevel',
+ label: '鐢靛帇绛夌骇',
+ component: 'Select',
+ componentProps: {
+ options: getDictOptions(DICT_TYPE.CRM_VOLTAGE_LEVEL),
+ placeholder: '璇烽�夋嫨鐢靛帇绛夌骇',
+ allowClear: true,
+ },
+ },
+ {
+ fieldName: 'electricityType',
+ label: '鐢ㄧ數绫诲瀷',
+ component: 'Select',
+ componentProps: {
+ options: getDictOptions(DICT_TYPE.CRM_ELECTRICITY_TYPE),
+ placeholder: '璇烽�夋嫨鐢ㄧ數绫诲瀷',
+ allowClear: true,
+ },
+ },
+ {
+ fieldName: 'contractCapacity',
+ label: '鍚堝悓瀹归噺锛坘VA锛�',
+ component: 'InputNumber',
+ componentProps: {
+ class: '!w-full',
+ min: 0,
+ precision: 2,
+ placeholder: '璇疯緭鍏ュ悎鍚屽閲�',
+ },
+ },
+ {
+ fieldName: 'tariffMode',
+ label: '鐢典环妯″紡',
+ component: 'Select',
+ componentProps: {
+ options: getDictOptions(DICT_TYPE.CRM_TARIFF_MODE),
+ placeholder: '璇烽�夋嫨鐢典环妯″紡',
+ allowClear: true,
+ },
+ },
+ {
+ fieldName: 'meterMode',
+ label: '璁¢噺鏂瑰紡',
+ component: 'Select',
+ componentProps: {
+ options: getDictOptions(DICT_TYPE.CRM_METER_MODE),
+ placeholder: '璇烽�夋嫨璁¢噺鏂瑰紡',
+ allowClear: true,
+ },
+ },
+ {
+ fieldName: 'payCycle',
+ label: '缂磋垂鍛ㄦ湡锛堟湀锛�',
+ component: 'InputNumber',
+ componentProps: {
+ class: '!w-full',
+ min: 1,
+ precision: 0,
+ placeholder: '璇疯緭鍏ョ即璐瑰懆鏈�',
},
},
{
@@ -343,6 +427,34 @@
slots: { default: 'businessName' },
},
{
+ title: '鍚堝悓绫诲瀷',
+ field: 'contractType',
+ minWidth: 110,
+ cellRender: {
+ name: 'CellDict',
+ props: { type: DICT_TYPE.CRM_CONTRACT_TYPE },
+ },
+ },
+ {
+ title: '鐢靛帇绛夌骇',
+ field: 'voltageLevel',
+ minWidth: 90,
+ cellRender: {
+ name: 'CellDict',
+ props: { type: DICT_TYPE.CRM_VOLTAGE_LEVEL },
+ },
+ },
+ {
+ title: '鍚堝悓瀹归噺',
+ field: 'contractCapacity',
+ minWidth: 100,
+ },
+ {
+ title: '鎸囦护鏁�',
+ field: 'commandCount',
+ minWidth: 80,
+ },
+ {
title: '鍚堝悓閲戦锛堝厓锛�',
field: 'totalPrice',
minWidth: 140,
@@ -405,6 +517,18 @@
},
},
{
+ title: '宸插紑绁ㄩ噾棰濓紙鍏冿級',
+ field: 'totalInvoicePrice',
+ minWidth: 150,
+ formatter: 'formatAmount2',
+ },
+ {
+ title: '鏈紑绁ㄩ噾棰濓紙鍏冿級',
+ field: 'unInvoicePrice',
+ minWidth: 140,
+ formatter: 'formatAmount2',
+ },
+ {
title: '鏈�鍚庤窡杩涙椂闂�',
field: 'contactLastTime',
minWidth: 180,
--
Gitblit v1.9.3