|
|
|
@ -71,14 +71,14 @@
|
|
|
|
|
:label-col="{ sm: { span: 24 }, md: { span: 5 } }"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 9 } }
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 19 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 19 } }
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<a-input
|
|
|
|
|
v-model:value="formModel.remark"
|
|
|
|
|
placeholder="请输入备注"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '37%' : '38%' }"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '83%' : '100%' }"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
@ -361,6 +361,7 @@
|
|
|
|
|
>
|
|
|
|
|
<div v-if="title === '编辑'">
|
|
|
|
|
<!-- <a-button @click="retrial">重审</a-button> -->
|
|
|
|
|
<a-button @click="storeResetForm">重置</a-button>
|
|
|
|
|
<a-button @click="handleClose">取消</a-button>
|
|
|
|
|
<a-button type="primary" html-type="submit" style="margin-left: 10px" @click="distribute"
|
|
|
|
|
>确定</a-button
|
|
|
|
@ -564,7 +565,7 @@ const pagingQuery = () => {
|
|
|
|
|
})
|
|
|
|
|
pois.push(...listData.value)
|
|
|
|
|
// 设置缩放级别,设置地图视图级别为
|
|
|
|
|
const targetZoom = 10
|
|
|
|
|
const targetZoom = 12
|
|
|
|
|
|
|
|
|
|
//回调函数
|
|
|
|
|
const placeSearch_CallBack = (data: any) => {
|
|
|
|
@ -618,6 +619,7 @@ const pagingQuery = () => {
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//匹配
|
|
|
|
|
const match = () => {
|
|
|
|
|
const fields = ['address', 'detailAddress', 'radius'] // 指定要校验的字段名
|
|
|
|
@ -634,16 +636,8 @@ const match = () => {
|
|
|
|
|
city: '杭州' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
const addressValue =
|
|
|
|
|
formModel.address?.toString().split(',').join('') + formModel.detailAddress
|
|
|
|
|
geocoder.value.getLocation(addressValue, function (status: any, result: any) {
|
|
|
|
|
if (status === 'complete' && result.info === 'OK') {
|
|
|
|
|
// result中对应详细地理坐标信息
|
|
|
|
|
lng.value = result.geocodes[0].location.lng
|
|
|
|
|
lat.value = result.geocodes[0].location.lat
|
|
|
|
|
}
|
|
|
|
|
pagingQuery()
|
|
|
|
|
})
|
|
|
|
|
//标记中心点
|
|
|
|
|
getCenterMarker('match')
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
// 校验失败
|
|
|
|
@ -679,15 +673,10 @@ const addStore = (item: any) => {
|
|
|
|
|
|
|
|
|
|
//删除预约门店
|
|
|
|
|
const delReservationStore = (i: any) => {
|
|
|
|
|
console.log(i, 'i')
|
|
|
|
|
// console.log(formModel.customStoreEntities, 'formModel.customStoreEntities')
|
|
|
|
|
console.log(listData.value, 'listData.value')
|
|
|
|
|
listData.value.forEach((item: any) => {
|
|
|
|
|
// console.log(i.storeId, 'id')
|
|
|
|
|
if (item.id == i.storeId) {
|
|
|
|
|
item.disabled = false
|
|
|
|
|
}
|
|
|
|
|
console.log(item, 'item')
|
|
|
|
|
})
|
|
|
|
|
formModel.customStoreEntities = formModel.customStoreEntities.filter((item: any) => {
|
|
|
|
|
return item.storeId != i.storeId
|
|
|
|
@ -697,12 +686,13 @@ const delReservationStore = (i: any) => {
|
|
|
|
|
const storeResetForm = () => {
|
|
|
|
|
formModel.customName = ''
|
|
|
|
|
formModel.customNid = ''
|
|
|
|
|
formModel.remark = ''
|
|
|
|
|
if (title.value !== '编辑预约') {
|
|
|
|
|
formModel.address = []
|
|
|
|
|
formModel.detailAddress = ''
|
|
|
|
|
formModel.radius = ''
|
|
|
|
|
formModel.customStoreEntities.length = 0
|
|
|
|
|
}
|
|
|
|
|
formModel.customStoreEntities.length = 0
|
|
|
|
|
|
|
|
|
|
listData.value.length = 0
|
|
|
|
|
// 清除地图上的所有标记物
|
|
|
|
@ -740,7 +730,7 @@ interface customStoreEntitiesItem {
|
|
|
|
|
//是否发送请求了,发送了就要就行表格刷新
|
|
|
|
|
const isSubmit = ref(false)
|
|
|
|
|
//提交请求操作
|
|
|
|
|
const submitOperate = (type: string, status?: number) => {
|
|
|
|
|
const submitOperate = () => {
|
|
|
|
|
//移除address属性
|
|
|
|
|
const filteredObj = Object.fromEntries(
|
|
|
|
|
Object.entries(formModel).filter(([key]) => key !== 'address')
|
|
|
|
@ -753,7 +743,7 @@ const submitOperate = (type: string, status?: number) => {
|
|
|
|
|
reservationTime: item.reservationTime,
|
|
|
|
|
reservationDate: item.reservationDate
|
|
|
|
|
}
|
|
|
|
|
if (title.value === '编辑预约') {
|
|
|
|
|
if (title.value === '编辑预约' || title.value === '编辑') {
|
|
|
|
|
if (item.customStoreId) {
|
|
|
|
|
obj.customStoreId = item.customStoreId
|
|
|
|
|
}
|
|
|
|
@ -786,13 +776,7 @@ const submitOperate = (type: string, status?: number) => {
|
|
|
|
|
}
|
|
|
|
|
//报名信息确认弹窗确定点击事件
|
|
|
|
|
const handleOk = async () => {
|
|
|
|
|
if (title.value === '编辑') {
|
|
|
|
|
//重审
|
|
|
|
|
await submitOperate('cs', 1)
|
|
|
|
|
} else {
|
|
|
|
|
//报名
|
|
|
|
|
await submitOperate('bm')
|
|
|
|
|
}
|
|
|
|
|
await submitOperate()
|
|
|
|
|
}
|
|
|
|
|
//暂存
|
|
|
|
|
const temporaryStorage = async () => {
|
|
|
|
@ -803,7 +787,7 @@ const temporaryStorage = async () => {
|
|
|
|
|
message.info('请先添加预约门店')
|
|
|
|
|
} else {
|
|
|
|
|
formModel.enrollStatus = 0
|
|
|
|
|
submitOperate('zc')
|
|
|
|
|
submitOperate()
|
|
|
|
|
// handleSubmit()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -813,9 +797,9 @@ const temporaryStorage = async () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//重审
|
|
|
|
|
const retrial = () => {
|
|
|
|
|
submitOperate('cs', 0)
|
|
|
|
|
}
|
|
|
|
|
// const retrial = () => {
|
|
|
|
|
// submitOperate()
|
|
|
|
|
// }
|
|
|
|
|
//分发
|
|
|
|
|
const distribute = () => {
|
|
|
|
|
registerVisible.value = true
|
|
|
|
@ -935,13 +919,23 @@ defineExpose({
|
|
|
|
|
formModel.detailAddress = detailAddress
|
|
|
|
|
formModel.radius = radius
|
|
|
|
|
formModel.customStoreEntities.push(...customStoreVOList)
|
|
|
|
|
|
|
|
|
|
//获取预约时间段下拉框回显数据
|
|
|
|
|
formModel.customStoreEntities.forEach((i: any) => {
|
|
|
|
|
i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime)
|
|
|
|
|
})
|
|
|
|
|
console.log(formModel.customStoreEntities, 'formModel.customStoreEntities')
|
|
|
|
|
}
|
|
|
|
|
if (opendata.type === 'audit') {
|
|
|
|
|
// isReadOnly.value = true
|
|
|
|
|
// reservationTimeisReadOnly.value = true
|
|
|
|
|
handleMapInit()
|
|
|
|
|
title.value = '编辑'
|
|
|
|
|
// formModel.description = 1
|
|
|
|
|
} else if (opendata.type === 'edit') {
|
|
|
|
|
isDisabled.value = true
|
|
|
|
|
handleMapInit()
|
|
|
|
|
|
|
|
|
|
title.value = '编辑预约'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const handleMapInit = () => {
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
initMap()
|
|
|
|
@ -960,23 +954,27 @@ defineExpose({
|
|
|
|
|
isReadOnly.value = true
|
|
|
|
|
reservationTimeisReadOnly.value = true
|
|
|
|
|
title.value = '详情'
|
|
|
|
|
} else if (opendata.type === 'audit') {
|
|
|
|
|
// isReadOnly.value = true
|
|
|
|
|
// reservationTimeisReadOnly.value = true
|
|
|
|
|
handleMapInit()
|
|
|
|
|
title.value = '编辑'
|
|
|
|
|
formModel.description = 1
|
|
|
|
|
} else if (opendata.type === 'distribute') {
|
|
|
|
|
}
|
|
|
|
|
// else if (opendata.type === 'audit') {
|
|
|
|
|
// // isReadOnly.value = true
|
|
|
|
|
// // reservationTimeisReadOnly.value = true
|
|
|
|
|
// handleMapInit()
|
|
|
|
|
// title.value = '编辑'
|
|
|
|
|
// // formModel.description = 1
|
|
|
|
|
// }
|
|
|
|
|
else if (opendata.type === 'distribute') {
|
|
|
|
|
isReadOnly.value = true
|
|
|
|
|
reservationTimeisReadOnly.value = true
|
|
|
|
|
handleMapInit()
|
|
|
|
|
title.value = '分发'
|
|
|
|
|
formModel.description = 1
|
|
|
|
|
} else {
|
|
|
|
|
isDisabled.value = true
|
|
|
|
|
handleMapInit()
|
|
|
|
|
title.value = '编辑预约'
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
// isDisabled.value = true
|
|
|
|
|
// handleMapInit()
|
|
|
|
|
|
|
|
|
|
// title.value = '编辑预约'
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
formAction.value = opendata.newFormAction
|
|
|
|
|
}
|
|
|
|
@ -1006,12 +1004,49 @@ const map = ref<any>({})
|
|
|
|
|
//逆向地理编码:将 地理坐标(经纬度) 转换成 地址描述信息,对应为AMap.Geocoder的getAddress方法
|
|
|
|
|
const geocoder = ref<any>({})
|
|
|
|
|
|
|
|
|
|
//创建地图
|
|
|
|
|
//标记中心点封装的方法
|
|
|
|
|
const getCenterMarker = (type: string) => {
|
|
|
|
|
const addressValue =
|
|
|
|
|
//标记中心点
|
|
|
|
|
formModel.address?.toString().split(',').join('') + formModel.detailAddress
|
|
|
|
|
geocoder.value.getLocation(addressValue, function (status: any, result: any) {
|
|
|
|
|
if (status === 'complete' && result.info === 'OK') {
|
|
|
|
|
// result中对应详细地理坐标信息
|
|
|
|
|
lng.value = result.geocodes[0].location.lng
|
|
|
|
|
lat.value = result.geocodes[0].location.lat
|
|
|
|
|
// 设置地图中心点
|
|
|
|
|
map.value.setCenter([lng.value, lat.value]) // 将经度和纬度作为参数传入
|
|
|
|
|
if (type === 'match') {
|
|
|
|
|
//修改地图的缩放级别
|
|
|
|
|
map.value.setZoom(12) // 设置新的缩放级别,例如12
|
|
|
|
|
}
|
|
|
|
|
// 创建标记并添加到地图上
|
|
|
|
|
const marker = new AMap.Marker({
|
|
|
|
|
position: [lng.value, lat.value], // 设定标记的位置为地图中心点
|
|
|
|
|
zIndex: 100 // 设置标记点的 z-index 值为 100
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 设置标记点的样式
|
|
|
|
|
marker.setIcon(
|
|
|
|
|
new AMap.Icon({
|
|
|
|
|
image: 'https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png', // 使用红色标记点的图标 URL
|
|
|
|
|
size: new AMap.Size(18, 30), // 图标尺寸
|
|
|
|
|
imageSize: new AMap.Size(18, 30) // 图片尺寸
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
marker.setMap(map.value) // 将标记添加到地图上
|
|
|
|
|
}
|
|
|
|
|
if (type === 'match') {
|
|
|
|
|
pagingQuery()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//创建地图
|
|
|
|
|
const initMap = () => {
|
|
|
|
|
map.value = new AMap.Map('draw-station-container', {
|
|
|
|
|
center: [120.1551, 30.2741], // 地图中心点经纬度
|
|
|
|
|
zoom: 10 // 缩放级别
|
|
|
|
|
// center: [120.1551, 30.2741], // 地图中心点经纬度
|
|
|
|
|
zoom: 18 // 缩放级别
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// marker.value = new AMap.Marker({
|
|
|
|
@ -1045,6 +1080,13 @@ const initMap = () => {
|
|
|
|
|
// city: '010' //城市设为北京,默认:“全国”
|
|
|
|
|
// })
|
|
|
|
|
})
|
|
|
|
|
AMap.plugin('AMap.Geocoder', function () {
|
|
|
|
|
geocoder.value = new AMap.Geocoder({
|
|
|
|
|
city: '杭州' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//标记中心点
|
|
|
|
|
getCenterMarker('init')
|
|
|
|
|
|
|
|
|
|
// map.value.add(marker.value)
|
|
|
|
|
}
|
|
|
|
@ -1177,7 +1219,7 @@ const storeItemClick = (item: any, index: number) => {
|
|
|
|
|
// map.value.add(marker.value)
|
|
|
|
|
// 设置定位点和缩放级别
|
|
|
|
|
const targetPosition = [item.lng, item.lat]
|
|
|
|
|
const targetZoom = 10 //设置地图视图级别为
|
|
|
|
|
const targetZoom = 12 //设置地图视图级别为
|
|
|
|
|
|
|
|
|
|
infoWindows.value.open(map.value, targetPosition)
|
|
|
|
|
// 定义定位函数
|
|
|
|
|