From 4feb321e6fa88e86991da3610b2bdfcf5a2d87a7 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 14 一月 2026 16:50:44 +0800
Subject: [PATCH] 新增字段

---
 ui/admin-ui3/src/views/tms/tmsProject/index.vue |  190 +++++++++++++++++++++--------------------------
 1 files changed, 86 insertions(+), 104 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsProject/index.vue b/ui/admin-ui3/src/views/tms/tmsProject/index.vue
index e1e7b64..e582100 100644
--- a/ui/admin-ui3/src/views/tms/tmsProject/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsProject/index.vue
@@ -111,16 +111,85 @@
         projectCode: {
           label: '椤圭洰缂栧彿',
           display: true,
+
+        },
+        relatedCustomerId: {
+          label: '鍏宠仈瀹㈡埛',
+          display: true,minWidth: 150,
+          type: 'table',suffixIcon:'search',dataType:'string',
           rules: [
             {
               required: true,
-              message: "椤圭洰缂栧彿涓嶈兘涓虹┖", trigger: "blur"
+              message: "鍏宠仈瀹㈡埛涓嶈兘涓虹┖", trigger: "change"
             }
           ],
+          children:{
+            border: true,
+            searchMenuSpan: 5,
+            column:{
+              customerType: {
+                label: '瀹㈡埛绫诲瀷', minWidth: 120,
+                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type',
+                search: true,
+              },
+              customerShortName: {
+                label: '瀹㈡埛绠�绉�', minWidth: 130,
+                search: true,
+              },
+              customerCode: {
+                label: '瀹㈡埛缂栧彿',minWidth: 120,
+                search: true,
+              },
+              contactName: {
+                label: '鑱旂郴浜哄鍚�',minWidth: 120,
+              },
+              signCompanyName: {
+                label: '绛剧害鍏徃', minWidth: 150,
+              },
+            },
+
+          },
+          props:{
+            label: 'customerShortName',
+            value: 'id'
+          },
+          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
+            if (value){
+              let id = value;
+              if (Array.isArray(value)){
+                id = value[0]
+              }
+              getTmsCustomerInfo(id).then(res=>{
+                return callback(res.data||{})
+              })
+            }else{
+              listTmsCustomerInfo({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
+                return callback({
+                  total: res.total,
+                  data: res.rows||[],
+                })
+              })
+            }
+
+          },
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('relatedCustomerId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                relatedCustomerId: active.id,
+                relatedCustomerName: active.customerShortName,
+              });
+              form.value.relatedContractId = undefined;
+              form.value.relatedContractName = undefined;
+            }
+          },
         },
         relatedContractId: {
           label: '鍏宠仈鍚堝悓',
-          display: true,minWidth: 150,
+          display: true,minWidth: 150,dataType:'string',
           type: 'table',suffixIcon:'search',
           rules: [
             {
@@ -177,7 +246,7 @@
                 return callback(res.data||{})
               })
             }else{
-              listTmsContract({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
+              listTmsContract({partyAId:form.value.relatedCustomerId,pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
                 return callback({
                   total: res.total,
                   data: res.rows||[],
@@ -185,70 +254,21 @@
               })
             }
 
-          }
-
-        },
-        relatedCustomerId: {
-          label: '鍏宠仈瀹㈡埛',
-          display: true,minWidth: 150,
-          type: 'table',suffixIcon:'search',
-          rules: [
-            {
-              required: true,
-              message: "鍏宠仈瀹㈡埛涓嶈兘涓虹┖", trigger: "change"
-            }
-          ],
-          children:{
-            border: true,
-            searchMenuSpan: 5,
-            column:{
-              customerType: {
-                label: '瀹㈡埛绫诲瀷', minWidth: 120,
-                type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type',
-                search: true,
-              },
-              customerShortName: {
-                label: '瀹㈡埛绠�绉�', minWidth: 130,
-                search: true,
-              },
-              customerCode: {
-                label: '瀹㈡埛缂栧彿',minWidth: 120,
-                search: true,
-              },
-              contactName: {
-                label: '鑱旂郴浜哄鍚�',minWidth: 120,
-              },
-              signCompany: {
-                label: '绛剧害鍏徃', minWidth: 150,
-              },
-            },
-
           },
-          props:{
-            label: 'customerShortName',
-            value: 'id'
-          },
-          onLoad: ({ page, value, data }: { page: any, value: any, data: any }, callback:any) => {
-            if (value){
-              let id = value;
-              if (Array.isArray(value)){
-                id = value[0]
-              }
-              getTmsCustomerInfo(id).then(res=>{
-                return callback(res.data||{})
-              })
-            }else{
-              listTmsCustomerInfo({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{
-                return callback({
-                  total: res.total,
-                  data: res.rows||[],
-                })
-              })
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('relatedContractId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                relatedContractId: active.id,
+                relatedContractName: active.contractName,
+              });
             }
-
-          }
-
+          },
         },
+
 
       }
     },
@@ -258,7 +278,7 @@
       column:{
         status: {
           label: '鐘舵��',dataType: 'string',
-          type: 'radio', dicUrl: '/system/dict/data/type/data_status',
+          type: 'radio', dicUrl: '/system/dict/data/type/project_status',
           addDisplay: false,minWidth: 150,
           editDisplay: false,
           viewDisplay: true,
@@ -328,7 +348,7 @@
     },
     status: {
       label: '鐘舵��',dataType: 'string',
-      type: 'radio', dicUrl: '/system/dict/data/type/data_status',
+      type: 'radio', dicUrl: '/system/dict/data/type/project_status',
       display: false,minWidth: 150,
       search: true,
     },
@@ -382,42 +402,4 @@
   }
 })
 
-onMounted(() => {
-  watch(() => form.value.relatedContractId, () => {
-
-    if (!form.value.relatedContractId){
-      return;
-    }
-    const table = crudRef.value?.getPropRef?.('relatedContractId')?.$refs?.temp;
-    if (!table) return;
-
-    let active = table.active;
-    if (Array.isArray(active)) active = active[0];
-
-    if (active) {
-      Object.assign(form.value, {
-        relatedContractId: active.id,
-        relatedContractName: active.contractName,
-      });
-    }
-  });
-  watch(() => form.value.relatedCustomerId, () => {
-
-    if (!form.value.relatedCustomerId){
-      return;
-    }
-    const table = crudRef.value?.getPropRef?.('relatedCustomerId')?.$refs?.temp;
-    if (!table) return;
-
-    let active = table.active;
-    if (Array.isArray(active)) active = active[0];
-
-    if (active) {
-      Object.assign(form.value, {
-        relatedCustomerId: active.id,
-        relatedCustomerName: active.customerShortName,
-      });
-    }
-  });
-});
 </script>

--
Gitblit v1.8.0