|
|
|
@ -155,7 +155,7 @@
@@ -155,7 +155,7 @@
|
|
|
|
|
const emit = defineEmits(['success']); |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
|
const instance = getCurrentInstance(); |
|
|
|
|
const { createMessage } = useMessage(); |
|
|
|
|
const { notification } = useMessage(); |
|
|
|
|
const { mapDesigner } = componentSetting; |
|
|
|
|
const mapState = reactive<MapState>({ |
|
|
|
|
/** 遮罩层状态 */ |
|
|
|
@ -619,10 +619,12 @@
@@ -619,10 +619,12 @@
|
|
|
|
|
mapState.mapData.mapTask.forEach(item => { |
|
|
|
|
const hospital = mapState.hospitalList.find(e => e.value == item.hospitalId); |
|
|
|
|
const org = mapState.orgList.find(e => e.value == item.orgId); |
|
|
|
|
// 下级医院必选,没有数据说明数据被更新过了 |
|
|
|
|
// 下级医院必选,所以必须查到,没有数据说明数据被更新过了 |
|
|
|
|
if (!hospital) { |
|
|
|
|
createMessage.error('当前机构数据或者医院数据已经更新,请重新刷新页面!'); |
|
|
|
|
throw Error('当前机构数据或者医院数据已经更新,请重新刷新页面!'); |
|
|
|
|
throw notification.error({ |
|
|
|
|
message: '当前机构数据或者医院数据已经更新,请重新刷新页面!', |
|
|
|
|
duration: 2 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
pointData.push({ |
|
|
|
|
lng: hospital.mapLng, |
|
|
|
@ -630,6 +632,7 @@
@@ -630,6 +632,7 @@
|
|
|
|
|
sort: undefined, |
|
|
|
|
type: '0', |
|
|
|
|
key: item.key, |
|
|
|
|
taskType: item.taskType, |
|
|
|
|
hospitalId: hospital.value, |
|
|
|
|
hospitalName: hospital.label |
|
|
|
|
}); |
|
|
|
@ -639,6 +642,7 @@
@@ -639,6 +642,7 @@
|
|
|
|
|
sort: undefined, |
|
|
|
|
type: '1', |
|
|
|
|
key: item.key, |
|
|
|
|
taskType: item.taskType, |
|
|
|
|
hospitalId: org.value, |
|
|
|
|
hospitalName: org.label |
|
|
|
|
}); |
|
|
|
@ -683,10 +687,10 @@
@@ -683,10 +687,10 @@
|
|
|
|
|
async function handleMapSave() { |
|
|
|
|
await formElRef.value.validate(); |
|
|
|
|
const mapData = toRaw(mapState.mapData); |
|
|
|
|
mapData.fileId = (mapData.fileId as [] || []).join(','); |
|
|
|
|
mapData.fileId = (mapData.fileId as[])?.join(','); |
|
|
|
|
mapData.mapTask.forEach(item => { |
|
|
|
|
const hospital = mapState.hospitalList.find(e => e.value == item.hospitalId), |
|
|
|
|
org = mapState.orgList.find(e => e.value == item.orgId); |
|
|
|
|
const hospital = item.hospitalId && mapState.hospitalList.find(e => e.value == item.hospitalId), |
|
|
|
|
org = item.orgId && mapState.orgList.find(e => e.value == item.orgId); |
|
|
|
|
item.courierUserId = mapData.courierUserId; |
|
|
|
|
hospital && Object.assign(item,{ |
|
|
|
|
hospitalName: hospital.label, |
|
|
|
@ -698,11 +702,11 @@
@@ -698,11 +702,11 @@
|
|
|
|
|
orgLng: org.mapLng, |
|
|
|
|
orgLat: org.mapLat |
|
|
|
|
}); |
|
|
|
|
item.fileId = (item.fileId as [] || []).join(','); |
|
|
|
|
item.fileId = (item.fileId as [])?.join(','); |
|
|
|
|
if (~~item.taskType == 1) { |
|
|
|
|
item?.mapTaskPreset?.forEach(childItem => { |
|
|
|
|
const childHospital = mapState.hospitalList.find(e => e.value == childItem.hospitalId), |
|
|
|
|
childOrg = mapState.orgList.find(e => e.value == childItem.orgId); |
|
|
|
|
const childHospital = childItem.hospitalId && mapState.hospitalList.find(e => e.value == childItem.hospitalId), |
|
|
|
|
childOrg = childItem.orgId && mapState.orgList.find(e => e.value == childItem.orgId); |
|
|
|
|
childItem.courierUserId = mapData.courierUserId; |
|
|
|
|
childHospital && Object.assign(item,{ |
|
|
|
|
orginPresetName: childHospital.label, |
|
|
|
@ -714,7 +718,7 @@
@@ -714,7 +718,7 @@
|
|
|
|
|
destinationPresetLng: childOrg.mapLng, |
|
|
|
|
destinationPresetLat: childOrg.mapLat |
|
|
|
|
}); |
|
|
|
|
childItem.fileId = (childItem.fileId as [] || [])?.join(','); |
|
|
|
|
childItem.fileId = (childItem.fileId as [])?.join(','); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|