salary
qsh 5 months ago
parent e1ff8213bf
commit ab0c770167
  1. 8
      src/views/Clue/Order/Comp/DialogOrder.vue
  2. 7
      src/views/Clue/Order/Comp/MallOrderList.vue
  3. 269
      src/views/Clue/Pool/Comp/ClueMap.vue
  4. 3
      src/views/Clue/Pool/Comp/DialogClue.vue
  5. 227
      src/views/Clue/Pool/index.vue
  6. 2
      src/views/Home/Index.vue

@ -108,9 +108,11 @@ const aftersaleList = ref([])
const extraPayList = ref([]) const extraPayList = ref([])
const prodTotalPrice = computed(() => { const prodTotalPrice = computed(() => {
return orderInfo.value.signProducts.reduce( return (
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0), orderInfo.value.signProducts?.reduce(
0 (pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
0
) || 0
) )
}) })

@ -67,9 +67,10 @@
<div class="p-10px flex justify-center"> <div class="p-10px flex justify-center">
<el-table :data="row.signProducts" stripe style="width: 900px"> <el-table :data="row.signProducts" stripe style="width: 900px">
<el-table-column prop="productName" label="成交产品" /> <el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" /> <el-table-column prop="specsName" label="产品规格" width="100px" />
<el-table-column prop="signNum" label="成交数量" width="100px" /> <el-table-column prop="signNum" label="成交数量" width="90px" />
<el-table-column label="发货状态" prop="sendState" width="100px" /> <el-table-column prop="remark" label="成交备注" />
<el-table-column label="发货状态" prop="sendState" width="90px" />
<el-table-column label="发货备注" width="100px"> <el-table-column label="发货备注" width="100px">
<template #default="scope"> <template #default="scope">
<el-popover <el-popover

