|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
:rule="formRule"
|
|
|
|
|
:label-col="{ sm: { span: 24 }, md: { span: 5 } }"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 16 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 19 } }
|
|
|
|
|
"
|
|
|
|
@ -26,7 +26,7 @@
|
|
|
|
|
:rules="[{ required: true, message: '请输入称呼', trigger: 'blur' }]"
|
|
|
|
|
:label-col="{ sm: { span: 24 }, md: { span: 5 } }"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 9 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 11 } }
|
|
|
|
|
"
|
|
|
|
@ -35,7 +35,7 @@
|
|
|
|
|
v-model:value="formModel.customName"
|
|
|
|
|
placeholder="请输入称呼"
|
|
|
|
|
style="width: 65%"
|
|
|
|
|
:readonly="title === '详情' || title === '审核'"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
@ -51,7 +51,7 @@
|
|
|
|
|
]"
|
|
|
|
|
:label-col="{ sm: { span: 24 }, md: { span: 5 } }"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 9 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 11 } }
|
|
|
|
|
"
|
|
|
|
@ -60,7 +60,7 @@
|
|
|
|
|
v-model:value="formModel.customNid"
|
|
|
|
|
placeholder="请输入联系方式"
|
|
|
|
|
style="width: 65%"
|
|
|
|
|
:readonly="title === '详情' || title === '审核'"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-row>
|
|
|
|
@ -70,17 +70,22 @@
|
|
|
|
|
name="remark"
|
|
|
|
|
:label-col="{ sm: { span: 24 }, md: { span: 5 } }"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 9 } }
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 19 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 19 } }
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<a-input
|
|
|
|
|
<!-- <a-input
|
|
|
|
|
v-model:value="formModel.remark"
|
|
|
|
|
placeholder="请输入备注"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '83%' : '100%' }"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
/> -->
|
|
|
|
|
<a-textarea
|
|
|
|
|
v-model:value="formModel.remark"
|
|
|
|
|
placeholder="请输入备注"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
allow-clear
|
|
|
|
|
:readonly="title === '详情' || title === '审核'"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '83%' : '100%' }"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
@ -103,7 +108,7 @@
|
|
|
|
|
:disabled="isDisabled"
|
|
|
|
|
:class="dynamicClass"
|
|
|
|
|
class="readonly-cascader"
|
|
|
|
|
:allow-clear="title === '新建预约' || title === '编辑预约'"
|
|
|
|
|
:allow-clear="title === '新建预约' || title === '编辑预约' || title === '编辑'"
|
|
|
|
|
@change="addressChange"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
@ -114,10 +119,11 @@
|
|
|
|
|
name="detailAddress"
|
|
|
|
|
>
|
|
|
|
|
<a-input
|
|
|
|
|
id="tipinput"
|
|
|
|
|
v-model:value="formModel.detailAddress"
|
|
|
|
|
placeholder="请输入小区名称"
|
|
|
|
|
:disabled="title === '编辑预约'"
|
|
|
|
|
:readonly="title === '详情' || title === '审核'"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
@ -131,7 +137,7 @@
|
|
|
|
|
<a-select
|
|
|
|
|
ref="select"
|
|
|
|
|
v-model:value="formModel.radius"
|
|
|
|
|
:style="{ width: title === '详情' || title === '审核' ? '37%' : '38%' }"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '37%' : '38%' }"
|
|
|
|
|
:options="radiusOptions"
|
|
|
|
|
:field-names="{ label: 'name', value: 'id', options: 'children' }"
|
|
|
|
|
:disabled="isDisabled"
|
|
|
|
@ -140,18 +146,21 @@
|
|
|
|
|
></a-select>
|
|
|
|
|
<div>
|
|
|
|
|
<a-button
|
|
|
|
|
v-if="title === '新建预约' || title === '编辑预约'"
|
|
|
|
|
v-if="title === '新建预约' || title === '编辑预约' || title === '编辑'"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="match"
|
|
|
|
|
>匹配</a-button
|
|
|
|
|
>
|
|
|
|
|
<a-button v-if="title === '新建预约'" style="margin-left: 10px" @click="resetForm"
|
|
|
|
|
<a-button
|
|
|
|
|
v-if="title === '新建预约' || title === '编辑'"
|
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
@click="resetForm"
|
|
|
|
|
>重置</a-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
|
v-if="title === '新建预约' || title === '编辑预约'"
|
|
|
|
|
v-if="title === '新建预约' || title === '编辑预约' || title === '编辑'"
|
|
|
|
|
style="display: flex; justify-content: center"
|
|
|
|
|
>
|
|
|
|
|
<!-- 地图 -->
|
|
|
|
@ -245,18 +254,18 @@
|
|
|
|
|
<div
|
|
|
|
|
v-for="(item, index) in formModel.customStoreEntities"
|
|
|
|
|
:key="index"
|
|
|
|
|
style="display: flex; justify-content: space-between"
|
|
|
|
|
style="display: flex; justify-content: space-between; align-items: center"
|
|
|
|
|
>
|
|
|
|
|
<a-form-item
|
|
|
|
|
style="width: 45%"
|
|
|
|
|
label="预约门店名称"
|
|
|
|
|
:label-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 11 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 8 } }
|
|
|
|
|
"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 13 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 16 } }
|
|
|
|
|
"
|
|
|
|
@ -270,20 +279,20 @@
|
|
|
|
|
<a-input
|
|
|
|
|
v-model:value="item.storeName"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
:readonly="title === '详情' || title === '审核'"
|
|
|
|
|
:style="{ width: title === '详情' || title === '审核' ? '103%' : '100%' }"
|
|
|
|
|
:readonly="title === '详情' || title === '分发'"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '103%' : '100%' }"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item
|
|
|
|
|
style="width: 30%"
|
|
|
|
|
label="预约时间"
|
|
|
|
|
:label-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 9 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 9 } }
|
|
|
|
|
"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 15 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 15 } }
|
|
|
|
|
"
|
|
|
|
@ -298,7 +307,7 @@
|
|
|
|
|
<a-date-picker
|
|
|
|
|
v-model:value="item.reservationDate"
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
:disabled="title === '详情' || title === '审核'"
|
|
|
|
|
:disabled="title === '详情' || title === '分发'"
|
|
|
|
|
:class="reservationTimeClass"
|
|
|
|
|
/>
|
|
|
|
|
</a-space>
|
|
|
|
@ -306,12 +315,12 @@
|
|
|
|
|
<a-form-item
|
|
|
|
|
style="width: 18%"
|
|
|
|
|
:label-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 0 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 0 } }
|
|
|
|
|
"
|
|
|
|
|
:wrapper-col="
|
|
|
|
|
title === '详情' || title === '审核'
|
|
|
|
|
title === '详情' || title === '分发'
|
|
|
|
|
? { sm: { span: 24 }, md: { span: 24 } }
|
|
|
|
|
: { sm: { span: 24 }, md: { span: 24 } }
|
|
|
|
|
"
|
|
|
|
@ -326,14 +335,17 @@
|
|
|
|
|
<a-select
|
|
|
|
|
ref="select"
|
|
|
|
|
v-model:value="item.reservationTime"
|
|
|
|
|
:allow-clear="title === '新建预约' || title === '编辑预约'"
|
|
|
|
|
:allow-clear="title === '新建预约' || title === '编辑预约' || title === '编辑'"
|
|
|
|
|
:options="item.option"
|
|
|
|
|
:class="reservationTimeClass"
|
|
|
|
|
:style="{ width: title === '详情' || title === '审核' ? '103%' : '100%' }"
|
|
|
|
|
:style="{ width: title === '详情' || title === '分发' ? '103%' : '100%' }"
|
|
|
|
|
>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-space>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item v-if="title === '新建预约' || title === '编辑预约' || title === '编辑'">
|
|
|
|
|
<delete-outlined @click="delReservationStore(item)" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form>
|
|
|
|
@ -354,8 +366,17 @@
|
|
|
|
|
<a-button v-if="title === '详情'" type="primary" html-type="submit" @click="visible = false"
|
|
|
|
|
>确定</a-button
|
|
|
|
|
>
|
|
|
|
|
<div v-if="title === '审核'">
|
|
|
|
|
<a-button @click="retrial">重审</a-button>
|
|
|
|
|
<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
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="title === '分发'">
|
|
|
|
|
<!-- <a-button @click="retrial">重审</a-button> -->
|
|
|
|
|
<a-button @click="handleClose">取消</a-button>
|
|
|
|
|
<a-button type="primary" html-type="submit" style="margin-left: 10px" @click="distribute"
|
|
|
|
|
>分发</a-button
|
|
|
|
|
>
|
|
|
|
@ -405,10 +426,6 @@ import type { CustomerDTO, GeopoliticalCustomersRecord } from '@/api/geopolitica
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
//把半小时一个时间区间数据赋值给预约时间下拉框列表数据
|
|
|
|
|
time_array.forEach((item: string) => {
|
|
|
|
|
appointmentTimeOptions.value?.push({ value: item, label: item })
|
|
|
|
|
})
|
|
|
|
|
//省市区下拉框列表数据
|
|
|
|
|
// provincesAndCitiesAndAutonomousOptions.value = provincesAndCitiesAndAutonomousRegions
|
|
|
|
|
provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions
|
|
|
|
@ -463,59 +480,7 @@ const radiusChange = (value: SelectValue) => {
|
|
|
|
|
//根据地址搜索出来的门店数据
|
|
|
|
|
const listData: any = ref([])
|
|
|
|
|
|
|
|
|
|
//预约时间下拉框列表数据
|
|
|
|
|
const appointmentTimeOptions = ref<any>([])
|
|
|
|
|
const time_array = [
|
|
|
|
|
'0:00~0:30',
|
|
|
|
|
'0:30~1:00',
|
|
|
|
|
'1:00~1:30',
|
|
|
|
|
'1:30~2:00',
|
|
|
|
|
'2:00~2:30',
|
|
|
|
|
'2:30~3:00',
|
|
|
|
|
'3:00~3:30',
|
|
|
|
|
'3:30~4:00',
|
|
|
|
|
'4:00~4:30',
|
|
|
|
|
'4:30~5:00',
|
|
|
|
|
'5:00~5:30',
|
|
|
|
|
'5:30~6:00',
|
|
|
|
|
'6:00~6:30',
|
|
|
|
|
'6:30~7:00',
|
|
|
|
|
'7:00~7:30',
|
|
|
|
|
'7:30~8:00',
|
|
|
|
|
'8:00~8:30',
|
|
|
|
|
'8:30~9:00',
|
|
|
|
|
'9:00~9:30',
|
|
|
|
|
'9:30~10:00',
|
|
|
|
|
'10:00~10:30',
|
|
|
|
|
'10:30~11:00',
|
|
|
|
|
'11:00~11:30',
|
|
|
|
|
'11:30~12:00',
|
|
|
|
|
'12:00~12:30',
|
|
|
|
|
'12:30~13:00',
|
|
|
|
|
'13:00~13:30',
|
|
|
|
|
'13:30~14:00',
|
|
|
|
|
'14:00~14:30',
|
|
|
|
|
'14:30~15:00',
|
|
|
|
|
'15:00~15:30',
|
|
|
|
|
'15:30~16:00',
|
|
|
|
|
'16:00~16:30',
|
|
|
|
|
'16:30~17:00',
|
|
|
|
|
'17:00~17:30',
|
|
|
|
|
'17:30~18:00',
|
|
|
|
|
'18:00~18:30',
|
|
|
|
|
'18:30~19:00',
|
|
|
|
|
'19:00~19:30',
|
|
|
|
|
'19:30~20:00',
|
|
|
|
|
'20:00~20:30',
|
|
|
|
|
'20:30~21:00',
|
|
|
|
|
'21:00~21:30',
|
|
|
|
|
'21:30~22:00',
|
|
|
|
|
'22:00~22:30',
|
|
|
|
|
'22:30~23:00',
|
|
|
|
|
'23:00~23:30',
|
|
|
|
|
'23:30~0:00'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
//预约时间下拉框列表数据(根据后端返回的营业时间生成)
|
|
|
|
|
const generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => {
|
|
|
|
|
const startHour = Number(tradeStartTime.split(':')[0])
|
|
|
|
|
const startMinute = Number(tradeStartTime.split(':')[1])
|
|
|
|
@ -591,16 +556,6 @@ const pagingQuery = () => {
|
|
|
|
|
result.data &&
|
|
|
|
|
result.data.forEach((item: any) => {
|
|
|
|
|
const disabled = ids.includes(Number(item.id))
|
|
|
|
|
// console.log(
|
|
|
|
|
// generateTimeSlots(item.tradeStartTime, item.tradeEndTime),
|
|
|
|
|
// 'generateTimeSlots(item.tradeStartTime, item.tradeEndTime)'
|
|
|
|
|
// )
|
|
|
|
|
// generateTimeSlots(item.tradeStartTime, item.tradeEndTime).forEach((i: string) => {
|
|
|
|
|
// generateTimeSlots(item.tradeStartTime, item.tradeEndTime).push({
|
|
|
|
|
// value: i,
|
|
|
|
|
// label: i
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
listData.value.push({
|
|
|
|
|
title: item.storeName,
|
|
|
|
|
description: item.address,
|
|
|
|
@ -614,11 +569,10 @@ const pagingQuery = () => {
|
|
|
|
|
reservationDate: item.reservationDate,
|
|
|
|
|
option: generateTimeSlots(item.tradeStartTime, item.tradeEndTime)
|
|
|
|
|
})
|
|
|
|
|
console.log(listData.value, 'listData.value')
|
|
|
|
|
})
|
|
|
|
|
pois.push(...listData.value)
|
|
|
|
|
// 设置缩放级别,设置地图视图级别为
|
|
|
|
|
const targetZoom = 10
|
|
|
|
|
const targetZoom = 12
|
|
|
|
|
|
|
|
|
|
//回调函数
|
|
|
|
|
const placeSearch_CallBack = (data: any) => {
|
|
|
|
@ -672,6 +626,7 @@ const pagingQuery = () => {
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//匹配
|
|
|
|
|
const match = () => {
|
|
|
|
|
const fields = ['address', 'detailAddress', 'radius'] // 指定要校验的字段名
|
|
|
|
@ -685,19 +640,11 @@ const match = () => {
|
|
|
|
|
map.value.clearMap()
|
|
|
|
|
AMap.plugin('AMap.Geocoder', function () {
|
|
|
|
|
geocoder.value = new AMap.Geocoder({
|
|
|
|
|
city: '杭州' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
|
|
|
|
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(() => {
|
|
|
|
|
// 校验失败
|
|
|
|
@ -726,19 +673,33 @@ const addStore = (item: any) => {
|
|
|
|
|
reservationTime: '',
|
|
|
|
|
storeId: item.id,
|
|
|
|
|
reservationDate: '',
|
|
|
|
|
option: item.option
|
|
|
|
|
option: item.option,
|
|
|
|
|
disabled: item.disabled
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除预约门店
|
|
|
|
|
const delReservationStore = (i: any) => {
|
|
|
|
|
listData.value.forEach((item: any) => {
|
|
|
|
|
if (item.id == i.storeId) {
|
|
|
|
|
item.disabled = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
formModel.customStoreEntities = formModel.customStoreEntities.filter((item: any) => {
|
|
|
|
|
return item.storeId != i.storeId
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//门店重置
|
|
|
|
|
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
|
|
|
|
|
// 清除地图上的所有标记物
|
|
|
|
@ -776,7 +737,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')
|
|
|
|
@ -789,7 +750,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
|
|
|
|
|
}
|
|
|
|
@ -809,26 +770,20 @@ const submitOperate = (type: string, status?: number) => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (title.value === '新建预约' || title.value === '编辑预约') {
|
|
|
|
|
if (title.value === '新建预约' || title.value === '编辑预约' || title.value === '编辑') {
|
|
|
|
|
const requestFn = title.value === '新建预约' ? addCustomer : updateCustomer
|
|
|
|
|
doRequest(requestFn(filteredObj), {
|
|
|
|
|
onSuccess: handleSuccess
|
|
|
|
|
})
|
|
|
|
|
} else if (title.value === '审核') {
|
|
|
|
|
doRequest(auditCustomer({ customId: formModel.customId, status: status }), {
|
|
|
|
|
} else if (title.value === '分发') {
|
|
|
|
|
doRequest(auditCustomer({ customId: formModel.customId, status: 1 }), {
|
|
|
|
|
onSuccess: handleSuccess
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//报名信息确认弹窗确定点击事件
|
|
|
|
|
const handleOk = async () => {
|
|
|
|
|
if (title.value === '审核') {
|
|
|
|
|
//重审
|
|
|
|
|
await submitOperate('cs', 1)
|
|
|
|
|
} else {
|
|
|
|
|
//报名
|
|
|
|
|
await submitOperate('bm')
|
|
|
|
|
}
|
|
|
|
|
await submitOperate()
|
|
|
|
|
}
|
|
|
|
|
//暂存
|
|
|
|
|
const temporaryStorage = async () => {
|
|
|
|
@ -839,7 +794,7 @@ const temporaryStorage = async () => {
|
|
|
|
|
message.info('请先添加预约门店')
|
|
|
|
|
} else {
|
|
|
|
|
formModel.enrollStatus = 0
|
|
|
|
|
submitOperate('zc')
|
|
|
|
|
submitOperate()
|
|
|
|
|
// handleSubmit()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -849,9 +804,9 @@ const temporaryStorage = async () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//重审
|
|
|
|
|
const retrial = () => {
|
|
|
|
|
submitOperate('cs', 0)
|
|
|
|
|
}
|
|
|
|
|
// const retrial = () => {
|
|
|
|
|
// submitOperate()
|
|
|
|
|
// }
|
|
|
|
|
//分发
|
|
|
|
|
const distribute = () => {
|
|
|
|
|
registerVisible.value = true
|
|
|
|
@ -926,7 +881,7 @@ const handleClose = () => {
|
|
|
|
|
{ required: true, message: '请输入正确的手机号码', pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/ }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
listData.value.length = 0
|
|
|
|
|
// listData.value.length = 0
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
// resetFields.value()
|
|
|
|
|
delete formModel.description
|
|
|
|
@ -971,8 +926,23 @@ defineExpose({
|
|
|
|
|
formModel.detailAddress = detailAddress
|
|
|
|
|
formModel.radius = radius
|
|
|
|
|
formModel.customStoreEntities.push(...customStoreVOList)
|
|
|
|
|
}
|
|
|
|
|
//获取预约时间段下拉框回显数据
|
|
|
|
|
formModel.customStoreEntities.forEach((i: any) => {
|
|
|
|
|
i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime)
|
|
|
|
|
})
|
|
|
|
|
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()
|
|
|
|
@ -991,17 +961,27 @@ defineExpose({
|
|
|
|
|
isReadOnly.value = true
|
|
|
|
|
reservationTimeisReadOnly.value = true
|
|
|
|
|
title.value = '详情'
|
|
|
|
|
} else if (opendata.type === 'audit') {
|
|
|
|
|
}
|
|
|
|
|
// 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 = '审核'
|
|
|
|
|
title.value = '分发'
|
|
|
|
|
formModel.description = 1
|
|
|
|
|
} else {
|
|
|
|
|
isDisabled.value = true
|
|
|
|
|
handleMapInit()
|
|
|
|
|
title.value = '编辑预约'
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
// isDisabled.value = true
|
|
|
|
|
// handleMapInit()
|
|
|
|
|
|
|
|
|
|
// title.value = '编辑预约'
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
formAction.value = opendata.newFormAction
|
|
|
|
|
}
|
|
|
|
@ -1020,6 +1000,8 @@ const filter: ShowSearchType['filter'] = (inputValue, path) => {
|
|
|
|
|
//输入提示插件AMap.Autocomplete
|
|
|
|
|
const autoComplete = ref()
|
|
|
|
|
//POI搜索插件AMap.PlaceSearch
|
|
|
|
|
const placeSearch = ref()
|
|
|
|
|
//POI搜索插件AMap.PlaceSearch
|
|
|
|
|
// const placeSearch = ref()
|
|
|
|
|
//点标记AMap.Marker
|
|
|
|
|
//创建的一个 Marker 实例
|
|
|
|
@ -1031,12 +1013,64 @@ 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 performQuery = (selectedTip: any) => {
|
|
|
|
|
const geocoder = new AMap.Geocoder()
|
|
|
|
|
const location = selectedTip.location
|
|
|
|
|
|
|
|
|
|
// 使用地理编码查询
|
|
|
|
|
geocoder.getAddress(location, function (status: any, result: any) {
|
|
|
|
|
if (status === 'complete' && result.info === 'OK') {
|
|
|
|
|
// 处理查询结果
|
|
|
|
|
const address = result.regeocode.formattedAddress
|
|
|
|
|
console.log('查询结果:', address)
|
|
|
|
|
// 进行其他操作...
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//创建地图
|
|
|
|
|
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({
|
|
|
|
@ -1070,6 +1104,27 @@ const initMap = () => {
|
|
|
|
|
// city: '010' //城市设为北京,默认:“全国”
|
|
|
|
|
// })
|
|
|
|
|
})
|
|
|
|
|
// AMap.plugin('AMap.PlaceSearch', function () {
|
|
|
|
|
// // PlaceSearch
|
|
|
|
|
// const placeOptions = {
|
|
|
|
|
// map: map.value
|
|
|
|
|
// }
|
|
|
|
|
// placeSearch.value = new AMap.PlaceSearch(placeOptions)
|
|
|
|
|
// })
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
autoComplete.value?.on('select', (e: any) => {
|
|
|
|
|
const selectedTip = e.poi // 获取用户选择的提示结果对象
|
|
|
|
|
formModel.detailAddress = selectedTip.name // 将选中的提示项名称赋值给输入框的值(使用 v-model 来绑定)
|
|
|
|
|
performQuery(selectedTip) // 执行查询操作
|
|
|
|
|
})
|
|
|
|
|
}, 300)
|
|
|
|
|
AMap.plugin('AMap.Geocoder', function () {
|
|
|
|
|
geocoder.value = new AMap.Geocoder({
|
|
|
|
|
city: '全国' // city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//标记中心点
|
|
|
|
|
getCenterMarker('init')
|
|
|
|
|
|
|
|
|
|
// map.value.add(marker.value)
|
|
|
|
|
}
|
|
|
|
@ -1202,7 +1257,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)
|
|
|
|
|
// 定义定位函数
|
|
|
|
|