From 27c8277d717b34b55f3ea967027b53b067f77df3 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 20 八月 2026 16:58:49 +0800
Subject: [PATCH] feat 功能变更

---
 src/views/crm/saleQuotation/data.ts |  117 +++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 98 insertions(+), 19 deletions(-)

diff --git a/src/views/crm/saleQuotation/data.ts b/src/views/crm/saleQuotation/data.ts
index ca86211..109c6e4 100644
--- a/src/views/crm/saleQuotation/data.ts
+++ b/src/views/crm/saleQuotation/data.ts
@@ -1,15 +1,20 @@
 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';
 import { getSimpleBusinessList } from '#/api/crm/business';
 import { getSimpleContactList } from '#/api/crm/contact';
-import { getCustomerSimpleList } from '#/api/crm/customer';
 import { getItemPage } from '#/api/mdm/item';
 import { getSimpleUserList } from '#/api/system/user';
 import { useUserStore } from '#/packages/stores/src';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
 
 /** 鎶ヤ环鍗曠姸鎬� */
 export const QUOTATION_STATUS = {
@@ -62,12 +67,9 @@
     {
       fieldName: 'customerId',
       label: '瀹㈡埛鍚嶇О',
-      component: 'ApiSelect',
+      component: markRaw(CrmCustomerSelect),
       rules: 'required',
       componentProps: {
-        api: getCustomerSimpleList,
-        labelField: 'name',
-        valueField: 'id',
         placeholder: '璇烽�夋嫨瀹㈡埛',
       },
     },
@@ -125,10 +127,11 @@
       fieldName: 'quotationTime',
       label: '鎶ヤ环鏃ユ湡',
       component: 'DatePicker',
+      rules: 'required',
       componentProps: {
         showTime: false,
         format: 'YYYY-MM-DD',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨鎶ヤ环鏃ユ湡',
       },
     },
@@ -139,7 +142,7 @@
       componentProps: {
         showTime: false,
         format: 'YYYY-MM-DD',
-        valueFormat: 'x',
+        valueFormat: 'YYYY-MM-DD',
         placeholder: '璇烽�夋嫨鏈夋晥鏈�',
       },
     },
@@ -156,6 +159,81 @@
       },
     },
     {
+      fieldName: 'quotationType',
+      label: '鎶ヤ环绫诲瀷',
+      component: 'Select',
+      componentProps: {
+        options: getDictOptions(DICT_TYPE.CRM_QUOTATION_TYPE),
+        placeholder: '璇烽�夋嫨鎶ヤ环绫诲瀷',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'capacity',
+      label: '鍚堝悓瀹归噺锛坘VA锛�',
+      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',
@@ -166,7 +244,7 @@
     },
     {
       fieldName: 'items',
-      label: '鐗╂枡娓呭崟',
+      label: '浜у搧娓呭崟',
       component: 'Input',
       formItemClass: 'col-span-3',
     },
@@ -240,11 +318,8 @@
     {
       fieldName: 'customerId',
       label: '瀹㈡埛',
-      component: 'ApiSelect',
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
-        api: getCustomerSimpleList,
-        labelField: 'name',
-        valueField: 'id',
         placeholder: '璇烽�夋嫨瀹㈡埛',
         allowClear: true,
       },
@@ -284,6 +359,15 @@
       title: '鎶ヤ环鍗曞悕绉�',
       minWidth: 160,
       fixed: 'left',
+    },
+    {
+      field: 'quotationType',
+      title: '鎶ヤ环绫诲瀷',
+      minWidth: 100,
+      cellRender: {
+        name: 'CellDict',
+        props: { type: DICT_TYPE.CRM_QUOTATION_TYPE },
+      },
     },
     {
       field: 'customerName',
@@ -344,24 +428,19 @@
   ];
 }
 
-/** 鐗╂枡鏄庣粏琛ㄦ牸鍒� */
+/** 浜у搧鏄庣粏琛ㄦ牸鍒� */
 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,
     },
     {

--
Gitblit v1.9.3