| | |
| | | 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(); |
| | |
| | | message: "所属客户不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', |
| | | type: 'table',dataType: 'string', |
| | | children:{ |
| | | border: true, |
| | | searchMenuSpan: 5, |
| | |
| | | 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: '调度单运输地', |
| | |
| | | }, |
| | | 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] |
| | | } |
| | | }, |
| | |
| | | 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); |
| | | |