sc
This commit is contained in:
@@ -19,6 +19,17 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="schoolPlace">
|
||||
<el-cascader
|
||||
v-model="form.schoolPlace"
|
||||
:options="placeOptions"
|
||||
placeholder="选择邀约驾校和场地"
|
||||
filterable
|
||||
show-all-levels
|
||||
style="width: 100%"
|
||||
:props="{ expandTrigger: 'hover', multiple: false, checkStrictly: true }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
@@ -31,6 +42,7 @@
|
||||
|
||||
<script setup>
|
||||
import { getWxGroupSimpleList, getClueRemarkByClueId, reportClue } from '@/api/clue/clueRemark'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -38,7 +50,8 @@ const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
remarkContent: '',
|
||||
groupId: ''
|
||||
groupId: '',
|
||||
schoolPlace: []
|
||||
})
|
||||
const rules = {
|
||||
remarkContent: [{ required: true, message: '请输入报备信息', trigger: 'blur' }],
|
||||
@@ -56,6 +69,11 @@ async function open(row) {
|
||||
const data = await getClueRemarkByClueId({ clueId: row.clueId })
|
||||
if (data && data.remarkId) {
|
||||
form.value = { ...data }
|
||||
if (data.schoolId && data.placeId) {
|
||||
form.value.schoolPlace = [data.schoolId, data.placeId]
|
||||
} else if (data.schoolId) {
|
||||
form.value.schoolPlace = [data.schoolId]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -75,11 +93,28 @@ async function open(row) {
|
||||
defineExpose({ open })
|
||||
|
||||
const groupOptions = ref([])
|
||||
|
||||
const placeOptions = ref([])
|
||||
function getOptions() {
|
||||
getWxGroupSimpleList().then((response) => {
|
||||
groupOptions.value = response
|
||||
})
|
||||
|
||||
getPlaceList({
|
||||
placeStatus: 0,
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
}).then((data) => {
|
||||
placeOptions.value = data.schoolList.map((item) => ({
|
||||
value: item.schoolId,
|
||||
label: item.schoolName,
|
||||
children: data.placeList
|
||||
.filter((place) => item.schoolId == place.schoolId)
|
||||
.map((place) => ({
|
||||
value: place.placeId,
|
||||
label: place.name
|
||||
}))
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
const formRef = ref(null)
|
||||
@@ -88,7 +123,14 @@ function handleSave() {
|
||||
if (valid) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
await reportClue(form.value)
|
||||
const params = { ...form.value }
|
||||
if (params.schoolPlace && params.schoolPlace.length) {
|
||||
params.schoolId = params.schoolPlace[0]
|
||||
if (params.schoolPlace.length == 2) {
|
||||
params.placeId = params.schoolPlace[1]
|
||||
}
|
||||
}
|
||||
await reportClue(params)
|
||||
message.success('提交报备信息成功')
|
||||
show.value = false
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user