|
|
@ -29,7 +29,7 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</AFormItem> |
|
|
|
</AFormItem> |
|
|
|
<AFormItem label="起点"> |
|
|
|
<AFormItem label="起点"> |
|
|
|
<ASelect v-model:value="mapState.modelRef.takeSpecimenId" :options="[]"/> |
|
|
|
<ASelect v-model:value="mapState.modelRef.takeSpecimenId" :options="mapState.takeSpecimenList"/> |
|
|
|
</AFormItem> |
|
|
|
</AFormItem> |
|
|
|
<AFormItem label="途径点"> |
|
|
|
<AFormItem label="途径点"> |
|
|
|
<ASelect v-model:value="mapState.modelRef.smallHospitalId" |
|
|
|
<ASelect v-model:value="mapState.modelRef.smallHospitalId" |
|
|
@ -82,7 +82,8 @@ |
|
|
|
largeHospitalId: '', |
|
|
|
largeHospitalId: '', |
|
|
|
smallHospitalId: '', |
|
|
|
smallHospitalId: '', |
|
|
|
takeSpecimenId: '' |
|
|
|
takeSpecimenId: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
takeSpecimenList: [] |
|
|
|
}); |
|
|
|
}); |
|
|
|
const AForm = Form; |
|
|
|
const AForm = Form; |
|
|
|
const AFormItem = Form.Item; |
|
|
|
const AFormItem = Form.Item; |
|
|
@ -289,6 +290,20 @@ |
|
|
|
})); |
|
|
|
})); |
|
|
|
takeSpecimenCluster?.setData(specimenPoints); |
|
|
|
takeSpecimenCluster?.setData(specimenPoints); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 扫描收样员园形范围 |
|
|
|
|
|
|
|
scanTakeSpecimenCircleRange = new AMap.Circle({ |
|
|
|
|
|
|
|
radius: 10000, |
|
|
|
|
|
|
|
borderWeight: 3, |
|
|
|
|
|
|
|
strokeColor: '#3600ff', |
|
|
|
|
|
|
|
strokeOpacity: 0.2, |
|
|
|
|
|
|
|
strokeWeight: 6, |
|
|
|
|
|
|
|
fillOpacity: 0.4, |
|
|
|
|
|
|
|
strokeStyle: 'dashed', |
|
|
|
|
|
|
|
strokeDasharray: [8, 8], |
|
|
|
|
|
|
|
fillColor: '#1791fc', |
|
|
|
|
|
|
|
zIndex: 50 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 构造路线导航类 |
|
|
|
// 构造路线导航类 |
|
|
|
const driving = new AMap.Driving({ |
|
|
|
const driving = new AMap.Driving({ |
|
|
|
map: map, |
|
|
|
map: map, |
|
|
@ -350,40 +365,26 @@ |
|
|
|
// 查找当前下级医院数据 |
|
|
|
// 查找当前下级医院数据 |
|
|
|
const smallHospitalMap = smallHospitalMapList.find(item => item.id == value); |
|
|
|
const smallHospitalMap = smallHospitalMapList.find(item => item.id == value); |
|
|
|
if (smallHospitalMap) { |
|
|
|
if (smallHospitalMap) { |
|
|
|
// 绘制20公里,园形矢量图,并且检测这个范围内是否有收样员 |
|
|
|
map.remove(scanTakeSpecimenCircleRange || {}); |
|
|
|
map.remove(scanTakeSpecimenCircleRange); |
|
|
|
|
|
|
|
// 扫描收样员园形范围 |
|
|
|
|
|
|
|
scanTakeSpecimenCircleRange = new AMap.Circle({ |
|
|
|
|
|
|
|
radius: 8000, |
|
|
|
|
|
|
|
borderWeight: 3, |
|
|
|
|
|
|
|
strokeColor: '#3600ff', |
|
|
|
|
|
|
|
strokeOpacity: 0.2, |
|
|
|
|
|
|
|
strokeWeight: 6, |
|
|
|
|
|
|
|
fillOpacity: 0.4, |
|
|
|
|
|
|
|
strokeStyle: 'dashed', |
|
|
|
|
|
|
|
strokeDasharray: [8, 8], |
|
|
|
|
|
|
|
fillColor: '#1791fc', |
|
|
|
|
|
|
|
zIndex: 50 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scanTakeSpecimenCircleRange.setCenter([smallHospitalMap.lng, smallHospitalMap.lat]); |
|
|
|
scanTakeSpecimenCircleRange.setCenter([smallHospitalMap.lng, smallHospitalMap.lat]); |
|
|
|
map.add(scanTakeSpecimenCircleRange); |
|
|
|
map.add(scanTakeSpecimenCircleRange); |
|
|
|
map.setFitView([ scanTakeSpecimenCircleRange ]); |
|
|
|
map.setFitView([ scanTakeSpecimenCircleRange ]); |
|
|
|
// 查找园圈内的收样员 |
|
|
|
const smallHospitalMarker = new AMap.Marker({ |
|
|
|
const gatherCircleRangeSpecimen = []; |
|
|
|
position: [smallHospitalMap.lng, smallHospitalMap.lat], |
|
|
|
for (let i = 0; i < smallHospitalMapList.length; ++i) { |
|
|
|
}); |
|
|
|
const smallHospitalMap = smallHospitalMapList[i]; |
|
|
|
const smallHospitalPosition = smallHospitalMarker.getPosition(); |
|
|
|
const specimenLngLat = new AMap.LngLat(smallHospitalMap.lng, smallHospitalMap.lat); |
|
|
|
// 计算最优先收样员顺序 |
|
|
|
if (scanTakeSpecimenCircleRange.contains(specimenLngLat)) { |
|
|
|
const optimalSpecimen = specimenMapList.sort((firstEl, secondEl) => { |
|
|
|
console.log('查找到'); |
|
|
|
const marker1 = new AMap.Marker({ |
|
|
|
} else { |
|
|
|
position: [firstEl.lng, firstEl.lat], |
|
|
|
console.log('没有查找到'); |
|
|
|
}),marker2 = new AMap.Marker({ |
|
|
|
} |
|
|
|
position: [secondEl.lng, secondEl.lat], |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
const position1 = marker1.getPosition(), |
|
|
|
|
|
|
|
position2 = marker2.getPosition(); |
|
|
|
|
|
|
|
return Math.round(smallHospitalPosition.distance(position1)) - Math.round(smallHospitalPosition.distance(position2)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
mapState.takeSpecimenList = optimalSpecimen.map(item => ({ value: item.id, label: item.title })); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw '查找不到发单点数据,请检查发单点!'; |
|
|
|
throw '查找不到发单点数据,请检查发单点!'; |
|
|
|
} |
|
|
|
} |
|
|
|