|
|
@ -106,12 +106,12 @@ |
|
|
|
import { getCourierUserList, listUser } from '/@/api/platform/system/controller/user'; |
|
|
|
import { getCourierUserList, listUser } from '/@/api/platform/system/controller/user'; |
|
|
|
import { listOrg } from '/@/api/platform/common/controller/org'; |
|
|
|
import { listOrg } from '/@/api/platform/common/controller/org'; |
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
import { split, divide, subtract, merge, isEmpty, cloneDeep, add } from 'lodash-es'; |
|
|
|
import { split, divide, subtract, merge, isEmpty, cloneDeep, add, concat } from 'lodash-es'; |
|
|
|
import componentSetting from '/@/settings/componentSetting'; |
|
|
|
import componentSetting from '/@/settings/componentSetting'; |
|
|
|
import { BasicUpload } from '/@/components/Upload'; |
|
|
|
import { BasicUpload } from '/@/components/Upload'; |
|
|
|
import { commonUpload } from '/@/api/platform/core/controller/upload'; |
|
|
|
import { commonUpload } from '/@/api/platform/core/controller/upload'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { listMapTaskPreset } from '/@/api/platform/common/controller/mapTaskPreset'; |
|
|
|
import { getTaskPresetPointByCourierUserId } from '/@/api/platform/common/controller/mapLogisticPoint'; |
|
|
|
import { defaultMapData } from '/@/enums/amapEnum'; |
|
|
|
import { defaultMapData } from '/@/enums/amapEnum'; |
|
|
|
import Toolbar from '../components/Toolbar.vue'; |
|
|
|
import Toolbar from '../components/Toolbar.vue'; |
|
|
|
import { saveOrUpdateMapLogistic } from '/@/api/platform/common/controller/mapLogistic'; |
|
|
|
import { saveOrUpdateMapLogistic } from '/@/api/platform/common/controller/mapLogistic'; |
|
|
@ -631,7 +631,7 @@ |
|
|
|
mapState.mapData.courierUserName = courierUserMap.label; |
|
|
|
mapState.mapData.courierUserName = courierUserMap.label; |
|
|
|
mapState.mapData.courierLng = courierUserMap.mapLng; |
|
|
|
mapState.mapData.courierLng = courierUserMap.mapLng; |
|
|
|
mapState.mapData.courierLat = courierUserMap.mapLat; |
|
|
|
mapState.mapData.courierLat = courierUserMap.mapLat; |
|
|
|
drawMapNavigate(mapState.mapData.mapLogisticPoint); |
|
|
|
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint)); |
|
|
|
} else notification.warn({ |
|
|
|
} else notification.warn({ |
|
|
|
message: '查找不到起点数据,请检查起点!', |
|
|
|
message: '查找不到起点数据,请检查起点!', |
|
|
|
duration: 2 |
|
|
|
duration: 2 |
|
|
@ -704,9 +704,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
setTableData(mapState.mapData.mapTask); |
|
|
|
setTableData(mapState.mapData.mapTask); |
|
|
|
if (!isEmpty(mapState.mapData.mapLogisticPoint)) { |
|
|
|
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint)); |
|
|
|
drawMapNavigate(mapState.mapData.mapLogisticPoint); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -795,7 +793,8 @@ |
|
|
|
key: item.key, |
|
|
|
key: item.key, |
|
|
|
taskType: item.taskType, |
|
|
|
taskType: item.taskType, |
|
|
|
hospitalId: hospital.value, |
|
|
|
hospitalId: hospital.value, |
|
|
|
hospitalName: hospital.label |
|
|
|
hospitalName: hospital.label, |
|
|
|
|
|
|
|
courierUserId: mapState.mapData.courierUserId |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
lng: org?.mapLng, |
|
|
|
lng: org?.mapLng, |
|
|
|
lat: org?.mapLat, |
|
|
|
lat: org?.mapLat, |
|
|
@ -803,43 +802,22 @@ |
|
|
|
key: item.key, |
|
|
|
key: item.key, |
|
|
|
taskType: item.taskType, |
|
|
|
taskType: item.taskType, |
|
|
|
hospitalId: org?.value, |
|
|
|
hospitalId: org?.value, |
|
|
|
hospitalName: org?.label ?? item.orgName |
|
|
|
hospitalName: org?.label ?? item.orgName, |
|
|
|
|
|
|
|
courierUserId: mapState.mapData.courierUserId, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 查找并添加与自己有关的交接预设任务,只能添加设置了位置的标记点 |
|
|
|
// 查找并添加与自己有关的交接预设任务,只能添加设置了位置的标记点 |
|
|
|
await listMapTaskPreset({ size: 40, courierUserId: mapState.mapData.courierUserId }).then(res => { |
|
|
|
mapState.mapData.mapTaskPresetLogisticPoint = await getTaskPresetPointByCourierUserId(mapState.mapData.courierUserId); |
|
|
|
res.data?.map(item => { |
|
|
|
|
|
|
|
const taskPresetHospital = item.orginPresetId ? mapState.hospitalList.find(e => e.value == item.orginPresetId) : {} as MapPointType, |
|
|
|
|
|
|
|
taskPresetOrg = item.destinationPresetId ? mapState.orgList.find(e => e.value == item.destinationPresetId) : {} as MapPointType; |
|
|
|
|
|
|
|
pointData.push({ |
|
|
|
|
|
|
|
lng: taskPresetHospital?.mapLng ?? item.orginPresetLng, |
|
|
|
|
|
|
|
lat: taskPresetHospital?.mapLat ?? item.orginPresetLat, |
|
|
|
|
|
|
|
type: '0', |
|
|
|
|
|
|
|
taskType: '1', |
|
|
|
|
|
|
|
mapTaskId: item.id, |
|
|
|
|
|
|
|
hospitalId: taskPresetHospital?.value ?? item.orginPresetId, |
|
|
|
|
|
|
|
hospitalName: taskPresetHospital?.label ?? item.orginPresetName |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
lng: taskPresetOrg?.mapLng ?? item.destinationPresetLng, |
|
|
|
|
|
|
|
lat: taskPresetOrg?.mapLat ?? item.destinationPresetLat, |
|
|
|
|
|
|
|
type: '1', |
|
|
|
|
|
|
|
taskType: '1', |
|
|
|
|
|
|
|
mapTaskId: item.id, |
|
|
|
|
|
|
|
hospitalId: taskPresetOrg?.value ?? item.destinationPresetId, |
|
|
|
|
|
|
|
hospitalName: taskPresetOrg?.label ?? item.destinationPresetName |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
pointData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
pointData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
mapState.mapData.mapLogisticPoint = pointData; |
|
|
|
mapState.mapData.mapLogisticPoint = pointData; |
|
|
|
drawMapNavigate(pointData); |
|
|
|
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 处理地图标记点数据 */ |
|
|
|
/** 处理地图标记点数据 */ |
|
|
|
function handleMapPoint(mapLogisticPoint: MapLogisticPoint[] = []) { |
|
|
|
function handleMapPoint(mapLogisticPoint: MapLogisticPoint[] = []) { |
|
|
|
if (!isEmpty(mapLogisticPoint)) { |
|
|
|
if (!isEmpty(mapLogisticPoint)) { |
|
|
|
mapState.mapData.mapLogisticPoint = mapLogisticPoint; |
|
|
|
mapState.mapData.mapLogisticPoint = mapLogisticPoint; |
|
|
|
drawMapNavigate(mapLogisticPoint); |
|
|
|
concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|