|
|
@ -40,10 +40,12 @@ |
|
|
|
:disabled="isEdit" |
|
|
|
:disabled="isEdit" |
|
|
|
:options="mapState.hospitalList" |
|
|
|
:options="mapState.hospitalList" |
|
|
|
@select="handleCourierUserSearch" |
|
|
|
@select="handleCourierUserSearch" |
|
|
|
|
|
|
|
@change="handleCreateSendOrderTask" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<ASelect v-model:value="mapState.mapData.sendOrderTaskType" |
|
|
|
<ASelect v-model:value="mapState.mapData.sendOrderTaskType" |
|
|
|
style="width: 30%" |
|
|
|
style="width: 30%" |
|
|
|
:disabled="isEdit" |
|
|
|
:disabled="isEdit" |
|
|
|
|
|
|
|
@change="handleCreateSendOrderTask" |
|
|
|
> |
|
|
|
> |
|
|
|
<ASelectOption key="0">普通任务</ASelectOption> |
|
|
|
<ASelectOption key="0">普通任务</ASelectOption> |
|
|
|
<ASelectOption key="1">交接任务</ASelectOption> |
|
|
|
<ASelectOption key="1">交接任务</ASelectOption> |
|
|
@ -118,7 +120,7 @@ |
|
|
|
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'; |
|
|
|
import { MapLogistic } from '/@/api/platform/common/entity/mapLogistic'; |
|
|
|
import { MapLogistic } from '/@/api/platform/common/entity/mapLogistic'; |
|
|
|
import {buildUUID} from "/@/utils/uuid"; |
|
|
|
import { buildUUID } from '/@/utils/uuid'; |
|
|
|
|
|
|
|
|
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
interface MapState { |
|
|
|
interface MapState { |
|
|
@ -226,7 +228,6 @@ |
|
|
|
const formElRef = ref(); |
|
|
|
const formElRef = ref(); |
|
|
|
const [registerTable, { setTableData }] = useTable({ |
|
|
|
const [registerTable, { setTableData }] = useTable({ |
|
|
|
title: '任务列表', |
|
|
|
title: '任务列表', |
|
|
|
rowKey: 'id', |
|
|
|
|
|
|
|
columns: operatePanelColumns, |
|
|
|
columns: operatePanelColumns, |
|
|
|
resizeHeightOffset: 100, |
|
|
|
resizeHeightOffset: 100, |
|
|
|
showTableSetting: true, |
|
|
|
showTableSetting: true, |
|
|
@ -552,40 +553,32 @@ |
|
|
|
message: '查找不到发单点数据,请检查发单点!', |
|
|
|
message: '查找不到发单点数据,请检查发单点!', |
|
|
|
duration: 2 |
|
|
|
duration: 2 |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 处理创建首个发单任务 */ |
|
|
|
/** 处理创建首个发单任务 */ |
|
|
|
function handleCreateSendOrderTask() { |
|
|
|
function handleCreateSendOrderTask() { |
|
|
|
if (!mapState.mapData.sendOrderId && !mapState.mapData.sendOrderTaskType) throw notification.error({ |
|
|
|
if (!mapState.mapData.sendOrderId || !mapState.mapData.sendOrderTaskType) return; |
|
|
|
message: '处理创建首个发单任务失败,请联系开发人员!', |
|
|
|
|
|
|
|
description: '检查到发单或发单任务类型为空!', |
|
|
|
|
|
|
|
duration: 2 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (isEmpty(mapState.mapData.mapTask)) { |
|
|
|
if (isEmpty(mapState.mapData.mapTask)) { |
|
|
|
mapState.mapData.mapTask.push({ |
|
|
|
mapState.mapData.mapTask.push({ |
|
|
|
name: '系统创建:发单任务', |
|
|
|
name: '系统创建:发单任务', |
|
|
|
hospitalId: mapState.mapData.sendOrderId, |
|
|
|
hospitalId: mapState.mapData.sendOrderId, |
|
|
|
taskType: mapState.mapData.sendOrderTaskType, |
|
|
|
taskType: mapState.mapData.sendOrderTaskType, |
|
|
|
|
|
|
|
orgId: '', |
|
|
|
orgName: ~~mapState.mapData.sendOrderTaskType ? '' : '等待收样员设置!', |
|
|
|
orgName: ~~mapState.mapData.sendOrderTaskType ? '' : '等待收样员设置!', |
|
|
|
sort: 1, |
|
|
|
sort: 1, |
|
|
|
fileId: [], |
|
|
|
fileId: [], |
|
|
|
key: buildUUID() |
|
|
|
key: buildUUID() |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
let mapTask = mapState.mapData.mapTask |
|
|
|
const mapTask = mapState.mapData.mapTask.find(item => item.hospitalId == mapState.mapData.sendOrderId); |
|
|
|
.filter(item => item.taskType == mapState.mapData.sendOrderTaskType) |
|
|
|
|
|
|
|
.find(item => item.sort == 1); |
|
|
|
|
|
|
|
mapTask && Object.assign(mapTask, { |
|
|
|
mapTask && Object.assign(mapTask, { |
|
|
|
hospitalId: mapState.mapData.sendOrderId, |
|
|
|
hospitalId: mapState.mapData.sendOrderId, |
|
|
|
taskType: mapState.mapData.sendOrderTaskType, |
|
|
|
taskType: mapState.mapData.sendOrderTaskType |
|
|
|
orgName: ~~mapState.mapData.sendOrderTaskType ? '' : '等待收样员设置!', |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
handleMapPointGenerate(); |
|
|
|
handleMapPointGenerate(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 处理起点收样员数据 */ |
|
|
|
/** 处理起点收样员数据 */ |
|
|
|
function handleCourierUserData(value) { |
|
|
|
function handleCourierUserData(value) { |
|
|
|
const courierUserMap = mapState.courierUserList.find(item => item.value == value); |
|
|
|
const courierUserMap = mapState.courierUserList.find(item => item.value == value); |
|
|
@ -602,9 +595,7 @@ |
|
|
|
/** 处理打开任务配置 */ |
|
|
|
/** 处理打开任务配置 */ |
|
|
|
async function handleOpenMapTask() { |
|
|
|
async function handleOpenMapTask() { |
|
|
|
await formElRef.value.validate(); |
|
|
|
await formElRef.value.validate(); |
|
|
|
if(mapState.mapData.mapTask |
|
|
|
if(!mapState.mapData.mapTask.find(item => item.hospitalId == mapState.mapData.sendOrderId)) { |
|
|
|
.filter(item => item.taskType == mapState.mapData.sendOrderTaskType) |
|
|
|
|
|
|
|
.find(item => item.sort == 1)?.hospitalId == mapState.mapData.sendOrderId) { |
|
|
|
|
|
|
|
notification.error({ |
|
|
|
notification.error({ |
|
|
|
message: '致命错误', |
|
|
|
message: '致命错误', |
|
|
|
description: `检测到任务列表中首个${~~mapState.mapData.sendOrderTaskType ? '普通' : '交接'}任务对应发单数据错误,请联系开发人员!`, |
|
|
|
description: `检测到任务列表中首个${~~mapState.mapData.sendOrderTaskType ? '普通' : '交接'}任务对应发单数据错误,请联系开发人员!`, |
|
|
@ -695,7 +686,7 @@ |
|
|
|
duration: 2 |
|
|
|
duration: 2 |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
pointData.push(omit(merge(item, { |
|
|
|
pointData.push({ |
|
|
|
lng: hospital.mapLng, |
|
|
|
lng: hospital.mapLng, |
|
|
|
lat: hospital.mapLat, |
|
|
|
lat: hospital.mapLat, |
|
|
|
type: '0', |
|
|
|
type: '0', |
|
|
@ -703,7 +694,7 @@ |
|
|
|
taskType: item.taskType, |
|
|
|
taskType: item.taskType, |
|
|
|
hospitalId: hospital.value, |
|
|
|
hospitalId: hospital.value, |
|
|
|
hospitalName: hospital.label |
|
|
|
hospitalName: hospital.label |
|
|
|
}), 'id'), omit(merge(item, { |
|
|
|
}, { |
|
|
|
lng: org?.mapLng, |
|
|
|
lng: org?.mapLng, |
|
|
|
lat: org?.mapLat, |
|
|
|
lat: org?.mapLat, |
|
|
|
type: '1', |
|
|
|
type: '1', |
|
|
@ -711,12 +702,12 @@ |
|
|
|
taskType: item.taskType, |
|
|
|
taskType: item.taskType, |
|
|
|
hospitalId: org?.value, |
|
|
|
hospitalId: org?.value, |
|
|
|
hospitalName: org?.label |
|
|
|
hospitalName: org?.label |
|
|
|
}), 'id')); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 查找并添加与自己有关的交接预设任务,只能添加设置了位置的标记点 |
|
|
|
// 查找并添加与自己有关的交接预设任务,只能添加设置了位置的标记点 |
|
|
|
await listMapTaskPreset({ size: 40, courierUserId: mapState.mapData.courierUserId }).then(res => { |
|
|
|
await listMapTaskPreset({ size: 40, courierUserId: mapState.mapData.courierUserId }).then(res => { |
|
|
|
res.data?.map(item => { |
|
|
|
res.data?.map(item => { |
|
|
|
pointData.push(omit(merge(item, { |
|
|
|
pointData.push({ |
|
|
|
lng: item.orginPresetLng, |
|
|
|
lng: item.orginPresetLng, |
|
|
|
lat: item.orginPresetLat, |
|
|
|
lat: item.orginPresetLat, |
|
|
|
type: '0', |
|
|
|
type: '0', |
|
|
@ -724,7 +715,7 @@ |
|
|
|
mapTaskId: item.id, |
|
|
|
mapTaskId: item.id, |
|
|
|
hospitalId: item.orginPresetId, |
|
|
|
hospitalId: item.orginPresetId, |
|
|
|
hospitalName: item.orginPresetName |
|
|
|
hospitalName: item.orginPresetName |
|
|
|
}), 'id'), omit(merge(item, { |
|
|
|
}, { |
|
|
|
lng: item.destinationPresetLng, |
|
|
|
lng: item.destinationPresetLng, |
|
|
|
lat: item.destinationPresetLat, |
|
|
|
lat: item.destinationPresetLat, |
|
|
|
type: '1', |
|
|
|
type: '1', |
|
|
@ -732,7 +723,7 @@ |
|
|
|
mapTaskId: item.id, |
|
|
|
mapTaskId: item.id, |
|
|
|
hospitalId: item.destinationPresetId, |
|
|
|
hospitalId: item.destinationPresetId, |
|
|
|
hospitalName: item.destinationPresetName |
|
|
|
hospitalName: item.destinationPresetName |
|
|
|
}), 'id')); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
pointData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
pointData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
@ -740,7 +731,6 @@ |
|
|
|
drawMapNavigate(pointData); |
|
|
|
drawMapNavigate(pointData); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 处理地图标记点数据 */ |
|
|
|
/** 处理地图标记点数据 */ |
|
|
|
function handleMapPoint(mapLogisticPoint: Recordable[] = []) { |
|
|
|
function handleMapPoint(mapLogisticPoint: Recordable[] = []) { |
|
|
|
if (!isEmpty(mapLogisticPoint)) { |
|
|
|
if (!isEmpty(mapLogisticPoint)) { |
|
|
|