From 794057ab9c4e347eed13cdb85f9e3fb5f4956e91 Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期二, 18 十一月 2025 15:25:36 +0800
Subject: [PATCH] 提交

---
 ui/admin-ui3/src/views/tms/tmsProject/index.vue |  189 ++++++++++++++++++++++-------------------------
 1 files changed, 88 insertions(+), 101 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..6db1da5 100644
--- a/ui/admin-ui3/src/views/tms/tmsProject/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsProject/index.vue
@@ -118,9 +118,83 @@
             }
           ],
         },
+        relatedCustomerId: {
+          label: '鍏宠仈瀹㈡埛',
+          display: true,minWidth: 150,
+          type: 'table',suffixIcon:'search',dataType:'string',
+          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,
+              },
+              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 +251,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 +259,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,
+              });
             }
-
-          }
-
+          },
         },
+
 
       }
     },
@@ -382,42 +407,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