|
|
|
|
@ -22,15 +22,27 @@
|
|
|
|
|
@click="isShowAdd = true"
|
|
|
|
|
>新增</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="isHasAuth('search')"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
@click="getList(true)"
|
|
|
|
|
<template v-if="isHasAuth('search')">
|
|
|
|
|
<el-cascader
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="select['filter[0][value]']"
|
|
|
|
|
:options="school"
|
|
|
|
|
style="margin-left: 10px;"
|
|
|
|
|
:props="{
|
|
|
|
|
emitPath: false,
|
|
|
|
|
value: 'id',
|
|
|
|
|
label: 'name',
|
|
|
|
|
}"></el-cascader>
|
|
|
|
|
<el-button
|
|
|
|
|
style="margin-left: 10px;"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
size="small"
|
|
|
|
|
@click="getList(true)"
|
|
|
|
|
>搜索</el-button
|
|
|
|
|
>
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
<el-popover
|
|
|
|
|
v-if="isHasAuth('import')"
|
|
|
|
|
placement="bottom-start"
|
|
|
|
|
@ -120,16 +132,23 @@
|
|
|
|
|
|
|
|
|
|
<vxe-column
|
|
|
|
|
align="center"
|
|
|
|
|
field="school_id"
|
|
|
|
|
field="school.name"
|
|
|
|
|
width="180"
|
|
|
|
|
title="学校"
|
|
|
|
|
:edit-render="{
|
|
|
|
|
name: 'VxeSelect',
|
|
|
|
|
options: school,
|
|
|
|
|
props: { multiple: false },
|
|
|
|
|
optionProps: { value: 'id', label: 'name' },
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
:edit-render="{}"
|
|
|
|
|
>
|
|
|
|
|
<template #edit="{ row }">
|
|
|
|
|
<el-cascader
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="row['school_id']"
|
|
|
|
|
:options="school"
|
|
|
|
|
:props="{
|
|
|
|
|
emitPath: false,
|
|
|
|
|
value: 'id',
|
|
|
|
|
label: 'name',
|
|
|
|
|
}"></el-cascader>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
|
|
|
|
|
<vxe-column
|
|
|
|
|
header-align="center"
|
|
|
|
|
@ -246,6 +265,7 @@ import axios from "axios";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
|
|
|
|
|
import { index as schoolIndex } from "@/api/school/school";
|
|
|
|
|
import {index as areaIndex} from "@/api/area/area";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Specialty",
|
|
|
|
|
@ -268,7 +288,10 @@ export default {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 20,
|
|
|
|
|
keyword: "",
|
|
|
|
|
show_relation: [],
|
|
|
|
|
show_relation: ['school'],
|
|
|
|
|
"filter[0][key]": 'school_id',
|
|
|
|
|
"filter[0][op]": 'eq',
|
|
|
|
|
"filter[0][value]": '',
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
allAlign: null,
|
|
|
|
|
@ -304,7 +327,9 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getSchool();
|
|
|
|
|
this.getArea().then(_ => {
|
|
|
|
|
this.getSchool();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
@ -391,7 +416,20 @@ export default {
|
|
|
|
|
await this.$refs["ShowSpecialty"].getDetail(row.id);
|
|
|
|
|
this.isShowDetail = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getArea() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await areaIndex(
|
|
|
|
|
{
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999,
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.area = res.data;
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getSchool() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await schoolIndex(
|
|
|
|
|
@ -401,7 +439,11 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
this.school = res.data;
|
|
|
|
|
|
|
|
|
|
this.school = this.area.map(area => ({
|
|
|
|
|
...area,
|
|
|
|
|
children: res.data.filter(school => school.area_id === area.id)
|
|
|
|
|
}))
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err);
|
|
|
|
|
}
|
|
|
|
|
|