@ -0,0 +1,269 @@
<template>
<div class="relative w-full h-full">
<div id="mapClue" style="height: 100%"></div>
<el-autocomplete
v-model="areaValue"
clearable
style="position: absolute; top: 20px; left: 20px; width: 400px"
placeholder="输入并搜索位置"
:fetch-suggestions="remoteMethod"
@select="currentSelect"
/>
<el-collapse v-model="collaspeKey" class="box-card">
<el-collapse-item name="nearbySchool">
<template #title>
<span class="ml-10px font-bold" style="font-size: 16px">附近驾校</span>
</template>
<div style="padding: 0 10px">
<div v-if="nearbySchoolSearching">正在搜索中...</div>
<template v-else>
<div v-for="p in nearbySchoolList" :key="p.index">
<div class="hover-pointer" style="font-size: 14px; color: blue">
<i v-if="p.recommend" class="el-icon-star-off"></i>
驾校: {{ p.deptName }}-{{ p.name }}
</div>
<div class="mt5">地址{{ p.address }}</div>
<div class="mt5">
直线距离: {{ p.distance }} 公里;
<span class="ml0">步行距离{{ p.walkdistance }}</span>
</div>
<el-divider style="margin: 3px 0 !important" />
</div>
</template>
</div>
</el-collapse-item>
</el-collapse>
<DialogSchoolInfo ref="placeInfoDialog" />
</div>
</template>
<script setup name="ClueMap">
import { getPlaceList } from '@/api/school/place'
import ImgPostion from '@/assets/imgs/flag/position_black.png'
import FlagRed from '@/assets/imgs/flag/flag_red.png'
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
import FlagGreen from '@/assets/imgs/flag/flag_green.png'
import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
import AMapLoader from '@amap/amap-jsapi-loader'
import DialogSchoolInfo from './DialogSchoolInfo.vue'
//
const clueMap = ref(null)
const aMap = ref(null)
const areaValue = ref('')
const flagMap = {
red: FlagRed,
yellow: FlagYellow,
purple: FlagPurple,
green: FlagGreen,
blue: FlagBlue,
black: FlagBlack
}
const defaultLatLng = ref({
lat: 31.86119,
lng: 117.283042
})
let AutoComplete = ref(null)
function initMap() {
AMapLoader.load({
key: '713d839ff505943b0f18e6df45f3b0dc', //key
version: '2.0',
plugins: ['AMap.AutoComplete']
}).then((AMap) => {
aMap.value = AMap
AutoComplete.value = new AMap.AutoComplete({
city: '合肥'
})
clueMap.value = new AMap.Map('mapClue', {
zoom: 14,
zooms: [2, 22],
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
})
getPageData()
})
}
const placeList = ref([])
async function getPageData() {
placeList.value = []
const data = await getPlaceList({
placeStatus: 0
})
if (data.placeList) {
placeList.value = data.placeList
createMarkersInMap()
getNearbySchool(defaultLatLng.value)
}
}
// markers
function createMarkersInMap() {
for (let i = 0; i < placeList.value.length; i++) {
const element = placeList.value[i]
const markerIcon = flagMap[element.flagColor || 'red']
const tmpMarker = new aMap.value.Marker({
map: clueMap.value,
position: [element.lng, element.lat],
icon: markerIcon,
label: {
content: element.name,
direction: 'right'
},
extData: element
})
tmpMarker.on('click', handleClickMarker)
}
}
const placeInfoDialog = ref()
function handleClickMarker(ev) {
placeInfoDialog.value.open(ev.target.getExtData())
}
function remoteMethod(searchValue, cb) {
if (searchValue) {
AutoComplete.value?.search(searchValue, (status, result) => {
if (result.tips?.length) {
// areaList.value = result?.tips
const list = result.tips.map((it) => ({
...it,
value: it.name
}))
cb(list)
} else {
cb([])
}
})
} else {
cb([])
}
}
function currentSelect(val) {
if (val) {
defaultLatLng.value = {
lng: val.location?.lng,
lat: val.location?.lat
}
addmark(val.location?.lng, val.location?.lat, aMap.value)
}
}
const marker = ref(null)
function addmark(lat, lng, AMap) {
marker.value && removeMarker()
marker.value = new AMap.Marker({
position: new AMap.LngLat(lat, lng),
zoom: 14,
icon: ImgPostion,
offset: [-16, -32]
})
clueMap.value.add(marker.value)
clueMap.value.setCenter([lat, lng], true)
getNearbySchool({ lat: lng, lng: lat })
}
const nearbySchoolList = ref([])
const nearbySchoolSearching = ref(false)
const collaspeKey = ref('nearbySchool')
function getNearbySchool(info) {
if (info.lng && info.lat) {
nearbySchoolList.value = []
nearbySchoolSearching.value = true
//
let places1 = []
//
let places2 = []
const p2 = [info.lng, info.lat]
for (let i = 0; i < placeList.value.length; i++) {
const element = placeList.value[i]
const p1 = [element.lng, element.lat]
// 线
element.distance = (aMap.value.GeometryUtil.distance(p1, p2) / 1000).toFixed(2)
element.recommend ? places1.push(element) : places2.push(element)
}
// 线
//
if (places1.length > 1) {
places1 = places1.sort((a, b) => a.distance - b.distance)
}
//
if (places2.length > 1) {
places2 = places2.sort((a, b) => a.distance - b.distance)
}
// ,
nearbySchoolList.value = []
for (let i = 0; i < 4; i++) {
places1.length > i && nearbySchoolList.value.push(places1[i])
places2.length > i && nearbySchoolList.value.push(places2[i])
if (nearbySchoolList.value.length === 4) {
break
}
}
//
nearbySchoolList.value.map(async (item) => {
const p1 = [item.lng, item.lat]
const resp = await getWalkingDistance(p1, p2)
item.walkdistance = resp
})
nearbySchoolSearching.value = false
}
}
//
async function getWalkingDistance(start, end) {
return new Promise((resolve) => {
aMap.value.plugin('AMap.Walking', () => {
const walking = new aMap.value.Walking()
let num = 0
walking.search(start, end, (status, result) => {
if (status === 'complete') {
result.routes.forEach((item) => {
num += item.distance
})
resolve(num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num}`)
} else {
resolve('步行数据无法确定')
}
})
})
})
}
function removeMarker() {
clueMap.value.remove(marker.value)
}
function destroyMap() {
areaValue.value = undefined
clueMap.value = null
aMap.value = null
}
defineExpose({ destroyMap })
onMounted(() => {
nextTick(() => {
initMap()
})
})
</script>
<style scoped lang="scss">
.box-card {
position: absolute;
right: 10px;
bottom: 10px;
width: 40%;
}
</style>

@ -485,7 +485,7 @@ function addmark(lat, lng, AMap) {
offset: [-16, -32] offset: [-16, -32]
}) })
dialogMap.value.add(marker.value) dialogMap.value.add(marker.value)
dialogMap.value.setCenter([lat, lng], '', 500) dialogMap.value.setCenter([lat, lng], true)
getNearbySchool({ lat: lng, lng: lat }) getNearbySchool({ lat: lng, lng: lat })
} }
function removeMarker() { function removeMarker() {
@ -557,7 +557,6 @@ function currentSelect(val) {
lat: val.location?.lat lat: val.location?.lat
} }
addmark(val.location?.lng, val.location?.lat, aMap.value) addmark(val.location?.lng, val.location?.lat, aMap.value)
dialogMap.value.setCenter([val.location?.lng, val.location?.lat], '', 500)
regeoCode(val.location?.lng, val.location?.lat) regeoCode(val.location?.lng, val.location?.lat)
} }
} }

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="relative"> <div class="relative">
<el-tabs v-model="queryType" size="small" @tab-change="resetQuery"> <el-tabs v-model="queryType" size="small" @tab-change="quickChange">
<el-tab-pane label="全部" name="0" /> <el-tab-pane label="全部" name="0" />
<el-tab-pane name="1"> <el-tab-pane name="1">
<template #label> <template #label>
@ -31,6 +31,14 @@
</template> </template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="公海" name="4" /> <el-tab-pane label="公海" name="4" />
<el-tab-pane
v-if="appStore.getAppInfo?.instanceType == 1"
label="地图总览"
name="5"
style="height: calc(100vh - 160px)"
>
<ClueMap ref="mapClue" v-if="queryType == 5" />
</el-tab-pane>
</el-tabs> </el-tabs>
<div class="absolute" style="right: 10px; top: 0"> <div class="absolute" style="right: 10px; top: 0">
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button> <el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
@ -39,110 +47,112 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<!-- 搜索工作栏 --> <template v-if="queryType != 5">
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0"> <!-- 搜索工作栏 -->
<template #actionMore> <Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button> <template #actionMore>
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button> <el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
</template> <el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
</Search>
<!-- 列表 -->
<SSTable
v-if="!loading"
class="mt-20px"
v-model:tableObject="tableObject"
:tableColumns="allSchemas.tableColumns"
@get-list="getTableList"
@get-checked-columns="getCheckedColumns"
>
<el-table-column
v-for="item in showColumns"
:key="item.field"
:prop="item.field"
:label="item.label"
min-width="120px"
>
<template #default="{ row }">
<div v-if="item.field == 'followRecord'">
<el-button
type="primary"
text
style="padding: 0"
@click="handleFollow(row)"
v-if="queryType != 4"
v-hasPermi="['clue:pool:update']"
>
快速新增
</el-button>
</div>
<div v-else-if="item.field == 'contact'">
<span>{{ row[item.field] }}</span>
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
</div>
<div v-else-if="item.form?.component == 'DatePicker'">
<span>{{ formatDate(row[item.field]) }}</span>
</div>
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="row[item.field]"></div>
</el-popover>
</div>
<span v-else>{{ row[item.field] }}</span>
</template> </template>
</el-table-column> </Search>
<el-table-column label="操作" width="200px" fixed="right"> <!-- 列表 -->
<template #default="scope"> <SSTable
<el-button v-if="!loading"
type="primary" class="mt-20px"
link v-model:tableObject="tableObject"
@click="handleDetail(scope.row)" :tableColumns="allSchemas.tableColumns"
v-hasPermi="['clue:pool:detail']" @get-list="getTableList"
> @get-checked-columns="getCheckedColumns"
详情 >
</el-button> <el-table-column
<template v-if="queryType != 4"> v-for="item in showColumns"
<el-button :key="item.field"
type="primary" :prop="item.field"
link :label="item.label"
@click="handleEdit(scope.row)" min-width="120px"
v-hasPermi="['clue:pool:update']" >
> <template #default="{ row }">
修改 <div v-if="item.field == 'followRecord'">
</el-button> <el-button
<el-button type="primary"
type="primary" text
link style="padding: 0"
:disabled="scope.row.state == '成交'" @click="handleFollow(row)"
@click="handleSuccess(scope.row)" v-if="queryType != 4"
v-hasPermi="['clue:pool:enroll']" v-hasPermi="['clue:pool:update']"
> >
登记 快速新增
</el-button> </el-button>
<el-button </div>
type="primary" <div v-else-if="item.field == 'contact'">
link <span>{{ row[item.field] }}</span>
v-hasPermi="['clue:pool:release']" <Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
@click="handleRelease(scope.row.clueId)" </div>
> <div v-else-if="item.form?.component == 'DatePicker'">
释放 <span>{{ formatDate(row[item.field]) }}</span>
</el-button> </div>
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="row[item.field]"></div>
</el-popover>
</div>
<span v-else>{{ row[item.field] }}</span>
</template> </template>
<template v-else> </el-table-column>
<el-table-column label="操作" width="200px" fixed="right">
<template #default="scope">
<el-button <el-button
type="primary" type="primary"
link link
v-hasPermi="['clue:pool:gain']" @click="handleDetail(scope.row)"
@click="handleGain(scope.row.clueId)" v-hasPermi="['clue:pool:detail']"
> >
获取 详情
</el-button> </el-button>
<template v-if="queryType != 4">
<el-button
type="primary"
link
@click="handleEdit(scope.row)"
v-hasPermi="['clue:pool:update']"
>
修改
</el-button>
<el-button
type="primary"
link
:disabled="scope.row.state == '成交'"
@click="handleSuccess(scope.row)"
v-hasPermi="['clue:pool:enroll']"
>
登记
</el-button>
<el-button
type="primary"
link
v-hasPermi="['clue:pool:release']"
@click="handleRelease(scope.row.clueId)"
>
释放
</el-button>
</template>
<template v-else>
<el-button
type="primary"
link
v-hasPermi="['clue:pool:gain']"
@click="handleGain(scope.row.clueId)"
>
获取
</el-button>
</template>
</template> </template>
</template> </el-table-column>
</el-table-column> </SSTable>
</SSTable> </template>
<DialogClue <DialogClue
v-if="!loading" v-if="!loading"
@ -164,11 +174,13 @@
</template> </template>
<script setup name="CluePool"> <script setup name="CluePool">
import { useAppStore } from '@/store/modules/app'
import { getSimpleFieldList } from '@/api/clue/clueField' import { getSimpleFieldList } from '@/api/clue/clueField'
import DialogClue from './Comp/DialogClue.vue' import DialogClue from './Comp/DialogClue.vue'
import DrawerClue from './Comp/DrawerClue.vue' import DrawerClue from './Comp/DrawerClue.vue'
import DialogSuccess from './Comp/DialogSuccess.vue' import DialogSuccess from './Comp/DialogSuccess.vue'
import DialogFollow from './Comp/DialogFollow.vue' import DialogFollow from './Comp/DialogFollow.vue'
import ClueMap from './Comp/ClueMap.vue'
import { getSimpleUserList as getUserOption } from '@/api/system/user' import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { removeNullField } from '@/utils' import { removeNullField } from '@/utils'
@ -177,6 +189,7 @@ import { formatDate } from '@/utils/formatTime'
import * as ClueApi from '@/api/clue' import * as ClueApi from '@/api/clue'
const message = useMessage() // const message = useMessage() //
const appStore = useAppStore()
const searchRef = ref() const searchRef = ref()
const queryType = ref('2') const queryType = ref('2')
@ -223,10 +236,24 @@ function getCheckedColumns(list) {
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
} }
const mapClue = ref()
function quickChange(name) {
try {
if (name != '5') {
resetQuery()
mapClue.value && mapClue.value.destroyMap()
}
} catch (error) {
console.log(error)
}
}
function resetQuery() { function resetQuery() {
searchRef.value.reset() nextTick(() => {
tableObject.value.pageNo = 1 searchRef.value && searchRef.value.reset()
getTableList() tableObject.value.pageNo = 1
getTableList()
})
} }
async function getTableList() { async function getTableList() {

@ -102,7 +102,7 @@
<span class="mr-10px">{{ item.username }}</span> <span class="mr-10px">{{ item.username }}</span>
<span>已跟进{{ item.followNum }}条线索</span> <span>已跟进{{ item.followNum }}条线索</span>
</li> </li>
<br /> <!-- <br /> -->
<!-- </TransitionGroup> --> <!-- </TransitionGroup> -->
</ul> </ul>
</el-skeleton> </el-skeleton>

Loading…
Cancel
Save