|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap"> |
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap"> |
|
|
|
<el-tabs v-model="tabName"> |
|
|
|
<el-tabs v-model="tabName" @tab-change="changeTab"> |
|
|
|
<el-tab-pane label="线索信息" name="info"> |
|
|
|
<el-tab-pane label="线索信息" name="info"> |
|
|
|
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" /> |
|
|
|
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" /> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
@ -41,6 +41,8 @@ |
|
|
|
<template #default="{ row }"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model="row.content" |
|
|
|
v-model="row.content" |
|
|
|
|
|
|
|
type="textarea" |
|
|
|
|
|
|
|
:autoSize="{ minRows: 2 }" |
|
|
|
placeholder="输入跟进内容" |
|
|
|
placeholder="输入跟进内容" |
|
|
|
:disabled="!row.editable" |
|
|
|
:disabled="!row.editable" |
|
|
|
/> |
|
|
|
/> |
|
|
@ -60,18 +62,15 @@ |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map"> |
|
|
|
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map"> |
|
|
|
<div class="flex justify-between items-center"> |
|
|
|
<div class="flex justify-between items-center"> |
|
|
|
<el-select |
|
|
|
<el-autocomplete |
|
|
|
v-model="areaValue" |
|
|
|
v-model="areaValue" |
|
|
|
filterable |
|
|
|
|
|
|
|
clearable |
|
|
|
clearable |
|
|
|
remote |
|
|
|
|
|
|
|
style="width: 250px" |
|
|
|
style="width: 250px" |
|
|
|
reserve-keyword |
|
|
|
|
|
|
|
placeholder="输入并搜索位置" |
|
|
|
placeholder="输入并搜索位置" |
|
|
|
:remote-method="remoteMethod" |
|
|
|
:fetch-suggestions="remoteMethod" |
|
|
|
@change="currentSelect" |
|
|
|
@select="currentSelect" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
<!-- <el-option |
|
|
|
v-for="item in areaList" |
|
|
|
v-for="item in areaList" |
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:label="item.name" |
|
|
@ -80,8 +79,8 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<span style="float: left">{{ item.name }}</span> |
|
|
|
<span style="float: left">{{ item.name }}</span> |
|
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span> |
|
|
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span> |
|
|
|
</el-option> |
|
|
|
</el-option> --> |
|
|
|
</el-select> |
|
|
|
</el-autocomplete> |
|
|
|
<div class="flex-1 flex items-center ml-10px mr-10px"> |
|
|
|
<div class="flex-1 flex items-center ml-10px mr-10px"> |
|
|
|
<div class="w-100px">线索位置:</div> |
|
|
|
<div class="w-100px">线索位置:</div> |
|
|
|
<el-input v-model="address" disabled placeholder="请输入线索位置" clearable /> |
|
|
|
<el-input v-model="address" disabled placeholder="请输入线索位置" clearable /> |
|
|
@ -119,18 +118,17 @@ |
|
|
|
</el-collapse> |
|
|
|
</el-collapse> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<div style="position: absolute; top: 75px; right: 20px"> |
|
|
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
<DialogSchoolInfo ref="schoolInfoDialog" /> |
|
|
|
<DialogSchoolInfo ref="schoolInfoDialog" /> |
|
|
|
<template #footer> |
|
|
|
|
|
|
|
<span> |
|
|
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</Dialog> |
|
|
|
</Dialog> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup name="DialogClue"> |
|
|
|
<script setup name="DialogClue"> |
|
|
|
import { useAppStore } from '@/store/modules/app' |
|
|
|
import { useAppStore } from '@/store/modules/app' |
|
|
|
|
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
import { getPlaceList } from '@/api/school/place' |
|
|
|
import { getPlaceList } from '@/api/school/place' |
|
|
|
import * as ClueApi from '@/api/clue' |
|
|
|
import * as ClueApi from '@/api/clue' |
|
|
|
import { getDiyFieldList } from '@/api/clue/clueField' |
|
|
|
import { getDiyFieldList } from '@/api/clue/clueField' |
|
|
@ -139,7 +137,7 @@ import AMapLoader from '@amap/amap-jsapi-loader' |
|
|
|
|
|
|
|
|
|
|
|
import DialogSchoolInfo from './DialogSchoolInfo.vue' |
|
|
|
import DialogSchoolInfo from './DialogSchoolInfo.vue' |
|
|
|
|
|
|
|
|
|
|
|
import ImgPostion from '@/assets/imgs/flag/position_blue.png' |
|
|
|
import ImgPostion from '@/assets/imgs/flag/position_black.png' |
|
|
|
import FlagRed from '@/assets/imgs/flag/flag_red.png' |
|
|
|
import FlagRed from '@/assets/imgs/flag/flag_red.png' |
|
|
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png' |
|
|
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png' |
|
|
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png' |
|
|
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png' |
|
|
@ -148,7 +146,6 @@ import FlagBlue from '@/assets/imgs/flag/flag_blue.png' |
|
|
|
import FlagBlack from '@/assets/imgs/flag/flag_black.png' |
|
|
|
import FlagBlack from '@/assets/imgs/flag/flag_black.png' |
|
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const appStore = useAppStore() |
|
|
|
const appStore = useAppStore() |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
const props = defineProps({ |
|
|
@ -161,8 +158,14 @@ const props = defineProps({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const formSchema = computed(() => { |
|
|
|
const formSchema = computed(() => { |
|
|
|
|
|
|
|
const newSchema = [...props.schema] |
|
|
|
|
|
|
|
newSchema.forEach((it) => { |
|
|
|
|
|
|
|
if (it.field == 'consultTime') { |
|
|
|
|
|
|
|
it.componentProps['disabled-date'] = dateAfterToday |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
...props.schema, |
|
|
|
...newSchema, |
|
|
|
{ |
|
|
|
{ |
|
|
|
component: 'Input', |
|
|
|
component: 'Input', |
|
|
|
label: '诉求', |
|
|
|
label: '诉求', |
|
|
@ -185,6 +188,10 @@ const formSchema = computed(() => { |
|
|
|
] |
|
|
|
] |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dateAfterToday = (t) => { |
|
|
|
|
|
|
|
return t.getTime() > Date.now() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
@ -204,7 +211,6 @@ const tabName = ref('info') |
|
|
|
const followList = ref([]) |
|
|
|
const followList = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
const areaValue = ref('') |
|
|
|
const areaValue = ref('') |
|
|
|
const areaList = ref([]) |
|
|
|
|
|
|
|
const address = ref('') |
|
|
|
const address = ref('') |
|
|
|
const defaultLatLng = ref({ |
|
|
|
const defaultLatLng = ref({ |
|
|
|
lat: 31.86119, |
|
|
|
lat: 31.86119, |
|
|
@ -235,36 +241,54 @@ const open = async (type, id) => { |
|
|
|
formLoading.value = false |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
followList.value = [] |
|
|
|
followList.value = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
userId: useUserStore().getUser.id, |
|
|
|
|
|
|
|
content: undefined, |
|
|
|
|
|
|
|
nextFollowTime: formatDate(new Date()), |
|
|
|
|
|
|
|
editable: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
address.value = '' |
|
|
|
address.value = '' |
|
|
|
defaultLatLng.value = { |
|
|
|
defaultLatLng.value = { |
|
|
|
lat: 31.86119, |
|
|
|
lat: 31.86119, |
|
|
|
lng: 117.283042 |
|
|
|
lng: 117.283042 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
nextTick(() => { |
|
|
|
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) { |
|
|
|
formRef.value.setValues(info.value) |
|
|
|
nextTick(async () => { |
|
|
|
|
|
|
|
await getSchoolPlace() |
|
|
|
|
|
|
|
initMap(info.value) |
|
|
|
|
|
|
|
remoteMethod(address.value) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function changeTab() { |
|
|
|
|
|
|
|
if (tabName.value == 'map') { |
|
|
|
|
|
|
|
if (!dialogMap.value) { |
|
|
|
|
|
|
|
nextTick(async () => { |
|
|
|
|
|
|
|
await getSchoolPlace() |
|
|
|
|
|
|
|
initMap(info.value) |
|
|
|
|
|
|
|
// remoteMethod(address.value) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
destroyMap() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
|
|
function resetForm() { |
|
|
|
function resetForm() { |
|
|
|
info.value.address = undefined |
|
|
|
info.value.address = undefined |
|
|
|
info.value.lat = undefined |
|
|
|
info.value.lat = undefined |
|
|
|
info.value.lng = undefined |
|
|
|
info.value.lng = undefined |
|
|
|
|
|
|
|
info.value.consultTime = formatDate(new Date()) |
|
|
|
info.value.followUsers = [] |
|
|
|
info.value.followUsers = [] |
|
|
|
info.value.diyParams = {} |
|
|
|
info.value.diyParams = {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const placeList = ref([]) |
|
|
|
const placeList = ref([]) |
|
|
|
async function getSchoolPlace() { |
|
|
|
async function getSchoolPlace() { |
|
|
|
const data = await getPlaceList() |
|
|
|
const data = await getPlaceList({ placeStatus: 0 }) |
|
|
|
placeList.value = data.placeList.filter((it) => it.status == 0 && it.schoolStatus == 0) |
|
|
|
placeList.value = data.placeList |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['success']) |
|
|
|
const emit = defineEmits(['success']) |
|
|
@ -274,7 +298,7 @@ async function handleSave() { |
|
|
|
if (!formRef.value) return |
|
|
|
if (!formRef.value) return |
|
|
|
const valid = await formRef.value.getElFormRef().validate() |
|
|
|
const valid = await formRef.value.getElFormRef().validate() |
|
|
|
if (!valid) return |
|
|
|
if (!valid) return |
|
|
|
if (!followList.value && followList.value.length == 0) { |
|
|
|
if (!followList.value || followList.value.length == 0) { |
|
|
|
message.info('请添加跟进人') |
|
|
|
message.info('请添加跟进人') |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
@ -303,11 +327,11 @@ async function handleSave() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (formType.value === 'create') { |
|
|
|
if (formType.value === 'create') { |
|
|
|
await ClueApi.createClue(params) |
|
|
|
const data = await ClueApi.createClue(params) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
message.success(data) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
await ClueApi.updateClue(params) |
|
|
|
const data = await ClueApi.updateClue(params) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
message.success(data) |
|
|
|
} |
|
|
|
} |
|
|
|
dialogVisible.value = false |
|
|
|
dialogVisible.value = false |
|
|
|
// 发送操作成功的事件 |
|
|
|
// 发送操作成功的事件 |
|
|
@ -353,11 +377,9 @@ function initMap(data) { |
|
|
|
zooms: [2, 22], |
|
|
|
zooms: [2, 22], |
|
|
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat] |
|
|
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat] |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (data.lng || data.lat) { |
|
|
|
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap) |
|
|
|
addmark(data.lng, data.lat, AMap) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
AutoComplete.value = new AMap.AutoComplete({ |
|
|
|
AutoComplete.value = new AMap.AutoComplete({ |
|
|
|
city: '全国' |
|
|
|
city: '合肥' |
|
|
|
}) |
|
|
|
}) |
|
|
|
geoCoder.value = new AMap.Geocoder() |
|
|
|
geoCoder.value = new AMap.Geocoder() |
|
|
|
dialogMap.value.on('click', (e) => { |
|
|
|
dialogMap.value.on('click', (e) => { |
|
|
@ -459,7 +481,8 @@ function addmark(lat, lng, AMap) { |
|
|
|
marker.value = new AMap.Marker({ |
|
|
|
marker.value = new AMap.Marker({ |
|
|
|
position: new AMap.LngLat(lat, lng), |
|
|
|
position: new AMap.LngLat(lat, lng), |
|
|
|
zoom: 13, |
|
|
|
zoom: 13, |
|
|
|
icon: ImgPostion |
|
|
|
icon: ImgPostion, |
|
|
|
|
|
|
|
offset: [-16, -32] |
|
|
|
}) |
|
|
|
}) |
|
|
|
dialogMap.value.add(marker.value) |
|
|
|
dialogMap.value.add(marker.value) |
|
|
|
dialogMap.value.setCenter([lat, lng], '', 500) |
|
|
|
dialogMap.value.setCenter([lat, lng], '', 500) |
|
|
@ -508,28 +531,34 @@ function showSchoolInfo(val) { |
|
|
|
schoolInfoDialog.value.open(val) |
|
|
|
schoolInfoDialog.value.open(val) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function remoteMethod(searchValue) { |
|
|
|
function remoteMethod(searchValue, cb) { |
|
|
|
if (searchValue !== '') { |
|
|
|
if (searchValue) { |
|
|
|
setTimeout(() => { |
|
|
|
AutoComplete.value?.search(searchValue, (status, result) => { |
|
|
|
AutoComplete.value?.search(searchValue, (status, result) => { |
|
|
|
if (result.tips?.length) { |
|
|
|
if (result.tips?.length) { |
|
|
|
// areaList.value = result?.tips |
|
|
|
areaList.value = result?.tips |
|
|
|
const list = result.tips.map((it) => ({ |
|
|
|
} |
|
|
|
...it, |
|
|
|
}) |
|
|
|
value: it.name |
|
|
|
}, 200) |
|
|
|
})) |
|
|
|
|
|
|
|
cb(list) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cb([]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cb([]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function currentSelect(val) { |
|
|
|
function currentSelect(val) { |
|
|
|
const area = areaList.value.find((it) => it.name == val) |
|
|
|
if (val) { |
|
|
|
if (area) { |
|
|
|
|
|
|
|
defaultLatLng.value = { |
|
|
|
defaultLatLng.value = { |
|
|
|
lng: area.location?.lng, |
|
|
|
lng: val.location?.lng, |
|
|
|
lat: area.location?.lat |
|
|
|
lat: val.location?.lat |
|
|
|
} |
|
|
|
} |
|
|
|
addmark(area.location?.lng, area.location?.lat, aMap.value) |
|
|
|
addmark(val.location?.lng, val.location?.lat, aMap.value) |
|
|
|
dialogMap.value.setCenter([area.location?.lng, area.location?.lat], '', 500) |
|
|
|
dialogMap.value.setCenter([val.location?.lng, val.location?.lat], '', 500) |
|
|
|
regeoCode(area.location?.lng, area.location?.lat) |
|
|
|
regeoCode(val.location?.lng, val.location?.lat) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|