飘泊客 1 year ago
commit c5126e5cea

@ -146,6 +146,10 @@ export interface GeopoliticalCustomersStoreDTO {
storeName: string storeName: string
appointTime: any appointTime: any
} }
interface optionItem {
label: string
value: string
}
interface customStoreEntitiesItem { interface customStoreEntitiesItem {
// createBy: number // createBy: number
// updateBy: number // updateBy: number
@ -154,7 +158,7 @@ interface customStoreEntitiesItem {
// customStoreId: number // customStoreId: number
// storeId: number // storeId: number
// customId: number // customId: number
option?: any option?: Array<optionItem>
//门店id //门店id
customStoreId?: number customStoreId?: number
//预约id //预约id
@ -165,6 +169,8 @@ interface customStoreEntitiesItem {
reservationDate?: Dayjs | string reservationDate?: Dayjs | string
//预约时间 //预约时间
reservationTime: string reservationTime: string
//添加禁用
disabled?: boolean
} }
export interface CustomerDTO { export interface CustomerDTO {
customId?: number | undefined customId?: number | undefined

@ -7,6 +7,7 @@
<a-button type="primary" :loading="props.loading" @click="emits('search')"></a-button> <a-button type="primary" :loading="props.loading" @click="emits('search')"></a-button>
<a-button @click="emits('reset')"></a-button> <a-button @click="emits('reset')"></a-button>
</a-space> </a-space>
<!-- <a v-if="props.collapsible" @click="() => toggleCollapsed()"> -->
<a v-if="props.collapsible" @click="() => toggleCollapsed()"> <a v-if="props.collapsible" @click="() => toggleCollapsed()">
{{ innerCollapsed ? '展开' : '收起' }} {{ innerCollapsed ? '展开' : '收起' }}
<DownOutlined v-if="innerCollapsed" /> <DownOutlined v-if="innerCollapsed" />

@ -23,7 +23,7 @@
</template> </template>
<template #menuFooterRender="props"> <template #menuFooterRender="props">
<a <!-- <a
:style="{ :style="{
display: 'flex', display: 'flex',
height: '16px', height: '16px',
@ -34,7 +34,7 @@
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
<!-- <img <img
alt="pro-logo" alt="pro-logo"
src="https://procomponents.ant.design/favicon.ico" src="https://procomponents.ant.design/favicon.ico"
:style="{ :style="{
@ -43,9 +43,9 @@
margin: '0 16px', margin: '0 16px',
marginRight: 10 marginRight: 10
}" }"
/> --> />
<!-- <template v-if="!props?.collapsed"> Preview Pro</template> --> <template v-if="!props?.collapsed"> Preview Pro</template>
</a> </a> -->
</template> </template>
<!-- <template #headerContentRender>--> <!-- <template #headerContentRender>-->

@ -25,7 +25,9 @@
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'operate'"> <template v-if="column.key === 'operate'">
<operation-group> <operation-group>
<a v-if="record.enrollStatus !== 2" @click="handleAudit(record)"></a> <!-- <a v-if="record.enrollStatus !== 2" @click="handleAudit(record)"></a> -->
<a v-if="record.enrollStatus !== 2" @click="handleEdit(record)"></a>
<a v-if="record.enrollStatus !== 2" @click="handleDistribute(record)"></a>
<span v-else>-</span> <span v-else>-</span>
</operation-group> </operation-group>
</template> </template>
@ -87,14 +89,22 @@ const searchTable = (params: GeopoliticalCustomersPageParam) => {
reloadTable(true) // tableRequest reloadTable(true) // tableRequest
} }
// //
const handleAudit = (record: GeopoliticalCustomersRecord) => { const handleEdit = (record: GeopoliticalCustomersRecord) => {
geopoliticalCustomersModalRef.value?.open({ geopoliticalCustomersModalRef.value?.open({
newFormAction: FormAction.UPDATE, newFormAction: FormAction.UPDATE,
type: 'audit', type: 'audit',
record: record record: record
}) })
} }
//
const handleDistribute = (record: GeopoliticalCustomersRecord) => {
geopoliticalCustomersModalRef.value?.open({
newFormAction: FormAction.UPDATE,
type: 'distribute',
record: record
})
}
const columns: ProColumns[] = [ const columns: ProColumns[] = [
{ {

@ -123,7 +123,16 @@ const columns: ProColumns[] = [
}, },
{ {
title: '联系方式', title: '联系方式',
dataIndex: 'customNid' // dataIndex: 'customNid',
customRender: function ({ record }: any) {
if (record.enrollStatus === 2) {
const phoneNumber = record.customNid.toString()
const hiddenPhoneNumber = phoneNumber.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
return h('div', hiddenPhoneNumber)
} else {
return h('div', record.customNid)
}
}
}, },
{ {
title: '报名状态', title: '报名状态',

@ -15,7 +15,7 @@
:rule="formRule" :rule="formRule"
:label-col="{ sm: { span: 24 }, md: { span: 5 } }" :label-col="{ sm: { span: 24 }, md: { span: 5 } }"
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 16 } } ? { sm: { span: 24 }, md: { span: 16 } }
: { sm: { span: 24 }, md: { span: 19 } } : { sm: { span: 24 }, md: { span: 19 } }
" "
@ -26,7 +26,7 @@
:rules="[{ required: true, message: '请输入称呼', trigger: 'blur' }]" :rules="[{ required: true, message: '请输入称呼', trigger: 'blur' }]"
:label-col="{ sm: { span: 24 }, md: { span: 5 } }" :label-col="{ sm: { span: 24 }, md: { span: 5 } }"
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 9 } } ? { sm: { span: 24 }, md: { span: 9 } }
: { sm: { span: 24 }, md: { span: 11 } } : { sm: { span: 24 }, md: { span: 11 } }
" "
@ -35,7 +35,7 @@
v-model:value="formModel.customName" v-model:value="formModel.customName"
placeholder="请输入称呼" placeholder="请输入称呼"
style="width: 65%" style="width: 65%"
:readonly="title === '详情' || title === '审核'" :readonly="title === '详情' || title === '分发'"
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
@ -51,7 +51,7 @@
]" ]"
:label-col="{ sm: { span: 24 }, md: { span: 5 } }" :label-col="{ sm: { span: 24 }, md: { span: 5 } }"
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 9 } } ? { sm: { span: 24 }, md: { span: 9 } }
: { sm: { span: 24 }, md: { span: 11 } } : { sm: { span: 24 }, md: { span: 11 } }
" "
@ -60,7 +60,7 @@
v-model:value="formModel.customNid" v-model:value="formModel.customNid"
placeholder="请输入联系方式" placeholder="请输入联系方式"
style="width: 65%" style="width: 65%"
:readonly="title === '详情' || title === '审核'" :readonly="title === '详情' || title === '分发'"
/> />
</a-form-item> </a-form-item>
<a-row> <a-row>
@ -70,17 +70,22 @@
name="remark" name="remark"
:label-col="{ sm: { span: 24 }, md: { span: 5 } }" :label-col="{ sm: { span: 24 }, md: { span: 5 } }"
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 9 } } ? { sm: { span: 24 }, md: { span: 19 } }
: { 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" v-model:value="formModel.remark"
placeholder="请输入备注" placeholder="请输入备注"
style="width: 100%" :style="{ width: title === '详情' || title === '分发' ? '83%' : '100%' }"
allow-clear :readonly="title === '详情' || title === '分发'"
:readonly="title === '详情' || title === '审核'"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -103,7 +108,7 @@
:disabled="isDisabled" :disabled="isDisabled"
:class="dynamicClass" :class="dynamicClass"
class="readonly-cascader" class="readonly-cascader"
:allow-clear="title === '新建预约' || title === '编辑预约'" :allow-clear="title === '新建预约' || title === '编辑预约' || title === '编辑'"
@change="addressChange" @change="addressChange"
/> />
</a-form-item> </a-form-item>
@ -114,10 +119,11 @@
name="detailAddress" name="detailAddress"
> >
<a-input <a-input
id="tipinput"
v-model:value="formModel.detailAddress" v-model:value="formModel.detailAddress"
placeholder="请输入小区名称" placeholder="请输入小区名称"
:disabled="title === '编辑预约'" :disabled="title === '编辑预约'"
:readonly="title === '详情' || title === '审核'" :readonly="title === '详情' || title === '分发'"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -131,7 +137,7 @@
<a-select <a-select
ref="select" ref="select"
v-model:value="formModel.radius" v-model:value="formModel.radius"
:style="{ width: title === '详情' || title === '审核' ? '37%' : '38%' }" :style="{ width: title === '详情' || title === '分发' ? '37%' : '38%' }"
:options="radiusOptions" :options="radiusOptions"
:field-names="{ label: 'name', value: 'id', options: 'children' }" :field-names="{ label: 'name', value: 'id', options: 'children' }"
:disabled="isDisabled" :disabled="isDisabled"
@ -140,18 +146,21 @@
></a-select> ></a-select>
<div> <div>
<a-button <a-button
v-if="title === '新建预约' || title === '编辑预约'" v-if="title === '新建预约' || title === '编辑预约' || title === '编辑'"
type="primary" type="primary"
@click="match" @click="match"
>匹配</a-button >匹配</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 >重置</a-button
> >
</div> </div>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
v-if="title === '新建预约' || title === '编辑预约'" v-if="title === '新建预约' || title === '编辑预约' || title === '编辑'"
style="display: flex; justify-content: center" style="display: flex; justify-content: center"
> >
<!-- 地图 --> <!-- 地图 -->
@ -245,18 +254,18 @@
<div <div
v-for="(item, index) in formModel.customStoreEntities" v-for="(item, index) in formModel.customStoreEntities"
:key="index" :key="index"
style="display: flex; justify-content: space-between" style="display: flex; justify-content: space-between; align-items: center"
> >
<a-form-item <a-form-item
style="width: 45%" style="width: 45%"
label="预约门店名称" label="预约门店名称"
:label-col=" :label-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 11 } } ? { sm: { span: 24 }, md: { span: 11 } }
: { sm: { span: 24 }, md: { span: 8 } } : { sm: { span: 24 }, md: { span: 8 } }
" "
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 13 } } ? { sm: { span: 24 }, md: { span: 13 } }
: { sm: { span: 24 }, md: { span: 16 } } : { sm: { span: 24 }, md: { span: 16 } }
" "
@ -270,20 +279,20 @@
<a-input <a-input
v-model:value="item.storeName" v-model:value="item.storeName"
placeholder="请输入" placeholder="请输入"
:readonly="title === '详情' || title === '审核'" :readonly="title === '详情' || title === '分发'"
:style="{ width: title === '详情' || title === '审核' ? '103%' : '100%' }" :style="{ width: title === '详情' || title === '分发' ? '103%' : '100%' }"
/> />
</a-form-item> </a-form-item>
<a-form-item <a-form-item
style="width: 30%" style="width: 30%"
label="预约时间" label="预约时间"
:label-col=" :label-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 9 } } ? { sm: { span: 24 }, md: { span: 9 } }
: { sm: { span: 24 }, md: { span: 9 } } : { sm: { span: 24 }, md: { span: 9 } }
" "
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 15 } } ? { sm: { span: 24 }, md: { span: 15 } }
: { sm: { span: 24 }, md: { span: 15 } } : { sm: { span: 24 }, md: { span: 15 } }
" "
@ -298,7 +307,7 @@
<a-date-picker <a-date-picker
v-model:value="item.reservationDate" v-model:value="item.reservationDate"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
:disabled="title === '详情' || title === '审核'" :disabled="title === '详情' || title === '分发'"
:class="reservationTimeClass" :class="reservationTimeClass"
/> />
</a-space> </a-space>
@ -306,12 +315,12 @@
<a-form-item <a-form-item
style="width: 18%" style="width: 18%"
:label-col=" :label-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 0 } } ? { sm: { span: 24 }, md: { span: 0 } }
: { sm: { span: 24 }, md: { span: 0 } } : { sm: { span: 24 }, md: { span: 0 } }
" "
:wrapper-col=" :wrapper-col="
title === '详情' || title === '审核' title === '详情' || title === '分发'
? { sm: { span: 24 }, md: { span: 24 } } ? { sm: { span: 24 }, md: { span: 24 } }
: { sm: { span: 24 }, md: { span: 24 } } : { sm: { span: 24 }, md: { span: 24 } }
" "
@ -326,14 +335,17 @@
<a-select <a-select
ref="select" ref="select"
v-model:value="item.reservationTime" v-model:value="item.reservationTime"
:allow-clear="title === '新建预约' || title === '编辑预约'" :allow-clear="title === '新建预约' || title === '编辑预约' || title === '编辑'"
:options="item.option" :options="item.option"
:class="reservationTimeClass" :class="reservationTimeClass"
:style="{ width: title === '详情' || title === '审核' ? '103%' : '100%' }" :style="{ width: title === '详情' || title === '分发' ? '103%' : '100%' }"
> >
</a-select> </a-select>
</a-space> </a-space>
</a-form-item> </a-form-item>
<a-form-item v-if="title === '新建预约' || title === '编辑预约' || title === '编辑'">
<delete-outlined @click="delReservationStore(item)" />
</a-form-item>
</div> </div>
</div> </div>
</a-form> </a-form>
@ -354,8 +366,17 @@
<a-button v-if="title === ''" type="primary" html-type="submit" @click="visible = false" <a-button v-if="title === ''" type="primary" html-type="submit" @click="visible = false"
>确定</a-button >确定</a-button
> >
<div v-if="title === '审核'"> <div v-if="title === '编辑'">
<a-button @click="retrial"></a-button> <!-- <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 type="primary" html-type="submit" style="margin-left: 10px" @click="distribute"
>分发</a-button >分发</a-button
> >
@ -405,10 +426,6 @@ import type { CustomerDTO, GeopoliticalCustomersRecord } from '@/api/geopolitica
// } // }
onMounted(() => { onMounted(() => {
//
time_array.forEach((item: string) => {
appointmentTimeOptions.value?.push({ value: item, label: item })
})
// //
// provincesAndCitiesAndAutonomousOptions.value = provincesAndCitiesAndAutonomousRegions // provincesAndCitiesAndAutonomousOptions.value = provincesAndCitiesAndAutonomousRegions
provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions
@ -463,59 +480,7 @@ const radiusChange = (value: SelectValue) => {
// //
const listData: any = ref([]) 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 generateTimeSlots = (tradeStartTime: string, tradeEndTime: string) => {
const startHour = Number(tradeStartTime.split(':')[0]) const startHour = Number(tradeStartTime.split(':')[0])
const startMinute = Number(tradeStartTime.split(':')[1]) const startMinute = Number(tradeStartTime.split(':')[1])
@ -591,16 +556,6 @@ const pagingQuery = () => {
result.data && result.data &&
result.data.forEach((item: any) => { result.data.forEach((item: any) => {
const disabled = ids.includes(Number(item.id)) 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({ listData.value.push({
title: item.storeName, title: item.storeName,
description: item.address, description: item.address,
@ -614,11 +569,10 @@ const pagingQuery = () => {
reservationDate: item.reservationDate, reservationDate: item.reservationDate,
option: generateTimeSlots(item.tradeStartTime, item.tradeEndTime) option: generateTimeSlots(item.tradeStartTime, item.tradeEndTime)
}) })
console.log(listData.value, 'listData.value')
}) })
pois.push(...listData.value) pois.push(...listData.value)
// , // ,
const targetZoom = 10 const targetZoom = 12
// //
const placeSearch_CallBack = (data: any) => { const placeSearch_CallBack = (data: any) => {
@ -672,6 +626,7 @@ const pagingQuery = () => {
} }
) )
} }
// //
const match = () => { const match = () => {
const fields = ['address', 'detailAddress', 'radius'] // const fields = ['address', 'detailAddress', 'radius'] //
@ -685,19 +640,11 @@ const match = () => {
map.value.clearMap() map.value.clearMap()
AMap.plugin('AMap.Geocoder', function () { AMap.plugin('AMap.Geocoder', function () {
geocoder.value = new AMap.Geocoder({ geocoder.value = new AMap.Geocoder({
city: '杭州' // city adcode citycode city: '全国' // city adcode citycode
}) })
}) })
const addressValue = //
formModel.address?.toString().split(',').join('') + formModel.detailAddress getCenterMarker('match')
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()
})
}) })
.catch(() => { .catch(() => {
// //
@ -726,19 +673,33 @@ const addStore = (item: any) => {
reservationTime: '', reservationTime: '',
storeId: item.id, storeId: item.id,
reservationDate: '', 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 = () => { const storeResetForm = () => {
formModel.customName = '' formModel.customName = ''
formModel.customNid = '' formModel.customNid = ''
formModel.remark = ''
if (title.value !== '编辑预约') { if (title.value !== '编辑预约') {
formModel.address = [] formModel.address = []
formModel.detailAddress = '' formModel.detailAddress = ''
formModel.radius = '' formModel.radius = ''
formModel.customStoreEntities.length = 0
} }
formModel.customStoreEntities.length = 0
listData.value.length = 0 listData.value.length = 0
// //
@ -776,7 +737,7 @@ interface customStoreEntitiesItem {
//, //,
const isSubmit = ref(false) const isSubmit = ref(false)
// //
const submitOperate = (type: string, status?: number) => { const submitOperate = () => {
//address //address
const filteredObj = Object.fromEntries( const filteredObj = Object.fromEntries(
Object.entries(formModel).filter(([key]) => key !== 'address') Object.entries(formModel).filter(([key]) => key !== 'address')
@ -789,7 +750,7 @@ const submitOperate = (type: string, status?: number) => {
reservationTime: item.reservationTime, reservationTime: item.reservationTime,
reservationDate: item.reservationDate reservationDate: item.reservationDate
} }
if (title.value === '编辑预约') { if (title.value === '编辑预约' || title.value === '编辑') {
if (item.customStoreId) { if (item.customStoreId) {
obj.customStoreId = 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 const requestFn = title.value === '新建预约' ? addCustomer : updateCustomer
doRequest(requestFn(filteredObj), { doRequest(requestFn(filteredObj), {
onSuccess: handleSuccess onSuccess: handleSuccess
}) })
} else if (title.value === '审核') { } else if (title.value === '分发') {
doRequest(auditCustomer({ customId: formModel.customId, status: status }), { doRequest(auditCustomer({ customId: formModel.customId, status: 1 }), {
onSuccess: handleSuccess onSuccess: handleSuccess
}) })
} }
} }
// //
const handleOk = async () => { const handleOk = async () => {
if (title.value === '审核') { await submitOperate()
//
await submitOperate('cs', 1)
} else {
//
await submitOperate('bm')
}
} }
// //
const temporaryStorage = async () => { const temporaryStorage = async () => {
@ -839,7 +794,7 @@ const temporaryStorage = async () => {
message.info('请先添加预约门店') message.info('请先添加预约门店')
} else { } else {
formModel.enrollStatus = 0 formModel.enrollStatus = 0
submitOperate('zc') submitOperate()
// handleSubmit() // handleSubmit()
} }
}) })
@ -849,9 +804,9 @@ const temporaryStorage = async () => {
} }
// //
const retrial = () => { // const retrial = () => {
submitOperate('cs', 0) // submitOperate()
} // }
// //
const distribute = () => { const distribute = () => {
registerVisible.value = true 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}$/ } { 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() formRef.value?.resetFields()
// resetFields.value() // resetFields.value()
delete formModel.description delete formModel.description
@ -971,8 +926,23 @@ defineExpose({
formModel.detailAddress = detailAddress formModel.detailAddress = detailAddress
formModel.radius = radius formModel.radius = radius
formModel.customStoreEntities.push(...customStoreVOList) 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 = () => { const handleMapInit = () => {
nextTick(() => { nextTick(() => {
initMap() initMap()
@ -991,17 +961,27 @@ defineExpose({
isReadOnly.value = true isReadOnly.value = true
reservationTimeisReadOnly.value = true reservationTimeisReadOnly.value = true
title.value = '详情' 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 isReadOnly.value = true
reservationTimeisReadOnly.value = true reservationTimeisReadOnly.value = true
handleMapInit() handleMapInit()
title.value = '审核' title.value = '分发'
formModel.description = 1 formModel.description = 1
} else {
isDisabled.value = true
handleMapInit()
title.value = '编辑预约'
} }
// else {
// isDisabled.value = true
// handleMapInit()
// title.value = ''
// }
} }
formAction.value = opendata.newFormAction formAction.value = opendata.newFormAction
} }
@ -1020,6 +1000,8 @@ const filter: ShowSearchType['filter'] = (inputValue, path) => {
//AMap.Autocomplete //AMap.Autocomplete
const autoComplete = ref() const autoComplete = ref()
//POIAMap.PlaceSearch //POIAMap.PlaceSearch
const placeSearch = ref()
//POIAMap.PlaceSearch
// const placeSearch = ref() // const placeSearch = ref()
//AMap.Marker //AMap.Marker
// Marker // Marker
@ -1031,12 +1013,64 @@ const map = ref<any>({})
// AMap.GeocodergetAddress // AMap.GeocodergetAddress
const geocoder = ref<any>({}) 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 = () => { const initMap = () => {
map.value = new AMap.Map('draw-station-container', { map.value = new AMap.Map('draw-station-container', {
center: [120.1551, 30.2741], // // center: [120.1551, 30.2741], //
zoom: 10 // zoom: 18 //
}) })
// marker.value = new AMap.Marker({ // marker.value = new AMap.Marker({
@ -1070,6 +1104,27 @@ const initMap = () => {
// city: '010' // // 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) // map.value.add(marker.value)
} }
@ -1202,7 +1257,7 @@ const storeItemClick = (item: any, index: number) => {
// map.value.add(marker.value) // map.value.add(marker.value)
// //
const targetPosition = [item.lng, item.lat] const targetPosition = [item.lng, item.lat]
const targetZoom = 10 // const targetZoom = 12 //
infoWindows.value.open(map.value, targetPosition) infoWindows.value.open(map.value, targetPosition)
// //

@ -18,11 +18,11 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="8" :md="12" :sm="24"> <!-- <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="联系方式"> <a-form-item label="联系方式">
<a-input v-model:value="formModel.customNid" placeholder="请输入" /> <a-input v-model:value="formModel.customNid" placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col> -->
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="填写时间"> <a-form-item label="填写时间">
<a-range-picker <a-range-picker

@ -182,6 +182,15 @@ defineExpose({
record = res.data record = res.data
record.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}` record.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}`
overrideProperties(formModel, record) overrideProperties(formModel, record)
record.customStoreVOList.forEach((item: any) => {
const targetObj = formModel.customStoreVOList.find(
(i: any) => i.storeId === item.storeId
)
if (targetObj) {
targetObj.reservationTime =
item.reservationDate.split(' ')[0] + ' ' + item.reservationTime
}
})
formAction.value = newFormAction formAction.value = newFormAction
} }
}) })

@ -118,8 +118,8 @@ const search = () => {
param.distributeStartTime = distributeTime.value[0].format('YYYY-MM-DD HH:mm:ss') param.distributeStartTime = distributeTime.value[0].format('YYYY-MM-DD HH:mm:ss')
param.distributeEndTime = distributeTime.value[1].format('YYYY-MM-DD HH:mm:ss') param.distributeEndTime = distributeTime.value[1].format('YYYY-MM-DD HH:mm:ss')
} else { } else {
param.startTime = '' param.distributeStartTime = ''
param.endTime = '' param.distributeEndTime = ''
} }
emits('search', param) emits('search', param)
} }

@ -137,6 +137,7 @@ import { reactive, ref, onMounted, toRefs } from 'vue'
import { useModal } from '@/hooks/modal' import { useModal } from '@/hooks/modal'
import type { FormRequestMapping } from '@/hooks/form' import type { FormRequestMapping } from '@/hooks/form'
import { overrideProperties } from '@/utils/bean-utils' import { overrideProperties } from '@/utils/bean-utils'
import { message } from 'ant-design-vue'
// import type { shopDTO } from '@/api/geopoliticalCustomers/types' // import type { shopDTO } from '@/api/geopoliticalCustomers/types'
import { storeUserQueryAll, createUser, updateUser } from '@/api/shopManage/index' import { storeUserQueryAll, createUser, updateUser } from '@/api/shopManage/index'
import { provincesAndCitiesAndAutonomousRegions } from '@/utils/geopolitical-customers' import { provincesAndCitiesAndAutonomousRegions } from '@/utils/geopolitical-customers'
@ -272,30 +273,35 @@ const handleClose = () => {
/* 表单提交处理 */ /* 表单提交处理 */
const handleSubmit = () => { const handleSubmit = () => {
formRef.value?.validate().then(res => { formRef.value?.validate().then(res => {
const addkey: any = {} if (anchorData && anchorData.location && anchorData.location.lng) {
if (title.value == '添加门店') { console.log(anchorData.location, 'anchorData.location')
addkey.province = anchorData.pname const addkey: any = {}
addkey.city = anchorData.cityname if (title.value == '添加门店') {
addkey.county = anchorData.adname addkey.province = anchorData.pname
addkey.detail = anchorData.address addkey.city = anchorData.cityname
addkey.longitude = anchorData.location.lng addkey.county = anchorData.adname
addkey.latitude = anchorData.location.lat addkey.detail = anchorData.address
} addkey.longitude = anchorData.location.lng
anchorData && addkey.latitude = anchorData.location.lat
validateAndSubmit( }
{ anchorData &&
...formModel, validateAndSubmit(
...addkey, {
tradeStartTime: formModel.tradeTime[0], ...formModel,
tradeEndTime: formModel.tradeTime[1] ...addkey,
}, tradeStartTime: formModel.tradeTime[0],
{ tradeEndTime: formModel.tradeTime[1]
onSuccess: () => { },
closeModal() {
emits('submit-success') onSuccess: () => {
closeModal()
emits('submit-success')
}
} }
} )
) } else {
message.info('请先选择具体门店')
}
}) })
} }
defineExpose({ defineExpose({
@ -465,5 +471,4 @@ defineExpose({
max-height: 70vh; max-height: 70vh;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>

@ -22,13 +22,13 @@ import { antdvStyleDeps } from './src/utils/resolvers'
//项目 //项目
// const serverAddress = 'http://admin.ballcat.cn' // const serverAddress = 'http://admin.ballcat.cn'
//xy //xy
// const serverAddress = 'http://172.18.0.225:8000' const serverAddress = 'http://172.18.0.225:8000'
//jt //jt
// const serverAddress = 'http://172.18.1.8:8000' // const serverAddress = 'http://172.18.1.8:8000'
//ts //ts
// const serverAddress = 'http://172.18.0.228:8000' // const serverAddress = 'http://172.18.0.228:8000'
//测试 //测试
const serverAddress = 'http://39.100.77.21:8000' // const serverAddress = 'http://39.100.77.21:8000'
//线上ip //线上ip
// const serverAddress = 'http://175.27.212.74:80' // const serverAddress = 'http://175.27.212.74:80'

Loading…
Cancel
Save