From 89fd2cf7202c321512c2ea699a3a220a7138ed44 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期四, 09 四月 2026 10:40:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cwxt_master' into cwxt_master

---
 ui/admin-ui3/src/views/tms/tmsConsignor/index.vue |  276 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 170 insertions(+), 106 deletions(-)

diff --git a/ui/admin-ui3/src/views/tms/tmsConsignor/index.vue b/ui/admin-ui3/src/views/tms/tmsConsignor/index.vue
index 760f8d5..cec133c 100644
--- a/ui/admin-ui3/src/views/tms/tmsConsignor/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsConsignor/index.vue
@@ -60,12 +60,13 @@
   updateTmsConsignor
 } from "@/api/tms/tmsConsignor";
 import useCurrentInstance from "@/utils/useCurrentInstance";
-import {computed, reactive, ref, toRefs,watch,onMounted} from "vue";
+import {computed, reactive, ref, toRefs,watch,nextTick} from "vue";
 import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
 import {usePagePlus} from "@/hooks/usePagePlus";
 import {hasPermission} from "@/utils/permissionUtils";
 import {getTmsCustomerInfo, listTmsCustomerInfo} from "@/api/tms/tmsCustomerInfo";
-import {getArea, getCity, getProvince, getStreet} from "@/api/tms/tmsRegion";
+import {getArea, getCity, getProvince, getStreet,getAddressCode} from "@/api/tms/tmsRegion";
+import {mapRegeo} from "@/api/common";
 
 const {proxy} = useCurrentInstance();
 const crudRef = ref();
@@ -101,8 +102,8 @@
       prop: 'jcxx',
       column:{
         consignorCode: {
-          label: '鏀跺彂璐т汉缂栫爜',minWidth: 150,
-          addDisplay: true,
+          label: '瑁呭嵏璐х偣缂栫爜',minWidth: 150,
+          addDisplay: false, disabled: true,
           editDisplay: true,
           viewDisplay: true,
           hide: false,
@@ -110,12 +111,12 @@
           rules: [
             {
               required: true,
-              message: "鏀跺彂璐т汉缂栫爜涓嶈兘涓虹┖", trigger: "blur"
+              message: "瑁呭嵏璐х偣缂栫爜涓嶈兘涓虹┖", trigger: "blur"
             }
           ],
         },
         consignorName: {
-          label: '鏀跺彂璐т汉鍚嶇О',minWidth: 150,
+          label: '瑁呭嵏璐х偣鍚嶇О',minWidth: 150,
           addDisplay: true,
           editDisplay: true,
           viewDisplay: true,
@@ -124,7 +125,7 @@
           rules: [
             {
               required: true,
-              message: "鏀跺彂璐т汉鍚嶇О涓嶈兘涓虹┖", trigger: "blur"
+              message: "瑁呭嵏璐х偣鍚嶇О涓嶈兘涓虹┖", trigger: "blur"
             }
           ],
         },
@@ -147,7 +148,7 @@
               message: "鎵�灞炲鎴蜂笉鑳戒负绌�", trigger: "change"
             }
           ],
-          type: 'table',
+          type: 'table',dataType: 'string',
           children:{
             border: true,
             searchMenuSpan: 5,
@@ -168,7 +169,7 @@
               contactName: {
                 label: '鑱旂郴浜哄鍚�',minWidth: 120,
               },
-              signCompany: {
+              signCompanyName: {
                 label: '绛剧害鍏徃', minWidth: 150,
               },
             },
@@ -196,7 +197,21 @@
               })
             }
 
-          }
+          },
+          change: (val: any) => {
+            const table = crudRef.value?.getPropRef?.('customerId')?.$refs?.temp;
+            if (!table) return;
+            let active = table.active;
+            if (Array.isArray(active)) active = active[0];
+            if (active) {
+              Object.assign(form.value, {
+                customerId: active.id,
+                customerSysCode: active.customerCode,
+                customerName: active.customerShortName,
+              });
+            }
+          },
+
         },
         customerSysCode: {
           label: '瀹㈡埛缂栫爜',minWidth: 150,
@@ -214,7 +229,7 @@
           ],
         },
         consignorType: {
-          label: '鏀跺彂璐т汉绫诲瀷',minWidth: 150,
+          label: '瑁呭嵏璐х偣绫诲瀷',minWidth: 150,
           type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type',
           addDisplay: true,
           editDisplay: true,
@@ -224,7 +239,7 @@
           rules: [
             {
               required: true,
-              message: "鏀跺彂璐т汉绫诲瀷涓嶈兘涓虹┖", trigger: "change"
+              message: "瑁呭嵏璐х偣绫诲瀷涓嶈兘涓虹┖", trigger: "change"
             }
           ],
         },
