qsh 5 months ago
commit f2064d99ad
  1. 5
      src/components/Search/src/Search.vue
  2. 8
      src/views/Clue/Order/Comp/DialogOrder.vue
  3. 25
      src/views/Clue/Order/Comp/MallOrderList.vue
  4. 20
      src/views/Clue/Order/Comp/OrderList.vue
  5. 269
      src/views/Clue/Pool/Comp/ClueMap.vue
  6. 140
      src/views/Clue/Pool/Comp/DialogClue.vue
  7. 2
      src/views/Clue/Pool/Comp/DialogSuccess.vue
  8. 9
      src/views/Clue/Pool/Comp/DrawerClue.vue
  9. 229
      src/views/Clue/Pool/index.vue
  10. 2
      src/views/Home/Index.vue
  11. 2
      src/views/SchoolManagement/Class/Comp/DialogClass.vue
  12. 10
      src/views/SchoolManagement/Class/index.vue
  13. 10
      src/views/SchoolManagement/Place/index.vue

@ -59,6 +59,11 @@ const usedSchema = ref([])
const newSchema = computed(() => {
let schema: FormSchema[] = cloneDeep(usedSchema.value)
schema.forEach((item: FormSchema) => {
if (item.component == 'TreeSelect') {
item.componentProps['check-strictly'] = true
}
})
if (props.expand && props.expandField && !unref(visible)) {
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
if (index > -1) {

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

@ -67,9 +67,10 @@
<div class="p-10px flex justify-center">
<el-table :data="row.signProducts" stripe style="width: 900px">
<el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" />
<el-table-column prop="signNum" label="成交数量" width="100px" />
<el-table-column label="发货状态" prop="sendState" width="100px" />
<el-table-column prop="specsName" label="产品规格" width="100px" />
<el-table-column prop="signNum" label="成交数量" width="90px" />
<el-table-column prop="remark" label="成交备注" />
<el-table-column label="发货状态" prop="sendState" width="90px" />
<el-table-column label="发货备注" width="100px">
<template #default="scope">
<el-popover
@ -205,6 +206,15 @@ import DialogDelivery from './DialogDelivery.vue'
import { removeNullField } from '@/utils'
const userOptions = ref([])
onMounted(() => {
getUserOption().then((data) => {
userOptions.value = data
getCurdSchemas()
})
getOptions()
})
const message = useMessage() //
const allSchemas = ref({})
@ -337,15 +347,6 @@ const deliveryDialog = ref()
function handleDelivery(row) {
deliveryDialog.value.open(row)
}
const userOptions = ref([])
onMounted(() => {
getUserOption().then((data) => {
userOptions.value = data
getCurdSchemas()
})
getOptions()
})
</script>
<style lang="scss" scoped></style>

@ -182,6 +182,15 @@ import DialogExtraFee from './DialogExtraPay.vue'
import { removeNullField } from '@/utils'
const userOptions = ref([])
onMounted(() => {
getUserOption().then((data) => {
userOptions.value = data
getCurdSchemas()
})
getOptions()
})
const message = useMessage() //
const allSchemas = ref({})
@ -322,20 +331,11 @@ async function getClassTypeOptions() {
function getOptions() {
//
getPlaceList().then((data) => {
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
schoolOptions.value = data.schoolList
allPlaceOptions.value = data.placeList
})
}
const userOptions = ref([])
onMounted(() => {
getUserOption().then((data) => {
userOptions.value = data
getCurdSchemas()
})
getOptions()
})
</script>
<style lang="scss" scoped></style>

@ -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>

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

@ -445,7 +445,7 @@ async function getClassTypeOptions() {
function getOptions() {
if (appStore.getAppInfo?.instanceType == 1) {
//
getPlaceList().then((data) => {
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
schoolOptions.value = data.schoolList
allPlaceOptions.value = data.placeList
})

@ -156,7 +156,7 @@ import DialogSchoolInfo from './DialogSchoolInfo.vue'
import AMapLoader from '@amap/amap-jsapi-loader'
import { formatDate, dateFormatter } from '@/utils/formatTime'
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 FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
@ -267,8 +267,8 @@ function followSuccess() {
const placeList = ref([])
async function getSchoolPlace() {
const data = await getPlaceList()
placeList.value = data.placeList.filter((it) => it.status == 0 && it.schoolStatus == 0)
const data = await getPlaceList({ placeStatus: 0 })
placeList.value = data.placeList
}
const defaultLatLng = ref({
@ -339,7 +339,8 @@ function addmark(lat, lng, AMap) {
marker.value = new AMap.Marker({
position: new AMap.LngLat(lat, lng),
zoom: 13,
icon: ImgPostion
icon: ImgPostion,
offset: [-16, -32]
})
dialogMap.value.add(marker.value)
dialogMap.value.setCenter([lat, lng], '', 500)

@ -1,7 +1,7 @@
<template>
<div>
<div class="relative">
<el-tabs v-model="queryType" size="small" @tab-change="getTableList">
<el-tabs v-model="queryType" size="small" @tab-change="quickChange">
<el-tab-pane label="全部" name="0" />
<el-tab-pane name="1">
<template #label>
@ -31,6 +31,14 @@
</template>
</el-tab-pane>
<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>
<div class="absolute" style="right: 10px; top: 0">
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
@ -39,117 +47,119 @@
</el-button>
</div>
</div>
<!-- 搜索工作栏 -->
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<template #actionMore>
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
</template>
</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 v-if="queryType != 5">
<!-- 搜索工作栏 -->
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<template #actionMore>
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="200px" fixed="right">
<template #default="scope">
<el-button
type="primary"
link
@click="handleDetail(scope.row)"
v-hasPermi="['clue:pool:detail']"
>
详情
</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>
</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 v-else>
</el-table-column>
<el-table-column label="操作" width="200px" fixed="right">
<template #default="scope">
<el-button
type="primary"
link
v-hasPermi="['clue:pool:gain']"
@click="handleGain(scope.row.clueId)"
@click="handleDetail(scope.row)"
v-hasPermi="['clue:pool:detail']"
>
获取
详情
</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>
</el-table-column>
</SSTable>
</el-table-column>
</SSTable>
</template>
<DialogClue
v-if="!loading"
ref="formRef"
:userOptions="userOptions"
:schema="allSchemas.formSchema"
@sucess="getTableList"
@success="getTableList"
/>
<DrawerClue
v-if="!loading"
@ -164,11 +174,13 @@
</template>
<script setup name="CluePool">
import { useAppStore } from '@/store/modules/app'
import { getSimpleFieldList } from '@/api/clue/clueField'
import DialogClue from './Comp/DialogClue.vue'
import DrawerClue from './Comp/DrawerClue.vue'
import DialogSuccess from './Comp/DialogSuccess.vue'
import DialogFollow from './Comp/DialogFollow.vue'
import ClueMap from './Comp/ClueMap.vue'
import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { removeNullField } from '@/utils'
@ -177,6 +189,7 @@ import { formatDate } from '@/utils/formatTime'
import * as ClueApi from '@/api/clue'
const message = useMessage() //
const appStore = useAppStore()
const searchRef = ref()
const queryType = ref('2')
@ -223,10 +236,24 @@ function getCheckedColumns(list) {
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() {
searchRef.value.reset()
tableObject.value.pageNo = 1
getTableList()
nextTick(() => {
searchRef.value && searchRef.value.reset()
tableObject.value.pageNo = 1
getTableList()
})
}
async function getTableList() {

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

@ -16,7 +16,7 @@
:options="props.schoolOption"
v-model="formData.schPlace"
filterable
:props="{ value: 'id' }"
:props="{ value: 'value' }"
show-all-levels
style="width: 100%"
/>

@ -51,7 +51,7 @@
>
<el-button
type="danger"
@click="handleBatchDelete"
@click="handleBatchDelete([])"
v-hasPermi="['school:class:batch-delete']"
>批量删除</el-button
>
@ -175,7 +175,11 @@ const schoolOption = ref([])
async function getSchoolList() {
try {
const data = await PlaceApi.getPlaceList()
const data = await PlaceApi.getPlaceList({
placeStatus: 0,
schoolStatus: 0,
isSearchSchool: true
})
schoolOption.value = data.schoolList.map((item) => ({
value: item.schoolId,
label: item.schoolName,
@ -240,7 +244,7 @@ function handleReset() {
}
async function handleBatchDelete(arr = []) {
if (!arr.length || !selectRows.value.length) {
if (!arr.length && !selectRows.value.length) {
message.info('请选择表格行!')
return
}

@ -325,7 +325,10 @@ function regeoCode() {
async function getPageData() {
schoolList.value = []
tableData.value = []
const data = await PlaceApi.getPlaceList()
const data = await PlaceApi.getPlaceList({
schoolStatus: 0,
isSearchSchool: true
})
if (data.schoolList) {
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
}
@ -363,7 +366,7 @@ function handleClickSchool(item) {
function createMarkersInMap() {
for (let i = 0; i < tableData.value.length; i++) {
const element = tableData.value[i]
if (!element.schoolShow || !element.showInMap) {
if (!element.schoolShow || !element.showInMap || element.status == 1) {
continue
}
const markerIcon = flagMap[element.flagColor || 'red']
@ -542,7 +545,8 @@ async function changePlaceStatus(row) {
await PlaceApi.updatePlaceStatus(row.placeId, row.status)
message.success('修改成功')
//
// await getList()
// await getPageData()
tableData.value.find((item) => item.placeId == row.placeId).status = row.status
resetMarkers()
} catch {
//

Loading…
Cancel
Save