From 5f3dea3fd930afde720677fba10b6bfb2e836a18 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 24 七月 2026 09:54:17 +0800
Subject: [PATCH] Merge branch 'dev_pro2.0' of http://114.132.189.42:9002/r/mom-pro2-before into dev_pro2.0

---
 src/views/crm/contract/data.ts |  101 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 76 insertions(+), 25 deletions(-)

diff --git a/src/views/crm/contract/data.ts b/src/views/crm/contract/data.ts
index e9ac060..5ea024f 100644
--- a/src/views/crm/contract/data.ts
+++ b/src/views/crm/contract/data.ts
@@ -1,14 +1,16 @@
 import type { VbenFormSchema } from '#/adapter/form';
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 
-import { useUserStore } from '../../../packages/stores/src';
-import { erpPriceInputFormatter, erpPriceMultiply } from '../../../packages/utils/src';
+import { useUserStore } from '@vben/stores';
+import { erpPriceInputFormatter, erpPriceMultiply } from '@vben/utils';
 
 import { z } from '#/adapter/form';
 import { getSimpleBusinessList } from '#/api/crm/business';
 import { getSimpleContactList } from '#/api/crm/contact';
-import { getCustomerSimpleList } from '#/api/crm/customer';
 import { getSimpleUserList } from '#/api/system/user';
+import CrmCustomerSelect from '#/components/crm-customer-select.vue';
+
+import { markRaw } from 'vue';
 
 /** 鏂板/淇敼鐨勮〃鍗� */
 export function useFormSchema(): VbenFormSchema[] {
@@ -59,13 +61,26 @@
     {
       fieldName: 'customerId',
       label: '瀹㈡埛鍚嶇О',
-      component: 'ApiSelect',
+      component: markRaw(CrmCustomerSelect),
       rules: 'required',
       componentProps: {
-        api: getCustomerSimpleList,
-        labelField: 'name',
-        valueField: 'id',
         placeholder: '璇烽�夋嫨瀹㈡埛',
+      },
+      dependencies: {
+        triggerFields: ['customerId'],
+        disabled: (values) => !!values.customerId,
+      },
+    },
+    {
+      fieldName: 'orderDate',
+      label: '涓嬪崟鏃ユ湡',
+      component: 'DatePicker',
+      rules: 'required',
+      componentProps: {
+        showTime: false,
+        format: 'YYYY-MM-DD',
+        valueFormat: 'x',
+        placeholder: '璇烽�夋嫨涓嬪崟鏃ユ湡',
       },
     },
     {
@@ -77,9 +92,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: [],
@@ -98,18 +119,6 @@
             placeholder: '璇烽�夋嫨鍟嗘満',
           };
         },
-      },
-    },
-    {
-      fieldName: 'orderDate',
-      label: '涓嬪崟鏃ユ湡',
-      component: 'DatePicker',
-      rules: 'required',
-      componentProps: {
-        showTime: false,
-        format: 'YYYY-MM-DD',
-        valueFormat: 'x',
-        placeholder: '璇烽�夋嫨涓嬪崟鏃ユ湡',
       },
     },
     {
@@ -133,6 +142,18 @@
         valueFormat: 'x',
         placeholder: '璇烽�夋嫨鍚堝悓缁撴潫鏃堕棿',
       },
+    },
+    {
+      fieldName: 'depositPrice',
+      label: '瀹氶噾閲戦锛堝厓锛�',
+      component: 'InputNumber',
+      componentProps: {
+        class: '!w-full',
+        min: 0,
+        precision: 2,
+        placeholder: '璇疯緭鍏ュ畾閲戦噾棰�',
+      },
+      rules: z.number().min(0).optional(),
     },
     {
       fieldName: 'signUserId',
@@ -268,12 +289,35 @@
     {
       fieldName: 'customerId',
       label: '瀹㈡埛',
-      component: 'ApiSelect',
+      component: markRaw(CrmCustomerSelect),
       componentProps: {
-        api: getCustomerSimpleList,
-        labelField: 'name',
-        valueField: 'id',
         placeholder: '璇烽�夋嫨瀹㈡埛',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'auditStatus',
+      label: '鍚堝悓鐘舵��',
+      component: 'Select',
+      componentProps: {
+        options: [
+          { label: '鏈彁浜�', value: 0 },
+          { label: '瀹℃壒涓�', value: 10 },
+          { label: '瀹℃牳閫氳繃', value: 20 },
+          { label: '瀹℃牳涓嶉�氳繃', value: 30 },
+          { label: '宸插彇娑�', value: 40 },
+          { label: '宸蹭綔搴�', value: 50 },
+        ],
+        placeholder: '璇烽�夋嫨鍚堝悓鐘舵��',
+        allowClear: true,
+      },
+    },
+    {
+      fieldName: 'orderNo',
+      label: '鍏宠仈璁㈠崟',
+      component: 'Input',
+      componentProps: {
+        placeholder: '璇疯緭鍏ヨ鍗曞彿',
         allowClear: true,
       },
     },
@@ -287,6 +331,7 @@
       field: 'no',
       minWidth: 180,
       fixed: 'left',
+      slots: { default: 'no' },
     },
     {
       title: '鍚堝悓鍚嶇О',
@@ -314,6 +359,12 @@
       formatter: 'formatAmount2',
     },
     {
+      title: '瀹氶噾閲戦锛堝厓锛�',
+      field: 'depositPrice',
+      minWidth: 140,
+      formatter: 'formatAmount2',
+    },
+    {
       title: '涓嬪崟鏃堕棿',
       field: 'orderDate',
       minWidth: 120,

--
Gitblit v1.9.3