@@ -270,70 +285,7 @@
       label: '鍦板潃淇℃伅',
       prop: 'dzxx',
       column:{
-        region: {
-          label: '琛屾斂鍖哄煙',minWidth: 150,type:'cascader',
-          addDisplay: true,
-          editDisplay: true,
-          viewDisplay: true,span: 24,
-          hide: true,
-          search: false,
-          lazy: true,
-          props: {
-            label: 'name',
-            value: 'code'
-          },
-          rules: [
-            {
-              required: true,
-              message: "鐪佷唤涓嶈兘涓虹┖", trigger: "blur"
-            }
-          ],
-          change:({value=[]}:{value:any})=>{
-            if (value && value.length>0){
-              form.value.provinceId = value[0];
-              form.value.cityId = value[1];
-              form.value.districtId = value[2];
-              form.value.streetId = value[3];
-            }
-          },
-          lazyLoad (node:any, resolve:any) {
-            const stopLevel = 3;
-            const level = node.level;
-            const data = node.data || {};
-            const code = data.code;
-            let list:any = [];
-            const callback = () => {
-              resolve((list || []).map((ele:any) => ({
-                ...ele,
-                leaf: level >= stopLevel
-              })));
-            };
 
-            if (level === 0) {
-              getProvince().then(res => {
-                list = res.data || [];
-                callback();
-              });
-            } else if (level === 1) {
-              getCity(code).then(res => {
-                list = res.data ||[];
-                callback();
-              });
-            } else if (level === 2) {
-              getArea(code).then(res => {
-                list = res.data ||  [];
-                callback();
-              });
-            }else if (level === 3) {
-              getStreet(code).then(res => {
-                list = res.data || [];
-                callback();
-              });
-            } else {
-              callback();
-            }
-          }
-        },
         mapLocationDetail: {
           label: '鍦板浘浣嶇疆',minWidth: 150,
           addDisplay: true,
@@ -342,6 +294,44 @@
           hide: true,
           search: false,
           type: 'map',
+          // mapChange: async (params:any)=>{
+          //   if (params.info === "OK") {
+          //     console.log( params)
+          //     let { province, city, district, township } = params.regeocode.addressComponent || {};
+          //
+          //     const res = await getAddressCode({province, city, district, township});
+          //     const {provinceCode, cityCode, districtCode, townshipCode} = res.data || {};
+          //
+          //     form.value.regionLabel = province + " / " + city + " / " + district + " / " + township;
+          //
+          //     form.value.region = [provinceCode, cityCode, districtCode, townshipCode];
+          //     form.value.provinceId = provinceCode;
+          //     form.value.cityId = cityCode;
+          //     form.value.districtId = districtCode;
+          //     form.value.streetId = townshipCode;
+          //
+          //     form.value.dispatchTransportArea = params.regeocode.formattedAddress;
+          //
+          //   }
+          // }
+          change: async ({value}:any)=>{
+            if (Array.isArray(value) && value.length === 3){
+              mapRegeo(value[1], value[0]).then(async res => {
+                let params = res.data || {};
+                if (params.info === "OK") {
+                  let {province, city, district, township} = params.regeocode.addressComponent || {};
+                  const res = await getAddressCode({province, city, district, township});
+                  const {provinceCode, cityCode, districtCode, townshipCode} = res.data || {};
+                  form.value.regionLabel = province + " / " + city + " / " + district + " / " + township;
+                  form.value.provinceId = provinceCode;
+                  form.value.cityId = cityCode;
+                  form.value.districtId = districtCode;
+                  form.value.streetId = townshipCode;
+                  form.value.dispatchTransportArea = params.regeocode.formatted_address || params.regeocode.formattedAddress;
+                }
+              });
+            }
+          },
         },
         dispatchTransportArea: {
           label: '璋冨害鍗曡繍杈撳湴',
@@ -357,6 +347,94 @@
             }
           ],
         },
