wujianwei
2025-12-23 fa5e8e2df6c3208a3b90549b88037f5ad14bbb0b
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();
@@ -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,
@@ -228,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,
@@ -238,7 +239,7 @@
          rules: [
            {
              required: true,
              message: "收发货人类型不能为空", trigger: "change"
              message: "装卸货点类型不能为空", trigger: "change"
            }
          ],
        },
@@ -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: '调度单运输地',
@@ -497,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,
@@ -522,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,
@@ -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);