|
@@ -12,14 +12,35 @@
|
|
|
<!-- 分类与导出 -->
|
|
|
<div class="top">
|
|
|
<div class="oneType">
|
|
|
- <div class="all_choose" v-for="(item, index) in VeidooList" :key="index"
|
|
|
- :style="{ margin: !VeidooJson[item.id].length && 0 }">
|
|
|
+ <div
|
|
|
+ class="all_choose"
|
|
|
+ v-for="(item, index) in VeidooList"
|
|
|
+ :key="index"
|
|
|
+ :style="{ margin: !VeidooJson[item.id].length && 0 }"
|
|
|
+ >
|
|
|
<!-- 大分类 -->
|
|
|
- <span v-if="VeidooJson[item.id].length" @click="点击赋值ftypeId(item.id)" :class="ftypeId == item.id ? '被点击的样式' : '没被点击的样坏死' "><span>{{ item.name }}</span></span>
|
|
|
+ <div
|
|
|
+ v-if="VeidooJson[item.id].length"
|
|
|
+ @click="clickFtypeId(item.id)"
|
|
|
+ :class="ftypeId == item.id ? 'onTypeTxt' : 'onTypeTxt2'"
|
|
|
+ style="position: relative;"
|
|
|
+ >
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
+ <div class="line" :style="{display: ftypeId == item.id ? 'block' : 'none'}"></div>
|
|
|
+ </div>
|
|
|
<!-- 子分类 -->
|
|
|
<div class="typeCss" v-if="VeidooJson[item.id].length">
|
|
|
- <div v-for="(item1, index1) in VeidooJson[item.id]" :key="index + '-' + index1" :label="item1.id">
|
|
|
- <div class="cName" @click="点击赋值stypeId(item.id)" :class="stypeId == item.id ? '被点击的样式' : '没被点击的样坏死' ">
|
|
|
+ <div
|
|
|
+ v-for="(item1, index1) in VeidooJson[item.id]"
|
|
|
+ v-if="item1.pid == ftypeId"
|
|
|
+ :key="index + '-' + index1"
|
|
|
+ :label="item1.id"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="cName"
|
|
|
+ @click="clickStypeId(item1.id)"
|
|
|
+ :class="stypeId == item1.id ? 'twoTypeTxt' : 'twoTypeTxt2'"
|
|
|
+ >
|
|
|
{{ item1.name }}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -31,10 +52,7 @@
|
|
|
<div class="selectSty">
|
|
|
<div style="margin-right: 10px">学期</div>
|
|
|
<el-select v-model="termId" placeholder="请选择" @change="getData">
|
|
|
- <el-option
|
|
|
- label="所有学期"
|
|
|
- value=""
|
|
|
- ></el-option>
|
|
|
+ <el-option label="所有学期" value=""></el-option>
|
|
|
<el-option
|
|
|
v-for="item in termList"
|
|
|
:key="item.id"
|
|
@@ -53,7 +71,7 @@
|
|
|
header-align="center"
|
|
|
:header-cell-style="{
|
|
|
background: '#E0EAFB',
|
|
|
- color: 'rgba(0, 0, 0, 0.90)',
|
|
|
+ color: 'rgba(0, 0, 0, 0.90)'
|
|
|
}"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
@@ -61,7 +79,6 @@
|
|
|
type="selection"
|
|
|
align="center"
|
|
|
label="全选"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
width="55"
|
|
|
>
|
|
|
</el-table-column>
|
|
@@ -105,21 +122,20 @@
|
|
|
label="操作"
|
|
|
align="center"
|
|
|
width="175px"
|
|
|
- show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<div class="evaluate">
|
|
|
<div
|
|
|
class="TableBtn"
|
|
|
style="color: #3681fc"
|
|
|
- @click="lookRecord(scope.row,0)"
|
|
|
+ @click="updateCred(scope.row, 0)"
|
|
|
>
|
|
|
查看
|
|
|
</div>
|
|
|
<div
|
|
|
class="TableBtn"
|
|
|
style="color: #3681fc"
|
|
|
- @click="updateCred(scope.row,1)"
|
|
|
+ @click="updateCred(scope.row, 1)"
|
|
|
>
|
|
|
修改
|
|
|
</div>
|
|
@@ -154,7 +170,6 @@
|
|
|
:termList="termList"
|
|
|
:weiList="weiList"
|
|
|
:studentList="studentList"
|
|
|
- @selectData="selectData"
|
|
|
@closePop="closePop"
|
|
|
></popbox>
|
|
|
</div>
|
|
@@ -164,27 +179,27 @@
|
|
|
import popbox from "./component/popbox";
|
|
|
export default {
|
|
|
components: {
|
|
|
- popbox,
|
|
|
+ popbox
|
|
|
},
|
|
|
props: {
|
|
|
userid: {
|
|
|
- type: String,
|
|
|
+ type: String
|
|
|
},
|
|
|
oid: {
|
|
|
- type: String,
|
|
|
+ type: String
|
|
|
},
|
|
|
org: {
|
|
|
- type: String,
|
|
|
+ type: String
|
|
|
},
|
|
|
cid: {
|
|
|
- type: String,
|
|
|
- },
|
|
|
+ type: String
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
// 筛选数据
|
|
|
VeidooList: [],
|
|
|
- VeidooJson:{},
|
|
|
+ VeidooJson: {},
|
|
|
VeidooListChild: [],
|
|
|
// 默认选择项
|
|
|
// VeidooValue:{},
|
|
@@ -213,10 +228,24 @@ export default {
|
|
|
studentList: [],
|
|
|
judgeNum: 0,
|
|
|
ftypeId: "",
|
|
|
- stypeId: "",
|
|
|
+ stypeId: ""
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 大分类点击
|
|
|
+ clickFtypeId(e) {
|
|
|
+ this.ftypeId = e;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ clickStypeId(e) {
|
|
|
+ console.log("点击小分类", e);
|
|
|
+ if (this.stypeId === e) {
|
|
|
+ this.stypeId = "";
|
|
|
+ } else {
|
|
|
+ this.stypeId = e;
|
|
|
+ }
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
closePop() {
|
|
|
this.isPop = false;
|
|
|
// console.log('关了');
|
|
@@ -228,17 +257,17 @@ export default {
|
|
|
//当页数发生改变的时候调用获取列表数据请求
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
this.Page = val;
|
|
|
- this.selectData();
|
|
|
+ this.getData();
|
|
|
},
|
|
|
//获取分类
|
|
|
getVeidooType() {
|
|
|
let params = {
|
|
|
org: this.org,
|
|
|
- oid: this.oid,
|
|
|
+ oid: this.oid
|
|
|
};
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "selectSTEType", params)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
var ftype = res.data[0]; //公共父级分类
|
|
|
var stype = res.data[1]; //公共子级分类
|
|
|
var sctype = res.data[2]; //该学校子级分类
|
|
@@ -286,8 +315,12 @@ export default {
|
|
|
|
|
|
this.VeidooList = allfType;
|
|
|
this.VeidooJson = VeidooJson;
|
|
|
+ this.$forceUpdate();
|
|
|
+ this.getData();
|
|
|
+
|
|
|
+ // console.log("小分类", this.VeidooJson, "大分类", this.VeidooList);
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
this.isLoading = false;
|
|
|
console.error(err);
|
|
|
});
|
|
@@ -298,20 +331,21 @@ export default {
|
|
|
let params = {
|
|
|
uid: this.userid,
|
|
|
cid: this.cid,
|
|
|
- cu: this.Veidoo,
|
|
|
- cn: this.VeidooListChild,
|
|
|
+ cu: this.ftypeId,
|
|
|
+ cn: this.stypeId,
|
|
|
cm: this.termId,
|
|
|
- page: this.page,
|
|
|
+ page: this.page
|
|
|
};
|
|
|
+ console.log(params);
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "selectVeidooType", params)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
this.isLoading = false;
|
|
|
this.tableData = res.data[0];
|
|
|
this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
- console.log(" 获取筛选数据", res);
|
|
|
+ // console.log(" 获取筛选数据", res);
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
this.isLoading = false;
|
|
|
console.error(err);
|
|
|
});
|
|
@@ -322,7 +356,7 @@ export default {
|
|
|
console.log(this.multipleSelection);
|
|
|
},
|
|
|
// 修改记录
|
|
|
- updateCred(e,t) {
|
|
|
+ updateCred(e, t) {
|
|
|
this.judgeNum = t;
|
|
|
if (!Array.isArray(e.type)) {
|
|
|
if (!e.type) {
|
|
@@ -346,21 +380,53 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.recordData = e;
|
|
|
- this.getClassStudent();
|
|
|
+ this.isPop = true;
|
|
|
+ },
|
|
|
+ // 获取纬度列表
|
|
|
+ getWeiList() {
|
|
|
+ // 获取纬度筛选框
|
|
|
+ const data = {
|
|
|
+ oid: this.org,
|
|
|
+ cla: 0
|
|
|
+ };
|
|
|
+
|
|
|
+ this.ajax.get(this.$store.state.api + "selectVeiDoo", data).then(res => {
|
|
|
+ // console.log(res);
|
|
|
+ this.weiList = res.data[0];
|
|
|
+ // console.log("this.weiList", res);
|
|
|
+ });
|
|
|
},
|
|
|
- getClassStudent(){
|
|
|
- // 获取班学生列表
|
|
|
+ // 获取班学生列表
|
|
|
+ getClassStudent() {
|
|
|
const data2 = {
|
|
|
cid: this.cid,
|
|
|
- uid: this.userid,
|
|
|
+ uid: this.userid
|
|
|
};
|
|
|
this.ajax
|
|
|
.get(this.$store.state.api + "selectManyClassStudent", data2)
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
// console.log(res);
|
|
|
this.studentList = res.data[0];
|
|
|
- console.log("this.studentList", res);
|
|
|
- this.isPop = true;
|
|
|
+ // console.log("this.studentList", res);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getYear() {
|
|
|
+ this.isLoading = true;
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectTerm")
|
|
|
+ .then(res => {
|
|
|
+ this.isLoading = false;
|
|
|
+ var yearJuri = res.data[0];
|
|
|
+ for (var i = 0; i < yearJuri.length; i++) {
|
|
|
+ if (yearJuri[i].defaultC == 1) {
|
|
|
+ this.year = yearJuri[i].id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.termList = yearJuri;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.isLoading = false;
|
|
|
+ console.error(err);
|
|
|
});
|
|
|
},
|
|
|
// 判断导出数据
|
|
@@ -368,29 +434,11 @@ export default {
|
|
|
if (this.multipleSelection.length) {
|
|
|
this.exportExcel();
|
|
|
} else {
|
|
|
- console.log(2);
|
|
|
+ this.$message({ message: "请先选择要导出的数据", type: "warning" });
|
|
|
+ return
|
|
|
}
|
|
|
},
|
|
|
- // exportExcelTwo() {
|
|
|
- // let data = {
|
|
|
- // uid: this.$route.query.suid,
|
|
|
- // cid: this.$route.query.cid,
|
|
|
- // cu: this.Veidoo,
|
|
|
- // cn: this.VeidooChild,
|
|
|
- // cm: this.termId,
|
|
|
- // page: this.page,
|
|
|
- // lim: 8
|
|
|
- // };
|
|
|
- // // return console.log("selectData", data);
|
|
|
- // this.ajax
|
|
|
- // .get(this.$store.state.api + "selectVeidooType", data)
|
|
|
- // .then(res => {
|
|
|
- // this.isLoading = false;
|
|
|
- // this.tableData = res.data[0];
|
|
|
- // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
- // console.log(" 获取筛选数据", res);
|
|
|
- // });
|
|
|
- // },
|
|
|
+
|
|
|
exportExcel() {
|
|
|
// var res = res.data[0];
|
|
|
var res = this.multipleSelection;
|
|
@@ -415,12 +463,15 @@ export default {
|
|
|
var XLSX = require("xlsx");
|
|
|
const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
|
|
|
let ws = XLSX.utils.json_to_sheet(array); //将json对象数组转化成工作表
|
|
|
- // ws["!cols"] = [
|
|
|
- // //设置每一列的宽度
|
|
|
- // { wch: 50 },
|
|
|
- // { wch: 50 },
|
|
|
- // { wch: 50 }
|
|
|
- // ];
|
|
|
+ ws["!cols"] = [
|
|
|
+ //设置每一列的宽度
|
|
|
+ { wch: 20 },
|
|
|
+ { wch: 30 },
|
|
|
+ { wch: 30 },
|
|
|
+ { wch: 30 },
|
|
|
+ { wch: 30 },
|
|
|
+ { wch: 30 }
|
|
|
+ ];
|
|
|
XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
|
|
|
XLSX.writeFile(workbook, "观察日记.xlsx");
|
|
|
// const wopts = { bookType: "xlsx", bookSST: false, type: "array" };//写入的样式bookType:输出的文件类型,type:输出的数据类型,bookSST: 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
|
|
@@ -428,25 +479,25 @@ export default {
|
|
|
// FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), `${title} demo.xlsx`);//保存文件
|
|
|
this.$message({
|
|
|
message: "导出成功",
|
|
|
- type: "success",
|
|
|
+ type: "success"
|
|
|
});
|
|
|
},
|
|
|
// 删除记录
|
|
|
delRecord(e) {
|
|
|
this.$confirm("是否删除?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
+ cancelButtonText: "取消"
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.ajax
|
|
|
.post(this.$store.state.api + "updateRecord", [{ rid: e.rid }])
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
console.log(res);
|
|
|
- this.selectData();
|
|
|
+ // this.selectData();
|
|
|
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: "已删除",
|
|
|
+ message: "已删除"
|
|
|
});
|
|
|
// this.isLoading = false; updateRecord
|
|
|
});
|
|
@@ -454,48 +505,23 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
- message: "已取消删除",
|
|
|
+ message: "已取消删除"
|
|
|
});
|
|
|
});
|
|
|
// return console.log(e);
|
|
|
- },
|
|
|
- lookRecord(e) {
|
|
|
- this.judgeNum = 0;
|
|
|
- console.log("eeeeeeeeeeeeeeeeeee", e);
|
|
|
- this.isPop = true;
|
|
|
- if (!Array.isArray(e.type)) {
|
|
|
- if (!e.type) {
|
|
|
- e.type = [];
|
|
|
- } else {
|
|
|
- e.type = e.type.split(",");
|
|
|
- }
|
|
|
- }
|
|
|
- if (!Array.isArray(e.contact)) {
|
|
|
- if (!e.contact) {
|
|
|
- e.contact = [];
|
|
|
- } else {
|
|
|
- e.contact = e.contact.split(",");
|
|
|
- }
|
|
|
- }
|
|
|
- if (!Array.isArray(e.recordImg)) {
|
|
|
- if (!e.recordImg) {
|
|
|
- e.recordImg = [];
|
|
|
- } else {
|
|
|
- e.recordImg = e.recordImg.split(",");
|
|
|
- }
|
|
|
- }
|
|
|
- this.recordData = e;
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getWeiList()
|
|
|
+ this.getClassStudent();
|
|
|
+ this.getYear();
|
|
|
this.getVeidooType();
|
|
|
- this.getData();
|
|
|
},
|
|
|
mounted() {
|
|
|
// this.$nextTick(() => {
|
|
|
// this.selectData();
|
|
|
// });
|
|
|
- },
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -533,10 +559,17 @@ export default {
|
|
|
align-items: flex-end;
|
|
|
}
|
|
|
.oneType {
|
|
|
+ position: relative;
|
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
|
/* flex-direction: column; */
|
|
|
}
|
|
|
+.typeCss {
|
|
|
+ position: absolute;
|
|
|
+ top: 120%;
|
|
|
+ left: 0;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
.onTypeTxt {
|
|
|
cursor: pointer;
|
|
|
display: flex;
|