|
@@ -1,24 +1,18 @@
|
|
|
<template>
|
|
|
- <div
|
|
|
- class="pb_content"
|
|
|
- style="
|
|
|
- overflow: auto;
|
|
|
- margin: 0px;
|
|
|
- box-sizing: border-box;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- "
|
|
|
- >
|
|
|
+ <div class="pb_content" style="
|
|
|
+ overflow: auto;
|
|
|
+ margin: 0px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ ">
|
|
|
<div>
|
|
|
- <div
|
|
|
- class="pb_content_body"
|
|
|
- style="
|
|
|
- background: #fff;
|
|
|
- padding: 0px 25px;
|
|
|
- box-sizing: border-box;
|
|
|
- margin: 10px auto 0;
|
|
|
- "
|
|
|
- >
|
|
|
+ <div class="pb_content_body" style="
|
|
|
+ background: #fff;
|
|
|
+ padding: 0px 25px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin: 10px auto 0;
|
|
|
+ ">
|
|
|
<div class="pb_head">
|
|
|
<span>学校管理</span>
|
|
|
<!-- <span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span> -->
|
|
@@ -30,26 +24,20 @@
|
|
|
<div>参与校</div>
|
|
|
<div>
|
|
|
<el-button size="small" type="primary" @click="openAddSchool(1)">
|
|
|
- 添加学校</el-button
|
|
|
- >
|
|
|
+ 添加学校</el-button>
|
|
|
+ <el-upload class="upload-demo newCss" v-if="false" :http-request="importA" :on-remove="handleRemove" action="#"
|
|
|
+ :file-list="fileListUpload" accept=".xlsx">
|
|
|
+ <el-button size="primary" type="primary">批量添加</el-button>
|
|
|
+ </el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin: 0 auto 10px">
|
|
|
<div class="student_table">
|
|
|
- <el-table
|
|
|
- ref="table"
|
|
|
- :data="tableData"
|
|
|
- stripe
|
|
|
- border
|
|
|
- :header-cell-style="{
|
|
|
- background: '#f1f1f1',
|
|
|
- 'text-align': 'center',
|
|
|
- }"
|
|
|
- :cell-style="{ 'text-align': 'center' }"
|
|
|
- style="width: 100%"
|
|
|
- :height="tableHeight"
|
|
|
- v-loading="isLoading"
|
|
|
- >
|
|
|
+ <el-table ref="table" :data="tableData" stripe border :header-cell-style="{
|
|
|
+ background: '#f1f1f1',
|
|
|
+ 'text-align': 'center',
|
|
|
+ }" :cell-style="{ 'text-align': 'center' }" style="width: 100%" :height="tableHeight"
|
|
|
+ v-loading="isLoading">
|
|
|
<el-table-column prop="name" label="学校名称" min-width="30">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="联结学校" min-width="10" align="center">
|
|
@@ -62,30 +50,17 @@
|
|
|
<el-table-column prop="date" label="操作" min-width="30">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="pb_buttonBox">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="openNoCSchool(scope.row.id, scope.row.cname)"
|
|
|
- >联结</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="
|
|
|
- updateS(
|
|
|
- scope.row.id,
|
|
|
- scope.row.name,
|
|
|
- scope.row.dest,
|
|
|
- 1
|
|
|
- )
|
|
|
- "
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="deleteSchool(scope.row.id, 1)"
|
|
|
- >删除
|
|
|
+ <el-button size="mini" type="primary"
|
|
|
+ @click="openNoCSchool(scope.row.id, scope.row.cname)">联结</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="
|
|
|
+ updateS(
|
|
|
+ scope.row.id,
|
|
|
+ scope.row.name,
|
|
|
+ scope.row.dest,
|
|
|
+ 1
|
|
|
+ )
|
|
|
+ ">修改</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="deleteSchool(scope.row.id, 1)">删除
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -94,14 +69,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="student_page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :page-size="10"
|
|
|
- :total="total"
|
|
|
- v-if="page"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- ></el-pagination>
|
|
|
+ <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
|
|
|
+ @current-change="handleCurrentChange"></el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="halfBox" style="width: 40%">
|
|
@@ -109,26 +78,16 @@
|
|
|
<div>协同校</div>
|
|
|
<div>
|
|
|
<el-button size="small" type="primary" @click="openAddSchool(2)">
|
|
|
- 添加学校</el-button
|
|
|
- >
|
|
|
+ 添加学校</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin: 0 auto 10px">
|
|
|
<div class="student_table">
|
|
|
- <el-table
|
|
|
- ref="table"
|
|
|
- :data="tableData1"
|
|
|
- stripe
|
|
|
- border
|
|
|
- :header-cell-style="{
|
|
|
- background: '#f1f1f1',
|
|
|
- 'text-align': 'center',
|
|
|
- }"
|
|
|
- :cell-style="{ 'text-align': 'center' }"
|
|
|
- style="width: 100%"
|
|
|
- :height="tableHeight"
|
|
|
- v-loading="isLoading"
|
|
|
- >
|
|
|
+ <el-table ref="table" :data="tableData1" stripe border :header-cell-style="{
|
|
|
+ background: '#f1f1f1',
|
|
|
+ 'text-align': 'center',
|
|
|
+ }" :cell-style="{ 'text-align': 'center' }" style="width: 100%" :height="tableHeight"
|
|
|
+ v-loading="isLoading">
|
|
|
<el-table-column prop="name" label="学校名称" min-width="30">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="ljBox">
|
|
@@ -148,24 +107,15 @@
|
|
|
<el-table-column prop="date" label="操作" min-width="30">
|
|
|
<template slot-scope="scope">
|
|
|
<div class="pb_buttonBox">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="
|
|
|
- updateS(
|
|
|
- scope.row.id,
|
|
|
- scope.row.name,
|
|
|
- scope.row.dest,
|
|
|
- 2
|
|
|
- )
|
|
|
- "
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- @click="deleteSchool(scope.row.id, 2)"
|
|
|
- >删除
|
|
|
+ <el-button size="mini" type="primary" @click="
|
|
|
+ updateS(
|
|
|
+ scope.row.id,
|
|
|
+ scope.row.name,
|
|
|
+ scope.row.dest,
|
|
|
+ 2
|
|
|
+ )
|
|
|
+ ">修改</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="deleteSchool(scope.row.id, 2)">删除
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -174,45 +124,22 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="student_page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :page-size="10"
|
|
|
- :total="total1"
|
|
|
- v-if="page1"
|
|
|
- @current-change="handleCurrentChange1"
|
|
|
- ></el-pagination>
|
|
|
+ <el-pagination background layout="prev, pager, next" :page-size="10" :total="total1" v-if="page1"
|
|
|
+ @current-change="handleCurrentChange1"></el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- title="添加学校"
|
|
|
- :visible.sync="dialogVisible"
|
|
|
- width="500px"
|
|
|
- :before-close="handleClose"
|
|
|
- class="dialog_diy"
|
|
|
- center
|
|
|
- >
|
|
|
+ <el-dialog title="添加学校" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" class="dialog_diy"
|
|
|
+ center>
|
|
|
<div class="addBox">
|
|
|
<span class="tian1">学校名称</span>
|
|
|
- <el-input
|
|
|
- v-model="schoolName"
|
|
|
- style="width: 250px; margin: 15px 0px"
|
|
|
- placeholder="请输入学校名称"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="schoolName" style="width: 250px; margin: 15px 0px" placeholder="请输入学校名称"></el-input>
|
|
|
</div>
|
|
|
<div class="addBox">
|
|
|
<span class="tian1">所属地区</span>
|
|
|
- <el-cascader
|
|
|
- size="large"
|
|
|
- style="width: 250px"
|
|
|
- clearable
|
|
|
- :options="region"
|
|
|
- v-model="selectedOptions"
|
|
|
- @change="handleChange"
|
|
|
- placeholder="请选择市区"
|
|
|
- >
|
|
|
+ <el-cascader size="large" style="width: 250px" clearable :options="region" v-model="selectedOptions"
|
|
|
+ @change="handleChange" placeholder="请选择市区">
|
|
|
</el-cascader>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -220,33 +147,16 @@
|
|
|
<el-button type="primary" @click="addSchool">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="修改学校"
|
|
|
- :visible.sync="dialogVisible1"
|
|
|
- width="500px"
|
|
|
- :before-close="handleClose"
|
|
|
- class="dialog_diy"
|
|
|
- center
|
|
|
- >
|
|
|
+ <el-dialog title="修改学校" :visible.sync="dialogVisible1" width="500px" :before-close="handleClose" class="dialog_diy"
|
|
|
+ center>
|
|
|
<div class="addBox">
|
|
|
<span class="tian1">学校名称</span>
|
|
|
- <el-input
|
|
|
- v-model="schoolName"
|
|
|
- style="width: 250px; margin: 15px 0px"
|
|
|
- placeholder="请输入学校名称"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="schoolName" style="width: 250px; margin: 15px 0px" placeholder="请输入学校名称"></el-input>
|
|
|
</div>
|
|
|
<div class="addBox">
|
|
|
<span class="tian1">所属地区</span>
|
|
|
- <el-cascader
|
|
|
- size="large"
|
|
|
- style="width: 250px"
|
|
|
- clearable
|
|
|
- :options="region"
|
|
|
- v-model="selectedOptions"
|
|
|
- @change="handleChange"
|
|
|
- placeholder="请选择市区"
|
|
|
- >
|
|
|
+ <el-cascader size="large" style="width: 250px" clearable :options="region" v-model="selectedOptions"
|
|
|
+ @change="handleChange" placeholder="请选择市区">
|
|
|
</el-cascader>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -254,24 +164,13 @@
|
|
|
<el-button type="primary" @click="updateSchool">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
- title="添加联结"
|
|
|
- :visible.sync="dialogVisible2"
|
|
|
- width="500px"
|
|
|
- :before-close="handleClose1"
|
|
|
- class="dialog_diy"
|
|
|
- center
|
|
|
- >
|
|
|
+ <el-dialog title="添加联结" :visible.sync="dialogVisible2" width="500px" :before-close="handleClose1" class="dialog_diy"
|
|
|
+ center>
|
|
|
<div class="addBox">
|
|
|
<span class="tian1">协同校</span>
|
|
|
<el-select v-model="isCSchool" placeholder="请选择联结学校">
|
|
|
<el-option label="取消联结" value="''"> </el-option>
|
|
|
- <el-option
|
|
|
- v-for="item in cShool"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- >
|
|
|
+ <el-option v-for="item in cShool" :key="item.id" :label="item.name" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -282,7 +181,7 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
+
|
|
|
<script>
|
|
|
import { regionData, CodeToText } from "element-china-area-data";
|
|
|
const Data = regionData;
|
|
@@ -311,6 +210,7 @@ export default {
|
|
|
sType: 0,
|
|
|
isCSchool: "",
|
|
|
cShool: [],
|
|
|
+ fileListUpload:[]
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -571,6 +471,109 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ importA(file) {
|
|
|
+ this.fileTemp = file.file;
|
|
|
+ if (this.fileTemp) {
|
|
|
+ if (
|
|
|
+ this.fileTemp.type ==
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
|
|
|
+ this.fileTemp.type == "application/vnd.ms-excel"
|
|
|
+ ) {
|
|
|
+ this.importCount = 1;
|
|
|
+ this.importfxx(this.fileTemp);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "附件格式错误,请删除后重新上传!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请上传附件!",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ this.fileTemp = null;
|
|
|
+ },
|
|
|
+ importfxx(obj) {
|
|
|
+ const loading = this.$loading.service({
|
|
|
+ background: "rgba(255, 255, 255, 0.7)",
|
|
|
+ target: document.body,
|
|
|
+ });
|
|
|
+ this.importCount++;
|
|
|
+ let _this = this;
|
|
|
+ // 通过DOM取文件数据
|
|
|
+ this.file = obj;
|
|
|
+ var rABS = false; //是否将文件读取为二进制字符串
|
|
|
+ var f = this.file;
|
|
|
+ var reader = new FileReader();
|
|
|
+ //if (!FileReader.prototype.readAsBinaryString) {
|
|
|
+ FileReader.prototype.readAsBinaryString = function (f) {
|
|
|
+ var binary = "";
|
|
|
+ var rABS = false; //是否将文件读取为二进制字符串
|
|
|
+ var pt = this;
|
|
|
+ var wb; //读取完成的数据
|
|
|
+ var outdata;
|
|
|
+ var reader = new FileReader();
|
|
|
+ reader.onload = function (e) {
|
|
|
+ var bytes = new Uint8Array(reader.result);
|
|
|
+ var length = bytes.byteLength;
|
|
|
+ for (var i = 0; i < length; i++) {
|
|
|
+ binary += String.fromCharCode(bytes[i]);
|
|
|
+ }
|
|
|
+ var XLSX = require("xlsx");
|
|
|
+ if (rABS) {
|
|
|
+ wb = XLSX.read(btoa(fixdata(binary)), {
|
|
|
+ //手动转化
|
|
|
+ type: "base64",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ wb = XLSX.read(binary, {
|
|
|
+ type: "binary",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]); //outdata就是你想要的东西
|
|
|
+ this.da = [...outdata];
|
|
|
+ let arr = [];
|
|
|
+ this.da.map((v) => {
|
|
|
+ let obj = {};
|
|
|
+ obj.school = v["学校名字"];
|
|
|
+ arr.push(obj);
|
|
|
+ });
|
|
|
+ console.log(arr);
|
|
|
+ let newArr = JSON.stringify(arr);
|
|
|
+ let params = [
|
|
|
+ {
|
|
|
+ arr: newArr,
|
|
|
+ org: _this.org,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ _this.ajax
|
|
|
+ .post(_this.$store.state.api + "batchRegistrationSchool", params)
|
|
|
+ .then((res) => {
|
|
|
+ _this.$message({
|
|
|
+ message: "新增成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ _this.fileListUpload = [];
|
|
|
+ };
|
|
|
+
|
|
|
+ reader.readAsArrayBuffer(f);
|
|
|
+ };
|
|
|
+
|
|
|
+ if (rABS) {
|
|
|
+ reader.readAsArrayBuffer(f);
|
|
|
+ } else {
|
|
|
+ reader.readAsBinaryString(f);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.page = 1;
|
|
@@ -579,9 +582,9 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
+
|
|
|
<style scoped>
|
|
|
-.pb_head > span:nth-child(2) {
|
|
|
+.pb_head>span:nth-child(2) {
|
|
|
font-size: 16px;
|
|
|
margin-left: 80px;
|
|
|
color: #ab582f;
|
|
@@ -607,7 +610,7 @@ export default {
|
|
|
margin: 10px 0 0 0;
|
|
|
}
|
|
|
|
|
|
-.disUoloadSty >>> .el-upload--picture-card {
|
|
|
+.disUoloadSty>>>.el-upload--picture-card {
|
|
|
display: none;
|
|
|
/* 上传按钮隐藏 */
|
|
|
}
|
|
@@ -634,11 +637,12 @@ export default {
|
|
|
background: #fff;
|
|
|
}
|
|
|
|
|
|
-.student_head > div:nth-child(1) {
|
|
|
+.student_head>div:nth-child(1) {
|
|
|
padding: 0 0 0 30px;
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
-.student_head > div:nth-child(2) {
|
|
|
+
|
|
|
+.student_head>div:nth-child(2) {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
|
|
@@ -657,47 +661,47 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
|
|
|
-.student_table >>> .el-table--border td {
|
|
|
+.student_table>>>.el-table--border td {
|
|
|
border-right: 0px !important;
|
|
|
}
|
|
|
|
|
|
-.student_table >>> .el-table,
|
|
|
-.student_table >>> .el-table__body-wrapper {
|
|
|
+.student_table>>>.el-table,
|
|
|
+.student_table>>>.el-table__body-wrapper {
|
|
|
height: auto !important;
|
|
|
}
|
|
|
|
|
|
-.el-table >>> .even_row {
|
|
|
+.el-table>>>.even_row {
|
|
|
background-color: #f1f1f1 !important;
|
|
|
}
|
|
|
|
|
|
-.dialog_diy >>> .el-dialog__header {
|
|
|
+.dialog_diy>>>.el-dialog__header {
|
|
|
padding: 9px 20px 10px;
|
|
|
background: #32455b !important;
|
|
|
}
|
|
|
|
|
|
-.dialog_diy >>> .el-dialog__title {
|
|
|
+.dialog_diy>>>.el-dialog__title {
|
|
|
color: #fff;
|
|
|
font-size: 15px;
|
|
|
}
|
|
|
|
|
|
-.dialog_diy >>> .el-dialog__headerbtn {
|
|
|
+.dialog_diy>>>.el-dialog__headerbtn {
|
|
|
top: 14px;
|
|
|
}
|
|
|
|
|
|
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
|
|
|
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
|
|
|
color: #fff;
|
|
|
}
|
|
|
|
|
|
-.dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
|
|
|
+.dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
|
|
|
color: #fff;
|
|
|
}
|
|
|
|
|
|
-.dialog_diy >>> .el-dialog__body,
|
|
|
-.dialog_diy >>> .el-dialog__footer {
|
|
|
+.dialog_diy>>>.el-dialog__body,
|
|
|
+.dialog_diy>>>.el-dialog__footer {
|
|
|
background: #fafafa;
|
|
|
}
|
|
|
|
|
|
-.r_diy >>> .el-dialog__footer {
|
|
|
+.r_diy>>>.el-dialog__footer {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
@@ -759,10 +763,12 @@ export default {
|
|
|
margin: 0 auto;
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
+
|
|
|
.halfBox {
|
|
|
/* width: 50%; */
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+
|
|
|
.ljBox {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
@@ -770,18 +776,20 @@ export default {
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
+
|
|
|
.isLj {
|
|
|
color: #4679ab;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
+
|
|
|
.isLjImg {
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
margin-left: 5px;
|
|
|
}
|
|
|
-.isLjImg > img {
|
|
|
+
|
|
|
+.isLjImg>img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
</style>
|
|
|
-
|