|
|
|
@ -633,7 +633,7 @@
@@ -633,7 +633,7 @@
|
|
|
|
|
mapState.mapData.courierUserName = courierUserMap.label; |
|
|
|
|
mapState.mapData.courierLng = courierUserMap.mapLng; |
|
|
|
|
mapState.mapData.courierLat = courierUserMap.mapLat; |
|
|
|
|
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint)); |
|
|
|
|
handleMapPointGenerate(); |
|
|
|
|
} else notification.warn({ |
|
|
|
|
message: '查找不到起点数据,请检查起点!', |
|
|
|
|
duration: 2 |
|
|
|
@ -744,9 +744,9 @@
@@ -744,9 +744,9 @@
|
|
|
|
|
|
|
|
|
|
/** 绘制地图导航路线 */ |
|
|
|
|
function drawMapNavigate(points: MapLogisticPoint[] = []) { |
|
|
|
|
debugger |
|
|
|
|
if (isEmpty(points) && mapState.mapData.courierUserId && mapState.mapData.courierLng && mapState.mapData.courierLat) |
|
|
|
|
throw console.warn('检查到当前起点数据为空或标记点集合为空,请选择起点!'); |
|
|
|
|
points = points.filter(item => item.lng && item.lat); |
|
|
|
|
if (points.length > 0 && mapState.mapData.courierLng && mapState.mapData.courierLat) { |
|
|
|
|
const lngLats = points.map(item => new AMap.LngLat(item.lng, item.lat)); |
|
|
|
|
const destination = lngLats.pop(); |
|
|
|
|
destination && driving.search(new AMap.LngLat(mapState.mapData.courierLng, mapState.mapData.courierLat), destination, { |
|
|
|
@ -758,11 +758,11 @@
@@ -758,11 +758,11 @@
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理地图标记点生成 */ |
|
|
|
|
async function handleMapPointGenerate() { |
|
|
|
|
setTableData(mapState.mapData.mapTask); |
|
|
|
|
if (mapState.mapData.courierUserId) { |
|
|
|
|
const pointData:MapLogisticPoint[] = []; |
|
|
|
|
mapState.mapData.mapTask.forEach(item => { |
|
|
|
|
const hospital = mapState.hospitalList.find(e => e.value == item.hospitalId), |
|
|
|
@ -796,11 +796,12 @@
@@ -796,11 +796,12 @@
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
// 查找并添加与自己有关的交接预设任务,只能添加设置了位置的标记点 |
|
|
|
|
mapState.mapData.mapTaskPresetLogisticPoint = await getTaskPresetPointByCourierUserId(mapState.mapData.courierUserId); |
|
|
|
|
pointData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
|
mapState.mapData.mapLogisticPoint = pointData; |
|
|
|
|
mapState.mapData.courierUserId && (mapState.mapData.mapTaskPresetLogisticPoint = await getTaskPresetPointByCourierUserId(mapState.mapData.courierUserId)); |
|
|
|
|
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理地图标记点数据 */ |
|
|
|
|
function handleMapPoint(mapLogisticPoint: MapLogisticPoint[] = []) { |
|
|
|
|