+        electronicFenceRange: {
+          label: '鐢靛瓙鍥存爮鑼冨洿',
+          addDisplay: true,minWidth: 150,
+          editDisplay: true,
+          viewDisplay: true,append:'绫�',
+          hide: false,
+          search: true,
+          rules: [
+            {
+              required: true,
+              message: "鐢靛瓙鍥存爮鑼冨洿涓嶈兘涓虹┖", trigger: "blur"
+            }
+          ],
+        },
+        // region: {
+        //   label: '琛屾斂鍖哄煙',minWidth: 150,type:'cascader',
+        //   addDisplay: true,
+        //   editDisplay: true,checkStrictly:true,
+        //   viewDisplay: true,span: 24,checkOnClickNode:true,
+        //   hide: true,
+        //   search: false,
+        //   lazy: true,
+        //   props: {
+        //     label: 'name',
+        //     value: 'code'
+        //   },
+        //   rules: [
+        //     {
+        //       required: true,
+        //       message: "琛屾斂鍖哄煙涓嶈兘涓虹┖", trigger: "blur"
+        //     }
+        //   ],
+        //   change:({value=[]}:{value:any})=>{
+        //     if (value && value.length>0){
+        //       console.log( value)
+        //       form.value.provinceId = value[0];
+        //       form.value.cityId = value[1];
+        //       form.value.districtId = value[2];
+        //       form.value.streetId = value[3];
+        //       const cascader = crudRef.value?.getPropRef?.('region')?.$refs?.temp;
+        //       console.log('cascader.getCheckedNodes()',cascader)
+        //       nextTick(()=>{
+        //         crudRef.value.getPropRef('region').$refs.temp.$forceUpdate()
+        //       })
+        //       if (cascader.getCheckedNodes() && cascader.getCheckedNodes().length >0){
+        //         form.value.regionLabel= cascader.getCheckedNodes()[0].text!;
+        //       }
+        //     }
+        //   },
+        //   lazyLoad (node:any, resolve:any) {
+        //     const stopLevel = 3;
+        //     const level = node.level;
+        //     const data = node.data || {};
+        //     const code = data.code;
+        //     let list:any = [];
+        //     const callback = () => {
+        //
+        //       resolve((list || []).map((ele:any) => ({
+        //         ...ele,
+        //         leaf: level >= stopLevel
+        //       })));
+        //     };
+        //     console.log( level)
+        //     if (level === 0) {
+        //       getProvince().then(res => {
+        //         list = res.data || [];
+        //         callback();
+        //       });
+        //     } else if (level === 1) {
+        //       getCity(code).then(res => {
+        //         list = res.data ||[];
+        //         callback();
+        //       });
+        //     } else if (level === 2) {
+        //       getArea(code).then(res => {
+        //         list = res.data ||  [];
+        //         callback();
+        //       });
+        //     }else if (level === 3) {
+        //       getStreet(code).then(res => {
+        //         list = res.data || [];
+        //         callback();
+        //       });
+        //     } else {
+        //       callback();
+        //     }
+        //   }
+        // },
       }
     },
     {
@@ -437,13 +515,13 @@
   column: {
 
     consignorCode: {
-      label: '鏀跺彂璐т汉缂栫爜',minWidth: 150,
+      label: '瑁呭嵏璐х偣缂栫爜',minWidth: 150,
       display: false,
       hide: false,
       search: true,
     },
     consignorName: {
-      label: '鏀跺彂璐т汉鍚嶇О',minWidth: 150,
+      label: '瑁呭嵏璐х偣鍚嶇О',minWidth: 150,
       display: false,
       hide: false,
       search: true,
@@ -462,7 +540,7 @@
       disabled: true,
     },
     consignorType: {
-      label: '鏀跺彂璐т汉绫诲瀷',minWidth: 150,
+      label: '瑁呭嵏璐х偣绫诲瀷',minWidth: 150,
       type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type',
       display: false,
       hide: false,
@@ -537,22 +615,29 @@
   },
   rowSaveBegin:(row:any)=>{
     if (row.mapLocationDetail){
-      row.mapLocation = row.mapLocationDetail[1]+','+row.mapLocationDetail[0];
+      row.mapLocation = row.mapLocationDetail[0]+','+row.mapLocationDetail[1];
       row.addressDetail = row.mapLocationDetail[2]
     }
   },
   rowUpdateBegin:(row:any)=>{
     if (row.mapLocationDetail){
-      row.mapLocation = row.mapLocationDetail[1]+','+row.mapLocationDetail[0];
+      row.mapLocation = row.mapLocationDetail[0]+','+row.mapLocationDetail[1];
       row.addressDetail = row.mapLocationDetail[2]
     }
   },
-  handleEndOpenFunc:()=>{
-    form.value.region = [form.value.provinceId, form.value.cityId,
-      form.value.districtId, form.value.streetId];
-    if (form.value.mapLocation && form.value.addressDetail){
-      form.value.mapLocationDetail = [...form.value.mapLocation.split(','), form.value.addressDetail];
+  handleEndOpenFunc:  ()=>{
+    if (form.value.mapLocation && form.value.addressDetail) {
+      form.value.mapLocationDetail = [...form.value.mapLocation.split(',').map(item=> Number(item)), form.value.addressDetail];
+      crudRef.value.getPropRef('mapLocationDetail').$refs.temp.text = form.value.mapLocationDetail;
+
     }
+    // nextTick(()=>{
+    //   crudRef.value.getPropRef('region').$refs.temp.$forceUpdate()
+    // })
+    console.log( )
+     // crudRef.value.getPropRef('region').$refs.temp.setCheckedKeys(form.value.region);
+
+
   },
   handleBeforeOpenFunc:(type:string)=>{
     if (type=='add'){
@@ -560,27 +645,6 @@
     }
   }
 })
-onMounted(() => {
-  watch(() => form.value.customerId, () => {
-
-      if (!form.value.customerId){
-        return;
-      }
-      const table = crudRef.value?.getPropRef?.('customerId')?.$refs?.temp;
-      if (!table) return;
-
-      let active = table.active;
-      if (Array.isArray(active)) active = active[0];
-
-      if (active) {
-        Object.assign(form.value, {
-          customerId: active.id,
-          customerSysCode: active.customerCode,
-          customerName: active.customerShortName,
-        });
-      }
-  });
-});
 
 
 </script>

--
Gitblit v1.8.0