salary
qsh 5 months ago
parent 87a2fe09de
commit e1ff8213bf
  1. 5
      src/components/Search/src/Search.vue
  2. 2
      src/views/Clue/Order/Comp/OrderList.vue
  3. 139
      src/views/Clue/Pool/Comp/DialogClue.vue
  4. 2
      src/views/Clue/Pool/Comp/DialogSuccess.vue
  5. 9
      src/views/Clue/Pool/Comp/DrawerClue.vue
  6. 4
      src/views/Clue/Pool/index.vue
  7. 2
      src/views/SchoolManagement/Class/Comp/DialogClass.vue
  8. 10
      src/views/SchoolManagement/Class/index.vue
  9. 10
      src/views/SchoolManagement/Place/index.vue

@ -59,6 +59,11 @@ const usedSchema = ref([])
const newSchema = computed(() => { const newSchema = computed(() => {
let schema: FormSchema[] = cloneDeep(usedSchema.value) 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)) { if (props.expand && props.expandField && !unref(visible)) {
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField) const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
if (index > -1) { if (index > -1) {

@ -322,7 +322,7 @@ async function getClassTypeOptions() {
function getOptions() { function getOptions() {
// //
getPlaceList().then((data) => { getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
schoolOptions.value = data.schoolList schoolOptions.value = data.schoolList
allPlaceOptions.value = data.placeList allPlaceOptions.value = data.placeList
}) })

@ -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) // 12 const formLoading = ref(false) // 12
@ -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)
} }
} }

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

@ -156,7 +156,7 @@ import DialogSchoolInfo from './DialogSchoolInfo.vue'
import AMapLoader from '@amap/amap-jsapi-loader' import AMapLoader from '@amap/amap-jsapi-loader'
import { formatDate, dateFormatter } from '@/utils/formatTime' 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 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'
@ -267,8 +267,8 @@ function followSuccess() {
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 defaultLatLng = ref({ const defaultLatLng = ref({
@ -339,7 +339,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)

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="relative"> <div class="relative">
<el-tabs v-model="queryType" size="small" @tab-change="getTableList"> <el-tabs v-model="queryType" size="small" @tab-change="resetQuery">
<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>
@ -149,7 +149,7 @@
ref="formRef" ref="formRef"
:userOptions="userOptions" :userOptions="userOptions"
:schema="allSchemas.formSchema" :schema="allSchemas.formSchema"
@sucess="getTableList" @success="getTableList"
/> />
<DrawerClue <DrawerClue
v-if="!loading" v-if="!loading"

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

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

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

Loading…
Cancel
Save