master
xy 1 year ago
parent a5fd0bdb89
commit b8ea5d89d7

@ -0,0 +1,37 @@
import request from '@/utils/request'
export function index(params,isLoading = true) {
return request({
method: 'get',
url: '/api/admin/batch-data/index',
params,
isLoading
})
}
export function show(params,isLoading = true) {
return request({
method: 'get',
url: '/api/admin/batch-data/show',
params,
isLoading
})
}
export function save(data, isLoading = true) {
return request({
method: 'post',
url: '/api/admin/batch-data/save',
data,
isLoading
})
}
export function destroy(params, isLoading = true) {
return request({
method: 'get',
url: '/api/admin/batch-data/destroy',
params,
isLoading
})
}

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -361,7 +361,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -165,6 +165,39 @@
:edit-render="{ name: 'input', attrs: { type: 'text' } }"
/>
<vxe-column
field="image_id"
min-width="180"
title="填报图"
header-align="center"
align="left"
:edit-render="{}"
>
<template #default="{ row }">
<vxe-upload
v-model="row['image']"
name-field="original_name"
readonly
progress-text="{percent}%"
:more-config="{ maxCount: 1, layout: 'horizontal' }"
:show-button-text="false"
single-mode
/>
</template>
<template #edit="{ row }">
<vxe-upload
name-field="original_name"
v-model="row['image']"
progress-text="{percent}%"
:more-config="{ maxCount: 1, layout: 'horizontal' }"
:limit-size="uploadSize / 1024 / 1024"
:show-button-text="false"
single-mode
:upload-method="({ file }) => uploadMethod(file)"
/>
</template>
</vxe-column>
<vxe-column
align="center"
field="need_sign"
@ -301,20 +334,28 @@ export default {
page: 1,
page_size: 20,
keyword: "",
show_relation: [],
show_relation: ["image"],
},
total: 0,
allAlign: null,
tableData: [],
form: {
id: "",
name: "",
group: "",
area_id: "",
year: "",
title: "",
remark: "",
tip: "",
image_id: [],
need_sign: "",
},
validRules: {
@ -503,7 +544,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);
@ -536,6 +580,9 @@ export default {
form[key] = row[key];
}
form["image_id"] =
(row["image"]?.response?.id || row["image"]?.id) ?? "";
this.loading = true;
await save(form, false);
await this.getList();

