|
|
@ -2,21 +2,16 @@ |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form :model="searchForm" ref="searchRef" inline label-width="0"> |
|
|
|
<el-form :model="searchForm" ref="searchRef" inline label-width="0"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input |
|
|
|
<el-cascader |
|
|
|
v-model="searchForm.schoolName" |
|
|
|
:options="schoolOption" |
|
|
|
placeholder="请输入驾校名称" |
|
|
|
v-model="searchForm.schPlace" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
style="width: 180px" |
|
|
|
filterable |
|
|
|
@keyup.enter="handleQuery" |
|
|
|
show-all-levels |
|
|
|
/> |
|
|
|
style="width: 300px" |
|
|
|
</el-form-item> |
|
|
|
placeholder="选择驾校/场地" |
|
|
|
<el-form-item> |
|
|
|
:props="{ expandTrigger: 'hover', multiple: false, checkStrictly: true }" |
|
|
|
<el-input |
|
|
|
@change="handleQuery" |
|
|
|
v-model="searchForm.placeName" |
|
|
|
|
|
|
|
placeholder="请输入场地名称" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
style="width: 180px" |
|
|
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
@ -69,85 +64,67 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-table |
|
|
|
<el-col :span="6" :offset="0"> |
|
|
|
:data="tableList" |
|
|
|
<div class="head-container" style="max-height: 700px; overflow-y: auto"> |
|
|
|
v-loading="loading" |
|
|
|
<el-tree |
|
|
|
border |
|
|
|
ref="tree" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
:data="schoolOption" |
|
|
|
> |
|
|
|
accordion |
|
|
|
<el-table-column type="selection" width="50" /> |
|
|
|
node-key="id" |
|
|
|
<el-table-column type="index" label="序号" width="60" /> |
|
|
|
highlight-current |
|
|
|
<el-table-column |
|
|
|
:default-expanded-keys="selectNodes.map((item) => item.id)" |
|
|
|
v-for="col in columns" |
|
|
|
@node-click="handleNodeClick" |
|
|
|
:prop="col.props" |
|
|
|
/> |
|
|
|
:key="col.props" |
|
|
|
</div> |
|
|
|
:label="col.label" |
|
|
|
</el-col> |
|
|
|
:width="col.width" |
|
|
|
<el-col :span="18" :offset="0"> |
|
|
|
show-overflow-tooltip |
|
|
|
<el-table |
|
|
|
/> |
|
|
|
:data="tableList" |
|
|
|
<el-table-column label="备注" width="260"> |
|
|
|
v-loading="loading" |
|
|
|
<template #default="{ row }"> |
|
|
|
border |
|
|
|
<div v-dompurify-html="row.remark"></div> |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
</template> |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column type="selection" width="50" /> |
|
|
|
<el-table-column label="状态" width="80"> |
|
|
|
<el-table-column type="index" label="序号" width="60" /> |
|
|
|
<template #default="{ row }"> |
|
|
|
<el-table-column |
|
|
|
<el-switch |
|
|
|
v-for="col in columns" |
|
|
|
v-model="row.status" |
|
|
|
:prop="col.props" |
|
|
|
:active-value="0" |
|
|
|
:key="col.props" |
|
|
|
:inactive-value="1" |
|
|
|
:label="col.label" |
|
|
|
:disabled="!checkPermi(['school:class:update'])" |
|
|
|
:width="col.width" |
|
|
|
@change="handleChangeStatus(row)" |
|
|
|
show-overflow-tooltip |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
<el-table-column label="备注" width="260"> |
|
|
|
</template> |
|
|
|
<template #default="{ row }"> |
|
|
|
</el-table-column> |
|
|
|
<div v-dompurify-html="row.remark"></div> |
|
|
|
<el-table-column label="操作" width="120px"> |
|
|
|
</template> |
|
|
|
<template #default="{ row }"> |
|
|
|
</el-table-column> |
|
|
|
<el-button |
|
|
|
<el-table-column label="状态" width="80"> |
|
|
|
type="primary" |
|
|
|
<template #default="{ row }"> |
|
|
|
style="padding: 0" |
|
|
|
<el-switch |
|
|
|
text |
|
|
|
v-model="row.status" |
|
|
|
v-hasPermi="['school:class:update']" |
|
|
|
:active-value="0" |
|
|
|
@click="handleOpenDialog('update', row.typeId)" |
|
|
|
:inactive-value="1" |
|
|
|
> |
|
|
|
:disabled="!checkPermi(['school:class:update'])" |
|
|
|
修改 |
|
|
|
@change="handleChangeStatus(row)" |
|
|
|
</el-button> |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
</template> |
|
|
|
type="danger" |
|
|
|
</el-table-column> |
|
|
|
style="padding: 0" |
|
|
|
<el-table-column label="操作" width="120px"> |
|
|
|
text |
|
|
|
<template #default="{ row }"> |
|
|
|
v-hasPermi="['school:class:delete']" |
|
|
|
<el-button |
|
|
|
@click="handleRemove(row.typeId)" |
|
|
|
type="primary" |
|
|
|
> |
|
|
|
style="padding: 0" |
|
|
|
删除 |
|
|
|
text |
|
|
|
</el-button> |
|
|
|
v-hasPermi="['school:class:update']" |
|
|
|
</template> |
|
|
|
@click="handleOpenDialog('update', row.typeId)" |
|
|
|
</el-table-column> |
|
|
|
> |
|
|
|
</el-table> |
|
|
|
修改 |
|
|
|
<Pagination |
|
|
|
</el-button> |
|
|
|
v-model:limit="searchForm.pageSize" |
|
|
|
<el-button |
|
|
|
v-model:page="searchForm.pageNo" |
|
|
|
type="danger" |
|
|
|
:total="total" |
|
|
|
style="padding: 0" |
|
|
|
@pagination="getList" |
|
|
|
text |
|
|
|
/> |
|
|
|
v-hasPermi="['school:class:delete']" |
|
|
|
|
|
|
|
@click="handleRemove(row.typeId)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
删除 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<!-- 分页 --> |
|
|
|
|
|
|
|
<Pagination |
|
|
|
|
|
|
|
v-model:limit="searchForm.pageSize" |
|
|
|
|
|
|
|
v-model:page="searchForm.pageNo" |
|
|
|
|
|
|
|
:total="total" |
|
|
|
|
|
|
|
@pagination="getList" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px"> |
|
|
|
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px"> |
|
|
|
<el-form :model="statusForm" ref="statusRef" label-width="80px"> |
|
|
|
<el-form :model="statusForm" ref="statusRef" label-width="80px"> |
|
|
|
<el-form-item label="选择状态" prop="status"> |
|
|
|
<el-form-item label="选择状态" prop="status"> |
|
|
@ -186,8 +163,7 @@ const total = ref(0) |
|
|
|
const tableList = ref([]) |
|
|
|
const tableList = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
const searchForm = ref({ |
|
|
|
const searchForm = ref({ |
|
|
|
schoolName: undefined, |
|
|
|
schPlace: undefined, |
|
|
|
placeName: undefined, |
|
|
|
|
|
|
|
typeName: undefined, |
|
|
|
typeName: undefined, |
|
|
|
licenseType: undefined, |
|
|
|
licenseType: undefined, |
|
|
|
pageNo: 1, |
|
|
|
pageNo: 1, |
|
|
@ -195,41 +171,24 @@ const searchForm = ref({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const schoolOption = ref([]) |
|
|
|
const schoolOption = ref([]) |
|
|
|
const selectNodes = ref([]) |
|
|
|
// const selectNodes = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
async function getSchoolList() { |
|
|
|
async function getSchoolList() { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const data = await PlaceApi.getPlaceList() |
|
|
|
const data = await PlaceApi.getPlaceList() |
|
|
|
schoolOption.value = data.schoolList.map((item) => ({ |
|
|
|
schoolOption.value = data.schoolList.map((item) => ({ |
|
|
|
id: item.schoolId, |
|
|
|
value: item.schoolId, |
|
|
|
label: item.schoolName, |
|
|
|
label: item.schoolName, |
|
|
|
level: 1, |
|
|
|
|
|
|
|
children: data.placeList |
|
|
|
children: data.placeList |
|
|
|
.filter((place) => item.schoolId === place.schoolId) |
|
|
|
.filter((place) => item.schoolId === place.schoolId) |
|
|
|
.map((place) => ({ |
|
|
|
.map((place) => ({ |
|
|
|
id: place.placeId, |
|
|
|
value: place.placeId, |
|
|
|
label: place.name, |
|
|
|
label: place.name |
|
|
|
level: 2 |
|
|
|
|
|
|
|
})) |
|
|
|
})) |
|
|
|
})) |
|
|
|
})) |
|
|
|
} catch {} |
|
|
|
} catch {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function handleNodeClick(data, node) { |
|
|
|
|
|
|
|
if (data.level === 1) { |
|
|
|
|
|
|
|
selectNodes.value = [{ id: data.id, name: data.label }] |
|
|
|
|
|
|
|
searchForm.value.schoolName = data.label |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
selectNodes.value = [ |
|
|
|
|
|
|
|
{ id: node.parent.data.id, name: node.parent.data.label }, |
|
|
|
|
|
|
|
{ id: data.id, name: data.label } |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
searchForm.value.schoolName = node.parent.data.label |
|
|
|
|
|
|
|
searchForm.value.placeName = data.label |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
handleQuery() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const columns = [ |
|
|
|
const columns = [ |
|
|
|
{ props: 'schoolName', label: '驾校', width: '100px' }, |
|
|
|
{ props: 'schoolName', label: '驾校', width: '100px' }, |
|
|
|
{ props: 'placeName', label: '场地' }, |
|
|
|
{ props: 'placeName', label: '场地' }, |
|
|
@ -248,7 +207,15 @@ function handleQuery() { |
|
|
|
async function getList() { |
|
|
|
async function getList() { |
|
|
|
loading.value = true |
|
|
|
loading.value = true |
|
|
|
try { |
|
|
|
try { |
|
|
|
const data = await ClassApi.getClassTypePage(searchForm.value) |
|
|
|
const params = { ...searchForm.value } |
|
|
|
|
|
|
|
if (params.schPlace && params.schPlace.length) { |
|
|
|
|
|
|
|
params.schoolId = params.schPlace[0] |
|
|
|
|
|
|
|
if (params.schPlace.length == 2) { |
|
|
|
|
|
|
|
params.placeId = params.schPlace[1] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
delete params.schPlace |
|
|
|
|
|
|
|
const data = await ClassApi.getClassTypePage(params) |
|
|
|
tableList.value = data.list |
|
|
|
tableList.value = data.list |
|
|
|
total.value = data.total |
|
|
|
total.value = data.total |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
@ -263,8 +230,7 @@ function handleOpenDialog(type, id = null) { |
|
|
|
|
|
|
|
|
|
|
|
function handleReset() { |
|
|
|
function handleReset() { |
|
|
|
searchForm.value = { |
|
|
|
searchForm.value = { |
|
|
|
schoolName: undefined, |
|
|
|
schPlace: undefined, |
|
|
|
placeName: undefined, |
|
|
|
|
|
|
|
typeName: undefined, |
|
|
|
typeName: undefined, |
|
|
|
licenseType: undefined, |
|
|
|
licenseType: undefined, |
|
|
|
pageNo: 1, |
|
|
|
pageNo: 1, |
|
|
|