|
|
|
@ -5,7 +5,7 @@
@@ -5,7 +5,7 @@
|
|
|
|
|
:default-zoom="mapState.defaultZoom" |
|
|
|
|
:toolbar="toolbar" |
|
|
|
|
@save="handleMapSave" |
|
|
|
|
@addTask="handleOpenTask" |
|
|
|
|
@addTask="handleOpenMapTask" |
|
|
|
|
@point="handleOpenMapPoint" |
|
|
|
|
@zoomIn="handleMapZoomIn" |
|
|
|
|
@zoomOut="handleMapZoomOut" |
|
|
|
@ -36,10 +36,18 @@
@@ -36,10 +36,18 @@
|
|
|
|
|
</AFormItem> |
|
|
|
|
<AFormItem label="发单" name="sendOrderId"> |
|
|
|
|
<ASelect v-model:value="mapState.mapData.sendOrderId" |
|
|
|
|
style="width: 70%" |
|
|
|
|
:disabled="isEdit" |
|
|
|
|
:options="mapState.hospitalList" |
|
|
|
|
@select="handleCourierUserSearch" |
|
|
|
|
/> |
|
|
|
|
<ASelect v-model:value="mapState.mapData.sendOrderTaskType" |
|
|
|
|
style="width: 30%" |
|
|
|
|
:disabled="isEdit" |
|
|
|
|
> |
|
|
|
|
<ASelectOption key="0">普通任务</ASelectOption> |
|
|
|
|
<ASelectOption key="1">交接任务</ASelectOption> |
|
|
|
|
</ASelect> |
|
|
|
|
</AFormItem> |
|
|
|
|
<AFormItem label="起点" name="courierUserId"> |
|
|
|
|
<ASelect v-model:value="mapState.mapData.courierUserId" |
|
|
|
@ -66,7 +74,7 @@
@@ -66,7 +74,7 @@
|
|
|
|
|
<BasicTable @register="registerTable"/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<MapTaskModal @register="registerModal" @success="handleMapTask"/> |
|
|
|
|
<MapTaskModal @register="registerModal" @success="handleMapPointGenerate"/> |
|
|
|
|
<MapPointModal @register="mapPointRegisterModal" @success="handleMapPoint"/> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -110,6 +118,7 @@
@@ -110,6 +118,7 @@
|
|
|
|
|
import Toolbar from '../components/Toolbar.vue'; |
|
|
|
|
import { saveOrUpdateMapLogistic } from '/@/api/platform/common/controller/mapLogistic'; |
|
|
|
|
import { MapLogistic } from '/@/api/platform/common/entity/mapLogistic'; |
|
|
|
|
import {buildUUID} from "/@/utils/uuid"; |
|
|
|
|
|
|
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
|
interface MapState { |
|
|
|
@ -201,6 +210,9 @@
@@ -201,6 +210,9 @@
|
|
|
|
|
name: [ |
|
|
|
|
{ required: true, whitespace: true, message: '地图名称不能为空', validateTrigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
sendOrderId: [ |
|
|
|
|
{ required: true, whitespace: true, message: '发单点不能为空', validateTrigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
courierUserId: [ |
|
|
|
|
{ required: true, whitespace: true, message: '起点不能为空', validateTrigger: 'blur' } |
|
|
|
|
] |
|
|
|
@ -210,6 +222,7 @@
@@ -210,6 +222,7 @@
|
|
|
|
|
const AForm = Form; |
|
|
|
|
const AFormItem = Form.Item; |
|
|
|
|
const ASelect = Select; |
|
|
|
|
const ASelectOption = Select.Option; |
|
|
|
|
const formElRef = ref(); |
|
|
|
|
const [registerTable, { setTableData }] = useTable({ |
|
|
|
|
title: '任务列表', |
|
|
|
@ -224,7 +237,7 @@
@@ -224,7 +237,7 @@
|
|
|
|
|
bordered: true, |
|
|
|
|
showIndexColumn: true, |
|
|
|
|
}); |
|
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
|
const [registerModal, { openModal:mapTaskOpenModal }] = useModal(); |
|
|
|
|
const [mapPointRegisterModal, { openModal: mapPointOpenModal }] = useModal(); |
|
|
|
|
|
|
|
|
|
onBeforeMount(() => { |
|
|
|
@ -542,6 +555,37 @@
@@ -542,6 +555,37 @@
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理创建首个发单任务 */ |
|
|
|
|
function handleCreateSendOrderTask() { |
|
|
|
|
if (!mapState.mapData.sendOrderId && !mapState.mapData.sendOrderTaskType) throw notification.error({ |
|
|
|
|
message: '处理创建首个发单任务失败,请联系开发人员!', |
|
|
|
|
description: '检查到发单或发单任务类型为空!', |
|
|
|
|
duration: 2 |
|
|
|
|
}); |
|
|
|
|
if (isEmpty(mapState.mapData.mapTask)) { |
|
|
|
|
mapState.mapData.mapTask.push({ |
|
|
|
|
name: '系统创建:发单任务', |
|
|
|
|
hospitalId: mapState.mapData.sendOrderId, |
|
|
|
|
taskType: mapState.mapData.sendOrderTaskType, |
|
|
|
|
orgName: ~~mapState.mapData.sendOrderTaskType ? '' : '等待收样员设置!', |
|
|
|
|
sort: 1, |
|
|
|
|
fileId: [], |
|
|
|
|
key: buildUUID() |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
let mapTask = mapState.mapData.mapTask |
|
|
|
|
.filter(item => item.taskType == mapState.mapData.sendOrderTaskType) |
|
|
|
|
.find(item => item.sort == 1); |
|
|
|
|
mapTask && Object.assign(mapTask, { |
|
|
|
|
hospitalId: mapState.mapData.sendOrderId, |
|
|
|
|
taskType: mapState.mapData.sendOrderTaskType, |
|
|
|
|
orgName: ~~mapState.mapData.sendOrderTaskType ? '' : '等待收样员设置!', |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
handleMapPointGenerate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 处理起点收样员数据 */ |
|
|
|
|
function handleCourierUserData(value) { |
|
|
|
|
const courierUserMap = mapState.courierUserList.find(item => item.value == value); |
|
|
|
@ -556,15 +600,28 @@
@@ -556,15 +600,28 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理打开任务配置 */ |
|
|
|
|
async function handleOpenTask() { |
|
|
|
|
async function handleOpenMapTask() { |
|
|
|
|
await formElRef.value.validate(); |
|
|
|
|
openModal(true, { mapData: mapState.mapData }); |
|
|
|
|
if(mapState.mapData.mapTask |
|
|
|
|
.filter(item => item.taskType == mapState.mapData.sendOrderTaskType) |
|
|
|
|
.find(item => item.sort == 1)?.hospitalId == mapState.mapData.sendOrderId) { |
|
|
|
|
notification.error({ |
|
|
|
|
message: '致命错误', |
|
|
|
|
description: `检测到任务列表中首个${~~mapState.mapData.sendOrderTaskType ? '普通' : '交接'}任务对应发单数据错误,请联系开发人员!`, |
|
|
|
|
duration: 2 |
|
|
|
|
}); |
|
|
|
|
} else mapTaskOpenModal(true, { mapData: mapState.mapData }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理打开地图标记点配置 */ |
|
|
|
|
async function handleOpenMapPoint() { |
|
|
|
|
await formElRef.value.validate(); |
|
|
|
|
mapPointOpenModal(true, { mapData: mapState.mapData }); |
|
|
|
|
if(isEmpty(mapState.mapData.mapLogisticPoint)){ |
|
|
|
|
notification.error({ |
|
|
|
|
message: '检测到标记点数据为空,请先配置任务!', |
|
|
|
|
duration: 2 |
|
|
|
|
}); |
|
|
|
|
} else mapPointOpenModal(true, { mapData: mapState.mapData }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理地图放大 */ |
|
|
|
@ -623,10 +680,9 @@
@@ -623,10 +680,9 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 处理地图任务数据 */ |
|
|
|
|
async function handleMapTask() { |
|
|
|
|
/** 处理地图标记点生成 */ |
|
|
|
|
async function handleMapPointGenerate() { |
|
|
|
|
setTableData(mapState.mapData.mapTask); |
|
|
|
|
// 生成标记点数据 |
|
|
|
|
const pointData:Recordable[] = []; |
|
|
|
|
mapState.mapData.mapTask.forEach(item => { |
|
|
|
|
const hospital = mapState.hospitalList.find(e => e.value == item.hospitalId), |
|
|
|
@ -634,7 +690,8 @@
@@ -634,7 +690,8 @@
|
|
|
|
|
// 下级医院必选,也不能由收样员设置交接位置,所以必须查到,没有数据说明数据被更新过了 |
|
|
|
|
if (!hospital) { |
|
|
|
|
throw notification.error({ |
|
|
|
|
message: '当前机构数据或者医院数据已经更新,请重新刷新页面!', |
|
|
|
|
message: '地图标记点生成错误', |
|
|
|
|
description: '当前机构数据或者医院数据已经更新,请重新刷新页面!', |
|
|
|
|
duration: 2 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -678,11 +735,12 @@
@@ -678,11 +735,12 @@
|
|
|
|
|
}), 'id')); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
pointData.forEach((item, index)=> { item.sort = add(index, 1); }); |
|
|
|
|
pointData.forEach((item, index)=> item.sort = add(index, 1)); |
|
|
|
|
mapState.mapData.mapLogisticPoint = pointData; |
|
|
|
|
drawMapNavigate(pointData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 处理地图标记点数据 */ |
|
|
|
|
function handleMapPoint(mapLogisticPoint: Recordable[] = []) { |
|
|
|
|
if (!isEmpty(mapLogisticPoint)) { |
|
|
|
|