wujianwei
2026-01-12 5dc6be84f02788d98a67a7488e7fb2c8d4b08c04
ui/admin-ui3/src/views/tms/tmsConsignor/index.vue
@@ -66,6 +66,7 @@
import {hasPermission} from "@/utils/permissionUtils";
import {getTmsCustomerInfo, listTmsCustomerInfo} from "@/api/tms/tmsCustomerInfo";
import {getArea, getCity, getProvince, getStreet,getAddressCode} from "@/api/tms/tmsRegion";
import {mapRegeo} from "@/api/common";
const {proxy} = useCurrentInstance();
const crudRef = ref();
@@ -147,7 +148,7 @@
              message: "所属客户不能为空", trigger: "change"
            }
          ],
          type: 'table',
          type: 'table',dataType: 'string',
          children:{
            border: true,
            searchMenuSpan: 5,
@@ -293,27 +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;
          // 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: '调度单运输地',
@@ -597,13 +615,13 @@
  },
  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]
    }
  },
@@ -613,9 +631,9 @@
      crudRef.value.getPropRef('mapLocationDetail').$refs.temp.text = form.value.mapLocationDetail;
    }
    nextTick(()=>{
      crudRef.value.getPropRef('region').$refs.temp.$forceUpdate()
    })
    // nextTick(()=>{
    //   crudRef.value.getPropRef('region').$refs.temp.$forceUpdate()
    // })
    console.log( )
     // crudRef.value.getPropRef('region').$refs.temp.setCheckedKeys(form.value.region);