From 06e621b20868b97ca7a7f9c63df2f160a827bf6a Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期四, 20 十一月 2025 20:36:10 +0800
Subject: [PATCH] 提交

---
 ui/admin-ui3/src/views/tms/tmsContract/index.vue |  177 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 127 insertions(+), 50 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsContract/index.vue b/ui/admin-ui3/src/views/tms/tmsContract/index.vue
index 9573a4d..70cd12e 100644
--- a/ui/admin-ui3/src/views/tms/tmsContract/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsContract/index.vue
@@ -65,7 +65,9 @@
 import {usePagePlus} from "@/hooks/usePagePlus";
 import {hasPermission} from "@/utils/permissionUtils";
 import {getTmsCustomerInfo, listTmsCustomerInfo} from "@/api/tms/tmsCustomerInfo";
-
+import dayjs from 'dayjs';
+import {formatDate} from "@/utils/ruoyi";
+import {getTmsSettlementEntity, listTmsSettlementEntity} from "@/api/tms/tmsSettlementEntity";
 const {proxy} = useCurrentInstance();
 const crudRef = ref();
 
@@ -176,9 +178,15 @@
           format: 'YYYY-MM-DD HH:mm:ss',
           valueFormat: 'YYYY-MM-DD HH:mm:ss',
           change: ({value}:{value:any}) => {
-            if (Array.isArray(value)){
+            if (Array.isArray(value) && value.length >1){
               form.value.contractStartDate = value[0]
               form.value.contractEndDate = value[1]
+            }
+            if (!(Array.isArray(value) && value.length >1)&& form.value.contractStartDate && form.value.contractEndDate){
+              form.value.contractDate = [
+                formatDate(form.value.contractStartDate),
+                formatDate(form.value.contractEndDate)
+              ];
             }
           }
         },
@@ -255,7 +263,7 @@
               contactName: {
                 label: '鑱旂郴浜哄鍚�',minWidth: 120,
               },
-              signCompany: {
+              signCompanyName: {
                 label: '绛剧害鍏徃', minWidth: 150,
               },
             },
@@ -283,7 +291,21 @@
               })
             }
 
-          }
+          },
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('partyAId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                partyAId: active.id,
+                partyAName: active.customerShortName,
+                partyAContact: active.contactName,
+                partyAContactInfo: active.contactPhone,
+              });
+            }
+          },
         },
         partyAContact: {
           label: '鐢叉柟鑱旂郴浜�',
@@ -303,7 +325,7 @@
       label: '涔欐柟淇℃伅',
       prop: 'yfxx',
       column: {
-        partyBName: {
+        partyBId: {
           label: '涔欐柟鍚嶇О',
           addDisplay: true,
           editDisplay: true,
@@ -311,10 +333,83 @@
           rules: [
             {
               required: true,
-              message: "涔欐柟鍚嶇О涓嶈兘涓虹┖", trigger: "blur"
+              message: "涔欐柟鍚嶇О涓嶈兘涓虹┖", trigger: "change"
             }
           ],
+          type: 'table',suffixIcon:'search',
+          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,
+              },
+            },
+
+          },
+          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]
+              }
+              getTmsSettlementEntity(id).then(res=>{
+                return callback(res.data||{})
+              })
+            }else{
+              listTmsSettlementEntity({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?.('partyBId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                partyBId: active.id,
+                partyBName: active.customerShortName,
+                partyBContact: active.contactName,
+                partyBContactInfo: active.contactPhone,
+              });
+            }
+          },
         },
+        // partyBName: {
+        //   label: '涔欐柟鍚嶇О',
+        //   addDisplay: true,
+        //   editDisplay: true,
+        //   viewDisplay: true,
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "涔欐柟鍚嶇О涓嶈兘涓虹┖", trigger: "blur"
+        //     }
+        //   ],
+        // },
         partyBContact: {
           label: '涔欐柟鑱旂郴浜�',
           addDisplay: true,
@@ -382,12 +477,12 @@
           addDisplay: true,
           editDisplay: true,
           viewDisplay: true,
-          rules: [
-            {
-              required: true,
-              message: "鍙戠エ鐘舵�佷笉鑳戒负绌�", trigger: "change"
-            }
-          ],
+          // rules: [
+          //   {
+          //     required: true,
+          //     message: "鍙戠エ鐘舵�佷笉鑳戒负绌�", trigger: "change"
+          //   }
+          // ],
         },
       }
     },
@@ -427,24 +522,31 @@
       label: '闄勪欢淇℃伅',
       prop: 'fjxx',
       column: {
-        attachmentName: {
-          label: '闄勪欢鍚嶇О',
-          addDisplay: false,
-          editDisplay: false,
-          viewDisplay: true,
-        },
+        // attachmentName: {
+        //   label: '闄勪欢鍚嶇О',
+        //   addDisplay: false,
+        //   editDisplay: false,
+        //   viewDisplay: true,
+        // },
         attachmentPath: {
           label: '闄勪欢璺緞',
           addDisplay: true,
           editDisplay: true,
-          viewDisplay: true,
+          viewDisplay: true,span: 24,
+          accept:'string',dataType: 'string',
+          type: 'upload',
+          action: '/common/upload2',
+          propsHttp:{
+            home:'url',
+            name:'newFileName',
+          },
         },
-        uploadedBy: {
-          label: '涓婁紶浜�',
-          addDisplay: false,
-          editDisplay: false,
-          viewDisplay: true,
-        },
+        // uploadedBy: {
+        //   label: '涓婁紶浜�',
+        //   addDisplay: false,
+        //   editDisplay: false,
+        //   viewDisplay: true,
+        // },
       }
     },
     {
@@ -677,33 +779,8 @@
   handleSelectionChangeFunc: (selection: any) => {
     selectionList.value = selection;
   },
-  handleEndOpenFunc:()=>{
-    if (form.value.contractStartDate && form.value.contractEndDate){
-      form.value.contractDate = [form.value.contractStartDate, form.value.contractEndDate]
-    }
-  }
 })
 
-onMounted(() => {
-  watch(() => form.value.partyAId, () => {
-
-    if (!form.value.partyAId){
-      return;
-    }
-    const table = crudRef.value?.getPropRef?.('partyAId')?.$refs?.temp;
-    if (!table) return;
-
-    let active = table.active;
-    if (Array.isArray(active)) active = active[0];
-
-    if (active) {
-      Object.assign(form.value, {
-        partyAId: active.id,
-        partyAName: active.customerShortName,
-      });
-    }
-  });
-});
 
 
 </script>

--
Gitblit v1.8.0