@ -87,7 +87,40 @@
></el-input>
</el-form-item>
<el-form-item label="是否需要签名" prop="need_sign" clearable>
<el-form-item label="填报图" prop="image_id">
<el-upload
:action="action"
:file-list="form['image_id']"
:headers="{ Authorization: `Bearer ${getToken()}` }"
accept="application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
multiple
:limit="1"
:before-upload="uploadBefore"
:on-success="
(response, file, fileList) =>
uploadSuccess(response, file, fileList, 'image_id')
"
:on-remove="
(file, fileList) => uploadRemove(file, fileList, 'image_id')
"
:on-error="
(err, file, fileList) =>
uploadError(err, file, fileList, 'image_id')
"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
文件不超过{{ formatFileSize(uploadSize) }}
</div>
</el-upload>
</el-form-item>
<el-form-item
label="是否需要签名"
prop="need_sign"
clearable
filterable
>
<el-select
v-model="form['need_sign']"
clearable
@ -150,10 +183,17 @@ export default {
name: "",
group: "",
area_id: "",
year: "",
title: "",
remark: "",
tip: "",
image_id: [],
need_sign: "",
},
rules: {
@ -232,12 +272,19 @@ export default {
reset() {
this.form = {
name: "",
area_id: "",
group: "",
year: "",
title: "",
remark: "",
tip: "",
image_id: [],
need_sign: "",
};
this.$refs["elForm"].resetFields();
@ -248,6 +295,8 @@ export default {
return;
}
this.form["image_id"] = this.form["image_id"][0]?.response?.id ?? "";
this.$refs["elForm"].validate(async (valid) => {
if (valid) {
this.loading = true;

@ -44,6 +44,14 @@
<div v-html="form['tip']"></div>
</el-descriptions-item>
<el-form-item label="填报图" prop="image_id">
<el-upload
:file-list="form['image_id']"
accept="application/msword,image/jpeg,application/pdf,image/png,application/vnd.ms-powerpoint,text/plain,application/x-zip-compressed,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
>
</el-upload>
</el-form-item>
<el-descriptions-item label="是否需要签名">
{{
[
@ -97,6 +105,8 @@ export default {
tip: "",
image_id: [],
need_sign: "",
},
};

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -450,7 +450,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -414,7 +414,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=true) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -0,0 +1,415 @@
<template>
<div>
<el-card shadow="never" style="margin-top: 20px">
<template #header>
<slot name="header">
<vxe-toolbar :print="isHasAuth('print')" custom ref="toolbar">
<template #toolSuffix>
<vxe-button
style="margin-right: 10px"
v-if="isHasAuth('export')"
icon="vxe-icon-download"
circle
@click="exportMethod"
></vxe-button>
</template>
<template #buttons>
<el-button
v-if="isHasAuth('search')"
icon="el-icon-search"
type="primary"
plain
size="small"
@click="getList(true)"
>搜索</el-button
>
</template>
</vxe-toolbar>
</slot>
</template>
<vxe-table
ref="table"
stripe
style="margin-top: 10px"
:loading="loading"
:height="tableHeight"
keep-source
show-overflow
:menu-config="{
className: 'my-menus',
body: {
options: [
[
{
code: 'copy',
name: '复制',
prefixConfig: { icon: 'vxe-icon-copy' },
suffixConfig: { content: 'Ctrl+C' },
},
{
code: 'remove',
name: '删除',
prefixConfig: {
icon: 'vxe-icon-delete-fill',
className: 'color-red',
},
},
],
],
},
}"
@menu-click="contextMenuClickEvent"
:row-config="{ isCurrent: true, isHover: true }"
:column-config="{ resizable: true }"
:export-config="{}"
:edit-rules="validRules"
:edit-config="{
trigger: 'manual',
mode: 'row',
showStatus: true,
isHover: true,
autoClear: false,
}"
:align="allAlign"
:data="tableData"
>
<vxe-column type="checkbox" width="50" align="center" />
<vxe-column type="seq" width="58" align="center" />
<vxe-column min-width="160" title="填报名称" field="aspiration.title" header-align="center"></vxe-column>
<vxe-column width="180" align="center" title="填报时间" field="created_at"></vxe-column>
<vxe-column
field="operate"
header-align="center"
title="操作"
min-width="220"
fixed="right"
>
<template #default="{ row }">
<template v-if="isActiveStatus(row)">
<el-button size="small" type="primary" @click="saveRowEvent(row)"
>保存</el-button
>
<el-button
size="small"
type="primary"
plain
@click="cancelRowEvent(row)"
>取消</el-button
>
</template>
<template v-else>
<el-button
v-if="isHasAuth('detail')"
size="small"
type="primary"
plain
@click="detail(row)"
>查看</el-button
>
<el-button
v-if="isHasAuth('edit')"
size="small"
type="warning"
@click="editRowEvent(row)"
>编辑</el-button
>
<el-button
v-if="isHasAuth('delete')"
size="small"
type="danger"
@click="destroyRowEvent(row)"
>删除</el-button
>
</template>
</template>
</vxe-column>
</vxe-table>
<el-pagination
style="margin-top: 10px; display: flex; justify-content: flex-end"
:current-page.sync="select.page"
:page-sizes="[20, 30, 40, 50]"
:page-size.sync="select.page_size"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="
(e) => {
select.page_size = e;
select.page = 1;
getList();
}
"
@current-change="
(e) => {
select.page = e;
getList();
}
"
/>
</el-card>
<ShowBatchData ref="ShowBatchData" :is-show.sync="isShowDetail" />
</div>
</template>
<script>
import VxeUI from "vxe-pc-ui";
import { authMixin } from "@/mixin/authMixin";
import { uploadSize } from "@/settings";
import { deepCopy } from "@/utils";
import { download } from "@/utils/downloadRequest";
import { destroy, index, save } from "@/api/batch-data/batch-data";
import ShowBatchData from "./components/ShowBatchData.vue";
import axios from "axios";
import { getToken } from "@/utils/auth";
export default {
name: "BatchData",
mixins: [authMixin],
components: {
ShowBatchData,
},
data() {
return {
uploadSize,
examineKey: 0,
isShowDetail: false,
loading: false,
tableHeight: 400,
select: {
page: 1,
page_size: 20,
keyword: "",
show_relation: ["aspiration"],
},
total: 0,
allAlign: null,
tableData: [],
form: {
id: "",
},
validRules: {},
};
},
computed: {
isActiveStatus() {
return function (row) {
if (this.$refs["table"]) {
return this.$refs["table"].isEditByRow(row);
}
};
},
isHasAuth() {
return function (auth) {
return this.auths_auth_mixin.indexOf(auth) !== -1;
};
},
},
created() {
this.getList();
},
mounted() {
this.bindToolbar();
this.calcTableHeight();
},
methods: {
exportMethod() {
this.$confirm("请选择导出方式", "提示", {
confirmButtonText: "全量导出",
cancelButtonText: "部分导出",
distinguishCancelAndClose: true,
})
.then((_) => {
download("/api/admin/school/index", "get", {
...this.select,
page: 1,
page_size: 9999,
is_export: 1,
export_fields: Object.keys(this.form),
});
})
.catch((action) => {
if (action === "cancel" && this.$refs["table"]) {
this.$refs["table"].openExport();
}
});
},
calcTableHeight() {
let clientHeight = document.documentElement.clientHeight;
let cardTitle = document
.querySelector(".el-card__header")
?.getBoundingClientRect()?.height;
let search = document
.querySelector(".vxe-toolbar")
?.getBoundingClientRect()?.height;
let paginationHeight =
(document.querySelector(".el-pagination")?.getBoundingClientRect()
?.height ?? 0) + 10; //
let topHeight = 50; //
let padding = 80;
let margin = 20;
this.tableHeight =
clientHeight -
cardTitle -
search -
paginationHeight -
topHeight -
padding -
margin;
},
contextMenuClickEvent({ menu, row, column }) {
switch (menu.code) {
case "copy":
//
if (row && column) {
if (VxeUI.clipboard.copy(row[column.field])) {
this.$message.success("已复制到剪贴板!");
}
}
break;
case "remove":
if (row && column) {
this.destroyRowEvent(row);
}
default:
}
},
async detail(row) {
await this.$refs["ShowBatchData"].getDetail(row.id);
this.isShowDetail = true;
},
uploadMethod(file) {
const formData = new FormData();
formData.append("file", file);
window.$_uploading = true;
return axios
.post(process.env.VUE_APP_UPLOAD_API, formData, {
headers: {
Authorization: `Bearer ${getToken()}`,
},
})
.then((response) => {
window.$_uploading = false;
if (response.status === 200 && !response.data.code) {
return {
response: response.data,
name: response.data.original_name,
url: response.data.url,
};
} else {
this.$message.error("上传失败");
}
})
.catch((_) => {
window.$_uploading = false;
});
},
bindToolbar() {
this.$nextTick(() => {
if (this.$refs["table"] && this.$refs["toolbar"]) {
this.$refs["table"].connect(this.$refs["toolbar"]);
}
});
},
editRowEvent(row) {
if (this.$refs["table"]) {
this.$refs["table"].setEditRow(row);
}
},
cancelRowEvent(row) {
if (this.$refs["table"]) {
this.$refs["table"].clearEdit().then(() => {
//
this.$refs["table"].revertData(row);
});
}
},
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);
this.tableData = res.data;
this.total = res.total;
this.loading = false;
} catch (err) {
console.error(err);
this.loading = false;
}
},
async saveRowEvent(row) {
if (window.$_uploading) {
this.$message.warning("文件正在上传中");
return;
}
try {
const errMap = await this.$refs["table"].validate();
if (errMap) {
throw new Error(errMap);
}
await this.$confirm("确认保存?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
});
await this.$refs["table"].clearEdit();
let form = deepCopy(this.form);
for (const key in form) {
form[key] = row[key];
}
this.loading = true;
await save(form, false);
await this.getList();
this.loading = false;
} catch (err) {
this.loading = false;
}
},
async destroyRowEvent(row) {
try {
await this.$confirm("确认删除?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
});
this.loading = true;
if (row.id) {
await destroy(
{
id: row.id,
},
false
);
await this.getList();
} else {
console.log(row);
this.tableData.splice(
this.tableData.findIndex((i) => i._X_ROW_KEY === row._X_ROW_KEY),
1
);
}
this.loading = false;
} catch (err) {
this.loading = false;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-card__header {
padding: 6px 20px;
}
::v-deep .el-tag + .el-tag {
margin-left: 4px;
}
</style>

@ -0,0 +1,168 @@
<template>
<div>
<el-drawer
:title="$route.meta.title"
direction="rtl"
size="68%"
:visible.sync="visible"
append-to-body
:before-close="handleClose"
@close="$emit('update:isShow', false)"
>
<section class="drawer-container">
<el-form
class="drawer-container__form"
ref="elForm"
:model="form"
:rules="rules"
label-position="top"
label-width="120px"
size="small"
>
<div class="form-layout"></div>
</el-form>
<div class="drawer-container__footer">
<el-button @click="reset"> </el-button>
<el-button type="primary" @click="submit" :loading="loading">{{
loading ? "提交中 ..." : "确 定"
}}</el-button>
</div>
</section>
</el-drawer>
</div>
</template>
<script>
import { save, show } from "@/api/batch-data/batch-data";
import axios from "axios";
import { getToken } from "@/utils/auth";
import { uploadSize } from "@/settings";
import { formatFileSize } from "@/utils";
export default {
name: "BatchDataDrawer",
props: {
isShow: {
type: Boolean,
default: false,
required: true,
},
},
data() {
return {
uploadSize,
action: process.env.VUE_APP_UPLOAD_API,
loading: false,
visible: false,
form: {},
rules: {},
};
},
watch: {
isShow(newVal) {
this.visible = newVal;
},
visible(newVal) {
this.$emit("update:isShow", newVal);
},
},
methods: {
uploadBefore(file) {
if (file.size > uploadSize) {
this.$message({
type: "warning",
message: `上传图片大小超过${formatFileSize(uploadSize)}`,
});
return false;
}
window.$_uploading = true;
},
uploadSuccess(response, file, fileList, fieldName) {
window.$_uploading = false;
fileList.forEach((file) => {
if (file.response?.data && !file.response?.code) {
file.response = file.response.data;
}
});
this.form[fieldName] = fileList;
},
uploadRemove(file, fileList, fieldName) {
this.form[fieldName] = fileList;
},
uploadError(err, file, fileList, fieldName) {
window.$_uploading = false;
this.form[fieldName] = fileList;
this.$message({
type: "warning",
message: err,
});
},
formatFileSize,
getToken,
handleClose(done) {
this.$confirm("确定关闭窗口?")
.then((_) => {
done();
})
.catch((_) => {});
},
reset() {
this.form = {};
this.$refs["elForm"].resetFields();
},
submit() {
if (window.$_uploading) {
this.$message.warning("文件正在上传中");
return;
}
this.$refs["elForm"].validate(async (valid) => {
if (valid) {
this.loading = true;
try {
await save(this.form);
this.$message.success("新增成功");
this.$emit("refresh");
this.$emit("update:isShow", false);
this.loading = false;
this.reset();
} catch (err) {
this.loading = false;
}
}
});
},
},
};
</script>
<style scoped lang="scss">
.span2 {
grid-column: span 2;
}
::v-deep .el-form-item > * {
max-width: 100%;
}
.form-layout {
display: grid;
grid-gap: 2%;
grid-template-columns: repeat(2, 1fr);
}
.drawer-container {
height: 100%;
padding: 20px;
display: flex;
flex-direction: column;
&__form {
flex: 1;
overflow-y: scroll;
}
&__footer {
margin-top: 20px;
display: flex;
}
}
</style>

@ -0,0 +1,179 @@
<template>
<div>
<el-drawer
:title="$route.meta.title"
direction="rtl"
size="100%"
:visible.sync="visible"
append-to-body
@close="$emit('update:isShow', false)"
>
<section class="drawer-container">
<h3 class="title">{{ detail.aspiration ? detail.aspiration.title : '' }}</h3>
<vxe-table ref="table" :data="list" align="center" border :merge-cells="mergeCells">
<vxe-colgroup title="录取批次" align="center">
<vxe-column title="" field="name"></vxe-column>
<vxe-column title="" field="batchSubs.name"></vxe-column>
</vxe-colgroup>
<vxe-column field="batchSubs.batchSubSchools.name" title="志愿序号"></vxe-column>
<vxe-colgroup title="学校">
<vxe-column title="代码" field="batchSubs.batchSubSchools.code"></vxe-column>
<vxe-column title="名称" field="batchSubs.batchSubSchools.value"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="专业">
<vxe-column title="序号" field="batchSubs.batchSubSchools.specialties.name"></vxe-column>
<vxe-column title="代码" field="batchSubs.batchSubSchools.specialties.code"></vxe-column>
<vxe-column title="名称" field="batchSubs.batchSubSchools.specialties.value"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="其他专业是否服从">
<vxe-column title="(是/否)" field=""></vxe-column>
</vxe-colgroup>
</vxe-table>
</section>
</el-drawer>
</div>
</template>
<script>
import { show } from "@/api/batch-data/batch-data";
export default {
name: "BatchDataShow",
props: {
isShow: {
type: Boolean,
default: false,
required: true,
},
},
data() {
return {
loading: false,
visible: false,
detail: {},
list: []
};
},
watch: {
isShow(newVal) {
this.visible = newVal;
},
visible(newVal) {
this.$emit("update:isShow", newVal);
},
},
methods: {
formatData(arr) {
const transformedArray = [];
arr.forEach(batch => {
batch.batchSubs.forEach(sub => {
sub.batchSubSchools.forEach(school => {
if (school.specialties.length > 0) {
school.specialties.forEach(specialty => {
transformedArray.push({
name: batch.name,
batchId: batch.batchId,
batchSubs: {
name: sub.name,
batchSubId: sub.batchSubId,
batchSubSchools: {
code: school.code,
name: school.name,
value: school.value,
specialties: {
code: specialty.code,
name: specialty.name,
value: specialty.value,
specialtyId: specialty.specialtyId
},
batchSubSchoolId: school.batchSubSchoolId
},
[sub.notShowSchoolObey ? 'notShowSchoolObey' : 'schoolObey']: sub.notShowSchoolObey ? sub.notShowSchoolObey : sub.schoolObey,
[sub.notShowSpecialtyObey ? 'notShowSpecialtyObey' : 'specialtyObey']: sub.notShowSpecialtyObey ? sub.notShowSpecialtyObey : sub.specialtyObey
}
});
});
} else {
transformedArray.push({
name: batch.name,
batchId: batch.batchId,
batchSubs: {
name: sub.name,
batchSubId: sub.batchSubId,
batchSubSchools: {
code: school.code,
name: school.name,
value: school.value,
specialties: [],
batchSubSchoolId: school.batchSubSchoolId
},
[sub.notShowSchoolObey ? 'notShowSchoolObey' : 'schoolObey']: sub.notShowSchoolObey ? sub.notShowSchoolObey : sub.schoolObey,
[sub.notShowSpecialtyObey ? 'notShowSpecialtyObey' : 'specialtyObey']: sub.notShowSpecialtyObey ? sub.notShowSpecialtyObey : sub.specialtyObey
}
});
}
});
});
});
console.log(transformedArray);
return transformedArray
},
async getDetail(id) {
try {
const detail = await show({
id,
show_relation: ["aspiration"]
});
this.detail = detail
this.list = this.formatData(detail.data)
} catch (err) {
console.error(err);
}
},
},
computed: {
mergeCells() {
let mergeCells = [];
let c1rowspan = 1;
for (let i = 1; i < this.list.length; i++) {
const item = this.list[i];
const prevItem = this.list[i - 1];
if (item.batchId === prevItem.batchId) {
c1rowspan++;
} else {
mergeCells.push({
row: i - c1rowspan, col: 0, rowspan: c1rowspan, colspan: 1
});
c1rowspan = 1;
}
if (i === this.list.length - 1 && item.batchId === prevItem.batchId) {
mergeCells.push({
row: i - (c1rowspan - 1), col: 0, rowspan: c1rowspan, colspan: 1
});
}
}
console.log(mergeCells);
return mergeCells;
}
}
};
</script>
<style scoped lang="scss">
.span2 {
grid-column: span 2;
}
::v-deep .el-form-item > * {
max-width: 100%;
}
.drawer-container {
height: 100%;
}
.title {
text-align: center;
}
</style>

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -106,6 +106,23 @@
}"
/>
<vxe-column
align="center"
field="school"
width="240"
title="绑定学校"
:edit-render="{}"
>
<template #default="{ row }">
{{ row.school ? row.school.map(i => i.name) : '' }}
</template>
<template #edit="{ row }">
<el-select v-model="row.school" style="width: 100%;" filterable multiple collapse-tags value-key="id" size="small">
<el-option v-for="item in school" :label="item.name" :value="{ code: item.code, name: item.name, id: item.id }"></el-option>
</el-select>
</template>
</vxe-column>
<vxe-column
header-align="center"
align="right"
@ -221,6 +238,7 @@
<AddBatchSub
ref="AddBatchSub"
:batch="batch"
:school="school"
:is-show.sync="isShowAdd"
@refresh="getList"
/>
@ -246,6 +264,7 @@ import axios from "axios";
import { getToken } from "@/utils/auth";
import { index as batchIndex } from "@/api/batch/batch";
import { index as schoolIndex } from "@/api/school/school";
export default {
name: "BatchSub",
@ -267,23 +286,19 @@ export default {
page: 1,
page_size: 20,
keyword: "",
show_relation: [],
show_relation: ["aspiration.batchs"],
},
total: 0,
allAlign: null,
tableData: [],
form: {
id: "",
name: "",
batch_id: "",
sort: "",
show_school_obey: "",
show_specialty_obey: "",
school: []
},
validRules: {
name: [
@ -302,6 +317,7 @@ export default {
},
batch: [],
school: [],
};
},
computed: {
@ -320,6 +336,7 @@ export default {
},
created() {
this.getBatch();
this.getSchool();
this.getList();
},
@ -394,6 +411,21 @@ export default {
this.isShowDetail = true;
},
async getSchool() {
try {
const res = await schoolIndex(
{
page: 1,
page_size: 999,
},
false
);
this.school = res.data;
} catch (err) {
console.error(err);
}
},
async getBatch() {
try {
const res = await batchIndex(
@ -457,7 +489,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -67,6 +67,12 @@
<!-- </el-select>-->
</el-form-item>
<el-form-item label="绑定学校" prop="school">
<el-select v-model="form.school" style="width: 100%;" filterable multiple collapse-tags value-key="id" size="small">
<el-option v-for="item in school" :label="item.name" :value="{ code: item.code, name: item.name, id: item.id }"></el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number
v-model="form['sort']"
@ -154,6 +160,10 @@ export default {
default: false,
required: true,
},
school: {
type: Array,
default: () => []
}
},
data() {
return {
@ -163,13 +173,10 @@ export default {
visible: false,
form: {
name: "",
batch_id: "",
school: [],
sort: "",
show_school_obey: "",
show_specialty_obey: "",
},
rules: {
@ -271,13 +278,10 @@ export default {
reset() {
this.form = {
name: "",
batch_id: "",
school: [],
sort: "",
show_school_obey: "",
show_specialty_obey: "",
};
this.$refs["elForm"].resetFields();

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -468,7 +468,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -568,7 +568,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -36,7 +36,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -497,7 +497,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -416,7 +416,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -561,7 +561,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -22,7 +22,7 @@
>
<template v-if="isHasAuth('search')">
<el-input style="width: 120px;" v-model="select['filter[1][value]']" placeholder="学校名称.." size="small"></el-input>
<el-select style="width: 100px;" v-model="select['filter[0][value]']" placeholder="区域.." size="small">
<el-select style="width: 100px;" clearable v-model="select['filter[0][value]']" placeholder="区域.." size="small">
<el-option v-for="item in area" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-input style="width: 120px;" v-model="select['filter[2][value]']" placeholder="学校星级.." size="small"></el-input>
@ -32,7 +32,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -600,7 +600,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -450,7 +450,10 @@ export default {
}
},
async getList() {
async getList(isRefresh=false) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -416,7 +416,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -539,7 +539,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

@ -28,7 +28,7 @@
type="primary"
plain
size="small"
@click="getList"
@click="getList(true)"
>搜索</el-button
>
</template>
@ -416,7 +416,10 @@ export default {
}
},
async getList() {
async getList(isRefresh) {
if(isRefresh) {
this.select.page = 1
}
this.loading = true;
try {
const res = await index(this.select, false);

Loading…
Cancel
Save